From evan.cheng at apple.com Mon Jan 12 00:16:35 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 06:16:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62080 - /llvm-gcc-4.2/trunk/gcc/llvm-internal.h Message-ID: <200901120616.n0C6GZcr000986@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 12 00:16:35 2009 New Revision: 62080 URL: http://llvm.org/viewvc/llvm-project?rev=62080&view=rev Log: Forgot to commit this. Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=62080&r1=62079&r2=62080&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Mon Jan 12 00:16:35 2009 @@ -251,23 +251,30 @@ }; /// LValue - This struct represents an lvalue in the program. In particular, -/// the Ptr member indicates the memory that the lvalue lives in. If this is -/// a bitfield reference, BitStart indicates the first bit in the memory that -/// is part of the field and BitSize indicates the extent. +/// the Ptr member indicates the memory that the lvalue lives in. Alignment +/// is the alignment of the memory (in bytes).If this is a bitfield reference, +/// BitStart indicates the first bit in the memory that is part of the field +/// and BitSize indicates the extent. /// /// "LValue" is intended to be a light-weight object passed around by-value. struct LValue { Value *Ptr; + unsigned char Alignment; unsigned char BitStart; unsigned char BitSize; - LValue(Value *P) : Ptr(P), BitStart(255), BitSize(255) {} - LValue(Value *P, unsigned BSt, unsigned BSi) - : Ptr(P), BitStart(BSt), BitSize(BSi) { + LValue(Value *P, unsigned Align) + : Ptr(P), Alignment(Align), BitStart(255), BitSize(255) {} + LValue(Value *P, unsigned Align, unsigned BSt, unsigned BSi) + : Ptr(P), Alignment(Align), BitStart(BSt), BitSize(BSi) { assert(BitStart == BSt && BitSize == BSi && "Bit values larger than 256?"); + } + + unsigned getAlignment() const { + assert(Alignment && "LValue alignment cannot be zero!"); + return Alignment; } - bool isBitfield() const { return BitStart != 255; } }; From evan.cheng at apple.com Mon Jan 12 02:05:54 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 08:05:54 -0000 Subject: [llvm-commits] [llvm] r62084 - /llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Message-ID: <200901120805.n0C85s3Q004770@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 12 02:05:54 2009 New Revision: 62084 URL: http://llvm.org/viewvc/llvm-project?rev=62084&view=rev Log: Second test is only valid in 32-bit mode. Modified: llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Modified: llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c?rev=62084&r1=62083&r2=62084&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c (original) +++ llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Mon Jan 12 02:05:54 2009 @@ -1,5 +1,5 @@ // RUN: %llvmgcc -O2 -S %s -o - | not grep alloca -// RUN: %llvmgcc -S %s -o - | grep store | not grep {align 8} +// RUN: %llvmgcc -m32 -S %s -o - | grep store | not grep {align 8} enum { PP_C, From rafael.espindola at gmail.com Mon Jan 12 09:53:26 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 12 Jan 2009 15:53:26 -0000 Subject: [llvm-commits] [llvm] r62088 - in /llvm/trunk: include/llvm/Support/Mangler.h lib/VMCore/Mangler.cpp Message-ID: <200901121553.n0CFrQDw030914@zion.cs.uiuc.edu> Author: rafael Date: Mon Jan 12 09:53:25 2009 New Revision: 62088 URL: http://llvm.org/viewvc/llvm-project?rev=62088&view=rev Log: Remove some dead code from the days llvm had type planes. There might be more dead code, but with llvm-gcc bootstrap broken on linux x86-64 it is had to test :-( Modified: llvm/trunk/include/llvm/Support/Mangler.h llvm/trunk/lib/VMCore/Mangler.cpp Modified: llvm/trunk/include/llvm/Support/Mangler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=62088&r1=62087&r2=62088&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Mangler.h (original) +++ llvm/trunk/include/llvm/Support/Mangler.h Mon Jan 12 09:53:25 2009 @@ -51,11 +51,6 @@ DenseMap TypeMap; unsigned TypeCounter; - /// This keeps track of which global values have had their names - /// mangled in the current module. - /// - SmallPtrSet MangledGlobals; - /// AcceptableChars - This bitfield contains a one for each character that is /// allowed to be part of an unmangled name. unsigned AcceptableChars[256/32]; Modified: llvm/trunk/lib/VMCore/Mangler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Mangler.cpp?rev=62088&r1=62087&r2=62088&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Mangler.cpp (original) +++ llvm/trunk/lib/VMCore/Mangler.cpp Mon Jan 12 09:53:25 2009 @@ -145,49 +145,13 @@ unsigned TypeUniqueID = getTypeID(GV->getType()); static unsigned GlobalID = 0; Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++); - } else if (!MangledGlobals.count(GV)) { - Name = makeNameProper(GV->getName() + Suffix, Prefix); } else { - unsigned TypeUniqueID = getTypeID(GV->getType()); - Name = "l" + utostr(TypeUniqueID) + "_" + makeNameProper(GV->getName()); + Name = makeNameProper(GV->getName() + Suffix, Prefix); } return Name; } -static void InsertName(GlobalValue *GV, StringMap &Names, - SmallPtrSet &MangledGlobals) { - if (!GV->hasName()) // We must mangle unnamed globals. - return; - - // Figure out if this is already used. - GlobalValue *&ExistingValue = Names[GV->getNameStart()]; - if (!ExistingValue) { - ExistingValue = GV; - return; - } - - // If GV is external but the existing one is static, mangle the existing one - if ((GV->hasExternalLinkage() || GV->hasDLLImportLinkage()) && - !(ExistingValue->hasExternalLinkage() - || ExistingValue->hasDLLImportLinkage())) { - MangledGlobals.insert(ExistingValue); - ExistingValue = GV; - } else if ((GV->hasExternalLinkage() || - GV->hasDLLImportLinkage()) && - (ExistingValue->hasExternalLinkage() || - ExistingValue->hasDLLImportLinkage()) && - GV->isDeclaration() && - ExistingValue->isDeclaration()) { - // If the two globals both have external inkage, and are both external, - // don't mangle either of them, we just have some silly type mismatch. - } else { - // Otherwise, mangle GV - MangledGlobals.insert(GV); - } -} - - Mangler::Mangler(Module &M, const char *prefix) : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false), Count(0), TypeCounter(0) { @@ -205,13 +169,4 @@ markCharAcceptable('_'); markCharAcceptable('$'); markCharAcceptable('.'); - - // Calculate which global values have names that will collide when we throw - // away type information. - StringMap Names; - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - InsertName(I, Names, MangledGlobals); - for (Module::global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) - InsertName(I, Names, MangledGlobals); } From dpatel at apple.com Mon Jan 12 12:41:00 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 18:41:00 -0000 Subject: [llvm-commits] [llvm] r62090 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901121841.n0CIf0ft005603@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 12:41:00 2009 New Revision: 62090 URL: http://llvm.org/viewvc/llvm-project?rev=62090&view=rev Log: There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62090&r1=62089&r2=62090&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 12:41:00 2009 @@ -1341,37 +1341,6 @@ // DbgScopeMap - Tracks the scopes in the current function. DenseMap DbgScopeMap; - // DbgLabelIDList - One entry per assigned label. Normally the entry is equal to - // the list index(+1). If the entry is zero then the label has been deleted. - // Any other value indicates the label has been deleted by is mapped to - // another label. - SmallVector DbgLabelIDList; - - /// NextLabelID - Return the next unique label id. - /// - unsigned NextLabelID() { - unsigned ID = (unsigned)DbgLabelIDList.size() + 1; - DbgLabelIDList.push_back(ID); - return ID; - } - - /// RemapLabel - Indicate that a label has been merged into another. - /// - void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) { - assert(0 < OldLabelID && OldLabelID <= DbgLabelIDList.size() && - "Old label ID out of range."); - assert(NewLabelID <= DbgLabelIDList.size() && - "New label ID out of range."); - DbgLabelIDList[OldLabelID - 1] = NewLabelID; - } - - /// MappedLabel - Find out the label's final ID. Zero indicates deletion. - /// ID != Mapped ID indicates that the label was folded into another label. - unsigned MappedLabel(unsigned LabelID) const { - assert(LabelID <= DbgLabelIDList.size() && "Debug label ID out of range."); - return LabelID ? DbgLabelIDList[LabelID - 1] : 0; - } - struct FunctionDebugFrameInfo { unsigned Number; std::vector Moves; @@ -2569,7 +2538,7 @@ unsigned RecordSourceLine(Value *V, unsigned Line, unsigned Col) { CompileUnit *Unit = DW_CUs[V]; assert (Unit && "Unable to find CompileUnit"); - unsigned ID = NextLabelID(); + unsigned ID = MMI->NextLabelID(); Lines.push_back(SrcLineInfo(Line, Col, Unit->getID(), ID)); return ID; } @@ -2588,7 +2557,7 @@ /// unsigned RecordRegionStart(GlobalVariable *V) { DbgScope *Scope = getOrCreateScope(V); - unsigned ID = NextLabelID(); + unsigned ID = MMI->NextLabelID(); if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); return ID; } @@ -2597,7 +2566,7 @@ /// unsigned RecordRegionEnd(GlobalVariable *V) { DbgScope *Scope = getOrCreateScope(V); - unsigned ID = NextLabelID(); + unsigned ID = MMI->NextLabelID(); Scope->setEndLabelID(ID); return ID; } @@ -2659,8 +2628,8 @@ // FIXME - Ignore inlined functions for the time being. if (!Scope->getParent()) continue; - unsigned StartID = MappedLabel(Scope->getStartLabelID()); - unsigned EndID = MappedLabel(Scope->getEndLabelID()); + unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID()); + unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID()); // Ignore empty scopes. if (StartID == EndID && StartID != 0) continue; From dpatel at apple.com Mon Jan 12 12:48:36 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 18:48:36 -0000 Subject: [llvm-commits] [llvm] r62092 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901121848.n0CImaxB005915@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 12:48:36 2009 New Revision: 62092 URL: http://llvm.org/viewvc/llvm-project?rev=62092&view=rev Log: Clear debug info at the end of function processing. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62092&r1=62091&r2=62092&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 12:48:36 2009 @@ -1249,7 +1249,10 @@ DbgScope(DbgScope *P, DIDescriptor *D) : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), Scopes(), Variables() {} - ~DbgScope(); + ~DbgScope() { + for (unsigned i = 0, N = Scopes.size(); i < N; ++i) delete Scopes[i]; + for (unsigned j = 0, M = Variables.size(); j < M; ++j) delete Variables[j]; + } // Accessors. DbgScope *getParent() const { return Parent; } @@ -3821,6 +3824,14 @@ DebugFrames.push_back(FunctionDebugFrameInfo(SubprogramCount, MMI->getFrameMoves())); + + // Clear debug info + if (RootDbgScope) { + delete RootDbgScope; + DbgScopeMap.clear(); + RootDbgScope = NULL; + } + Lines.clear(); } }; From clattner at apple.com Mon Jan 12 12:49:02 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 10:49:02 -0800 Subject: [llvm-commits] [test-suite] r62072 - in /test-suite/trunk/SingleSource/Benchmarks: C++Bench/ C++Bench/LICENSE_1_0_0.txt C++Bench/Makefile C++Bench/README.txt C++Bench/benchmark_algorithms.h C++Bench/benchmark_results.h C++Bench/benchmark_shared_tests.h C++Bench/benchmark_stdint.hpp C++Bench/benchmark_timer.h C++Bench/functionobjects.cpp C++Bench/loop_unroll.cpp C++Bench/simple_types_constant_folding.cpp C++Bench/simple_types_loop_invariant.cpp C++Bench/stepanov_abstraction.cpp C++Bench/stepanov_vector.cpp Makefile In-Reply-To: <200901120305.n0C3505Y027333@zion.cs.uiuc.edu> References: <200901120305.n0C3505Y027333@zion.cs.uiuc.edu> Message-ID: <1D18E3AC-35EC-4B71-ADDD-5494EC285FF4@apple.com> On Jan 11, 2009, at 7:05 PM, Owen Anderson wrote: > Author: resistor > Date: Sun Jan 11 21:04:59 2009 > New Revision: 62072 > > URL: http://llvm.org/viewvc/llvm-project?rev=62072&view=rev > Log: > Add Adobe's C++ benchmark suite. Cool, thanks Owen! How about renaming it to Adobe-C++ or something like that? C++Bench is very generic. Also, would it make sense to split out each loop (e.g. in loop-unroll) to its own benchmark? I did this for flops (SS/Benchmarks/Misc/flops-*), and it seems to work well. -Chris From dalej at apple.com Mon Jan 12 12:59:54 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 Jan 2009 18:59:54 -0000 Subject: [llvm-commits] [test-suite] r62094 - /test-suite/trunk/Makefile.tests Message-ID: <200901121859.n0CIxsoH006397@zion.cs.uiuc.edu> Author: johannes Date: Mon Jan 12 12:59:54 2009 New Revision: 62094 URL: http://llvm.org/viewvc/llvm-project?rev=62094&view=rev Log: Echo commmand line flags of initial (->.bc) compilation. Modified: test-suite/trunk/Makefile.tests Modified: test-suite/trunk/Makefile.tests URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.tests?rev=62094&r1=62093&r2=62094&view=diff ============================================================================== --- test-suite/trunk/Makefile.tests (original) +++ test-suite/trunk/Makefile.tests Mon Jan 12 12:59:54 2009 @@ -39,32 +39,32 @@ # Compile from X.c to Output/X.bc Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.cpp to Output/X.bc Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.cc to Output/X.bc Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.C to Output/X.bc Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.m to Output/X.bc Output/%.bc: %.m $(LCC1) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.mm to Output/X.bc Output/%.bc: %.mm $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) to $@ + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from From sabre at nondot.org Mon Jan 12 13:02:51 2009 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Jan 2009 19:02:51 -0000 Subject: [llvm-commits] [llvm] r62095 - /llvm/trunk/docs/CommandGuide/llvm-ld.pod Message-ID: <200901121902.n0CJ2pRo006521@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 12 13:02:50 2009 New Revision: 62095 URL: http://llvm.org/viewvc/llvm-project?rev=62095&view=rev Log: remove some dead options. Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod Modified: llvm/trunk/docs/CommandGuide/llvm-ld.pod URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-ld.pod?rev=62095&r1=62094&r2=62095&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/llvm-ld.pod (original) +++ llvm/trunk/docs/CommandGuide/llvm-ld.pod Mon Jan 12 13:02:50 2009 @@ -162,8 +162,7 @@ =item B<-disable-opt> -Completely disable optimization. The various B<-On> options will be ignored and -no link time optimization passes will be run. +Completely disable optimization. =item B<-disable-internalize> @@ -194,14 +193,6 @@ An alias for B<-disable-internalize> -=item B<-load> F - -Load an optimization module, F, which is expected to be a dynamic -library that provides the function name C. This function will -be passed the PassManager, and the optimization level (values 0-5 based on the -B<-On> option). This function may add passes to the PassManager that should be -run. This feature allows the optimization passes of B to be extended. - =item B<-post-link-opt>F Run post-link optimization program. After linking is completed a bitcode file From dpatel at apple.com Mon Jan 12 13:15:51 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 11:15:51 -0800 Subject: [llvm-commits] [llvm] r61552 - in /llvm/trunk: lib/Transforms/IPO/FunctionAttrs.cpp test/Transforms/FunctionAttrs/2008-12-31-NoCapture.ll In-Reply-To: <569598DB-3381-4EC9-8377-9B50CF413DB3@gmail.com> References: <200901020346.n023kvwv022788@zion.cs.uiuc.edu> <200901041844.25778.baldrick@free.fr> <496A20A5.40707@mxc.ca> <200901112118.59331.baldrick@free.fr> <569598DB-3381-4EC9-8377-9B50CF413DB3@gmail.com> Message-ID: On Jan 11, 2009, at 4:22 PM, Bill Wendling wrote: > On Jan 11, 2009, at 12:18 PM, Duncan Sands wrote: > >> Hi Nick, >> >>> I'm not too keen on the notion of 'opt -simplifycfg -functionattrs' >>> behaving entirely differently from 'opt -simplifycfg | opt - >>> functionattrs'. >> >> opt -functionattrs -inline is already different to opt - >> functionattrs | >> opt -inline. >> > It is?! Ew! I agree with Nick that the behavior shouldn't change in > this way. What's the difference? opt -functionattrs -inline walks call graph and executes both passes on each node... functionattrs(f1) inline(f1) functionattrs(f2) inline(f2) functionattrs(f3) inline(f3) where as opt -functionattrs | opt -inline walks call graph twice functionattrs(f1) functionattrs(f2) functionattrs(f3) inline(f1) inline(f2) inline(f2) When one pass influence other pass's behavior then there is a difference in such situation. - Devang From dpatel at apple.com Mon Jan 12 13:17:34 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 19:17:34 -0000 Subject: [llvm-commits] [llvm] r62096 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901121917.n0CJHYm9007081@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 13:17:34 2009 New Revision: 62096 URL: http://llvm.org/viewvc/llvm-project?rev=62096&view=rev Log: Add DwarfWriter interface to mainipulate source location info. ( May be this info should be directly handled by the dwarf writer ? ) Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62096&r1=62095&r2=62096&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Mon Jan 12 13:17:34 2009 @@ -30,6 +30,7 @@ class MachineModuleInfo; class MachineFunction; class Module; +class GlobalVariable; class TargetAsmInfo; class raw_ostream; @@ -73,6 +74,25 @@ /// EndFunction - Gather and emit post-function debug information. /// void EndFunction(MachineFunction *MF); + + + /// label. Returns a unique label ID used to generate a label and provide + /// correspondence to the source line list. + unsigned RecordSourceLine(unsigned Line, unsigned Col, unsigned Src); + + /// RecordSource - Register a source file with debug info. Returns an source + /// ID. + unsigned RecordSource(const std::string &Dir, const std::string &File); + + /// RecordRegionStart - Indicate the start of a region. + unsigned RecordRegionStart(GlobalVariable *V); + + /// RecordRegionEnd - Indicate the end of a region. + unsigned RecordRegionEnd(GlobalVariable *V); + + /// getRecordSourceLineCount - Count source lines. + unsigned getRecordSourceLineCount(); + }; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62096&r1=62095&r2=62096&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 13:17:34 2009 @@ -2538,51 +2538,6 @@ return VariableDie; } - unsigned RecordSourceLine(Value *V, unsigned Line, unsigned Col) { - CompileUnit *Unit = DW_CUs[V]; - assert (Unit && "Unable to find CompileUnit"); - unsigned ID = MMI->NextLabelID(); - Lines.push_back(SrcLineInfo(Line, Col, Unit->getID(), ID)); - return ID; - } - - unsigned getRecordSourceLineCount() { - return Lines.size(); - } - - unsigned RecordSource(const std::string &Directory, - const std::string &File) { - unsigned DID = Directories.insert(Directory); - return SrcFiles.insert(SrcFileInfo(DID,File)); - } - - /// RecordRegionStart - Indicate the start of a region. - /// - unsigned RecordRegionStart(GlobalVariable *V) { - DbgScope *Scope = getOrCreateScope(V); - unsigned ID = MMI->NextLabelID(); - if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); - return ID; - } - - /// RecordRegionEnd - Indicate the end of a region. - /// - unsigned RecordRegionEnd(GlobalVariable *V) { - DbgScope *Scope = getOrCreateScope(V); - unsigned ID = MMI->NextLabelID(); - Scope->setEndLabelID(ID); - return ID; - } - - /// RecordVariable - Indicate the declaration of a local variable. - /// - void RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { - DbgScope *Scope = getOrCreateScope(GV); - DIVariable *VD = new DIVariable(GV); - DbgVariable *DV = new DbgVariable(VD, FrameIndex); - Scope->AddVariable(DV); - } - /// getOrCreateScope - Returns the scope associated with the given descriptor. /// DbgScope *getOrCreateScope(GlobalVariable *V) { @@ -3833,6 +3788,67 @@ } Lines.clear(); } + +public: + + /// RecordSourceLine - Records location information and associates it with a + /// label. Returns a unique label ID used to generate a label and provide + /// correspondence to the source line list. + unsigned RecordSourceLine(Value *V, unsigned Line, unsigned Col) { + CompileUnit *Unit = DW_CUs[V]; + assert (Unit && "Unable to find CompileUnit"); + unsigned ID = MMI->NextLabelID(); + Lines.push_back(SrcLineInfo(Line, Col, Unit->getID(), ID)); + return ID; + } + + /// RecordSourceLine - Records location information and associates it with a + /// label. Returns a unique label ID used to generate a label and provide + /// correspondence to the source line list. + unsigned RecordSourceLine(unsigned Line, unsigned Col, unsigned Src) { + unsigned ID = MMI->NextLabelID(); + Lines.push_back(SrcLineInfo(Line, Col, Src, ID)); + return ID; + } + + unsigned getRecordSourceLineCount() { + return Lines.size(); + } + + /// RecordSource - Register a source file with debug info. Returns an source + /// ID. + unsigned RecordSource(const std::string &Directory, + const std::string &File) { + unsigned DID = Directories.insert(Directory); + return SrcFiles.insert(SrcFileInfo(DID,File)); + } + + /// RecordRegionStart - Indicate the start of a region. + /// + unsigned RecordRegionStart(GlobalVariable *V) { + DbgScope *Scope = getOrCreateScope(V); + unsigned ID = MMI->NextLabelID(); + if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); + return ID; + } + + /// RecordRegionEnd - Indicate the end of a region. + /// + unsigned RecordRegionEnd(GlobalVariable *V) { + DbgScope *Scope = getOrCreateScope(V); + unsigned ID = MMI->NextLabelID(); + Scope->setEndLabelID(ID); + return ID; + } + + /// RecordVariable - Indicate the declaration of a local variable. + /// + void RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { + DbgScope *Scope = getOrCreateScope(GV); + DIVariable *VD = new DIVariable(GV); + DbgVariable *DV = new DbgVariable(VD, FrameIndex); + Scope->AddVariable(DV); + } }; //===----------------------------------------------------------------------===// @@ -4927,3 +4943,33 @@ // Clear function debug information. MMI->EndFunction(); } + +/// RecordSourceLine - Records location information and associates it with a +/// label. Returns a unique label ID used to generate a label and provide +/// correspondence to the source line list. +unsigned DwarfWriter::RecordSourceLine(unsigned Line, unsigned Col, + unsigned Src) { + return DD->RecordSourceLine(Line, Col, Src); +} + +/// RecordSource - Register a source file with debug info. Returns an source +/// ID. +unsigned DwarfWriter::RecordSource(const std::string &Dir, + const std::string &File) { + return DD->RecordSource(Dir, File); +} + +/// RecordRegionStart - Indicate the start of a region. +unsigned DwarfWriter::RecordRegionStart(GlobalVariable *V) { + return DD->RecordRegionStart(V); +} + +/// RecordRegionEnd - Indicate the end of a region. +unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) { + return DD->RecordRegionEnd(V); +} + +/// getRecordSourceLineCount - Count source lines. +unsigned DwarfWriter::getRecordSourceLineCount() { + return DD->getRecordSourceLineCount(); +} From isanbard at gmail.com Mon Jan 12 13:27:17 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 Jan 2009 11:27:17 -0800 Subject: [llvm-commits] [llvm] r62088 - in /llvm/trunk: include/llvm/Support/Mangler.h lib/VMCore/Mangler.cpp In-Reply-To: <200901121553.n0CFrQDw030914@zion.cs.uiuc.edu> References: <200901121553.n0CFrQDw030914@zion.cs.uiuc.edu> Message-ID: <16e5fdf90901121127v2a3e25an2a7f5a8b05fbd57a@mail.gmail.com> On Mon, Jan 12, 2009 at 7:53 AM, Rafael Espindola wrote: > Author: rafael > Date: Mon Jan 12 09:53:25 2009 > New Revision: 62088 > > URL: http://llvm.org/viewvc/llvm-project?rev=62088&view=rev > Log: > Remove some dead code from the days llvm had type planes. > > There might be more dead code, but with llvm-gcc bootstrap broken on linux x86-64 it is had to test :-( > FWIW, it passed bootstrapping on Darwin. -bw From baldrick at free.fr Mon Jan 12 14:38:59 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 12 Jan 2009 20:38:59 -0000 Subject: [llvm-commits] [llvm] r62099 - in /llvm/trunk: bindings/ocaml/target/ docs/ include/llvm-c/ include/llvm/Target/ lib/Analysis/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/AsmPrinter/ lib/Target/CBackend/ lib/Target/CellSPU/AsmPrinter/ lib/Target/IA64/ lib/Target/MSIL/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/AsmPrinter/ lib/Target/Sparc/As... Message-ID: <200901122039.n0CKd1xY010943@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 12 14:38:59 2009 New Revision: 62099 URL: http://llvm.org/viewvc/llvm-project?rev=62099&view=rev Log: Rename getABITypeSize to getTypePaddedSize, as suggested by Chris. Modified: llvm/trunk/bindings/ocaml/target/llvm_target.mli llvm/trunk/docs/CompilerDriver.html llvm/trunk/include/llvm-c/Target.h llvm/trunk/include/llvm/Target/TargetData.h llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp llvm/trunk/lib/Analysis/ConstantFolding.cpp llvm/trunk/lib/Analysis/ValueTracking.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.h llvm/trunk/lib/CodeGen/MachineFunction.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/CodeGen/StackProtector.cpp llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.cpp llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/trunk/lib/Target/Target.cpp llvm/trunk/lib/Target/TargetData.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Modified: llvm/trunk/bindings/ocaml/target/llvm_target.mli URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/target/llvm_target.mli?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/bindings/ocaml/target/llvm_target.mli (original) +++ llvm/trunk/bindings/ocaml/target/llvm_target.mli Mon Jan 12 14:38:59 2009 @@ -70,7 +70,7 @@ external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" (** Computes the ABI size of a type in bytes for a target. - See the method llvm::TargetData::getABITypeSize. *) + See the method llvm::TargetData::getTypePaddedSize. *) external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" (** Computes the ABI alignment of a type in bytes for a target. Modified: llvm/trunk/docs/CompilerDriver.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerDriver.html?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/docs/CompilerDriver.html (original) +++ llvm/trunk/docs/CompilerDriver.html Mon Jan 12 14:38:59 2009 @@ -588,7 +588,7 @@ Mikhail Glushenkov
LLVM Compiler Infrastructure
-Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ +Last modified: $Date$ Modified: llvm/trunk/include/llvm-c/Target.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Target.h?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/include/llvm-c/Target.h (original) +++ llvm/trunk/include/llvm-c/Target.h Mon Jan 12 14:38:59 2009 @@ -70,7 +70,7 @@ unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef, LLVMTypeRef); /** Computes the ABI size of a type in bytes for a target. - See the method llvm::TargetData::getABITypeSize. */ + See the method llvm::TargetData::getTypePaddedSize. */ unsigned long long LLVMABISizeOfType(LLVMTargetDataRef, LLVMTypeRef); /** Computes the ABI alignment of a type in bytes for a target. Modified: llvm/trunk/include/llvm/Target/TargetData.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetData.h (original) +++ llvm/trunk/include/llvm/Target/TargetData.h Mon Jan 12 14:38:59 2009 @@ -173,21 +173,21 @@ return 8*getTypeStoreSize(Ty); } - /// getABITypeSize - Return the offset in bytes between successive objects + /// getTypePaddedSize - Return the offset in bytes between successive objects /// of the specified type, including alignment padding. This is the amount /// that alloca reserves for this type. For example, returns 12 or 16 for /// x86_fp80, depending on alignment. - uint64_t getABITypeSize(const Type* Ty) const { + uint64_t getTypePaddedSize(const Type* Ty) const { // Round up to the next alignment boundary. return RoundUpAlignment(getTypeStoreSize(Ty), getABITypeAlignment(Ty)); } - /// getABITypeSizeInBits - Return the offset in bits between successive + /// getTypePaddedSizeInBits - Return the offset in bits between successive /// objects of the specified type, including alignment padding; always a /// multiple of 8. This is the amount that alloca reserves for this type. /// For example, returns 96 or 128 for x86_fp80, depending on alignment. - uint64_t getABITypeSizeInBits(const Type* Ty) const { - return 8*getABITypeSize(Ty); + uint64_t getTypePaddedSizeInBits(const Type* Ty) const { + return 8*getTypePaddedSize(Ty); } /// getABITypeAlignment - Return the minimum ABI-required alignment for the Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Jan 12 14:38:59 2009 @@ -195,7 +195,7 @@ } if (AccessTy->isSized()) - return TD.getABITypeSize(AccessTy) < Size; + return TD.getTypePaddedSize(AccessTy) < Size; return false; } Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original) +++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Mon Jan 12 14:38:59 2009 @@ -76,7 +76,7 @@ Offset += TD.getStructLayout(ST)->getElementOffset(CI->getZExtValue()); } else { const SequentialType *SQT = cast(*GTI); - Offset += TD.getABITypeSize(SQT->getElementType())*CI->getSExtValue(); + Offset += TD.getTypePaddedSize(SQT->getElementType())*CI->getSExtValue(); } } return true; Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ValueTracking.cpp (original) +++ llvm/trunk/lib/Analysis/ValueTracking.cpp Mon Jan 12 14:38:59 2009 @@ -459,7 +459,7 @@ const Type *IndexedTy = GTI.getIndexedType(); if (!IndexedTy->isSized()) return; unsigned GEPOpiBits = Index->getType()->getPrimitiveSizeInBits(); - uint64_t TypeSize = TD ? TD->getABITypeSize(IndexedTy) : 1; + uint64_t TypeSize = TD ? TD->getTypePaddedSize(IndexedTy) : 1; LocalMask = APInt::getAllOnesValue(GEPOpiBits); LocalKnownZero = LocalKnownOne = APInt(GEPOpiBits, 0); ComputeMaskedBits(Index, LocalMask, Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -298,7 +298,7 @@ // Emit inter-object padding for alignment. if (J != E) { const Type *Ty = Entry.getType(); - unsigned EntSize = TM.getTargetData()->getABITypeSize(Ty); + unsigned EntSize = TM.getTargetData()->getTypePaddedSize(Ty); unsigned ValEnd = Entry.getOffset() + EntSize; EmitZeros(J->second.first.getOffset()-ValEnd); } @@ -857,12 +857,12 @@ // We can emit the pointer value into this slot if the slot is an // integer slot greater or equal to the size of the pointer. - if (TD->getABITypeSize(Ty) >= TD->getABITypeSize(Op->getType())) + if (TD->getTypePaddedSize(Ty) >= TD->getTypePaddedSize(Op->getType())) return EmitConstantValueOnly(Op); O << "(("; EmitConstantValueOnly(Op); - APInt ptrMask = APInt::getAllOnesValue(TD->getABITypeSizeInBits(Ty)); + APInt ptrMask = APInt::getAllOnesValue(TD->getTypePaddedSizeInBits(Ty)); SmallString<40> S; ptrMask.toStringUnsigned(S); @@ -958,14 +958,14 @@ void AsmPrinter::EmitGlobalConstantStruct(const ConstantStruct *CVS) { // Print the fields in successive locations. Pad to align if needed! const TargetData *TD = TM.getTargetData(); - unsigned Size = TD->getABITypeSize(CVS->getType()); + unsigned Size = TD->getTypePaddedSize(CVS->getType()); const StructLayout *cvsLayout = TD->getStructLayout(CVS->getType()); uint64_t sizeSoFar = 0; for (unsigned i = 0, e = CVS->getNumOperands(); i != e; ++i) { const Constant* field = CVS->getOperand(i); // Check if padding is needed and insert one or more 0s. - uint64_t fieldSize = TD->getABITypeSize(field->getType()); + uint64_t fieldSize = TD->getTypePaddedSize(field->getType()); uint64_t padSize = ((i == e-1 ? Size : cvsLayout->getElementOffset(i+1)) - cvsLayout->getElementOffset(i)) - fieldSize; sizeSoFar += fieldSize + padSize; @@ -1059,7 +1059,7 @@ << '\t' << TAI->getCommentString() << " long double most significant halfword\n"; } - EmitZeros(TD->getABITypeSize(Type::X86_FP80Ty) - + EmitZeros(TD->getTypePaddedSize(Type::X86_FP80Ty) - TD->getTypeStoreSize(Type::X86_FP80Ty)); return; } else if (CFP->getType() == Type::PPC_FP128Ty) { @@ -1139,7 +1139,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) { const TargetData *TD = TM.getTargetData(); const Type *type = CV->getType(); - unsigned Size = TD->getABITypeSize(type); + unsigned Size = TD->getTypePaddedSize(type); if (CV->isNullValue() || isa(CV)) { EmitZeros(Size); Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Mon Jan 12 14:38:59 2009 @@ -276,7 +276,7 @@ unsigned Align = TM.getTargetData()->getPreferredAlignment(GV); unsigned Size = - TM.getTargetData()->getABITypeSize(GV->getType()->getElementType()); + TM.getTargetData()->getTypePaddedSize(GV->getType()->getElementType()); // If this global has a zero initializer, it is part of the .bss or common // section. Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Mon Jan 12 14:38:59 2009 @@ -276,7 +276,7 @@ // "giant object for PIC" optimization. for (unsigned i = 0, e = CP.size(); i != e; ++i) { const Type *Ty = CP[i].getType(); - unsigned Size = TM.getTargetData()->getABITypeSize(Ty); + unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty); MachOWriter::MachOSection *Sec = MOW.getConstSection(CP[i].Val.ConstVal); OutputBuffer SecDataOut(Sec->SectionData, is64Bit, isLittleEndian); @@ -350,7 +350,7 @@ void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) { const Type *Ty = GV->getType()->getElementType(); - unsigned Size = TM.getTargetData()->getABITypeSize(Ty); + unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty); unsigned Align = TM.getTargetData()->getPreferredAlignment(GV); // Reserve space in the .bss section for this symbol while maintaining the @@ -395,7 +395,7 @@ void MachOWriter::EmitGlobal(GlobalVariable *GV) { const Type *Ty = GV->getType()->getElementType(); - unsigned Size = TM.getTargetData()->getABITypeSize(Ty); + unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty); bool NoInit = !GV->hasInitializer(); // If this global has a zero initializer, it is part of the .bss or common @@ -820,7 +820,7 @@ continue; } else if (const ConstantVector *CP = dyn_cast(PC)) { unsigned ElementSize = - TD->getABITypeSize(CP->getType()->getElementType()); + TD->getTypePaddedSize(CP->getType()->getElementType()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) WorkList.push_back(CPair(CP->getOperand(i), PA+i*ElementSize)); } else if (const ConstantExpr *CE = dyn_cast(PC)) { @@ -921,10 +921,10 @@ abort(); } } else if (isa(PC)) { - memset((void*)PA, 0, (size_t)TD->getABITypeSize(PC->getType())); + memset((void*)PA, 0, (size_t)TD->getTypePaddedSize(PC->getType())); } else if (const ConstantArray *CPA = dyn_cast(PC)) { unsigned ElementSize = - TD->getABITypeSize(CPA->getType()->getElementType()); + TD->getTypePaddedSize(CPA->getType()->getElementType()); for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i) WorkList.push_back(CPair(CPA->getOperand(i), PA+i*ElementSize)); } else if (const ConstantStruct *CPS = dyn_cast(PC)) { Modified: llvm/trunk/lib/CodeGen/MachOWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.h?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.h (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.h Mon Jan 12 14:38:59 2009 @@ -468,7 +468,7 @@ const Type *Ty = C->getType(); if (Ty->isPrimitiveType() || Ty->isInteger()) { - unsigned Size = TM.getTargetData()->getABITypeSize(Ty); + unsigned Size = TM.getTargetData()->getTypePaddedSize(Ty); switch(Size) { default: break; // Fall through to __TEXT,__const case 4: Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Mon Jan 12 14:38:59 2009 @@ -503,7 +503,7 @@ unsigned Offset = 0; if (!Constants.empty()) { Offset = Constants.back().getOffset(); - Offset += TD->getABITypeSize(Constants.back().getType()); + Offset += TD->getTypePaddedSize(Constants.back().getType()); Offset = (Offset+AlignMask)&~AlignMask; } @@ -527,7 +527,7 @@ unsigned Offset = 0; if (!Constants.empty()) { Offset = Constants.back().getOffset(); - Offset += TD->getABITypeSize(Constants.back().getType()); + Offset += TD->getTypePaddedSize(Constants.back().getType()); Offset = (Offset+AlignMask)&~AlignMask; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jan 12 14:38:59 2009 @@ -273,7 +273,7 @@ if (ConstantInt *CI = dyn_cast(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD.getABITypeSize(Ty)*cast(CI)->getSExtValue(); + TD.getTypePaddedSize(Ty)*cast(CI)->getSExtValue(); N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT); if (N == 0) // Unhandled operand. Halt "fast" selection and bail. @@ -282,7 +282,7 @@ } // N = N + Idx * ElementSize; - uint64_t ElementSize = TD.getABITypeSize(Ty); + uint64_t ElementSize = TD.getTypePaddedSize(Ty); unsigned IdxN = getRegForGEPIndex(Idx); if (IdxN == 0) // Unhandled operand. Halt "fast" selection and bail. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 12 14:38:59 2009 @@ -3572,8 +3572,9 @@ SDValue VAList = DAG.getLoad(TLI.getPointerTy(), Tmp1, Tmp2, V, 0); // Increment the pointer, VAList, to the next vaarg Tmp3 = DAG.getNode(ISD::ADD, TLI.getPointerTy(), VAList, - DAG.getConstant(TLI.getTargetData()->getABITypeSize(VT.getTypeForMVT()), - TLI.getPointerTy())); + DAG.getConstant(TLI.getTargetData()-> + getTypePaddedSize(VT.getTypeForMVT()), + TLI.getPointerTy())); // Store the incremented VAList to the legalized pointer Tmp3 = DAG.getStore(VAList.getValue(1), Tmp3, Tmp2, V, 0); // Load the actual argument out of the pointer VAList Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp Mon Jan 12 14:38:59 2009 @@ -296,7 +296,7 @@ Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type); if (Align == 0) { // Alignment of vector types. FIXME! - Align = TM.getTargetData()->getABITypeSize(Type); + Align = TM.getTargetData()->getTypePaddedSize(Type); Align = Log2_64(Align); } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Jan 12 14:38:59 2009 @@ -125,7 +125,7 @@ // Given an array type, recursively traverse the elements. if (const ArrayType *ATy = dyn_cast(Ty)) { const Type *EltTy = ATy->getElementType(); - uint64_t EltSize = TLI.getTargetData()->getABITypeSize(EltTy); + uint64_t EltSize = TLI.getTargetData()->getTypePaddedSize(EltTy); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) ComputeValueVTs(TLI, EltTy, ValueVTs, Offsets, StartingOffset + i * EltSize); @@ -288,7 +288,7 @@ if (AllocaInst *AI = dyn_cast(I)) if (ConstantInt *CUI = dyn_cast(AI->getArraySize())) { const Type *Ty = AI->getAllocatedType(); - uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), AI->getAlignment()); @@ -2603,14 +2603,14 @@ if (ConstantInt *CI = dyn_cast(Idx)) { if (CI->getZExtValue() == 0) continue; uint64_t Offs = - TD->getABITypeSize(Ty)*cast(CI)->getSExtValue(); + TD->getTypePaddedSize(Ty)*cast(CI)->getSExtValue(); N = DAG.getNode(ISD::ADD, N.getValueType(), N, DAG.getIntPtrConstant(Offs)); continue; } // N = N + Idx * ElementSize; - uint64_t ElementSize = TD->getABITypeSize(Ty); + uint64_t ElementSize = TD->getTypePaddedSize(Ty); SDValue IdxN = getValue(Idx); // If the index is smaller or larger than intptr_t, truncate or extend @@ -2646,7 +2646,7 @@ return; // getValue will auto-populate this. const Type *Ty = I.getAllocatedType(); - uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), I.getAlignment()); @@ -4951,7 +4951,7 @@ // Otherwise, create a stack slot and emit a store to it before the // asm. const Type *Ty = OpVal->getType(); - uint64_t TySize = TLI.getTargetData()->getABITypeSize(Ty); + uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(Ty); MachineFunction &MF = DAG.getMachineFunction(); int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align); @@ -5236,7 +5236,7 @@ Src = DAG.getNode(ISD::ZERO_EXTEND, IntPtr, Src); // Scale the source by the type size. - uint64_t ElementSize = TD->getABITypeSize(I.getType()->getElementType()); + uint64_t ElementSize = TD->getTypePaddedSize(I.getType()->getElementType()); Src = DAG.getNode(ISD::MUL, Src.getValueType(), Src, DAG.getIntPtrConstant(ElementSize)); @@ -5337,7 +5337,7 @@ const PointerType *Ty = cast(I->getType()); const Type *ElementTy = Ty->getElementType(); unsigned FrameAlign = getByValTypeAlignment(ElementTy); - unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); + unsigned FrameSize = getTargetData()->getTypePaddedSize(ElementTy); // For ByVal, alignment should be passed from FE. BE will guess if // this info is not there but there are cases it cannot get right. if (F.getParamAlignment(j)) @@ -5470,7 +5470,7 @@ const PointerType *Ty = cast(Args[i].Ty); const Type *ElementTy = Ty->getElementType(); unsigned FrameAlign = getByValTypeAlignment(ElementTy); - unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy); + unsigned FrameSize = getTargetData()->getTypePaddedSize(ElementTy); // For ByVal, alignment should come from FE. BE will guess if this // info is not there but there are cases it cannot get right. if (Args[i].Alignment) Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Mon Jan 12 14:38:59 2009 @@ -114,7 +114,7 @@ if (const ArrayType *AT = dyn_cast(AI->getAllocatedType())) // If an array has more than SSPBufferSize bytes of allocated space, // then we emit stack protectors. - if (SSPBufferSize <= TD->getABITypeSize(AT)) + if (SSPBufferSize <= TD->getTypePaddedSize(AT)) return true; } } Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Mon Jan 12 14:38:59 2009 @@ -54,7 +54,7 @@ char* ExecutionEngine::getMemoryForGV(const GlobalVariable* GV) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getABITypeSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); return new char[GVSize]; } @@ -845,16 +845,16 @@ return; } else if (const ConstantVector *CP = dyn_cast(Init)) { unsigned ElementSize = - getTargetData()->getABITypeSize(CP->getType()->getElementType()); + getTargetData()->getTypePaddedSize(CP->getType()->getElementType()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) InitializeMemory(CP->getOperand(i), (char*)Addr+i*ElementSize); return; } else if (isa(Init)) { - memset(Addr, 0, (size_t)getTargetData()->getABITypeSize(Init->getType())); + memset(Addr, 0, (size_t)getTargetData()->getTypePaddedSize(Init->getType())); return; } else if (const ConstantArray *CPA = dyn_cast(Init)) { unsigned ElementSize = - getTargetData()->getABITypeSize(CPA->getType()->getElementType()); + getTargetData()->getTypePaddedSize(CPA->getType()->getElementType()); for (unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i) InitializeMemory(CPA->getOperand(i), (char*)Addr+i*ElementSize); return; @@ -1001,7 +1001,7 @@ InitializeMemory(GV->getInitializer(), GA); const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getABITypeSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); NumInitBytes += (unsigned)GVSize; ++NumGlobals; } Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/Interpreter/Execution.cpp Mon Jan 12 14:38:59 2009 @@ -750,7 +750,7 @@ unsigned NumElements = getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue(); - unsigned TypeSize = (size_t)TD.getABITypeSize(Ty); + unsigned TypeSize = (size_t)TD.getTypePaddedSize(Ty); // Avoid malloc-ing zero bytes, use max()... unsigned MemToAlloc = std::max(1U, NumElements * TypeSize); @@ -810,7 +810,7 @@ assert(BitWidth == 64 && "Invalid index type for getelementptr"); Idx = (int64_t)IdxGV.IntVal.getZExtValue(); } - Total += TD.getABITypeSize(ST->getElementType())*Idx; + Total += TD.getTypePaddedSize(ST->getElementType())*Idx; } } Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Mon Jan 12 14:38:59 2009 @@ -562,7 +562,7 @@ // emit it into memory. It goes in the same array as the generated // code, jump tables, etc. const Type *GlobalType = GV->getType()->getElementType(); - size_t S = getTargetData()->getABITypeSize(GlobalType); + size_t S = getTargetData()->getTypePaddedSize(GlobalType); size_t A = getTargetData()->getPreferredAlignment(GV); if (GV->isThreadLocal()) { MutexGuard locked(lock); @@ -617,7 +617,7 @@ /// char* JIT::getMemoryForGV(const GlobalVariable* GV) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)getTargetData()->getABITypeSize(ElTy); + size_t GVSize = (size_t)getTargetData()->getTypePaddedSize(ElTy); if (GV->isThreadLocal()) { MutexGuard locked(lock); return TJI.allocateThreadLocalMemory(GVSize); Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Jan 12 14:38:59 2009 @@ -659,7 +659,7 @@ unsigned Size = CPE.Offset; const Type *Ty = CPE.isMachineConstantPoolEntry() ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); - Size += TheJIT->getTargetData()->getABITypeSize(Ty); + Size += TheJIT->getTargetData()->getTypePaddedSize(Ty); return Size; } @@ -687,7 +687,7 @@ unsigned JITEmitter::addSizeOfGlobal(const GlobalVariable *GV, unsigned Size) { const Type *ElTy = GV->getType()->getElementType(); - size_t GVSize = (size_t)TheJIT->getTargetData()->getABITypeSize(ElTy); + size_t GVSize = (size_t)TheJIT->getTargetData()->getTypePaddedSize(ElTy); size_t GVAlign = (size_t)TheJIT->getTargetData()->getPreferredAlignment(GV); DOUT << "JIT: Adding in size " << GVSize << " alignment " << GVAlign; @@ -1080,7 +1080,7 @@ unsigned Size = CPE.Offset; const Type *Ty = CPE.isMachineConstantPoolEntry() ? CPE.Val.MachineCPVal->getType() : CPE.Val.ConstVal->getType(); - Size += TheJIT->getTargetData()->getABITypeSize(Ty); + Size += TheJIT->getTargetData()->getTypePaddedSize(Ty); unsigned Align = 1 << MCP->getConstantPoolAlignment(); ConstantPoolBase = allocateSpace(Size, Align); Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Mon Jan 12 14:38:59 2009 @@ -295,7 +295,7 @@ const TargetData &TD = *Fn.getTarget().getTargetData(); for (unsigned i = 0, e = CPs.size(); i != e; ++i) { - unsigned Size = TD.getABITypeSize(CPs[i].getType()); + unsigned Size = TD.getTypePaddedSize(CPs[i].getType()); // Verify that all constant pool entries are a multiple of 4 bytes. If not, // we would have to pad them out or something so that instructions stay // aligned. Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -825,7 +825,7 @@ std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); bool isDarwin = Subtarget->isTargetDarwin(); Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -216,7 +216,7 @@ std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); - unsigned Size = TD->getABITypeSize(C->getType()); + unsigned Size = TD->getTypePaddedSize(C->getType()); unsigned Align = TD->getPreferredAlignmentLog(GVar); // 0: Switch to section Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Mon Jan 12 14:38:59 2009 @@ -490,7 +490,7 @@ const VectorType *VTy = cast(Ty); return printSimpleType(Out, VTy->getElementType(), isSigned, " __attribute__((vector_size(" + - utostr(TD->getABITypeSize(VTy)) + " ))) " + NameSoFar); + utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar); } default: @@ -535,7 +535,7 @@ const VectorType *VTy = cast(Ty); return printSimpleType(Out, VTy->getElementType(), isSigned, " __attribute__((vector_size(" + - utostr(TD->getABITypeSize(VTy)) + " ))) " + NameSoFar); + utostr(TD->getTypePaddedSize(VTy)) + " ))) " + NameSoFar); } default: Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -529,7 +529,7 @@ Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); SwitchToSection(TAI->SectionForGlobal(GVar)); Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Mon Jan 12 14:38:59 2009 @@ -117,7 +117,7 @@ Constant *C = cast(GV)->getInitializer(); const Type *Type = cast(C)->getType()->getElementType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); if (Size) { unsigned Align = TD->getPreferredAlignment(GV); if (Align <= 32) @@ -138,7 +138,7 @@ DarwinTargetAsmInfo::MergeableConstSection(const Type *Ty) const { const TargetData *TD = TM.getTargetData(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size == 4) return FourByteConstantSection; else if (Size == 8) Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Mon Jan 12 14:38:59 2009 @@ -109,7 +109,7 @@ // FIXME: string here is temporary, until stuff will fully land in. // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's // currently directly used by asmprinter. - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size == 4 || Size == 8 || Size == 16) { std::string Name = ".rodata.cst" + utostr(Size); @@ -128,7 +128,7 @@ const ConstantArray *CVA = cast(C); const Type *Ty = CVA->getType()->getElementType(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size <= 16) { assert(getCStringSection() && "Should have string section prefix"); Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -266,7 +266,7 @@ O << "\n\n"; std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); - unsigned Size = TD->getABITypeSize(C->getType()); + unsigned Size = TD->getTypePaddedSize(C->getType()); unsigned Align = TD->getPreferredAlignmentLog(GVar); printVisibility(name, GVar->getVisibility()); Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Mon Jan 12 14:38:59 2009 @@ -378,7 +378,7 @@ case Type::DoubleTyID: return "r8"; case Type::PointerTyID: - return "i"+utostr(TD->getABITypeSize(Ty)); + return "i"+utostr(TD->getTypePaddedSize(Ty)); default: cerr << "TypeID = " << Ty->getTypeID() << '\n'; assert(0 && "Invalid type in TypeToPostfix()"); @@ -688,14 +688,14 @@ uint64_t FieldIndex = cast(IndexValue)->getZExtValue(); // Offset is the sum of all previous structure fields. for (uint64_t F = 0; FgetABITypeSize(StrucTy->getContainedType((unsigned)F)); + Size += TD->getTypePaddedSize(StrucTy->getContainedType((unsigned)F)); printPtrLoad(Size); printSimpleInstruction("add"); continue; } else if (const SequentialType* SeqTy = dyn_cast(*I)) { - Size = TD->getABITypeSize(SeqTy->getElementType()); + Size = TD->getTypePaddedSize(SeqTy->getElementType()); } else { - Size = TD->getABITypeSize(*I); + Size = TD->getTypePaddedSize(*I); } // Add offset of current element to stack top. if (!isZeroValue(IndexValue)) { @@ -1020,7 +1020,7 @@ void MSILWriter::printAllocaInstruction(const AllocaInst* Inst) { - uint64_t Size = TD->getABITypeSize(Inst->getAllocatedType()); + uint64_t Size = TD->getTypePaddedSize(Inst->getAllocatedType()); // Constant optimization. if (const ConstantInt* CInt = dyn_cast(Inst->getOperand(0))) { printPtrLoad(CInt->getZExtValue()*Size); @@ -1436,7 +1436,8 @@ // Print not duplicated type if (Printed.insert(Ty).second) { Out << ".class value explicit ansi sealed '" << Name << "'"; - Out << " { .pack " << 1 << " .size " << TD->getABITypeSize(Ty)<< " }\n\n"; + Out << " { .pack " << 1 << " .size " << TD->getTypePaddedSize(Ty); + Out << " }\n\n"; } } } @@ -1465,7 +1466,7 @@ const Type* Ty = C->getType(); // Print zero initialized constant. if (isa(C) || C->isNullValue()) { - TySize = TD->getABITypeSize(C->getType()); + TySize = TD->getTypePaddedSize(C->getType()); Offset += TySize; Out << "int8 (0) [" << TySize << "]"; return; @@ -1473,14 +1474,14 @@ // Print constant initializer switch (Ty->getTypeID()) { case Type::IntegerTyID: { - TySize = TD->getABITypeSize(Ty); + TySize = TD->getTypePaddedSize(Ty); const ConstantInt* Int = cast(C); Out << getPrimitiveTypeName(Ty,true) << "(" << Int->getSExtValue() << ")"; break; } case Type::FloatTyID: case Type::DoubleTyID: { - TySize = TD->getABITypeSize(Ty); + TySize = TD->getTypePaddedSize(Ty); const ConstantFP* FP = cast(C); if (Ty->getTypeID() == Type::FloatTyID) Out << "int32 (" << @@ -1499,7 +1500,7 @@ } break; case Type::PointerTyID: - TySize = TD->getABITypeSize(C->getType()); + TySize = TD->getTypePaddedSize(C->getType()); // Initialize with global variable address if (const GlobalVariable *G = dyn_cast(C)) { std::string name = getValueName(G); Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -480,7 +480,7 @@ std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); const Type *CTy = C->getType(); - unsigned Size = TD->getABITypeSize(CTy); + unsigned Size = TD->getTypePaddedSize(CTy); const ConstantArray *CVA = dyn_cast(C); bool printSizeAndType = true; Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jan 12 14:38:59 2009 @@ -212,7 +212,7 @@ return false; const Type *Ty = GV->getType()->getElementType(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); // if this is a internal constant string, there is a special // section for it, but not in small data/bss. @@ -543,7 +543,7 @@ // hacking it. This feature should come soon so we can uncomment the // stuff below. //if (!Subtarget->hasABICall() && - // IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) { + // IsInSmallSection(getTargetData()->getTypePaddedSize(C->getType()))) { // SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP); // SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32); // ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode); Modified: llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsTargetAsmInfo.cpp Mon Jan 12 14:38:59 2009 @@ -66,7 +66,7 @@ if (isa(GV)) { const TargetData *TD = TM.getTargetData(); - unsigned Size = TD->getABITypeSize(GV->getType()->getElementType()); + unsigned Size = TD->getTypePaddedSize(GV->getType()->getElementType()); unsigned Threshold = Subtarget->getSSectionThreshold(); if (Size > 0 && Size <= Threshold) { Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -299,7 +299,7 @@ continue; const Type *Ty = C->getType(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); O << name << " " <<"RES"<< " " << Size ; O << "\n"; } @@ -327,7 +327,7 @@ O << CurrentFnName << ".retval:\n"; const Type *RetType = F->getReturnType(); if (RetType->getTypeID() != Type::VoidTyID) { - unsigned RetSize = TD->getABITypeSize(RetType); + unsigned RetSize = TD->getTypePaddedSize(RetType); if (RetSize > 0) O << CurrentFnName << ".retval" << " RES " << RetSize; } @@ -337,7 +337,7 @@ AI != AE; ++AI) { std::string ArgName = Mang->getValueName(AI); const Type *ArgTy = AI->getType(); - unsigned ArgSize = TD->getABITypeSize(ArgTy); + unsigned ArgSize = TD->getTypePaddedSize(ArgTy); O << CurrentFnName << ".args." << ArgName << " RES " << ArgSize; } // Emit the function variables. @@ -357,7 +357,7 @@ Constant *C = I->getInitializer(); const Type *Ty = C->getType(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); // Emit memory reserve directive. O << VarName << " RES " << Size << "\n"; } Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -679,7 +679,7 @@ Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); SwitchToSection(TAI->SectionForGlobal(GVar)); @@ -904,7 +904,7 @@ Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); SwitchToSection(TAI->SectionForGlobal(GVar)); Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -246,7 +246,7 @@ O << "\n\n"; std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); - unsigned Size = TD->getABITypeSize(C->getType()); + unsigned Size = TD->getTypePaddedSize(C->getType()); unsigned Align = TD->getPreferredAlignment(GVar); printVisibility(name, GVar->getVisibility()); Modified: llvm/trunk/lib/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Target.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/Target.cpp (original) +++ llvm/trunk/lib/Target/Target.cpp Mon Jan 12 14:38:59 2009 @@ -53,7 +53,7 @@ } unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return unwrap(TD)->getABITypeSize(unwrap(Ty)); + return unwrap(TD)->getTypePaddedSize(unwrap(Ty)); } unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty) { Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Mon Jan 12 14:38:59 2009 @@ -58,7 +58,7 @@ StructAlignment = std::max(TyAlign, StructAlignment); MemberOffsets[i] = StructSize; - StructSize += TD.getABITypeSize(Ty); // Consume space for this data item + StructSize += TD.getTypePaddedSize(Ty); // Consume space for this data item } // Empty structures have alignment of 1 byte. @@ -425,7 +425,7 @@ return getPointerSizeInBits(); case Type::ArrayTyID: { const ArrayType *ATy = cast(Ty); - return getABITypeSizeInBits(ATy->getElementType())*ATy->getNumElements(); + return getTypePaddedSizeInBits(ATy->getElementType())*ATy->getNumElements(); } case Type::StructTyID: // Get the layout annotation... which is lazily created on demand. @@ -568,7 +568,7 @@ // Get the array index and the size of each array element. int64_t arrayIdx = cast(Indices[CurIDX])->getSExtValue(); - Result += arrayIdx * (int64_t)getABITypeSize(Ty); + Result += arrayIdx * (int64_t)getTypePaddedSize(Ty); } } Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -75,7 +75,7 @@ Ty = cast(Ty)->getElementType(); // Size should be aligned to DWORD boundary - Size += ((TD->getABITypeSize(Ty) + 3)/4)*4; + Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4; } // We're not supporting tooooo huge arguments :) @@ -767,7 +767,7 @@ std::string name = Mang->getValueName(GVar); Constant *C = GVar->getInitializer(); const Type *Type = C->getType(); - unsigned Size = TD->getABITypeSize(Type); + unsigned Size = TD->getTypePaddedSize(Type); unsigned Align = TD->getPreferredAlignmentLog(GVar); printVisibility(name, GVar->getVisibility()); Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -58,7 +58,7 @@ Ty = cast(Ty)->getElementType(); // Size should be aligned to DWORD boundary - Size += ((TD->getABITypeSize(Ty) + 3)/4)*4; + Size += ((TD->getTypePaddedSize(Ty) + 3)/4)*4; } // We're not supporting tooooo huge arguments :) Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Jan 12 14:38:59 2009 @@ -386,7 +386,7 @@ unsigned Idx = cast(Op)->getZExtValue(); Disp += SL->getElementOffset(Idx); } else { - uint64_t S = TD.getABITypeSize(GTI.getIndexedType()); + uint64_t S = TD.getTypePaddedSize(GTI.getIndexedType()); if (ConstantInt *CI = dyn_cast(Op)) { // Constant-offset addressing. Disp += CI->getSExtValue() * S; @@ -1469,7 +1469,7 @@ unsigned Align = TD.getPreferredTypeAlignmentShift(C->getType()); if (Align == 0) { // Alignment of vector types. FIXME! - Align = TD.getABITypeSize(C->getType()); + Align = TD.getTypePaddedSize(C->getType()); Align = Log2_64(Align); } Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Mon Jan 12 14:38:59 2009 @@ -214,7 +214,7 @@ EmitAlignment(Align, GV, 2); - unsigned Size = TD->getABITypeSize(C->getType()); + unsigned Size = TD->getTypePaddedSize(C->getType()); if (GV->isThreadLocal()) { Size *= MaxThreads; } Modified: llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelLowering.cpp Mon Jan 12 14:38:59 2009 @@ -265,7 +265,7 @@ } SDValue base = getGlobalAddressWrapper(GA, GV, DAG); const TargetData *TD = TM.getTargetData(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); SDValue offset = DAG.getNode(ISD::MUL, MVT::i32, BuildGetId(DAG), DAG.getConstant(Size, MVT::i32)); return DAG.getNode(ISD::ADD, MVT::i32, base, offset); Modified: llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreTargetAsmInfo.cpp Mon Jan 12 14:38:59 2009 @@ -106,7 +106,7 @@ XCoreTargetAsmInfo::MergeableConstSection(const Type *Ty) const { const TargetData *TD = TM.getTargetData(); - unsigned Size = TD->getABITypeSize(Ty); + unsigned Size = TD->getTypePaddedSize(Ty); if (Size == 4 || Size == 8 || Size == 16) { std::string Name = ".cp.const" + utostr(Size); Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Mon Jan 12 14:38:59 2009 @@ -511,7 +511,7 @@ return 0; // It's not worth it. NewGlobals.reserve(NumElements); - uint64_t EltSize = TD.getABITypeSize(STy->getElementType()); + uint64_t EltSize = TD.getTypePaddedSize(STy->getElementType()); unsigned EltAlign = TD.getABITypeAlignment(STy->getElementType()); for (unsigned i = 0, e = NumElements; i != e; ++i) { Constant *In = getAggregateConstantElement(Init, @@ -1445,7 +1445,7 @@ // (2048 bytes currently), as we don't want to introduce a 16M global or // something. if (NElements->getZExtValue()* - TD.getABITypeSize(MI->getAllocatedType()) < 2048) { + TD.getTypePaddedSize(MI->getAllocatedType()) < 2048) { GVI = OptimizeGlobalAddressOfMalloc(GV, MI); return true; } Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon Jan 12 14:38:59 2009 @@ -817,7 +817,7 @@ cast(AddrInst->getOperand(i))->getZExtValue(); ConstantOffset += SL->getElementOffset(Idx); } else { - uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType()); + uint64_t TypeSize = TD->getTypePaddedSize(GTI.getIndexedType()); if (ConstantInt *CI = dyn_cast(AddrInst->getOperand(i))) { ConstantOffset += CI->getSExtValue()*TypeSize; } else if (TypeSize) { // Scales of zero don't do anything. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Mon Jan 12 14:38:59 2009 @@ -305,11 +305,11 @@ if (AllocaInst* A = dyn_cast(*I)) { if (ConstantInt* C = dyn_cast(A->getArraySize())) pointerSize = C->getZExtValue() * - TD.getABITypeSize(A->getAllocatedType()); + TD.getTypePaddedSize(A->getAllocatedType()); } else { const PointerType* PT = cast( cast(*I)->getType()); - pointerSize = TD.getABITypeSize(PT->getElementType()); + pointerSize = TD.getTypePaddedSize(PT->getElementType()); } // See if the call site touches it @@ -382,10 +382,10 @@ if (AllocaInst* A = dyn_cast(*I)) { if (ConstantInt* C = dyn_cast(A->getArraySize())) pointerSize = C->getZExtValue() * - TD.getABITypeSize(A->getAllocatedType()); + TD.getTypePaddedSize(A->getAllocatedType()); } else { const PointerType* PT = cast(cast(*I)->getType()); - pointerSize = TD.getABITypeSize(PT->getElementType()); + pointerSize = TD.getTypePaddedSize(PT->getElementType()); } // See if this pointer could alias it Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jan 12 14:38:59 2009 @@ -5142,7 +5142,7 @@ for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; ++i, ++GTI) { Value *Op = *i; - uint64_t Size = TD.getABITypeSize(GTI.getIndexedType()) & PtrSizeMask; + uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()) & PtrSizeMask; if (ConstantInt *OpC = dyn_cast(Op)) { if (OpC->isZero()) continue; @@ -5233,7 +5233,7 @@ if (const StructType *STy = dyn_cast(*GTI)) { Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue()); } else { - uint64_t Size = TD.getABITypeSize(GTI.getIndexedType()); + uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()); Offset += Size*CI->getSExtValue(); } } else { @@ -5249,7 +5249,7 @@ Value *VariableIdx = GEP->getOperand(i); // Determine the scale factor of the variable element. For example, this is // 4 if the variable index is into an array of i32. - uint64_t VariableScale = TD.getABITypeSize(GTI.getIndexedType()); + uint64_t VariableScale = TD.getTypePaddedSize(GTI.getIndexedType()); // Verify that there are no other variable indices. If so, emit the hard way. for (++i, ++GTI; i != e; ++i, ++GTI) { @@ -5263,7 +5263,7 @@ if (const StructType *STy = dyn_cast(*GTI)) { Offset += TD.getStructLayout(STy)->getElementOffset(CI->getZExtValue()); } else { - uint64_t Size = TD.getABITypeSize(GTI.getIndexedType()); + uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()); Offset += Size*CI->getSExtValue(); } } @@ -7419,8 +7419,8 @@ // same, we open the door to infinite loops of various kinds. if (!AI.hasOneUse() && CastElTyAlign == AllocElTyAlign) return 0; - uint64_t AllocElTySize = TD->getABITypeSize(AllocElTy); - uint64_t CastElTySize = TD->getABITypeSize(CastElTy); + uint64_t AllocElTySize = TD->getTypePaddedSize(AllocElTy); + uint64_t CastElTySize = TD->getTypePaddedSize(CastElTy); if (CastElTySize == 0 || AllocElTySize == 0) return 0; // See if we can satisfy the modulus by pulling a scale out of the array @@ -7708,7 +7708,7 @@ // is something like [0 x {int, int}] const Type *IntPtrTy = TD->getIntPtrType(); int64_t FirstIdx = 0; - if (int64_t TySize = TD->getABITypeSize(Ty)) { + if (int64_t TySize = TD->getTypePaddedSize(Ty)) { FirstIdx = Offset/TySize; Offset -= FirstIdx*TySize; @@ -7740,7 +7740,7 @@ Offset -= SL->getElementOffset(Elt); Ty = STy->getElementType(Elt); } else if (const ArrayType *AT = dyn_cast(Ty)) { - uint64_t EltSize = TD->getABITypeSize(AT->getElementType()); + uint64_t EltSize = TD->getTypePaddedSize(AT->getElementType()); assert(EltSize && "Cannot index into a zero-sized array"); NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize)); Offset %= EltSize; @@ -8407,7 +8407,7 @@ // is a single-index GEP. if (X->getType() == CI.getType()) { // Get the size of the pointee type. - uint64_t Size = TD->getABITypeSize(DestPointee); + uint64_t Size = TD->getTypePaddedSize(DestPointee); // Convert the constant to intptr type. APInt Offset = Cst->getValue(); @@ -8427,7 +8427,7 @@ // "inttoptr+GEP" instead of "add+intptr". // Get the size of the pointee type. - uint64_t Size = TD->getABITypeSize(DestPointee); + uint64_t Size = TD->getTypePaddedSize(DestPointee); // Convert the constant to intptr type. APInt Offset = Cst->getValue(); @@ -9492,7 +9492,7 @@ const Type* DstTy = cast(CI->getType())->getElementType(); if (!SrcTy->isSized() || !DstTy->isSized()) return false; - if (TD->getABITypeSize(SrcTy) != TD->getABITypeSize(DstTy)) + if (TD->getTypePaddedSize(SrcTy) != TD->getTypePaddedSize(DstTy)) return false; return true; } @@ -10608,8 +10608,8 @@ const Type *SrcElTy = cast(X->getType())->getElementType(); const Type *ResElTy=cast(PtrOp->getType())->getElementType(); if (isa(SrcElTy) && - TD->getABITypeSize(cast(SrcElTy)->getElementType()) == - TD->getABITypeSize(ResElTy)) { + TD->getTypePaddedSize(cast(SrcElTy)->getElementType()) == + TD->getTypePaddedSize(ResElTy)) { Value *Idx[2]; Idx[0] = Constant::getNullValue(Type::Int32Ty); Idx[1] = GEP.getOperand(1); @@ -10626,7 +10626,7 @@ if (isa(SrcElTy) && ResElTy == Type::Int8Ty) { uint64_t ArrayEltSize = - TD->getABITypeSize(cast(SrcElTy)->getElementType()); + TD->getTypePaddedSize(cast(SrcElTy)->getElementType()); // Check to see if "tmp" is a scale by a multiple of ArrayEltSize. We // allow either a mul, shift, or constant here. @@ -10779,7 +10779,7 @@ // Note that we only do this for alloca's, because malloc should allocate and // return a unique pointer, even for a zero byte allocation. if (isa(AI) && AI.getAllocatedType()->isSized() && - TD->getABITypeSize(AI.getAllocatedType()) == 0) + TD->getTypePaddedSize(AI.getAllocatedType()) == 0) return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType())); return 0; Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Jan 12 14:38:59 2009 @@ -330,7 +330,7 @@ Value *OpVal = getCastedVersionOf(opcode, *i); SCEVHandle Idx = SE->getSCEV(OpVal); - uint64_t TypeSize = TD->getABITypeSize(GTI.getIndexedType()); + uint64_t TypeSize = TD->getTypePaddedSize(GTI.getIndexedType()); if (TypeSize != 1) Idx = SE->getMulExpr(Idx, SE->getConstant(ConstantInt::get(UIntPtrTy, Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Mon Jan 12 14:38:59 2009 @@ -104,7 +104,7 @@ // Otherwise, we have a sequential type like an array or vector. Multiply // the index by the ElementSize. - uint64_t Size = TD.getABITypeSize(GTI.getIndexedType()); + uint64_t Size = TD.getTypePaddedSize(GTI.getIndexedType()); Offset += Size*OpC->getSExtValue(); } @@ -511,7 +511,7 @@ if (!srcArraySize) return false; - uint64_t srcSize = TD.getABITypeSize(srcAlloca->getAllocatedType()) * + uint64_t srcSize = TD.getTypePaddedSize(srcAlloca->getAllocatedType()) * srcArraySize->getZExtValue(); if (cpyLength->getZExtValue() < srcSize) @@ -526,7 +526,7 @@ if (!destArraySize) return false; - uint64_t destSize = TD.getABITypeSize(A->getAllocatedType()) * + uint64_t destSize = TD.getTypePaddedSize(A->getAllocatedType()) * destArraySize->getZExtValue(); if (destSize < srcSize) @@ -538,7 +538,7 @@ return false; const Type* StructTy = cast(A->getType())->getElementType(); - uint64_t destSize = TD.getABITypeSize(StructTy); + uint64_t destSize = TD.getTypePaddedSize(StructTy); if (destSize < srcSize) return false; Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Jan 12 14:38:59 2009 @@ -243,7 +243,7 @@ isa(AI->getAllocatedType())) && AI->getAllocatedType()->isSized() && // Do not promote any struct whose size is larger than "128" bytes. - TD->getABITypeSize(AI->getAllocatedType()) < SRThreshold && + TD->getTypePaddedSize(AI->getAllocatedType()) < SRThreshold && // Do not promote any struct into more than "32" separate vars. getNumSAElements(AI->getAllocatedType()) < SRThreshold/4) { // Check that all of the users of the allocation are capable of being @@ -562,7 +562,7 @@ // If not the whole aggregate, give up. if (Length->getZExtValue() != - TD->getABITypeSize(AI->getType()->getElementType())) + TD->getTypePaddedSize(AI->getType()->getElementType())) return MarkUnsafe(Info); // We only know about memcpy/memset/memmove. @@ -595,8 +595,8 @@ // cast a {i32,i32}* to i64* and store through it. This is similar to the // memcpy case and occurs in various "byval" cases and emulated memcpys. if (isa(SI->getOperand(0)->getType()) && - TD->getABITypeSize(SI->getOperand(0)->getType()) == - TD->getABITypeSize(AI->getType()->getElementType())) { + TD->getTypePaddedSize(SI->getOperand(0)->getType()) == + TD->getTypePaddedSize(AI->getType()->getElementType())) { Info.isMemCpyDst = true; continue; } @@ -607,8 +607,8 @@ // cast a {i32,i32}* to i64* and load through it. This is similar to the // memcpy case and occurs in various "byval" cases and emulated memcpys. if (isa(LI->getType()) && - TD->getABITypeSize(LI->getType()) == - TD->getABITypeSize(AI->getType()->getElementType())) { + TD->getTypePaddedSize(LI->getType()) == + TD->getTypePaddedSize(AI->getType()->getElementType())) { Info.isMemCpySrc = true; continue; } @@ -789,7 +789,7 @@ OtherElt = new BitCastInst(OtherElt, BytePtrTy,OtherElt->getNameStr(), MI); - unsigned EltSize = TD->getABITypeSize(EltTy); + unsigned EltSize = TD->getTypePaddedSize(EltTy); // Finally, insert the meminst for this element. if (isa(MI) || isa(MI)) { @@ -823,13 +823,13 @@ // and store the element value to the individual alloca. Value *SrcVal = SI->getOperand(0); const Type *AllocaEltTy = AI->getType()->getElementType(); - uint64_t AllocaSizeBits = TD->getABITypeSizeInBits(AllocaEltTy); + uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy); // If this isn't a store of an integer to the whole alloca, it may be a store // to the first element. Just ignore the store in this case and normal SROA // will handle it. if (!isa(SrcVal->getType()) || - TD->getABITypeSizeInBits(SrcVal->getType()) != AllocaSizeBits) + TD->getTypePaddedSizeInBits(SrcVal->getType()) != AllocaSizeBits) return; DOUT << "PROMOTING STORE TO WHOLE ALLOCA: " << *AI << *SI; @@ -845,7 +845,7 @@ uint64_t Shift = Layout->getElementOffsetInBits(i); if (TD->isBigEndian()) - Shift = AllocaSizeBits-Shift-TD->getABITypeSizeInBits(FieldTy); + Shift = AllocaSizeBits-Shift-TD->getTypePaddedSizeInBits(FieldTy); Value *EltVal = SrcVal; if (Shift) { @@ -880,7 +880,7 @@ } else { const ArrayType *ATy = cast(AllocaEltTy); const Type *ArrayEltTy = ATy->getElementType(); - uint64_t ElementOffset = TD->getABITypeSizeInBits(ArrayEltTy); + uint64_t ElementOffset = TD->getTypePaddedSizeInBits(ArrayEltTy); uint64_t ElementSizeBits = TD->getTypeSizeInBits(ArrayEltTy); uint64_t Shift; @@ -935,13 +935,13 @@ // Extract each element out of the NewElts according to its structure offset // and form the result value. const Type *AllocaEltTy = AI->getType()->getElementType(); - uint64_t AllocaSizeBits = TD->getABITypeSizeInBits(AllocaEltTy); + uint64_t AllocaSizeBits = TD->getTypePaddedSizeInBits(AllocaEltTy); // If this isn't a load of the whole alloca to an integer, it may be a load // of the first element. Just ignore the load in this case and normal SROA // will handle it. if (!isa(LI->getType()) || - TD->getABITypeSizeInBits(LI->getType()) != AllocaSizeBits) + TD->getTypePaddedSizeInBits(LI->getType()) != AllocaSizeBits) return; DOUT << "PROMOTING LOAD OF WHOLE ALLOCA: " << *AI << *LI; @@ -954,7 +954,7 @@ Layout = TD->getStructLayout(EltSTy); } else { const Type *ArrayEltTy = cast(AllocaEltTy)->getElementType(); - ArrayEltBitOffset = TD->getABITypeSizeInBits(ArrayEltTy); + ArrayEltBitOffset = TD->getTypePaddedSizeInBits(ArrayEltTy); } Value *ResultVal = Constant::getNullValue(LI->getType()); @@ -1048,7 +1048,7 @@ } else if (const VectorType *VTy = dyn_cast(Ty)) { return HasPadding(VTy->getElementType(), TD); } - return TD.getTypeSizeInBits(Ty) != TD.getABITypeSizeInBits(Ty); + return TD.getTypeSizeInBits(Ty) != TD.getTypePaddedSizeInBits(Ty); } /// isSafeStructAllocaToScalarRepl - Check to see if the specified allocation of @@ -1270,7 +1270,7 @@ // Check to see if this is stepping over an element: GEP Ptr, int C if (GEP->getNumOperands() == 2 && isa(GEP->getOperand(1))) { unsigned Idx = cast(GEP->getOperand(1))->getZExtValue(); - unsigned ElSize = TD->getABITypeSize(PTy->getElementType()); + unsigned ElSize = TD->getTypePaddedSize(PTy->getElementType()); unsigned BitOffset = Idx*ElSize*8; if (BitOffset > 64 || !isPowerOf2_32(ElSize)) return 0; @@ -1279,7 +1279,7 @@ if (SubElt == 0) return 0; if (SubElt != Type::VoidTy && SubElt->isInteger()) { const Type *NewTy = - getIntAtLeastAsBigAs(TD->getABITypeSizeInBits(SubElt)+BitOffset); + getIntAtLeastAsBigAs(TD->getTypePaddedSizeInBits(SubElt)+BitOffset); if (NewTy == 0 || MergeInType(NewTy, UsedType, *TD)) return 0; continue; } @@ -1320,7 +1320,8 @@ } else { return 0; } - const Type *NTy = getIntAtLeastAsBigAs(TD->getABITypeSizeInBits(AggTy)); + const Type *NTy = + getIntAtLeastAsBigAs(TD->getTypePaddedSizeInBits(AggTy)); if (NTy == 0 || MergeInType(NTy, UsedType, *TD)) return 0; const Type *SubTy = CanConvertToScalar(GEP, IsNotTrivial); if (SubTy == 0) return 0; @@ -1396,7 +1397,7 @@ const PointerType *AggPtrTy = cast(GEP->getOperand(0)->getType()); unsigned AggSizeInBits = - TD->getABITypeSizeInBits(AggPtrTy->getElementType()); + TD->getTypePaddedSizeInBits(AggPtrTy->getElementType()); // Check to see if this is stepping over an element: GEP Ptr, int C unsigned NewOffset = Offset; @@ -1417,7 +1418,7 @@ const Type *AggTy = AggPtrTy->getElementType(); if (const SequentialType *SeqTy = dyn_cast(AggTy)) { unsigned ElSizeBits = - TD->getABITypeSizeInBits(SeqTy->getElementType()); + TD->getTypePaddedSizeInBits(SeqTy->getElementType()); NewOffset += ElSizeBits*Idx; } else { @@ -1471,7 +1472,7 @@ // Otherwise it must be an element access. unsigned Elt = 0; if (Offset) { - unsigned EltSize = TD->getABITypeSizeInBits(VTy->getElementType()); + unsigned EltSize = TD->getTypePaddedSizeInBits(VTy->getElementType()); Elt = Offset/EltSize; Offset -= EltSize*Elt; } @@ -1557,7 +1558,7 @@ SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); } else { // Must be an element insertion. - unsigned Elt = Offset/TD->getABITypeSizeInBits(PTy->getElementType()); + unsigned Elt = Offset/TD->getTypePaddedSizeInBits(PTy->getElementType()); SV = InsertElementInst::Create(Old, SV, ConstantInt::get(Type::Int32Ty, Elt), "tmp", SI); Modified: llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/LowerAllocations.cpp Mon Jan 12 14:38:59 2009 @@ -115,7 +115,8 @@ // malloc(type) becomes sbyte *malloc(size) Value *MallocArg; if (LowerMallocArgToInteger) - MallocArg = ConstantInt::get(Type::Int64Ty, TD.getABITypeSize(AllocTy)); + MallocArg = ConstantInt::get(Type::Int64Ty, + TD.getTypePaddedSize(AllocTy)); else MallocArg = ConstantExpr::getSizeOf(AllocTy); MallocArg = ConstantExpr::getTruncOrBitCast(cast(MallocArg), Modified: llvm/trunk/utils/TableGen/CallingConvEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CallingConvEmitter.cpp?rev=62099&r1=62098&r2=62099&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CallingConvEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/CallingConvEmitter.cpp Mon Jan 12 14:38:59 2009 @@ -163,7 +163,7 @@ O << Size << ", "; else O << "\n" << IndentStr << " State.getTarget().getTargetData()" - "->getABITypeSize(LocVT.getTypeForMVT()), "; + "->getTypePaddedSize(LocVT.getTypeForMVT()), "; if (Align) O << Align; else From baldrick at free.fr Mon Jan 12 14:48:31 2009 From: baldrick at free.fr (Duncan Sands) Date: Mon, 12 Jan 2009 20:48:31 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62100 - in /llvm-gcc-4.2/trunk/gcc: config/i386/llvm-i386.cpp llvm-abi.h llvm-convert.cpp llvm-types.cpp Message-ID: <200901122048.n0CKmW6M011277@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 12 14:48:30 2009 New Revision: 62100 URL: http://llvm.org/viewvc/llvm-project?rev=62100&view=rev Log: Rename getABITypeSize to getTypePaddedSize. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp llvm-gcc-4.2/trunk/gcc/llvm-abi.h llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=62100&r1=62099&r2=62100&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Mon Jan 12 14:48:30 2009 @@ -1019,7 +1019,7 @@ const Type *llvm_x86_scalar_type_for_struct_return(tree type, unsigned *Offset) { *Offset = 0; const Type *Ty = ConvertType(type); - unsigned Size = getTargetData().getABITypeSize(Ty); + unsigned Size = getTargetData().getTypePaddedSize(Ty); if (Size == 0) return Type::VoidTy; else if (Size == 1) Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=62100&r1=62099&r2=62100&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Jan 12 14:48:30 2009 @@ -205,7 +205,7 @@ // target independent implementation. static const Type* getLLVMScalarTypeForStructReturn(tree type, unsigned *Offset) { const Type *Ty = ConvertType(type); - unsigned Size = getTargetData().getABITypeSize(Ty); + unsigned Size = getTargetData().getTypePaddedSize(Ty); *Offset = 0; if (Size == 0) return Type::VoidTy; @@ -653,20 +653,20 @@ const StructType *STy = StructType::get(Elts, false); - unsigned Size = getTargetData().getABITypeSize(STy); + unsigned Size = getTargetData().getTypePaddedSize(STy); const StructType *InSTy = dyn_cast(Ty); unsigned InSize = 0; // If Ty and STy size does not match then last element is accessing // extra bits. unsigned LastEltSizeDiff = 0; if (InSTy) { - InSize = getTargetData().getABITypeSize(InSTy); + InSize = getTargetData().getTypePaddedSize(InSTy); if (InSize < Size) { unsigned N = STy->getNumElements(); const llvm::Type *LastEltTy = STy->getElementType(N-1); if (LastEltTy->isInteger()) LastEltSizeDiff = - getTargetData().getABITypeSize(LastEltTy) - (Size - InSize); + getTargetData().getTypePaddedSize(LastEltTy) - (Size - InSize); } } for (unsigned i = 0, e = Elts.size(); i != e; ++i) { Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=62100&r1=62099&r2=62100&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jan 12 14:48:30 2009 @@ -1349,7 +1349,7 @@ } } else { const ArrayType *ATy = cast(ElTy); - unsigned EltSize = getTargetData().getABITypeSize(ATy->getElementType()); + unsigned EltSize = getTargetData().getTypePaddedSize(ATy->getElementType()); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) { Value *DElPtr = Builder.CreateStructGEP(DestLoc.Ptr, i); Value *SElPtr = Builder.CreateStructGEP(SrcLoc.Ptr, i); @@ -1460,7 +1460,7 @@ } } else { const ArrayType *ATy = cast(ElTy); - unsigned EltSize = getTargetData().getABITypeSize(ATy->getElementType()); + unsigned EltSize = getTargetData().getTypePaddedSize(ATy->getElementType()); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) { Value *Ptr = Builder.CreateStructGEP(DestLoc.Ptr, i); unsigned Alignment = MinAlign(DestLoc.Alignment, i * EltSize); @@ -3456,7 +3456,7 @@ // We can't get the type size (and thus convert to using a GEP instr) from // pointers to opaque structs if the type isn't abstract. if (ElTy->isSized()) { - int64_t EltSize = TD.getABITypeSize(ElTy); + int64_t EltSize = TD.getTypePaddedSize(ElTy); // If EltSize exactly divides Offset, then we know that we can turn this // into a getelementptr instruction. @@ -5750,7 +5750,7 @@ Value *ImagPtr = Builder.CreateStructGEP(SrcComplex.Ptr, 1, "imag"); Imag = Builder.CreateLoad(ImagPtr, SrcComplex.Volatile, "imag"); cast(Imag)->setAlignment( - MinAlign(SrcComplex.Alignment, TD.getABITypeSize(Real->getType())) + MinAlign(SrcComplex.Alignment, TD.getTypePaddedSize(Real->getType())) ); } @@ -5765,7 +5765,7 @@ Value *ImagPtr = Builder.CreateStructGEP(DestComplex.Ptr, 1, "imag"); St = Builder.CreateStore(Imag, ImagPtr, DestComplex.Volatile); St->setAlignment( - MinAlign(DestComplex.Alignment, TD.getABITypeSize(Real->getType())) + MinAlign(DestComplex.Alignment, TD.getTypePaddedSize(Real->getType())) ); } @@ -5997,7 +5997,7 @@ Value *Ptr = Builder.CreateGEP(ArrayAddr, Idxs, Idxs + 2); const Type *ATy = cast(ArrayAddr->getType())->getElementType(); const Type *ElementTy = cast(ATy)->getElementType(); - unsigned Alignment = MinAlign(ArrayAlign, TD.getABITypeSize(ElementTy)); + unsigned Alignment = MinAlign(ArrayAlign, TD.getTypePaddedSize(ElementTy)); return LValue(BitCastToType(Ptr, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), Alignment); @@ -6218,7 +6218,7 @@ if (LLVMFieldTy->isInteger() && LLVMFieldTy->getPrimitiveSizeInBits() >= BitStart + BitfieldSize && LLVMFieldTy->getPrimitiveSizeInBits() == - TD.getABITypeSizeInBits(LLVMFieldTy)) + TD.getTypePaddedSizeInBits(LLVMFieldTy)) FieldTy = LLVMFieldTy; else // If the field result type T is a bool or some other curiously sized @@ -6228,10 +6228,10 @@ // sized like an i24 there may be trouble: incrementing a T* will move // the position by 32 bits not 24, leaving the upper 8 of those 32 bits // inaccessible. Avoid this by rounding up the size appropriately. - FieldTy = IntegerType::get(TD.getABITypeSizeInBits(FieldTy)); + FieldTy = IntegerType::get(TD.getTypePaddedSizeInBits(FieldTy)); assert(FieldTy->getPrimitiveSizeInBits() == - TD.getABITypeSizeInBits(FieldTy) && "Field type not sequential!"); + TD.getTypePaddedSizeInBits(FieldTy) && "Field type not sequential!"); // If this is a bitfield, the field may span multiple fields in the LLVM // type. As such, cast the pointer to be a pointer to the declared type. @@ -6308,7 +6308,7 @@ assert(BitSize <= ValueSizeInBits && "ValTy isn't large enough to hold the value loaded!"); - assert(ValueSizeInBits == TD.getABITypeSizeInBits(ValTy) && + assert(ValueSizeInBits == TD.getTypePaddedSizeInBits(ValTy) && "FIXME: BIT_FIELD_REF logic is broken for non-round types"); // BIT_FIELD_REF values can have BitStart values that are quite large. We @@ -6344,7 +6344,8 @@ Alignment = Ptr.Alignment; else // IMAGPART alignment = MinAlign(Ptr.Alignment, sizeof field); - Alignment = MinAlign(Ptr.Alignment, TD.getABITypeSize(Ptr.Ptr->getType())); + Alignment = MinAlign(Ptr.Alignment, + TD.getTypePaddedSize(Ptr.Ptr->getType())); return LValue(Builder.CreateStructGEP(Ptr.Ptr, Idx), Alignment); } @@ -7032,7 +7033,7 @@ static Constant *ConvertStructFieldInitializerToType(Constant *Val, const Type *FieldTy) { const TargetData &TD = getTargetData(); - assert(TD.getABITypeSize(FieldTy) == TD.getABITypeSize(Val->getType()) && + assert(TD.getTypePaddedSize(FieldTy) == TD.getTypePaddedSize(Val->getType()) && "Mismatched initializer type isn't same size as initializer!"); // If this is an integer initializer for an array of ubytes, we are @@ -7140,11 +7141,11 @@ Constant *retval = ConstantStruct::get(ResultElts, STy->isPacked()); const Type *NewSTy = retval->getType(); - unsigned oldLLVMSize = getTargetData().getABITypeSize(STy); + unsigned oldLLVMSize = getTargetData().getTypePaddedSize(STy); unsigned oldLLVMAlign = getTargetData().getABITypeAlignment(STy); oldLLVMSize = ((oldLLVMSize+oldLLVMAlign-1)/oldLLVMAlign)*oldLLVMAlign; - unsigned newLLVMSize = getTargetData().getABITypeSize(NewSTy); + unsigned newLLVMSize = getTargetData().getTypePaddedSize(NewSTy); unsigned newLLVMAlign = getTargetData().getABITypeAlignment(NewSTy); newLLVMSize = ((newLLVMSize+newLLVMAlign-1)/newLLVMAlign)*newLLVMAlign; @@ -7181,7 +7182,7 @@ tree UnionType = TREE_TYPE(exp); if (TYPE_SIZE(UnionType) && TREE_CODE(TYPE_SIZE(UnionType)) == INTEGER_CST) { unsigned UnionSize = ((unsigned)TREE_INT_CST_LOW(TYPE_SIZE(UnionType))+7)/8; - unsigned InitSize = getTargetData().getABITypeSize(Elts[0]->getType()); + unsigned InitSize = getTargetData().getTypePaddedSize(Elts[0]->getType()); if (UnionSize != InitSize) { const Type *FillTy; assert(UnionSize > InitSize && "Init shouldn't be larger than union!"); Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=62100&r1=62099&r2=62100&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Jan 12 14:48:30 2009 @@ -72,11 +72,11 @@ static const Type * llvm_set_type(tree Tr, const Type *Ty) { // For x86 long double, llvm records the size of the data (80) while - // gcc's TYPE_SIZE including alignment padding. getABITypeSizeInBits + // gcc's TYPE_SIZE including alignment padding. getTypePaddedSizeInBits // is used to compensate for this. assert((!TYPE_SIZE(Tr) || !Ty->isSized() || !isInt64(TYPE_SIZE(Tr), true) || getInt64(TYPE_SIZE(Tr), true) == - getTargetData().getABITypeSizeInBits(Ty)) + getTargetData().getTypePaddedSizeInBits(Ty)) && "LLVM type size doesn't match GCC type size!"); unsigned &TypeSlot = LTypesMap[Ty]; @@ -1346,7 +1346,7 @@ /// getTypeSize - Return the size of the specified type in bytes. /// uint64_t getTypeSize(const Type *Ty) const { - return TD.getABITypeSize(Ty); + return TD.getTypePaddedSize(Ty); } /// getLLVMType - Return the LLVM type for the specified object. @@ -2272,7 +2272,7 @@ } #endif const Type *TheTy = ConvertType(TheGccTy); - unsigned Size = TD.getABITypeSize(TheTy); + unsigned Size = TD.getTypePaddedSize(TheTy); unsigned Align = TD.getABITypeAlignment(TheTy); adjustPaddingElement(GccUnionTy, TheGccTy); @@ -2309,7 +2309,7 @@ unsigned EltSize = 0; if (UnionTy) { // Not an empty union. EltAlign = TD.getABITypeAlignment(UnionTy); - EltSize = TD.getABITypeSize(UnionTy); + EltSize = TD.getTypePaddedSize(UnionTy); UnionElts.push_back(UnionTy); } From clattner at apple.com Mon Jan 12 15:20:26 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 13:20:26 -0800 Subject: [llvm-commits] [test-suite] r62094 - /test-suite/trunk/Makefile.tests In-Reply-To: <200901121859.n0CIxsoH006397@zion.cs.uiuc.edu> References: <200901121859.n0CIxsoH006397@zion.cs.uiuc.edu> Message-ID: <4747FDEC-0C8A-46B1-AA4A-F6EA65566EBA@apple.com> On Jan 12, 2009, at 10:59 AM, Dale Johannesen wrote: > Author: johannes > Date: Mon Jan 12 12:59:54 2009 > New Revision: 62094 > > URL: http://llvm.org/viewvc/llvm-project?rev=62094&view=rev > Log: > Echo commmand line flags of initial (->.bc) compilation. Dale, please don't do this. If you want to see these options, please build with 'make VERBOSE=1' -Chris > > > > Modified: > test-suite/trunk/Makefile.tests > > Modified: test-suite/trunk/Makefile.tests > URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.tests?rev=62094&r1=62093&r2=62094&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- test-suite/trunk/Makefile.tests (original) > +++ test-suite/trunk/Makefile.tests Mon Jan 12 12:59:54 2009 > @@ -39,32 +39,32 @@ > > # Compile from X.c to Output/X.bc > Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # Compile from X.cpp to Output/X.bc > Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # Compile from X.cc to Output/X.bc > Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # Compile from X.C to Output/X.bc > Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # Compile from X.m to Output/X.bc > Output/%.bc: %.m $(LCC1) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # Compile from X.mm to Output/X.bc > Output/%.bc: %.mm $(LCC1XX) Output/.dir $(INCLUDES) > - @echo Compiling $(notdir $<) to $@ > + @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) to $@ > -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $ > (TARGET_FLAGS) -c $< -o $@ -emit-llvm > > # LLVM Assemble from X.ll to Output/X.bc. Because we are coming > directly from > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Mon Jan 12 15:29:41 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 Jan 2009 21:29:41 -0000 Subject: [llvm-commits] [llvm] r62102 - /llvm/trunk/docs/Projects.html Message-ID: <200901122129.n0CLTkHI012843@zion.cs.uiuc.edu> Author: djg Date: Mon Jan 12 15:29:24 2009 New Revision: 62102 URL: http://llvm.org/viewvc/llvm-project?rev=62102&view=rev Log: Fix the instructions to work even when PATH does not contain ".". Thanks to Martin Geisse for pointing this out! Modified: llvm/trunk/docs/Projects.html Modified: llvm/trunk/docs/Projects.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Projects.html?rev=62102&r1=62101&r2=62102&view=diff ============================================================================== --- llvm/trunk/docs/Projects.html (original) +++ llvm/trunk/docs/Projects.html Mon Jan 12 15:29:24 2009 @@ -118,7 +118,7 @@

% cd autoconf
- % AutoRegen.sh

+ % ./AutoRegen.sh

You must be using Autoconf version 2.59 or later and your aclocal version From gohman at apple.com Mon Jan 12 15:35:59 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 Jan 2009 21:35:59 -0000 Subject: [llvm-commits] [llvm] r62103 - /llvm/trunk/docs/LangRef.html Message-ID: <200901122135.n0CLZxRa013116@zion.cs.uiuc.edu> Author: djg Date: Mon Jan 12 15:35:55 2009 New Revision: 62103 URL: http://llvm.org/viewvc/llvm-project?rev=62103&view=rev Log: The LLVM Assembly Language Reference incorrectly stated that the prefix used for dll{import,export} is _imp__; it is actually __imp_. Patch by Mahadevan R! Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=62103&r1=62102&r2=62103&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Jan 12 15:35:55 2009 @@ -552,7 +552,7 @@

"dllimport" linkage causes the compiler to reference a function or variable via a global pointer to a pointer that is set up by the DLL exporting the symbol. On Microsoft Windows targets, the pointer name is - formed by combining _imp__ and the function or variable name. + formed by combining __imp_ and the function or variable name.
dllexport:
@@ -560,7 +560,7 @@
"dllexport" linkage causes the compiler to provide a global pointer to a pointer in a DLL, so that it can be referenced with the dllimport attribute. On Microsoft Windows targets, the pointer - name is formed by combining _imp__ and the function or variable + name is formed by combining __imp_ and the function or variable name.
From dpatel at apple.com Mon Jan 12 15:38:43 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 21:38:43 -0000 Subject: [llvm-commits] [llvm] r62104 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp Message-ID: <200901122138.n0CLchFU013208@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 15:38:43 2009 New Revision: 62104 URL: http://llvm.org/viewvc/llvm-project?rev=62104&view=rev Log: Add classof() methods to support isa<> and other related facilities. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/lib/Analysis/DebugInfo.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=62104&r1=62103&r2=62104&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Mon Jan 12 15:38:43 2009 @@ -17,6 +17,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/Support/Dwarf.h" namespace llvm { class BasicBlock; @@ -95,10 +96,9 @@ int64_t getLo() const { return (int64_t)getUInt64Field(1); } int64_t getHi() const { return (int64_t)getUInt64Field(2); } - static bool isSubrange(unsigned); static inline bool classof(const DISubrange *) { return true; } static inline bool classof(const DIDescriptor *D) { - return isSubrange(D->getTag()); + return D->getTag() == dwarf::DW_TAG_subrange_type; } }; @@ -111,6 +111,12 @@ DIDescriptor getElement(unsigned Idx) const { return getDescriptorField(Idx); } + + static inline bool classof(const DIArray *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return D->getTag() == dwarf::DW_TAG_array_type + || D->getTag() == dwarf::DW_AT_GNU_vector; + } }; /// DICompileUnit - A wrapper for a compile unit. @@ -122,6 +128,11 @@ std::string getFilename() const { return getStringField(3); } std::string getDirectory() const { return getStringField(4); } std::string getProducer() const { return getStringField(5); } + + static inline bool classof(const DICompileUnit *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return D->getTag() == dwarf::DW_TAG_compile_unit; + } }; /// DIEnumerator - A wrapper for an enumerator (e.g. X and Y in 'enum {X,Y}'). @@ -133,6 +144,10 @@ std::string getName() const { return getStringField(1); } uint64_t getEnumValue() const { return getUInt64Field(2); } + static inline bool classof(const DIEnumerator *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return D->getTag() == dwarf::DW_TAG_enumerator; + } }; /// DIType - This is a wrapper for a type. @@ -144,6 +159,21 @@ // This ctor is used when the Tag has already been validated by a derived // ctor. DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {} + + /// isDerivedType - Return true if the specified tag is legal for + /// DIDerivedType. + static bool isDerivedType(unsigned TAG); + + /// isCompositeType - Return true if the specified tag is legal for + /// DICompositeType. + static bool isCompositeType(unsigned TAG); + + /// isBasicType - Return true if the specified tag is legal for + /// DIBasicType. + static bool isBasicType(unsigned TAG) { + return TAG == dwarf::DW_TAG_base_type; + } + public: explicit DIType(GlobalVariable *GV); explicit DIType() {} @@ -169,6 +199,13 @@ assert (0 && "Invalid DIDescriptor"); return ""; } + + static inline bool classof(const DIType *) { return true; } + static inline bool classof(const DIDescriptor *D) { + unsigned Tag = D->getTag(); + return isBasicType(Tag) || isDerivedType(Tag) || isCompositeType(Tag); + } + }; /// DIBasicType - A basic type, like 'int' or 'float'. @@ -194,10 +231,6 @@ std::string getFilename() const { return getStringField(10); } std::string getDirectory() const { return getStringField(11); } - /// isDerivedType - Return true if the specified tag is legal for - /// DIDerivedType. - static bool isDerivedType(unsigned TAG); - static inline bool classof(const DIDerivedType *) { return true; } static inline bool classof(const DIDescriptor *D) { return isDerivedType(D->getTag()); @@ -216,9 +249,6 @@ std::string getFilename() const { return getStringField(11); } std::string getDirectory() const { return getStringField(12); } - /// isCompositeType - Return true if the specified tag is legal for - /// DICompositeType. - static bool isCompositeType(unsigned TAG); static inline bool classof(const DIDerivedType *) { return true; } static inline bool classof(const DIDescriptor *D) { return isCompositeType(D->getTag()); @@ -230,6 +260,19 @@ protected: explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag) : DIDescriptor(GV, RequiredTag) {} + + /// isSubprogram - Return true if the specified tag is legal for + /// DISubprogram. + static bool isSubprogram(unsigned TAG) { + return TAG == dwarf::DW_TAG_subprogram; + } + + /// isGlobalVariable - Return true if the specified tag is legal for + /// DIGlobalVariable. + static bool isGlobalVariable(unsigned TAG) { + return TAG == dwarf::DW_TAG_variable; + } + public: virtual ~DIGlobal() {} @@ -256,6 +299,12 @@ assert (0 && "Invalid DIDescriptor"); return ""; } + + static inline bool classof(const DIGlobal *) { return true; } + static inline bool classof(const DIDescriptor *D) { + unsigned Tag = D->getTag(); + return isSubprogram(Tag) || isGlobalVariable(Tag); + } }; @@ -266,6 +315,10 @@ std::string getFilename() const { return getStringField(11); } std::string getDirectory() const { return getStringField(12); } DICompositeType getType() const { return getFieldAs(8); } + static inline bool classof(const DISubprogram *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return isSubprogram(D->getTag()); + } }; /// DIGlobalVariable - This is a wrapper for a global variable. @@ -276,6 +329,10 @@ GlobalVariable *getGlobal() const { return getGlobalVariableField(11); } std::string getFilename() const { return getStringField(12); } std::string getDirectory() const { return getStringField(13); } + static inline bool classof(const DIGlobalVariable *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return isGlobalVariable(D->getTag()); + } }; @@ -296,6 +353,10 @@ /// isVariable - Return true if the specified tag is legal for DIVariable. static bool isVariable(unsigned Tag); + static inline bool classof(const DIVariable *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return isVariable(D->getTag()); + } }; @@ -305,6 +366,10 @@ explicit DIBlock(GlobalVariable *GV = 0); DIDescriptor getContext() const { return getDescriptorField(1); } + static inline bool classof(const DIBlock *) { return true; } + static inline bool classof(const DIDescriptor *D) { + return D->getTag() == dwarf::DW_TAG_lexical_block; + } }; /// DIFactory - This object assists with the construction of the various Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=62104&r1=62103&r2=62104&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DebugInfo.cpp (original) +++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jan 12 15:38:43 2009 @@ -20,7 +20,6 @@ #include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/Analysis/ValueTracking.h" -#include "llvm/Support/Dwarf.h" using namespace llvm; //===----------------------------------------------------------------------===// @@ -112,7 +111,7 @@ /// isDerivedType - Return true if the specified tag is legal for /// DIDerivedType. -bool DIDerivedType::isDerivedType(unsigned Tag) { +bool DIType::isDerivedType(unsigned Tag) { switch (Tag) { case dwarf::DW_TAG_typedef: case dwarf::DW_TAG_pointer_type: @@ -137,7 +136,7 @@ /// isCompositeType - Return true if the specified tag is legal for /// DICompositeType. -bool DICompositeType::isCompositeType(unsigned TAG) { +bool DIType::isCompositeType(unsigned TAG) { switch (TAG) { case dwarf::DW_TAG_array_type: case dwarf::DW_TAG_structure_type: @@ -181,11 +180,6 @@ return C->getNumOperands(); } -/// isSubrange - Return true if the specified tag is legal for DISubrange. -bool DISubrange::isSubrange(unsigned Tag) { - return Tag == dwarf::DW_TAG_subrange_type; -} - //===----------------------------------------------------------------------===// // DIFactory: Basic Helpers //===----------------------------------------------------------------------===// From dalej at apple.com Mon Jan 12 16:11:51 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 Jan 2009 22:11:51 -0000 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll Message-ID: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> Author: johannes Date: Mon Jan 12 16:11:50 2009 New Revision: 62107 URL: http://llvm.org/viewvc/llvm-project?rev=62107&view=rev Log: Enable recursive inlining. Reduce inlining threshold back to 200; 400 seems to be too high, loses more than it gains. Added: llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=62107&r1=62106&r2=62107&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon Jan 12 16:11:50 2009 @@ -31,8 +31,8 @@ STATISTIC(NumDeleted, "Number of functions deleted because all callers found"); static cl::opt -InlineLimit("inline-threshold", cl::Hidden, cl::init(400), - cl::desc("Control the amount of inlining to perform (default = 400)")); +InlineLimit("inline-threshold", cl::Hidden, cl::init(200), + cl::desc("Control the amount of inlining to perform (default = 200)")); Inliner::Inliner(void *ID) : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} @@ -168,8 +168,7 @@ for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi) if (Function *Callee = CallSites[CSi].getCalledFunction()) { // Calls to external functions are never inlinable. - if (Callee->isDeclaration() || - CallSites[CSi].getInstruction()->getParent()->getParent() ==Callee){ + if (Callee->isDeclaration()) { if (SCC.size() == 1) { std::swap(CallSites[CSi], CallSites.back()); CallSites.pop_back(); @@ -190,7 +189,8 @@ if (InlineCallIfPossible(CS, CG, SCCFunctions, getAnalysis())) { // Remove any cached cost info for this caller, as inlining the callee - // has increased the size of the caller. + // has increased the size of the caller (which may be the same as the + // callee). resetCachedCostInfo(Caller); // Remove this call site from the list. If possible, use Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=62107&r1=62106&r2=62107&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Jan 12 16:11:50 2009 @@ -180,14 +180,12 @@ Function *Callee = CS.getCalledFunction(); Function *Caller = TheCall->getParent()->getParent(); - // Don't inline a directly recursive call. - if (Caller == Callee || // Don't inline functions which can be redefined at link-time to mean // something else. // FIXME: We allow link-once linkage since in practice all versions of // the function have the same body (C++ ODR) - but the LLVM definition // of LinkOnceLinkage doesn't require this. - (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || + if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || // Don't inline functions marked noinline. Callee->hasFnAttr(Attribute::NoInline) || NeverInline.count(Callee)) return llvm::InlineCost::getNever(); Added: llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll?rev=62107&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll (added) +++ llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll Mon Jan 12 16:11:50 2009 @@ -0,0 +1,92 @@ +; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {call.*fib} | count 4 +; First call to fib from fib is inlined, producing 2 instead of 1, total 3. +; Second call to fib from fib is not inlined because new body of fib exceeds +; inlining limit of 200. Plus call in main = 4 total. + +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.6" +@"\01LC" = internal constant [5 x i8] c"%ld\0A\00" ; <[5 x i8]*> [#uses=1] + +define i32 @fib(i32 %n) nounwind { +entry: + %n_addr = alloca i32 ; [#uses=4] + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %n, i32* %n_addr + %1 = load i32* %n_addr, align 4 ; [#uses=1] + %2 = icmp ule i32 %1, 1 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + store i32 1, i32* %0, align 4 + br label %bb2 + +bb1: ; preds = %entry + %3 = load i32* %n_addr, align 4 ; [#uses=1] + %4 = sub i32 %3, 2 ; [#uses=1] + %5 = call i32 @fib(i32 %4) nounwind ; [#uses=1] + %6 = load i32* %n_addr, align 4 ; [#uses=1] + %7 = sub i32 %6, 1 ; [#uses=1] + %8 = call i32 @fib(i32 %7) nounwind ; [#uses=1] + %9 = add i32 %5, %8 ; [#uses=1] + store i32 %9, i32* %0, align 4 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %10 = load i32* %0, align 4 ; [#uses=1] + store i32 %10, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + ret i32 %retval3 +} + +define i32 @main(i32 %argc, i8** %argv) nounwind { +entry: + %argc_addr = alloca i32 ; [#uses=2] + %argv_addr = alloca i8** ; [#uses=2] + %retval = alloca i32 ; [#uses=2] + %N = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %iftmp.0 = alloca i32 ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %argc, i32* %argc_addr + store i8** %argv, i8*** %argv_addr + %1 = load i32* %argc_addr, align 4 ; [#uses=1] + %2 = icmp eq i32 %1, 2 ; [#uses=1] + br i1 %2, label %bb, label %bb1 + +bb: ; preds = %entry + %3 = load i8*** %argv_addr, align 4 ; [#uses=1] + %4 = getelementptr i8** %3, i32 1 ; [#uses=1] + %5 = load i8** %4, align 4 ; [#uses=1] + %6 = call i32 @atoi(i8* %5) nounwind ; [#uses=1] + store i32 %6, i32* %iftmp.0, align 4 + br label %bb2 + +bb1: ; preds = %entry + store i32 43, i32* %iftmp.0, align 4 + br label %bb2 + +bb2: ; preds = %bb1, %bb + %7 = load i32* %iftmp.0, align 4 ; [#uses=1] + store i32 %7, i32* %N, align 4 + %8 = load i32* %N, align 4 ; [#uses=1] + %9 = call i32 @fib(i32 %8) nounwind ; [#uses=1] + %10 = call i32 (i8*, ...)* @printf(i8* getelementptr ([5 x i8]* @"\01LC", i32 0, i32 0), i32 %9) nounwind ; [#uses=0] + store i32 0, i32* %0, align 4 + %11 = load i32* %0, align 4 ; [#uses=1] + store i32 %11, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + ret i32 %retval3 +} + +declare i32 @atoi(i8*) + +declare i32 @printf(i8*, ...) nounwind From dpatel at apple.com Mon Jan 12 16:27:01 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 22:27:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62109 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h Message-ID: <200901122227.n0CMR1qi015183@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 16:27:00 2009 New Revision: 62109 URL: http://llvm.org/viewvc/llvm-project?rev=62109&view=rev Log: Do not generate multiple compile_unit, it has many issues in current implementation. The code generator is not set up to handle multiple complete or partial compile_units as per dwarf specification. On darwin, the tool chain expects one compile_unit per .o file. Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp llvm-gcc-4.2/trunk/gcc/llvm-debug.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=62109&r1=62108&r2=62109&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Jan 12 16:27:00 2009 @@ -198,28 +198,33 @@ , PrevFullPath("") , PrevLineNo(0) , PrevBB(NULL) -, CompileUnitCache() , StopPointFn(NULL) , FuncStartFn(NULL) , RegionStartFn(NULL) , RegionEndFn(NULL) , DeclareFn(NULL) , RegionStack() -{} +{ + MainCompileUnit = createCompileUnit(main_input_filename); +} /// EmitFunctionStart - Constructs the debug code for entering a function - /// "llvm.dbg.func.start." void DebugInfo::EmitFunctionStart(tree FnDecl, Function *Fn, BasicBlock *CurBB) { // Gather location information. - DICompileUnit Unit = getOrCreateCompileUnit(CurFullPath); + expanded_location Loc = GetNodeLocation(FnDecl, false); + std::string Filename, Directory; + DirectoryAndFile(Loc.file, Directory, Filename); const char *LinkageName = getLinkageName(FnDecl); - DIType FnTy = getOrCreateType(TREE_TYPE(TREE_TYPE(FnDecl)), Unit); - DISubprogram SP = DebugFactory.CreateSubprogram(Unit, Fn->getNameStr(), - Fn->getNameStr(), LinkageName, - Unit, CurLineNo, FnTy, - Fn->hasInternalLinkage(), - true /*definition*/); + DIType FnTy = getOrCreateType(TREE_TYPE(TREE_TYPE(FnDecl))); + DISubprogram SP = DebugFactory.CreateSubprogram(MainCompileUnit, + Fn->getNameStr(), + Fn->getNameStr(), LinkageName, + MainCompileUnit, CurLineNo, + FnTy, Fn->hasInternalLinkage(), + true /*definition*/, + &Filename, &Directory); DebugFactory.InsertSubprogramStart(SP, CurBB); @@ -262,12 +267,14 @@ assert(!RegionStack.empty() && "Region stack mismatch, stack empty!"); expanded_location Loc = GetNodeLocation(decl, false); - DICompileUnit File = getOrCreateCompileUnit(Loc.file); + std::string Filename, Directory; + DirectoryAndFile(Loc.file, Directory, Filename); // Construct variable. llvm::DIVariable D = - DebugFactory.CreateVariable(Tag, RegionStack.back(), Name, File, Loc.line, - getOrCreateType(type, File)); + DebugFactory.CreateVariable(Tag, RegionStack.back(), Name, MainCompileUnit, + Loc.line, getOrCreateType(type), &Filename, + &Directory); // Insert an llvm.dbg.declare into the current block. DebugFactory.InsertDeclare(AI, D, CurBB); @@ -288,10 +295,7 @@ PrevLineNo = CurLineNo; PrevBB = CurBB; - // Get the appropriate compile unit. - DICompileUnit Unit = getOrCreateCompileUnit(CurFullPath); - - DebugFactory.InsertStopPoint(Unit, CurLineNo, 0 /*column no. */, + DebugFactory.InsertStopPoint(MainCompileUnit, CurLineNo, 0 /*column no. */, CurBB); } @@ -299,22 +303,23 @@ /// void DebugInfo::EmitGlobalVariable(GlobalVariable *GV, tree decl) { // Gather location information. - expanded_location location = expand_location(DECL_SOURCE_LOCATION(decl)); - DICompileUnit Unit = getOrCreateCompileUnit(location.file); - const char *LinkageName = getLinkageName(decl); - DIType TyD = getOrCreateType(TREE_TYPE(decl), Unit); - - DebugFactory.CreateGlobalVariable(Unit, GV->getNameStr(), GV->getNameStr(), - LinkageName, Unit, location.line, - TyD, GV->hasInternalLinkage(), - true/*definition*/, GV); + expanded_location Loc = expand_location(DECL_SOURCE_LOCATION(decl)); + std::string Filename, Directory; + DirectoryAndFile(Loc.file, Directory, Filename); + DIType TyD = getOrCreateType(TREE_TYPE(decl)); + DebugFactory.CreateGlobalVariable(MainCompileUnit, GV->getNameStr(), + GV->getNameStr(), getLinkageName(decl), + MainCompileUnit, Loc.line, + TyD, GV->hasInternalLinkage(), + true/*definition*/, GV, + &Filename, &Directory); } /// getOrCreateType - Get the type from the cache or create a new type if /// necessary. /// FIXME - I hate jumbo methods - split up. -DIType DebugInfo::getOrCreateType(tree type, DICompileUnit Unit) { +DIType DebugInfo::getOrCreateType(tree type) { DEBUGASSERT(type != NULL_TREE && type != error_mark_node && "Not a type."); if (type == NULL_TREE || type == error_mark_node) return DIType(); @@ -330,16 +335,15 @@ DIType MainTy; if (type != TYPE_MAIN_VARIANT(type)) - MainTy = getOrCreateType(TYPE_MAIN_VARIANT(type), Unit); + MainTy = getOrCreateType(TYPE_MAIN_VARIANT(type)); // Get the name and location early to assist debugging. const char *TypeName = GetNodeName(type); expanded_location Loc = GetNodeLocation(type); - // Bit size, align and offset of the type. + // Bit size and align of the type. uint64_t Size = NodeSizeInBits(type); uint64_t Align = NodeAlignInBits(type); - uint64_t Offset = 0; DIType Ty; // Do we have a typedef? @@ -348,9 +352,9 @@ expanded_location TypeDefLoc = GetNodeLocation(Name); std::string Filename, Directory; DirectoryAndFile(TypeDefLoc.file, Directory, Filename); - Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef, Unit, + Ty = DebugFactory.CreateDerivedType(DW_TAG_typedef, MainCompileUnit, GetNodeName(Name), - Unit, TypeDefLoc.line, + MainCompileUnit, TypeDefLoc.line, 0 /*size*/, 0 /*align*/, 0 /*offset */, @@ -363,8 +367,8 @@ } if (TYPE_VOLATILE(type)) { - Ty = DebugFactory.CreateDerivedType(DW_TAG_volatile_type, Unit, "", - DICompileUnit(), 0 /*line no*/, + Ty = DebugFactory.CreateDerivedType(DW_TAG_volatile_type, MainCompileUnit, "", + MainCompileUnit, 0 /*line no*/, NodeSizeInBits(type), NodeAlignInBits(type), 0 /*offset */, @@ -374,8 +378,8 @@ } if (TYPE_READONLY(type)) - Ty = DebugFactory.CreateDerivedType(DW_TAG_const_type, Unit, "", - DICompileUnit(), 0 /*line no*/, + Ty = DebugFactory.CreateDerivedType(DW_TAG_const_type, MainCompileUnit, "", + MainCompileUnit, 0 /*line no*/, NodeSizeInBits(type), NodeAlignInBits(type), 0 /*offset */, @@ -405,15 +409,15 @@ case REFERENCE_TYPE: case BLOCK_POINTER_TYPE: { - DIType FromTy = getOrCreateType(TREE_TYPE(type), Unit); + DIType FromTy = getOrCreateType(TREE_TYPE(type)); // type* and type& // FIXME: Should BLOCK_POINTER_TYP have its own DW_TAG? unsigned Tag = (TREE_CODE(type) == POINTER_TYPE || TREE_CODE(type) == BLOCK_POINTER_TYPE) ? DW_TAG_pointer_type : DW_TAG_reference_type; - Ty = DebugFactory.CreateDerivedType(Tag, Unit, "", - DICompileUnit(), 0 /*line no*/, + Ty = DebugFactory.CreateDerivedType(Tag, MainCompileUnit, "", + MainCompileUnit, 0 /*line no*/, NodeSizeInBits(type), NodeAlignInBits(type), 0 /*offset */, @@ -435,21 +439,21 @@ llvm::SmallVector EltTys; // Add the result type at least. - EltTys.push_back(getOrCreateType(TREE_TYPE(type), Unit)); + EltTys.push_back(getOrCreateType(TREE_TYPE(type))); // Set up remainder of arguments. for (tree arg = TYPE_ARG_TYPES(type); arg; arg = TREE_CHAIN(arg)) { tree formal_type = TREE_VALUE(arg); if (formal_type == void_type_node) break; - EltTys.push_back(getOrCreateType(formal_type, Unit)); + EltTys.push_back(getOrCreateType(formal_type)); } llvm::DIArray EltTypeArray = DebugFactory.GetOrCreateArray(&EltTys[0], EltTys.size()); Ty = DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type, - Unit, "", llvm::DICompileUnit(), - 0, 0, 0, 0, 0, + MainCompileUnit, "", + MainCompileUnit, 0, 0, 0, 0, 0, llvm::DIType(), EltTypeArray); break; } @@ -498,9 +502,10 @@ DebugFactory.GetOrCreateArray(&Subscripts[0], Subscripts.size()); Ty = DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_array_type, - Unit, "", llvm::DICompileUnit(), + MainCompileUnit, "", + MainCompileUnit, 0, Size, Align, 0, 0, - getOrCreateType(EltTy, Unit), + getOrCreateType(EltTy), SubscriptArray); break; } @@ -525,7 +530,8 @@ std::string Filename, Directory; DirectoryAndFile(Loc.file, Directory, Filename); Ty = DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type, - Unit, TypeName, Unit, Loc.line, + MainCompileUnit, TypeName, + MainCompileUnit, Loc.line, Size, Align, 0, 0, llvm::DIType(), EltArray, &Filename, &Directory); @@ -550,7 +556,8 @@ std::string Filename, Directory; DirectoryAndFile(Loc.file, Directory, Filename); llvm::DIType FwdDecl = - DebugFactory.CreateCompositeType(Tag, Unit, TypeName, Unit, Loc.line, + DebugFactory.CreateCompositeType(Tag, MainCompileUnit, TypeName, + MainCompileUnit, Loc.line, 0, 0, 0, DW_AT_declaration, llvm::DIType(), llvm::DIArray(), &Filename, &Directory); @@ -574,11 +581,13 @@ for (unsigned i = 0, e = BINFO_N_BASE_BINFOS(binfo); i != e; ++i) { tree BInfo = BINFO_BASE_BINFO(binfo, i); tree BInfoType = BINFO_TYPE (BInfo); - DIType BaseClass = getOrCreateType(BInfoType, Unit); + DIType BaseClass = getOrCreateType(BInfoType); // FIXME : name, size, align etc... DIType DTy = - DebugFactory.CreateDerivedType(DW_TAG_inheritance, Unit,"", Unit, 0,0,0, + DebugFactory.CreateDerivedType(DW_TAG_inheritance, + MainCompileUnit,"", + MainCompileUnit, 0,0,0, getInt64(BINFO_OFFSET(BInfo), 0), 0, BaseClass); EltTys.push_back(DTy); @@ -604,9 +613,8 @@ // Field type is the declared type of the field. tree FieldNodeType = FieldType(Member); - DIType MemberType = getOrCreateType(FieldNodeType, Unit); + DIType MemberType = getOrCreateType(FieldNodeType); const char *MemberName = GetNodeName(Member); - DICompileUnit MemFile = getOrCreateCompileUnit(MemLoc.file); unsigned Flags = 0; if (TREE_PROTECTED(Member)) Flags = DW_ACCESS_protected; @@ -615,8 +623,9 @@ else Flags = DW_ACCESS_public; DIType DTy = - DebugFactory.CreateDerivedType(DW_TAG_member, Unit, MemberName, - Unit, MemLoc.line, NodeSizeInBits(Member), + DebugFactory.CreateDerivedType(DW_TAG_member, MainCompileUnit, + MemberName, MainCompileUnit, + MemLoc.line, NodeSizeInBits(Member), NodeAlignInBits(FieldNodeType), int_bit_position(Member), Flags, MemberType, @@ -638,11 +647,11 @@ DirectoryAndFile(MemLoc.file, MemDirectory, MemFilename); const char *MemberName = GetNodeName(Member); - DIType SPTy = getOrCreateType(TREE_TYPE(Member), Unit); + DIType SPTy = getOrCreateType(TREE_TYPE(Member)); DISubprogram SP = - DebugFactory.CreateSubprogram(Unit, MemberName, MemberName, - MemberName, Unit, MemLoc.line, - SPTy, false, false, + DebugFactory.CreateSubprogram(MainCompileUnit, MemberName, MemberName, + MemberName, MainCompileUnit, + MemLoc.line, SPTy, false, false, &MemFilename, &MemDirectory); EltTys.push_back(SP); @@ -652,7 +661,8 @@ DebugFactory.GetOrCreateArray(&EltTys[0], EltTys.size()); llvm::DIType RealDecl = - DebugFactory.CreateCompositeType(Tag, Unit, TypeName, Unit, Loc.line, Size, + DebugFactory.CreateCompositeType(Tag, MainCompileUnit, TypeName, + MainCompileUnit, Loc.line, Size, Align, 0, 0, llvm::DIType(), Elements, &Filename, &Directory); @@ -703,21 +713,18 @@ break; } } - Ty = DebugFactory.CreateBasicType(Unit, TypeName, Unit, 0, Size, Align, - Offset, 0, Encoding); + Ty = DebugFactory.CreateBasicType(MainCompileUnit, TypeName, + MainCompileUnit, 0, Size, Align, + 0, 0, Encoding); } } TypeCache[type] = Ty; return Ty; } -/// getOrCreateCompileUnit - Get the compile unit from the cache or create a new +/// createCompileUnit - Get the compile unit from the cache or create a new /// one if necessary. -DICompileUnit DebugInfo::getOrCreateCompileUnit(const std::string &FullPath){ - // See if this compile unit has been used before. - DICompileUnit &Slot = CompileUnitCache[FullPath]; - if (!Slot.isNull()) return Slot; - +DICompileUnit DebugInfo::createCompileUnit(const std::string &FullPath){ // Get source file information. std::string Directory; std::string FileName; @@ -745,8 +752,8 @@ else LangTag = DW_LANG_C89; - return Slot = DebugFactory.CreateCompileUnit(LangTag, FileName, Directory, - version_string); + return DebugFactory.CreateCompileUnit(LangTag, FileName, Directory, + version_string); } /* LLVM LOCAL end (ENTIRE FILE!) */ Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.h?rev=62109&r1=62108&r2=62109&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-debug.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-debug.h Mon Jan 12 16:27:00 2009 @@ -59,9 +59,7 @@ const char *PrevFullPath; // Previous location file encountered. int PrevLineNo; // Previous location line# encountered. BasicBlock *PrevBB; // Last basic block encountered. - std::map CompileUnitCache; - // Cache of previously constructed - // CompileUnits. + DICompileUnit MainCompileUnit; std::map TypeCache; // Cache of previously constructed // Types. @@ -108,11 +106,10 @@ /// getOrCreateType - Get the type from the cache or create a new type if /// necessary. - DIType getOrCreateType(tree_node *type, DICompileUnit Unit); + DIType getOrCreateType(tree_node *type); - /// getOrCreateCompileUnit - Get the compile unit from the cache or create a - /// new one if necessary. - DICompileUnit getOrCreateCompileUnit(const std::string &FullPath); + /// createCompileUnit - Create a new compile unit. + DICompileUnit createCompileUnit(const std::string &FullPath); }; From dpatel at apple.com Mon Jan 12 16:29:26 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 22:29:26 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62110 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200901122229.n0CMTQcG015301@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 16:29:25 2009 New Revision: 62110 URL: http://llvm.org/viewvc/llvm-project?rev=62110&view=rev Log: Disable debug info generation while writing pch because it does not work properly right now. Note, this does not mean we are losing debug type info for the types that are defined in pch header. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=62110&r1=62109&r2=62110&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Mon Jan 12 16:29:25 2009 @@ -246,7 +246,9 @@ else RegisterRegAlloc::setDefault(createLocalRegisterAllocator); - if (!optimize && debug_info_level > DINFO_LEVEL_NONE) + // FIXME - Do not disable debug info while writing pch. + if (!flag_pch_file && + !optimize && debug_info_level > DINFO_LEVEL_NONE) TheDebugInfo = new DebugInfo(TheModule); } @@ -282,7 +284,9 @@ TheModule = ParseBitcodeFile(MB, &ErrMsg); delete MB; - if (!optimize && debug_info_level > DINFO_LEVEL_NONE) + // FIXME - Do not disable debug info while writing pch. + if (!flag_pch_file && + !optimize && debug_info_level > DINFO_LEVEL_NONE) TheDebugInfo = new DebugInfo(TheModule); if (!TheModule) { From dalej at apple.com Mon Jan 12 16:35:36 2009 From: dalej at apple.com (Dale Johannesen) Date: Mon, 12 Jan 2009 22:35:36 -0000 Subject: [llvm-commits] [test-suite] r62111 - /test-suite/trunk/Makefile.tests Message-ID: <200901122235.n0CMZbWN015571@zion.cs.uiuc.edu> Author: johannes Date: Mon Jan 12 16:35:36 2009 New Revision: 62111 URL: http://llvm.org/viewvc/llvm-project?rev=62111&view=rev Log: Revert previous patch, catering to those who prefer to keep information hidden. Modified: test-suite/trunk/Makefile.tests Modified: test-suite/trunk/Makefile.tests URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.tests?rev=62111&r1=62110&r2=62111&view=diff ============================================================================== --- test-suite/trunk/Makefile.tests (original) +++ test-suite/trunk/Makefile.tests Mon Jan 12 16:35:36 2009 @@ -39,32 +39,32 @@ # Compile from X.c to Output/X.bc Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.cpp to Output/X.bc Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.cc to Output/X.bc Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.C to Output/X.bc Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.m to Output/X.bc Output/%.bc: %.m $(LCC1) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGCC) $(CPPFLAGS) $(CFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # Compile from X.mm to Output/X.bc Output/%.bc: %.mm $(LCC1XX) Output/.dir $(INCLUDES) - @echo Compiling $(notdir $<) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) to $@ + @echo Compiling $(notdir $<) to $@ -$(VERB) $(LLVMGXX) $(CPPFLAGS) $(CXXFLAGS) $(LOPTFLAGS) $(TARGET_FLAGS) -c $< -o $@ -emit-llvm # LLVM Assemble from X.ll to Output/X.bc. Because we are coming directly from From viridia at gmail.com Mon Jan 12 14:27:04 2009 From: viridia at gmail.com (Talin) Date: Mon, 12 Jan 2009 20:27:04 +0000 (UTC) Subject: [llvm-commits] [PATCH] SmallEnumSet References: <6AEB9DE3-3F4C-4014-94EC-E47974F40487@gmail.com> Message-ID: Bill Wendling writes: > > Hi Talin, > > Thanks for this submission. I have some comments and questions. > Before I begin, I should mention that one of my self-imposed design constraints is that the class should be no less efficient than using the traditional "flags" idiom. This means that for small sets of flags (less than 32), every method in this class should theoretically be optimizable down to a single machine instruction, and for larger sets the number of machine instructions should be roughly on the order of the number of machine words in the bitset. That being said, I have not actually *verified* that this happens - rather, based on my (admittedly somewhat incomplete) knowledge of what optimizers can and cannot do, I have attempted to apply standard rules of thumb for writing optimizable code. Some of those rules of thumb have evolved from working with LLVM itself, and may represent an unwarranted level of confidence in the compiler's ability to optimize, especially when the compiler isn't LLVM-based. With that in mind, I believe some of my responses below will make more sense. > > This patch contains a new container class, SmallEnumSet, and unit > > tests for it. > > > > SmallEnumSet is inspired by SmallVector and the other "small" sets > > in ADT. > > > From looking at the code, it seems like this is very similar to the > BitVector. The difference being that the size is known at compile > time. Is it possible either to use the BitVector or modify BitVector's > implementation so that you know the size at compile time (if that's > important enough)? You would need something like SmallBitVector in order for this to work. BitVector *always* allocates memory, whereas SmallEnumSet *never* does, so the two are completely different in this respect. Having the structure be a fixed size is important for small sets of flags,because it means that the structure will get passed in a single machine register, just as a flags field would be. For larger sets, see the discussion below. > > > The keys of the set are enumeration constants, which range from 0 to > > some maximum value which is known at compile time. Internally, > > SmallEnumSet maintains a fixed-length bit vector, so that membership > > in the set is represented by a single bit per possible key. > > > Enumerated values can go from negative to positive. They don't have to > start from 0. For enumerations that correspond to a set of flags, having values less than zero makes no sense. So my response to that is "don't do that". > > Traditionally in C and C++ this sort of thing is done via a "flags" > > field. SmallEnumSet has a number of advantages over using flags: > > ? It's type safe. > > An enum is its own type. Yes, but the traditional "flags" idiom requires enumerated values to be implicitly cast to an integer. For example, if I have an integer flags field, and an enum that defines the values of those flags, I might accidentally using an enum constant from a different enum type with that flags field. In order to prevent this, I have to create a set of public accessor methods (getFlag/setFlag/etc) that take enum type arguments, and make the flags field private. But then you lose some expressive power, such as the ability to set or test multiple flags in a single call. > > ? It has a set-like interface, so you can use "add", "contains" and > > other set methods. > > The std::set doesn't use "add" or "contains". If you're going to call > this a set, you should use the same nomenclature: e.g. "insert", > "find". You should also have an "iterator" associated with this class > to keep things consistent. Sorry, for some reason I was following the Java set protocol rather than the C++ one. Habit I guess. You would probably want "test" (which returns a bool) rather than "find" (which returns an iterator). > > > ? It isn't limited to 32 flags or whatever the size of an integer > > may be. > > Okay. > > > ? The keys can be sequentially-numbered enumeration constants, such > > as produced by an enum statement with default initialization - you > > don't have to initialize your enum constants to single-bit values > > such as "(1 << 5)" or "0x00000800", nor do you have to update all of > > the initializers if you want to insert a new constant in the middle > > of the sequence. > > > At the same time, SmallEnumSet retains many of the advantages of an > > integer flags field - it allocates no memory, and can efficiently be > > passed or returned by value between functions. > > This is only true if the size of the enum set is small enough that the > array holding the values can be passed back efficiently (without > calling memcpy or something similar). Agreed, however in practice I don't think this is a problem. Large collections of booleans are fairly rare; Of the ones that exist, most are either sparse (in which case a bit vector is not the best representation), or have keys which are not known at compile time or are otherwise unbounded (in which case, BitVector is a better choice). For those rare cases where this class makes sense, I think it is best to let the application programmer make the decision as to whether the set should be passed by reference or by value - by choosing whether to pass the value or the address between methods. Mainly, I expect this class to be used for fairly small sets, but I don't want the programmer to have to switch to a different representation if the number of flags bits grows to larger than 32. > > All of the methods of the class can be optimized down to essentially > > the same code you would write if you were using flags. > > > > A few comments inline: > > + SmallEnumSet(const SmallEnumSet & src) { > + for (unsigned i = 0; i < NumWords; ++i) { > + bits[i] = src.bits[i]; > + } > + } > + > > BitVector uses "std::copy" to do this. Maybe you should too? That sounds like a good idea. > + bool empty() const { > + for (unsigned i = 0; i < NumWords; ++i) { > + if (bits[i] != 0) { > + return false; > + } > + } > + > + return true; > + } > > empty() should really execute in constant time. Maybe you could rename > it. BitVector uses "none()" and "any()". Well, it does execute in constant time(), because NumWords is a constant :) More seriously, I'm assuming that the compiler will unroll this loop, especially in the most common case where NumWords == 1. > + bool containsAll(const SmallEnumSet & in) const { > + for (unsigned i = 0; i < NumWords; ++i) { > + if ((~bits[i] & in.bits[i]) != 0) { > + return false; > + } > + } > + > + return true; > + } > > How is this different from "operator==()"? It's not the same - this method is a subset test, it returns true if 'in' is a subset of 'this'. > > + SmallEnumSet & add(EnumType val) { > + bits[wordForIndex(val)] |= bitForIndex(val); > + return * this; > + } > > I prefer "insert" to "add" if we're calling this a "set". OK. > > + SmallEnumSet & addAll(const SmallEnumSet & in) { > + for (unsigned i = 0; i < NumWords; ++i) { > + bits[i] |= in.bits[i]; > + } > + return * this; > + } > > Instead of calling this "addAll", just call it "insert", but when it's > passed a SmallEnumSet&, it will add the whole thing. Sure. > + SmallEnumSet & addRange(EnumType first, EnumType last) { > + unsigned firstWord = wordForIndex(first); > + unsigned lastWord = wordForIndex(last); > + if (firstWord == lastWord) { > + bits[firstWord] |= maskForIndex(first) & ~maskForIndex(last); > + } else { > + bits[firstWord] |= maskForIndex(first); > + for (unsigned i = firstWord + 1; i < lastWord; ++i) { > + bits[i] = -1; > + } > + bits[lastWord] |= ~maskForIndex(last); > + } > + > + return * this; > + } > > Same comment above. Call this "insert", etc. This should probably take > iterators. Unfortunately, there's no efficient way to implement iterators with a bit vector - advancing an iterator requires examining every potential bit to determine whether its on or off, so that you can skip over the ones that are off (i.e. not in the set.) Also, I don't believe that there's a compelling practical use case for iterating over a set like this. > > + SmallEnumSet & remove(EnumType val) { > + bits[wordForIndex(val)] &= ~bitForIndex(val); > + return * this; > + } > + > + SmallEnumSet & removeAll(const SmallEnumSet & in) { > + for (unsigned i = 0; i < NumWords; ++i) { > + bits[i] &= ~in.bits[i]; > + } > + return * this; > + } > + > + SmallEnumSet & removeRange(EnumType first, EnumType last) { > + unsigned firstWord = wordForIndex(first); > + unsigned lastWord = wordForIndex(last); > + if (firstWord == lastWord) { > + bits[firstWord] &= ~maskForIndex(first) | maskForIndex(last); > + } else { > + bits[firstWord] &= ~maskForIndex(first); > + for (unsigned i = firstWord + 1; i < lastWord; ++i) { > + bits[i] = 0; > + } > + bits[lastWord] &= maskForIndex(last); > + } > + > + return * this; > + } > > Similar comments for the "remove" statements. "erase" is more > consistent with a "set". And you should name these all "erase", and > have them act accordingly based on what's passed in. The last one > should take iterators. > > + SmallEnumSet & intersectWith(const SmallEnumSet & in) { > + for (unsigned i = 0; i < NumWords; ++i) { > + bits[i] &= in.bits[i]; > + } > + return * this; > + } > > It's probably sufficient to call this "intersect" instead of > "intersectWith". OK. > + static SmallEnumSet noneOf() { > + return SmallEnumSet(); > + } > > This name isn't very informative. What does this mean? It was supposed to return the empty set. > > + static SmallEnumSet of(EnumType v0) { > + return SmallEnumSet().add(v0); > + } > + > ... > + static SmallEnumSet of( > + EnumType v0, EnumType v1, EnumType v2, EnumType v3, EnumType v4, > + EnumType v5, EnumType v6, EnumType v7, EnumType v8, EnumType > v9) { > + return > SmallEnumSet().add(v0).add(v1).add(v2).add(v3).add(v4).add(v5) > + .add(v6).add(v7).add(v8).add(v9); > + } > > Yikes! Please don't do this. Use "inserts" instead that loop over a > vector of values or something similar. I want to avoid a loop because the most common use case for this method is in constructing constants. For example, constructing a mask: static Atttributes METHOD_ATTRS = Attributes.of( InlineAttr, ExternAttr, IntrinsicAttr, PureAttr, ConstructorAttr); The compiler should inline all of the calls to "add": this = SmallEnumSet(); this.bits[0] |= k0; this.bits[0] |= k1; this.bits[0] |= k2; this.bits[0] |= k3; this.bits[0] |= k4; this.bits[0] |= k5; this.bits[0] |= k6; this.bits[0] |= k7; this.bits[0] |= k8; this.bits[0] |= k9; And then should combine all of the constants: this = SmallEnumSet(); this.bits[0] |= (k0 | k1 | k2 | k3 | k4 | k5 | k6 | k7 | k8 | k9); So in the end, all that happens (hopefully) is we are assigning a constant integer to a symbol. > > + friend SmallEnumSet operator |( > + const SmallEnumSet & a, const SmallEnumSet & b) { > + return unionOf(a, b); > + } > + > + friend SmallEnumSet operator &( > + const SmallEnumSet & a, const SmallEnumSet & b) { > + return SmallEnumSet(a).intersectWith(b); > + } > > Is it necessary to make these "friend" methods? They seem to use > publicly accessible methods. (I haven't tried to compile them without > the friend keyword, so I don't know.) They don't have to be - I'm just following what I thought was a standard idiom for non-member operator definitions. ('friend' forces the function to be a non-member.) > > -bw > From dpatel at apple.com Mon Jan 12 16:54:42 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 22:54:42 -0000 Subject: [llvm-commits] [llvm] r62114 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901122254.n0CMsggA016314@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 16:54:42 2009 New Revision: 62114 URL: http://llvm.org/viewvc/llvm-project?rev=62114&view=rev Log: Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62114&r1=62113&r2=62114&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 16:54:42 2009 @@ -1170,7 +1170,7 @@ }; //===----------------------------------------------------------------------===// -/// SourceLineInfo - This class is used to record source line correspondence. +/// SrcLineInfo - This class is used to record source line correspondence. /// class SrcLineInfo { unsigned Line; // Source line number. @@ -1327,7 +1327,7 @@ /// SectionSourceLines - Tracks line numbers per text section. /// - std::vector > SectionSourceLines; + std::vector > SectionSourceLines; /// didInitial - Flag to indicate if initial emission has been done. /// @@ -3126,7 +3126,7 @@ for (unsigned j = 0; j < SecSrcLinesSize; ++j) { // Isolate current sections line info. - const std::vector &LineInfos = SectionSourceLines[j]; + const std::vector &LineInfos = SectionSourceLines[j]; if (VerboseAsm) { const Section* S = SectionMap[j + 1]; @@ -3140,7 +3140,7 @@ // Construct rows of the address, source, line, column matrix. for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) { - const SourceLineInfo &LineInfo = LineInfos[i]; + const SrcLineInfo &LineInfo = LineInfos[i]; unsigned LabelID = MMI->MappedLabel(LineInfo.getLabelID()); if (!LabelID) continue; @@ -3735,9 +3735,8 @@ // Emit label for the implicitly defined dbg.stoppoint at the start of // the function. - const std::vector &LineInfos = MMI->getSourceLines(); - if (!LineInfos.empty()) { - const SourceLineInfo &LineInfo = LineInfos[0]; + if (!Lines.empty()) { + const SrcLineInfo &LineInfo = Lines[0]; Asm->printLabel(LineInfo.getLabelID()); } } @@ -3751,16 +3750,14 @@ EmitLabel("func_end", SubprogramCount); // Get function line info. - const std::vector &LineInfos = MMI->getSourceLines(); - - if (!LineInfos.empty()) { + if (!Lines.empty()) { // Get section line info. unsigned ID = SectionMap.insert(Asm->CurrentSection_); if (SectionSourceLines.size() < ID) SectionSourceLines.resize(ID); - std::vector &SectionLineInfos = SectionSourceLines[ID-1]; + std::vector &SectionLineInfos = SectionSourceLines[ID-1]; // Append the function info to section info. SectionLineInfos.insert(SectionLineInfos.end(), - LineInfos.begin(), LineInfos.end()); + Lines.begin(), Lines.end()); } // Construct scopes for subprogram. From dpatel at apple.com Mon Jan 12 16:58:15 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 22:58:15 -0000 Subject: [llvm-commits] [llvm] r62115 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901122258.n0CMwFwF016459@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 16:58:14 2009 New Revision: 62115 URL: http://llvm.org/viewvc/llvm-project?rev=62115&view=rev Log: Avoid cast<>, use light weith wrapper directly. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62115&r1=62114&r2=62115&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 16:58:14 2009 @@ -2629,13 +2629,13 @@ if (!RootScope) return; // Get the subprogram debug information entry. - DISubprogram *SPD = cast(RootScope->getDesc()); + DISubprogram SPD(RootScope->getDesc()->getGV()); // Get the compile unit context. - CompileUnit *Unit = FindCompileUnit(SPD->getCompileUnit()); + CompileUnit *Unit = FindCompileUnit(SPD.getCompileUnit()); // Get the subprogram die. - DIE *SPDie = Unit->getDieMapSlotFor(SPD->getGV()); + DIE *SPDie = Unit->getDieMapSlotFor(SPD.getGV()); assert(SPDie && "Missing subprogram descriptor"); // Add the function bounds. From dpatel at apple.com Mon Jan 12 17:05:56 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 23:05:56 -0000 Subject: [llvm-commits] [llvm] r62116 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901122305.n0CN5uZv016827@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 17:05:55 2009 New Revision: 62116 URL: http://llvm.org/viewvc/llvm-project?rev=62116&view=rev Log: If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit. Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.) Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62116&r1=62115&r2=62116&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 17:05:55 2009 @@ -2952,13 +2952,16 @@ /// void SizeAndOffsets() { // Process base compile unit. - CompileUnit *Unit = GetBaseCompileUnit(); - // Compute size of compile unit header - unsigned Offset = sizeof(int32_t) + // Length of Compilation Unit Info - sizeof(int16_t) + // DWARF version number - sizeof(int32_t) + // Offset Into Abbrev. Section - sizeof(int8_t); // Pointer Size (in bytes) - SizeAndOffsetDie(Unit->getDie(), Offset, true); + for (DenseMap::iterator CI = DW_CUs.begin(), + CE = DW_CUs.end(); CI != CE; ++CI) { + CompileUnit *Unit = CI->second; + // Compute size of compile unit header + unsigned Offset = sizeof(int32_t) + // Length of Compilation Unit Info + sizeof(int16_t) + // DWARF version number + sizeof(int32_t) + // Offset Into Abbrev. Section + sizeof(int8_t); // Pointer Size (in bytes) + SizeAndOffsetDie(Unit->getDie(), Offset, true); + } } /// EmitDebugInfo - Emit the debug info section. @@ -2967,32 +2970,35 @@ // Start debug info section. Asm->SwitchToDataSection(TAI->getDwarfInfoSection()); - CompileUnit *Unit = GetBaseCompileUnit(); - DIE *Die = Unit->getDie(); - // Emit the compile units header. - EmitLabel("info_begin", Unit->getID()); - // Emit size of content not including length itself - unsigned ContentSize = Die->getSize() + - sizeof(int16_t) + // DWARF version number - sizeof(int32_t) + // Offset Into Abbrev. Section - sizeof(int8_t) + // Pointer Size (in bytes) - sizeof(int32_t); // FIXME - extra pad for gdb bug. - - Asm->EmitInt32(ContentSize); Asm->EOL("Length of Compilation Unit Info"); - Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number"); - EmitSectionOffset("abbrev_begin", "section_abbrev", 0, 0, true, false); - Asm->EOL("Offset Into Abbrev. Section"); - Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in bytes)"); - - EmitDIE(Die); - // FIXME - extra padding for gdb bug. - Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); - Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); - Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); - Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); - EmitLabel("info_end", Unit->getID()); - - Asm->EOL(); + for (DenseMap::iterator CI = DW_CUs.begin(), + CE = DW_CUs.end(); CI != CE; ++CI) { + CompileUnit *Unit = CI->second; + DIE *Die = Unit->getDie(); + // Emit the compile units header. + EmitLabel("info_begin", Unit->getID()); + // Emit size of content not including length itself + unsigned ContentSize = Die->getSize() + + sizeof(int16_t) + // DWARF version number + sizeof(int32_t) + // Offset Into Abbrev. Section + sizeof(int8_t) + // Pointer Size (in bytes) + sizeof(int32_t); // FIXME - extra pad for gdb bug. + + Asm->EmitInt32(ContentSize); Asm->EOL("Length of Compilation Unit Info"); + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number"); + EmitSectionOffset("abbrev_begin", "section_abbrev", 0, 0, true, false); + Asm->EOL("Offset Into Abbrev. Section"); + Asm->EmitInt8(TD->getPointerSize()); Asm->EOL("Address Size (in bytes)"); + + EmitDIE(Die); + // FIXME - extra padding for gdb bug. + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + EmitLabel("info_end", Unit->getID()); + + Asm->EOL(); + } } /// EmitAbbreviations - Emit the abbreviation section. @@ -3290,39 +3296,42 @@ // Start the dwarf pubnames section. Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection()); - CompileUnit *Unit = GetBaseCompileUnit(); - - EmitDifference("pubnames_end", Unit->getID(), - "pubnames_begin", Unit->getID(), true); - Asm->EOL("Length of Public Names Info"); - - EmitLabel("pubnames_begin", Unit->getID()); - - Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF Version"); - - EmitSectionOffset("info_begin", "section_info", - Unit->getID(), 0, true, false); - Asm->EOL("Offset of Compilation Unit Info"); - - EmitDifference("info_end", Unit->getID(), "info_begin", Unit->getID(),true); - Asm->EOL("Compilation Unit Length"); - - std::map &Globals = Unit->getGlobals(); - - for (std::map::iterator GI = Globals.begin(), - GE = Globals.end(); - GI != GE; ++GI) { - const std::string &Name = GI->first; - DIE * Entity = GI->second; - - Asm->EmitInt32(Entity->getOffset()); Asm->EOL("DIE offset"); - Asm->EmitString(Name); Asm->EOL("External Name"); + for (DenseMap::iterator CI = DW_CUs.begin(), + CE = DW_CUs.end(); CI != CE; ++CI) { + CompileUnit *Unit = CI->second; + + EmitDifference("pubnames_end", Unit->getID(), + "pubnames_begin", Unit->getID(), true); + Asm->EOL("Length of Public Names Info"); + + EmitLabel("pubnames_begin", Unit->getID()); + + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF Version"); + + EmitSectionOffset("info_begin", "section_info", + Unit->getID(), 0, true, false); + Asm->EOL("Offset of Compilation Unit Info"); + + EmitDifference("info_end", Unit->getID(), "info_begin", Unit->getID(),true); + Asm->EOL("Compilation Unit Length"); + + std::map &Globals = Unit->getGlobals(); + + for (std::map::iterator GI = Globals.begin(), + GE = Globals.end(); + GI != GE; ++GI) { + const std::string &Name = GI->first; + DIE * Entity = GI->second; + + Asm->EmitInt32(Entity->getOffset()); Asm->EOL("DIE offset"); + Asm->EmitString(Name); Asm->EOL("External Name"); + } + + Asm->EmitInt32(0); Asm->EOL("End Mark"); + EmitLabel("pubnames_end", Unit->getID()); + + Asm->EOL(); } - - Asm->EmitInt32(0); Asm->EOL("End Mark"); - EmitLabel("pubnames_end", Unit->getID()); - - Asm->EOL(); } /// EmitDebugStr - Emit visible names into a debug str section. From dpatel at apple.com Mon Jan 12 17:09:42 2009 From: dpatel at apple.com (Devang Patel) Date: Mon, 12 Jan 2009 23:09:42 -0000 Subject: [llvm-commits] [llvm] r62118 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901122309.n0CN9gOk017012@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 17:09:42 2009 New Revision: 62118 URL: http://llvm.org/viewvc/llvm-project?rev=62118&view=rev Log: Emit debug info, only if at least one compile unit is seen. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62118&r1=62117&r2=62118&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 17:09:42 2009 @@ -3596,10 +3596,16 @@ /// SetDebugInfo - Create global DIEs and emit initial debug info sections. /// This is inovked by the target AsmPrinter. - void SetDebugInfo() { - // FIXME - Check if the module has debug info or not. + void SetDebugInfo(MachineModuleInfo *mmi) { + // Create all the compile unit DIEs. ConstructCompileUnits(); + + if (DW_CUs.empty()) + return; + + MMI = mmi; + shouldEmit = true; // Create DIEs for each of the externally visible global variables. ConstructGlobalVariableDIEs(); From gohman at apple.com Mon Jan 12 17:12:39 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 Jan 2009 23:12:39 -0000 Subject: [llvm-commits] [llvm] r62120 - /llvm/trunk/docs/LangRef.html Message-ID: <200901122312.n0CNCeH1017155@zion.cs.uiuc.edu> Author: djg Date: Mon Jan 12 17:12:39 2009 New Revision: 62120 URL: http://llvm.org/viewvc/llvm-project?rev=62120&view=rev Log: Document several current CodeGen limitations in LangRef.html. Patches for any of these are welcome! Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=62120&r1=62119&r2=62120&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Jan 12 17:12:39 2009 @@ -2034,6 +2034,10 @@ ret void ; Return from a void function ret { i32, i8 } { i32 4, i8 2 } ; Return an aggregate of values 4 and 2 + +

Note that the code generator does not yet fully support larger + aggregate return values.

+ @@ -3231,6 +3235,10 @@ %array3 = malloc i32, i32 4, align 1024 ; yields {i32*}:array3 %array4 = malloc i32, align 1024 ; yields {i32*}:array4 + +

Note that the code generator does not yet respect the + alignment value.

+ @@ -4493,6 +4501,10 @@

See the variable argument processing section.

+

Note that the code generator does not yet fully support va_arg + on many targets. Also, it does not currently support va_arg with + aggregate types on any target.

+ From nicolas.geoffray at lip6.fr Mon Jan 12 17:21:31 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Jan 2009 00:21:31 +0100 Subject: [llvm-commits] [llvm] r62071 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp utils/TableGen/IntrinsicEmitter.cpp In-Reply-To: <200901120241.n0C2fbvx026680@zion.cs.uiuc.edu> References: <200901120241.n0C2fbvx026680@zion.cs.uiuc.edu> Message-ID: <496BD07B.7000402@lip6.fr> Hi Chris, This patch is making llc -march=cpp output invalid LLVM C++ API code. When compiling a .ll file with only: declare void @llvm.memcpy.i32(i8 *, i8 *, i32, i32) llc -march=cpp outputs: SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 1U; PAWI.Attrs = 0 ; Attrs.push_back(PAWI); PAWI.Index = 2U; PAWI.Attrs = 0 ; Attrs.push_back(PAWI); PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); func_llvm_memcpy_i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); Which gives an assertion error when being executed: Assertion failed: (Attrs[i].Attrs != Attribute::None && "Pointless attribute!"), function get, file Attributes.cpp, line 136. Nicolas Chris Lattner wrote: > Author: lattner > Date: Sun Jan 11 20:41:37 2009 > New Revision: 62071 > > URL: http://llvm.org/viewvc/llvm-project?rev=62071&view=rev > Log: > make tblgen autogenerate the nocapture intrinsics for > llvm.memcpy/memset/memmove. This allows removal of some > hackish code from basicaa. > > Modified: > llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp > llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp > > Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=62071&r1=62070&r2=62071&view=diff > > ============================================================================== > --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original) > +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sun Jan 11 20:41:37 2009 > @@ -69,10 +69,6 @@ > if (cast(I)->paramHasAttr(UI.getOperandNo(), > Attribute::NoCapture)) > continue; > - > - // FIXME: MemIntrinsics should have their operands marked nocapture! > - if (isa(I)) > - continue; // next use > return true; > case Instruction::Invoke: > // If the argument to the call has the nocapture attribute, then the call > > Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=62071&r1=62070&r2=62071&view=diff > > ============================================================================== > --- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original) > +++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Sun Jan 11 20:41:37 2009 > @@ -423,8 +423,7 @@ > OS << " break;\n"; > OS << " }\n"; > OS << " AttributeWithIndex AWI[" << MaxArgAttrs+1 << "];\n"; > - OS << " AWI[0] = AttributeWithIndex::get(~0, Attr);\n"; > - OS << " unsigned NumAttrs = 1;\n"; > + OS << " unsigned NumAttrs = 0;\n"; > OS << " switch (id) {\n"; > OS << " default: break;\n"; > > @@ -441,17 +440,33 @@ > > unsigned NumArgsWithAttrs = 0; > > - // FIXME: EMIT ATTRS > - > + while (!ArgAttrs.empty()) { > + unsigned ArgNo = ArgAttrs[0].first; > + > + OS << " AWI[" << NumArgsWithAttrs++ << "] = AttributeWithIndex::get(" > + << ArgNo+1 << ", 0"; > + > + while (!ArgAttrs.empty() && ArgAttrs[0].first == ArgNo) { > + switch (ArgAttrs[0].second) { > + default: assert(0 && "Unknown arg attribute"); > + case CodeGenIntrinsic::NoCapture: > + OS << "|Attribute::NoCapture"; > + break; > + } > + ArgAttrs.erase(ArgAttrs.begin()); > + } > + OS << ");\n"; > + } > > - OS << " NumAttrs = " << NumArgsWithAttrs+1 << ";\n"; > + OS << " NumAttrs = " << NumArgsWithAttrs << ";\n"; > OS << " break;\n"; > } > > OS << " }\n"; > - OS << " return AttrListPtr::get(AWI, NumAttrs);\n"; > + OS << " AWI[NumAttrs] = AttributeWithIndex::get(~0, Attr);\n"; > + OS << " return AttrListPtr::get(AWI, NumAttrs+1);\n"; > OS << "}\n"; > - OS << "#endif\n\n"; > + OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n"; > } > > void IntrinsicEmitter:: > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From dpatel at apple.com Mon Jan 12 18:20:51 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 00:20:51 -0000 Subject: [llvm-commits] [llvm] r62125 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901130020.n0D0KpvA019669@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 18:20:51 2009 New Revision: 62125 URL: http://llvm.org/viewvc/llvm-project?rev=62125&view=rev Log: Start using DebugInfo API to emit debug info. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62125&r1=62124&r2=62125&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan 12 18:20:51 2009 @@ -2545,7 +2545,7 @@ if (!Slot) { // FIXME - breaks down when the context is an inlined function. DIDescriptor ParentDesc; - DIDescriptor *DB = new DIBlock(V); + DIDescriptor *DB = new DIDescriptor(V); if (DIBlock *Block = dyn_cast(DB)) { ParentDesc = Block->getContext(); } @@ -2627,6 +2627,7 @@ void ConstructRootDbgScope(DbgScope *RootScope) { // Exit if there is no root scope. if (!RootScope) return; + if (!RootScope->getDesc()->isNull()) return; // Get the subprogram debug information entry. DISubprogram SPD(RootScope->getDesc()->getGV()); @@ -3100,9 +3101,6 @@ Asm->EmitInt8(0); Asm->EOL("DW_LNS_const_add_pc arg count"); Asm->EmitInt8(1); Asm->EOL("DW_LNS_fixed_advance_pc arg count"); - const UniqueVector &Directories = MMI->getDirectories(); - const UniqueVector &SourceFiles = MMI->getSourceFiles(); - // Emit directories. for (unsigned DirectoryID = 1, NDID = Directories.size(); DirectoryID <= NDID; ++DirectoryID) { @@ -3111,9 +3109,9 @@ Asm->EmitInt8(0); Asm->EOL("End of directories"); // Emit files. - for (unsigned SourceID = 1, NSID = SourceFiles.size(); + for (unsigned SourceID = 1, NSID = SrcFiles.size(); SourceID <= NSID; ++SourceID) { - const SourceFileInfo &SourceFile = SourceFiles[SourceID]; + const SrcFileInfo &SourceFile = SrcFiles[SourceID]; Asm->EmitString(SourceFile.getName()); Asm->EOL("Source"); Asm->EmitULEB128Bytes(SourceFile.getDirectoryID()); @@ -3151,7 +3149,7 @@ if (!LabelID) continue; unsigned SourceID = LineInfo.getSourceID(); - const SourceFileInfo &SourceFile = SourceFiles[SourceID]; + const SrcFileInfo &SourceFile = SrcFiles[SourceID]; unsigned DirectoryID = SourceFile.getDirectoryID(); if (VerboseAsm) Asm->EOL(Directories[DirectoryID] @@ -3636,6 +3634,7 @@ /// SetModuleInfo - Set machine module information when it's known that pass /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { + assert (0 && "Who is this?"); // Make sure initial declarations are made. if (!MMI && mmi->hasDebugInfo()) { MMI = mmi; @@ -3776,8 +3775,8 @@ } // Construct scopes for subprogram. - if (MMI->getRootScope()) - ConstructRootScope(MMI->getRootScope()); + if (RootDbgScope) + ConstructRootDbgScope(RootDbgScope); else // FIXME: This is wrong. We are essentially getting past a problem with // debug information not being able to handle unreachable blocks that have @@ -3787,7 +3786,7 @@ // scope, i.e., one that encompasses the whole function. This isn't // desirable. And a better way of handling this (and all of the debugging // information) needs to be explored. - ConstructDefaultScope(MF); + ConstructDefaultDbgScope(MF); DebugFrames.push_back(FunctionDebugFrameInfo(SubprogramCount, MMI->getFrameMoves())); @@ -4927,7 +4926,7 @@ DD = new DwarfDebug(OS, A, T); DE->BeginModule(M); DD->BeginModule(M); - DD->SetModuleInfo(MMI); + DD->SetDebugInfo(MMI); DE->SetModuleInfo(MMI); } From dpatel at apple.com Mon Jan 12 18:32:17 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 00:32:17 -0000 Subject: [llvm-commits] [llvm] r62126 - in /llvm/trunk/test: CodeGen/X86/2006-07-19-ATTAsm.ll DebugInfo/dataOnly.ll DebugInfo/deaddebuglabel.ll Message-ID: <200901130032.n0D0WHmt020029@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 18:32:17 2009 New Revision: 62126 URL: http://llvm.org/viewvc/llvm-project?rev=62126&view=rev Log: Use DebugInfo interface to lower dbg_* intrinsics. Modified: llvm/trunk/test/CodeGen/X86/2006-07-19-ATTAsm.ll llvm/trunk/test/DebugInfo/dataOnly.ll llvm/trunk/test/DebugInfo/deaddebuglabel.ll Modified: llvm/trunk/test/CodeGen/X86/2006-07-19-ATTAsm.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2006-07-19-ATTAsm.ll?rev=62126&r1=62125&r2=62126&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2006-07-19-ATTAsm.ll (original) +++ llvm/trunk/test/CodeGen/X86/2006-07-19-ATTAsm.ll Mon Jan 12 18:32:17 2009 @@ -7,13 +7,14 @@ %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } - %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* } + %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8 *, i8*, { }*, i32, { }*, i1, i1, { }* } @x = global i32 0 ; [#uses=1] @llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { - i32 327732, + i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @str, i64 0, i64 0), + i8* getelementptr ([2 x i8]* @str, i64 0, i64 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, Modified: llvm/trunk/test/DebugInfo/dataOnly.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dataOnly.ll?rev=62126&r1=62125&r2=62126&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/dataOnly.ll (original) +++ llvm/trunk/test/DebugInfo/dataOnly.ll Mon Jan 12 18:32:17 2009 @@ -1,6 +1,5 @@ ; RUN: llvm-as < %s | llc | grep DWARF ; ModuleID = 'foo.c' -; XFAIL: * target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" %llvm.dbg.anchor.type = type { i32, i32 } Modified: llvm/trunk/test/DebugInfo/deaddebuglabel.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/deaddebuglabel.ll?rev=62126&r1=62125&r2=62126&view=diff ============================================================================== --- llvm/trunk/test/DebugInfo/deaddebuglabel.ll (original) +++ llvm/trunk/test/DebugInfo/deaddebuglabel.ll Mon Jan 12 18:32:17 2009 @@ -1,6 +1,5 @@ ; PR2614 ; RUN: llvm-as < %s | llc | grep "label" | count 8 -; XFAIL: * 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-f80:32:32-v64:64:64-v128:128:128-a0:0:64" target triple = "i686-pc-linux-gnu" From dpatel at apple.com Mon Jan 12 18:35:13 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 00:35:13 -0000 Subject: [llvm-commits] [llvm] r62127 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/X86/ Message-ID: <200901130035.n0D0ZE1S020153@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 12 18:35:13 2009 New Revision: 62127 URL: http://llvm.org/viewvc/llvm-project?rev=62127&view=rev Log: Use DebugInfo interface to lower dbg_* intrinsics. Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h llvm/trunk/include/llvm/CodeGen/SelectionDAG.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/FastISel.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/FastISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/FastISel.h Mon Jan 12 18:35:13 2009 @@ -28,6 +28,7 @@ class MachineFunction; class MachineFrameInfo; class MachineModuleInfo; +class DwarfWriter; class MachineRegisterInfo; class TargetData; class TargetInstrInfo; @@ -50,6 +51,7 @@ #endif MachineFunction &MF; MachineModuleInfo *MMI; + DwarfWriter *DW; MachineRegisterInfo &MRI; MachineFrameInfo &MFI; MachineConstantPool &MCP; @@ -115,6 +117,7 @@ protected: FastISel(MachineFunction &mf, MachineModuleInfo *mmi, + DwarfWriter *dw, DenseMap &vm, DenseMap &bm, DenseMap &am Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Mon Jan 12 18:35:13 2009 @@ -136,6 +136,7 @@ TargetLowering &getTargetLoweringInfo() const { return TLI; } FunctionLoweringInfo &getFunctionLoweringInfo() const { return FLI; } MachineModuleInfo *getMachineModuleInfo() const { return MMI; } + DwarfWriter *getDwarfWriter() const { return DW; } /// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'. /// @@ -312,7 +313,7 @@ SDValue getValueType(MVT); SDValue getRegister(unsigned Reg, MVT VT); SDValue getDbgStopPoint(SDValue Root, unsigned Line, unsigned Col, - const CompileUnitDesc *CU); + Value *CU); SDValue getLabel(unsigned Opcode, SDValue Root, unsigned LabelID); SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N) { Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Jan 12 18:35:13 2009 @@ -29,6 +29,7 @@ class MachineFunction; class MachineInstr; class MachineModuleInfo; + class DwarfWriter; class TargetLowering; class TargetInstrInfo; class FunctionLoweringInfo; @@ -110,6 +111,7 @@ private: void SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, MachineModuleInfo *MMI, + DwarfWriter *DW, const TargetInstrInfo &TII); void FinishBasicBlock(); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 12 18:35:13 2009 @@ -39,7 +39,7 @@ class MachineBasicBlock; class MachineConstantPoolValue; class SDNode; -class CompileUnitDesc; +class Value; template struct DenseMapInfo; template struct simplify_type; template struct ilist_traits; @@ -586,7 +586,7 @@ // DBG_STOPPOINT - This node is used to represent a source location for // debug info. It takes token chain as input, and carries a line number, - // column number, and a pointer to a CompileUnitDesc object identifying + // column number, and a pointer to a CompileUnit object identifying // the containing compilation unit. It produces a token chain as output. DBG_STOPPOINT, @@ -1981,12 +1981,12 @@ SDUse Chain; unsigned Line; unsigned Column; - const CompileUnitDesc *CU; + Value *CU; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. protected: friend class SelectionDAG; DbgStopPointSDNode(SDValue ch, unsigned l, unsigned c, - const CompileUnitDesc *cu) + Value *cu) : SDNode(ISD::DBG_STOPPOINT, getSDVTList(MVT::Other)), Line(l), Column(c), CU(cu) { Chain = ch; @@ -1995,7 +1995,7 @@ public: unsigned getLine() const { return Line; } unsigned getColumn() const { return Column; } - const CompileUnitDesc *getCompileUnit() const { return CU; } + Value *getCompileUnit() const { return CU; } static bool classof(const DbgStopPointSDNode *) { return true; } static bool classof(const SDNode *N) { Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Jan 12 18:35:13 2009 @@ -43,6 +43,7 @@ class MachineFrameInfo; class MachineInstr; class MachineModuleInfo; + class DwarfWriter; class SDNode; class SDValue; class SelectionDAG; @@ -1199,7 +1200,7 @@ /// or null if the target does not support "fast" ISel. virtual FastISel * createFastISel(MachineFunction &, - MachineModuleInfo *, + MachineModuleInfo *, DwarfWriter *, DenseMap &, DenseMap &, DenseMap & Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Jan 12 18:35:13 2009 @@ -47,6 +47,8 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetLowering.h" @@ -315,14 +317,13 @@ default: break; case Intrinsic::dbg_stoppoint: { DbgStopPointInst *SPI = cast(I); - if (MMI && SPI->getContext() && MMI->Verify(SPI->getContext())) { - DebugInfoDesc *DD = MMI->getDescFor(SPI->getContext()); - assert(DD && "Not a debug information descriptor"); - const CompileUnitDesc *CompileUnit = cast(DD); - unsigned SrcFile = MMI->RecordSource(CompileUnit); + if (DW && SPI->getContext()) { + DICompileUnit CU(cast(SPI->getContext())); + unsigned SrcFile = DW->RecordSource(CU.getDirectory(), + CU.getFilename()); unsigned Line = SPI->getLine(); unsigned Col = SPI->getColumn(); - unsigned ID = MMI->RecordSourceLine(Line, Col, SrcFile); + unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, II).addImm(ID); } @@ -330,8 +331,9 @@ } case Intrinsic::dbg_region_start: { DbgRegionStartInst *RSI = cast(I); - if (MMI && RSI->getContext() && MMI->Verify(RSI->getContext())) { - unsigned ID = MMI->RecordRegionStart(RSI->getContext()); + if (DW && RSI->getContext()) { + unsigned ID = + DW->RecordRegionStart(cast(RSI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, II).addImm(ID); } @@ -339,30 +341,31 @@ } case Intrinsic::dbg_region_end: { DbgRegionEndInst *REI = cast(I); - if (MMI && REI->getContext() && MMI->Verify(REI->getContext())) { - unsigned ID = MMI->RecordRegionEnd(REI->getContext()); + if (DW && REI->getContext()) { + unsigned ID = + DW->RecordRegionEnd(cast(REI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, II).addImm(ID); } return true; } case Intrinsic::dbg_func_start: { - if (!MMI) return true; + if (!DW) return true; DbgFuncStartInst *FSI = cast(I); Value *SP = FSI->getSubprogram(); - if (SP && MMI->Verify(SP)) { + if (SP) { // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is // what (most?) gdb expects. - DebugInfoDesc *DD = MMI->getDescFor(SP); - assert(DD && "Not a debug information descriptor"); - SubprogramDesc *Subprogram = cast(DD); - const CompileUnitDesc *CompileUnit = Subprogram->getFile(); - unsigned SrcFile = MMI->RecordSource(CompileUnit); + DISubprogram Subprogram(cast(SP)); + DICompileUnit CompileUnit = Subprogram.getCompileUnit(); + unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(), + CompileUnit.getFilename()); // Record the source line but does not create a label for the normal // function start. It will be emitted at asm emission time. However, // create a label if this is a beginning of inlined function. - unsigned LabelID = MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile); - if (MMI->getSourceLines().size() != 1) { + unsigned LabelID = + DW->RecordSourceLine(Subprogram.getLineNumber(), 0, SrcFile); + if (DW->getRecordSourceLineCount() != 1) { const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); BuildMI(MBB, II).addImm(LabelID); } @@ -372,7 +375,7 @@ case Intrinsic::dbg_declare: { DbgDeclareInst *DI = cast(I); Value *Variable = DI->getVariable(); - if (MMI && Variable && MMI->Verify(Variable)) { + if (DW && Variable) { // Determine the address of the declared object. Value *Address = DI->getAddress(); if (BitCastInst *BCI = dyn_cast(Address)) @@ -682,6 +685,7 @@ FastISel::FastISel(MachineFunction &mf, MachineModuleInfo *mmi, + DwarfWriter *dw, DenseMap &vm, DenseMap &bm, DenseMap &am @@ -698,6 +702,7 @@ #endif MF(mf), MMI(mmi), + DW(dw), MRI(MF.getRegInfo()), MFI(*MF.getFrameInfo()), MCP(*MF.getConstantPool()), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 12 18:35:13 2009 @@ -16,6 +16,8 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetLowering.h" @@ -26,6 +28,7 @@ #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" +#include "llvm/GlobalVariable.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MathExtras.h" @@ -1258,15 +1261,17 @@ case TargetLowering::Promote: default: assert(0 && "This action is not supported yet!"); case TargetLowering::Expand: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + DwarfWriter *DW = DAG.getDwarfWriter(); bool useDEBUG_LOC = TLI.isOperationLegal(ISD::DEBUG_LOC, MVT::Other); bool useLABEL = TLI.isOperationLegal(ISD::DBG_LABEL, MVT::Other); const DbgStopPointSDNode *DSP = cast(Node); - if (MMI && (useDEBUG_LOC || useLABEL)) { - const CompileUnitDesc *CompileUnit = DSP->getCompileUnit(); - unsigned SrcFile = MMI->RecordSource(CompileUnit); - + GlobalVariable *CU_GV = cast(DSP->getCompileUnit()); + if (DW && (useDEBUG_LOC || useLABEL) && !CU_GV->isDeclaration()) { + DICompileUnit CU(cast(DSP->getCompileUnit())); + unsigned SrcFile = DW->RecordSource(CU.getDirectory(), + CU.getFilename()); + unsigned Line = DSP->getLine(); unsigned Col = DSP->getColumn(); @@ -1276,7 +1281,7 @@ DAG.getConstant(SrcFile, MVT::i32) }; Result = DAG.getNode(ISD::DEBUG_LOC, MVT::Other, Ops, 4); } else { - unsigned ID = MMI->RecordSourceLine(Line, Col, SrcFile); + unsigned ID = DW->RecordSourceLine(Line, Col, SrcFile); Result = DAG.getLabel(ISD::DBG_LABEL, Tmp1, ID); } } else { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 12 18:35:13 2009 @@ -1137,8 +1137,8 @@ } SDValue SelectionDAG::getDbgStopPoint(SDValue Root, - unsigned Line, unsigned Col, - const CompileUnitDesc *CU) { + unsigned Line, unsigned Col, + Value *CU) { SDNode *N = NodeAllocator.Allocate(); new (N) DbgStopPointSDNode(Root, Line, Col, CU); AllNodes.push_back(N); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Jan 12 18:35:13 2009 @@ -37,6 +37,8 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/CodeGen/SelectionDAG.h" +#include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetFrameInfo.h" @@ -3742,67 +3744,65 @@ return 0; } case Intrinsic::dbg_stoppoint: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + DwarfWriter *DW = DAG.getDwarfWriter(); DbgStopPointInst &SPI = cast(I); - if (MMI && SPI.getContext() && MMI->Verify(SPI.getContext())) { - DebugInfoDesc *DD = MMI->getDescFor(SPI.getContext()); - assert(DD && "Not a debug information descriptor"); + if (DW && SPI.getContext()) DAG.setRoot(DAG.getDbgStopPoint(getRoot(), SPI.getLine(), SPI.getColumn(), - cast(DD))); - } - + SPI.getContext())); return 0; } case Intrinsic::dbg_region_start: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionStartInst &RSI = cast(I); - if (MMI && RSI.getContext() && MMI->Verify(RSI.getContext())) { - unsigned LabelID = MMI->RecordRegionStart(RSI.getContext()); + if (DW && RSI.getContext()) { + unsigned LabelID = + DW->RecordRegionStart(cast(RSI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); } return 0; } case Intrinsic::dbg_region_end: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionEndInst &REI = cast(I); - if (MMI && REI.getContext() && MMI->Verify(REI.getContext())) { - unsigned LabelID = MMI->RecordRegionEnd(REI.getContext()); + if (DW && REI.getContext()) { + unsigned LabelID = + DW->RecordRegionEnd(cast(REI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); } return 0; } case Intrinsic::dbg_func_start: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); - if (!MMI) return 0; + DwarfWriter *DW = DAG.getDwarfWriter(); + if (!DW) return 0; DbgFuncStartInst &FSI = cast(I); Value *SP = FSI.getSubprogram(); - if (SP && MMI->Verify(SP)) { + if (SP) { // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is // what (most?) gdb expects. - DebugInfoDesc *DD = MMI->getDescFor(SP); - assert(DD && "Not a debug information descriptor"); - SubprogramDesc *Subprogram = cast(DD); - const CompileUnitDesc *CompileUnit = Subprogram->getFile(); - unsigned SrcFile = MMI->RecordSource(CompileUnit); + DISubprogram Subprogram(cast(SP)); + DICompileUnit CompileUnit = Subprogram.getCompileUnit(); + unsigned SrcFile = DW->RecordSource(CompileUnit.getDirectory(), + CompileUnit.getFilename()); // Record the source line but does not create a label for the normal // function start. It will be emitted at asm emission time. However, // create a label if this is a beginning of inlined function. - unsigned LabelID = MMI->RecordSourceLine(Subprogram->getLine(), 0, SrcFile); - if (MMI->getSourceLines().size() != 1) + unsigned LabelID = + DW->RecordSourceLine(Subprogram.getLineNumber(), 0, SrcFile); + if (DW->getRecordSourceLineCount() != 1) DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); } return 0; } case Intrinsic::dbg_declare: { - MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); + DwarfWriter *DW = DAG.getDwarfWriter(); DbgDeclareInst &DI = cast(I); Value *Variable = DI.getVariable(); - if (MMI && Variable && MMI->Verify(Variable)) + if (DW && Variable) DAG.setRoot(DAG.getNode(ISD::DECLARE, MVT::Other, getRoot(), getValue(DI.getAddress()), getValue(Variable))); return 0; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 12 18:35:13 2009 @@ -327,7 +327,7 @@ // Mark landing pad. FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad(); - SelectAllBasicBlocks(Fn, MF, MMI, TII); + SelectAllBasicBlocks(Fn, MF, MMI, DW, TII); // If the first basic block in the function has live ins that need to be // copied into vregs, emit the copies into the top of the block before @@ -696,11 +696,12 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, MachineModuleInfo *MMI, + DwarfWriter *DW, const TargetInstrInfo &TII) { // Initialize the Fast-ISel state, if needed. FastISel *FastIS = 0; if (EnableFastISel) - FastIS = TLI.createFastISel(*FuncInfo->MF, MMI, + FastIS = TLI.createFastISel(*FuncInfo->MF, MMI, DW, FuncInfo->ValueMap, FuncInfo->MBBMap, FuncInfo->StaticAllocaMap Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Mon Jan 12 18:35:13 2009 @@ -20,6 +20,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/PseudoSourceValue.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" @@ -177,7 +178,8 @@ Op += " #" + utostr(R->getReg()); } } else if (const DbgStopPointSDNode *D = dyn_cast(Node)) { - Op += ": " + D->getCompileUnit()->getFileName(); + DICompileUnit CU(cast(D->getCompileUnit())); + Op += ": " + CU.getFilename(); Op += ":" + utostr(D->getLine()); if (D->getColumn() != 0) Op += ":" + utostr(D->getColumn()); Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Jan 12 18:35:13 2009 @@ -51,6 +51,7 @@ public: explicit X86FastISel(MachineFunction &mf, MachineModuleInfo *mmi, + DwarfWriter *dw, DenseMap &vm, DenseMap &bm, DenseMap &am @@ -58,7 +59,7 @@ , SmallSet &cil #endif ) - : FastISel(mf, mmi, vm, bm, am + : FastISel(mf, mmi, dw, vm, bm, am #ifndef NDEBUG , cil #endif @@ -1512,6 +1513,7 @@ namespace llvm { llvm::FastISel *X86::createFastISel(MachineFunction &mf, MachineModuleInfo *mmi, + DwarfWriter *dw, DenseMap &vm, DenseMap &bm, DenseMap &am @@ -1519,7 +1521,7 @@ , SmallSet &cil #endif ) { - return new X86FastISel(mf, mmi, vm, bm, am + return new X86FastISel(mf, mmi, dw, vm, bm, am #ifndef NDEBUG , cil #endif Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jan 12 18:35:13 2009 @@ -1923,6 +1923,7 @@ FastISel * X86TargetLowering::createFastISel(MachineFunction &mf, MachineModuleInfo *mmo, + DwarfWriter *dw, DenseMap &vm, DenseMap &bm, @@ -1931,7 +1932,7 @@ , SmallSet &cil #endif ) { - return X86::createFastISel(mf, mmo, vm, bm, am + return X86::createFastISel(mf, mmo, dw, vm, bm, am #ifndef NDEBUG , cil #endif Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=62127&r1=62126&r2=62127&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Jan 12 18:35:13 2009 @@ -505,7 +505,7 @@ /// or null if the target does not support "fast" ISel. virtual FastISel * createFastISel(MachineFunction &mf, - MachineModuleInfo *mmi, + MachineModuleInfo *mmi, DwarfWriter *dw, DenseMap &, DenseMap &, DenseMap & @@ -658,7 +658,7 @@ namespace X86 { FastISel *createFastISel(MachineFunction &mf, - MachineModuleInfo *mmi, + MachineModuleInfo *mmi, DwarfWriter *dw, DenseMap &, DenseMap &, DenseMap & From kremenek at apple.com Mon Jan 12 19:10:11 2009 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 13 Jan 2009 01:10:11 -0000 Subject: [llvm-commits] [llvm] r62133 - /llvm/tags/checker/checker-0.139/ Message-ID: <200901130110.n0D1ABjp021520@zion.cs.uiuc.edu> Author: kremenek Date: Mon Jan 12 19:10:10 2009 New Revision: 62133 URL: http://llvm.org/viewvc/llvm-project?rev=62133&view=rev Log: Tagging checker-0.139. Added: llvm/tags/checker/checker-0.139/ - copied from r62132, llvm/trunk/ From gohman at apple.com Mon Jan 12 19:18:01 2009 From: gohman at apple.com (Dan Gohman) Date: Mon, 12 Jan 2009 17:18:01 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> Message-ID: <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> Hi Chris, The recent 176.gcc JIT regression on darwin x86-32 isolated down to this commit. Can you investigate? Thanks, Dan On Jan 8, 2009, at 11:47 PM, Chris Lattner wrote: > Author: lattner > Date: Fri Jan 9 01:47:06 2009 > New Revision: 61985 > > URL: http://llvm.org/viewvc/llvm-project?rev=61985&view=rev > Log: > Implement rdar://6480391, extending of equality icmp's to avoid a > truncation. > I noticed this in the code compiled for a routine using std::map, > which produced > this code: > %25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind > readonly > %.lobit.i = lshr i32 %25, 31 ; [#uses=1] > %tmp.i = trunc i32 %.lobit.i to i8 ; [#uses=1] > %toBool = icmp eq i8 %tmp.i, 0 ; [#uses=1] > br i1 %toBool, label %bb3, label %bb4 > which compiled to: > > call L_memcmp$stub > shrl $31, %eax > testb %al, %al > jne LBB1_11 ## > > with this change, we compile it to: > > call L_memcmp$stub > testl %eax, %eax > js LBB1_11 > > This triggers all the time in common code, with patters like this: > > %169 = and i32 %ply, 1 ; [#uses=1] > %170 = trunc i32 %169 to i8 ; [#uses=1] > %toBool = icmp ne i8 %170, 0 ; [#uses=1] > > %7 = lshr i32 %6, 24 ; [#uses=1] > %9 = trunc i32 %7 to i8 ; [#uses=1] > %10 = icmp ne i8 %9, 0 ; [#uses=1] > > etc > > > Modified: > llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > llvm/trunk/test/Transforms/InstCombine/cast.ll > llvm/trunk/test/Transforms/InstCombine/icmp.ll > > Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=61985&r1=61984&r2=61985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > (original) > +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri > Jan 9 01:47:06 2009 > @@ -6343,6 +6343,28 @@ > const APInt &RHSV = RHS->getValue(); > > switch (LHSI->getOpcode()) { > + case Instruction::Trunc: > + if (ICI.isEquality() && LHSI->hasOneUse()) { > + // Simplify icmp eq (trunc x to i8), 42 -> icmp eq x, 42| > highbits if all > + // of the high bits truncated out of x are known. > + unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(), > + SrcBits = LHSI->getOperand(0)->getType()- > >getPrimitiveSizeInBits(); > + APInt Mask(APInt::getHighBitsSet(SrcBits, SrcBits-DstBits)); > + APInt KnownZero(SrcBits, 0), KnownOne(SrcBits, 0); > + ComputeMaskedBits(LHSI->getOperand(0), Mask, KnownZero, > KnownOne); > + > + // If all the high bits are known, we can do this xform. > + if ((KnownZero|KnownOne).countLeadingOnes() >= SrcBits- > DstBits) { > + // Pull in the high bits from known-ones set. > + APInt NewRHS(RHS->getValue()); > + NewRHS.zext(SrcBits); > + NewRHS |= KnownOne; > + return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), > + ConstantInt::get(NewRHS)); > + } > + } > + break; > + > case Instruction::Xor: // (icmp pred (xor X, XorCST), CI) > if (ConstantInt *XorCST = dyn_cast(LHSI- > >getOperand(1))) { > // If this is a comparison that tests the signbit (X < 0) or > (x > -1), > > Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=61985&r1=61984&r2=61985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/InstCombine/cast.ll (original) > +++ llvm/trunk/test/Transforms/InstCombine/cast.ll Fri Jan 9 > 01:47:06 2009 > @@ -1,7 +1,5 @@ > ; Tests to make sure elimination of casts is working correctly > -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ > -; RUN: grep %c | notcast > -; END. > +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c | notcast > > @inbuf = external global [32832 x i8] ; <[32832 x i8]*> > [#uses=1] > > @@ -238,3 +236,21 @@ > ret i16 %c2 > } > > +; icmp sgt i32 %a, -1 > +; rdar://6480391 > +define i1 @test36(i32 %a) { > + %b = lshr i32 %a, 31 > + %c = trunc i32 %b to i8 > + %d = icmp eq i8 %c, 0 > + ret i1 %d > +} > + > +; ret i1 false > +define i1 @test37(i32 %a) { > + %b = lshr i32 %a, 31 > + %c = or i32 %b, 512 > + %d = trunc i32 %c to i8 > + %e = icmp eq i8 %d, 11 > + ret i1 %e > +} > + > > Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=61985&r1=61984&r2=61985&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original) > +++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Fri Jan 9 > 01:47:06 2009 > @@ -1,5 +1,4 @@ > ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp > -; END. > > define i32 @test1(i32 %X) { > entry: > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Mon Jan 12 20:47:22 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 Jan 2009 02:47:22 -0000 Subject: [llvm-commits] [test-suite] r62141 - in /test-suite/trunk/SingleSource/Benchmarks: Adobe-C++/ C++Bench/ Makefile Message-ID: <200901130247.n0D2lM2q024724@zion.cs.uiuc.edu> Author: resistor Date: Mon Jan 12 20:47:22 2009 New Revision: 62141 URL: http://llvm.org/viewvc/llvm-project?rev=62141&view=rev Log: Rename this to something more meaningful. Added: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/ (props changed) - copied from r62072, test-suite/trunk/SingleSource/Benchmarks/C++Bench/ Removed: test-suite/trunk/SingleSource/Benchmarks/C++Bench/ Modified: test-suite/trunk/SingleSource/Benchmarks/Makefile Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/ ------------------------------------------------------------------------------ svn:mergeinfo = Modified: test-suite/trunk/SingleSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Makefile?rev=62141&r1=62140&r2=62141&view=diff ============================================================================== --- test-suite/trunk/SingleSource/Benchmarks/Makefile (original) +++ test-suite/trunk/SingleSource/Benchmarks/Makefile Mon Jan 12 20:47:22 2009 @@ -1,6 +1,6 @@ LEVEL = ../.. PARALLEL_DIRS=Dhrystone CoyoteBench Shootout Shootout-C++ Stanford McGill \ - Misc Misc-C++ BenchmarkGame C++Bench + Misc Misc-C++ BenchmarkGame Adobe-C++ # Misc-C++-EH - someday when EH is supported in llvm-gcc we should # re-enable this test. It always fails and its very slow # (100MB Bytecode) so we disable it for now. From evan.cheng at apple.com Mon Jan 12 21:57:45 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 03:57:45 -0000 Subject: [llvm-commits] [llvm] r62144 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-01-12-CoalescerBug.ll Message-ID: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 12 21:57:45 2009 New Revision: 62144 URL: http://llvm.org/viewvc/llvm-project?rev=62144&view=rev Log: FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block. Added: llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62144&r1=62143&r2=62144&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jan 12 21:57:45 2009 @@ -1731,7 +1731,20 @@ // If it's coalescing a virtual register to a physical register, estimate // its live interval length. This is the *cost* of scanning an entire live // interval. If the cost is low, we'll do an exhaustive check instead. + + // If this is something like this: + // BB1: + // v1024 = op + // ... + // BB2: + // ... + // RAX = v1024 + // + // That is, the live interval of v1024 crosses a bb. Then we can't rely on + // less conservative check. It's possible a sub-register is defined before + // v1024 (or live in) and live out of BB1. if (RHS.containsOneValue() && + li_->intervalIsInOneMBB(RHS) && li_->getApproximateInstructionCount(RHS) <= 10) { // Perform a more exhaustive check for some common cases. if (li_->conflictsWithPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) Added: llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll?rev=62144&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll Mon Jan 12 21:57:45 2009 @@ -0,0 +1,84 @@ +; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu | grep movq | count 2 +; PR3311 + + %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } + %struct.VEC_basic_block_base = type { i32, i32, [1 x %struct.basic_block_def*] } + %struct.VEC_basic_block_gc = type { %struct.VEC_basic_block_base } + %struct.VEC_edge_base = type { i32, i32, [1 x %struct.edge_def*] } + %struct.VEC_edge_gc = type { %struct.VEC_edge_base } + %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] } + %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base } + %struct.VEC_temp_slot_p_base = type { i32, i32, [1 x %struct.temp_slot*] } + %struct.VEC_temp_slot_p_gc = type { %struct.VEC_temp_slot_p_base } + %struct.VEC_tree_base = type { i32, i32, [1 x %struct.tree_node*] } + %struct.VEC_tree_gc = type { %struct.VEC_tree_base } + %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] } + %struct.basic_block_def = type { %struct.tree_node*, %struct.VEC_edge_gc*, %struct.VEC_edge_gc*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_il_dependent, %struct.tree_node*, %struct.edge_prediction*, i64, i32, i32, i32, i32 } + %struct.basic_block_il_dependent = type { %struct.rtl_bb_info* } + %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [2 x i64] } + %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* } + %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack } + %struct.block_symbol = type { [3 x %struct.rtunion], %struct.object_block*, i64 } + %struct.c_arg_info = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i8 } + %struct.c_language_function = type { %struct.stmt_tree_s } + %struct.c_switch = type opaque + %struct.control_flow_graph = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.VEC_basic_block_gc*, i32, i32, i32, %struct.VEC_basic_block_gc*, i32 } + %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.location_t*, i32, i32, i64, i32 } + %struct.edge_def_insns = type { %struct.rtx_def* } + %struct.edge_prediction = type opaque + %struct.eh_status = type opaque + %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** } + %struct.et_node = type opaque + %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* } + %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.control_flow_graph*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.VEC_temp_slot_p_gc*, %struct.temp_slot*, %struct.var_refs_queue*, i32, i32, i32, i32, %struct.machine_function*, i32, i32, %struct.language_function*, %struct.htab*, %struct.rtx_def*, i32, i32, i32, %struct.location_t, %struct.VEC_tree_gc*, %struct.tree_node*, i8*, i8*, i8*, i8*, i8*, %struct.tree_node*, i8, i8, i8, i8, i8, i8 } + %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i64, i64, i64, i32, i32, i8* (i64, i64)*, void (i8*)*, i8*, i8* (i8*, i64, i64)*, void (i8*, i8*)*, i32 } + %struct.initial_value_struct = type opaque + %struct.lang_decl = type { i8 } + %struct.language_function = type { %struct.c_language_function, %struct.tree_node*, %struct.tree_node*, %struct.c_switch*, %struct.c_arg_info*, i32, i32, i32, i32 } + %struct.location_t = type { i8*, i32 } + %struct.loop = type opaque + %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, [4 x i32], i32, i32, i32 } + %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* } + %struct.obstack = type { i64, %struct._obstack_chunk*, i8*, i8*, i8*, i64, i32, %struct._obstack_chunk* (i8*, i64)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 } + %struct.omp_clause_subcode = type { i32 } + %struct.rtl_bb_info = type { %struct.rtx_def*, %struct.rtx_def*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, %struct.rtx_def*, %struct.rtx_def*, i32 } + %struct.rtunion = type { i8* } + %struct.rtx_def = type { i16, i8, i8, %struct.u } + %struct.section = type { %struct.unnamed_section } + %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* } + %struct.stack_local_entry = type opaque + %struct.stmt_tree_s = type { %struct.tree_node*, i32 } + %struct.temp_slot = type opaque + %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 } + %struct.tree_decl_common = type { %struct.tree_decl_minimal, %struct.tree_node*, i8, i8, i8, i8, i8, i32, i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* } + %struct.tree_decl_minimal = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, %struct.tree_node* } + %struct.tree_decl_non_common = type { %struct.tree_decl_with_vis, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* } + %struct.tree_decl_with_rtl = type { %struct.tree_decl_common, %struct.rtx_def*, i32 } + %struct.tree_decl_with_vis = type { %struct.tree_decl_with_rtl, %struct.tree_node*, %struct.tree_node*, i8, i8, i8, i8 } + %struct.tree_function_decl = type { %struct.tree_decl_non_common, i32, i8, i8, i64, %struct.function* } + %struct.tree_node = type { %struct.tree_function_decl } + %struct.u = type { %struct.block_symbol } + %struct.unnamed_section = type { %struct.omp_clause_subcode, void (i8*)*, i8*, %struct.section* } + %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* } + %struct.varasm_status = type opaque + %union.tree_ann_d = type opaque + at .str1 = external constant [31 x i8] ; <[31 x i8]*> [#uses=1] + at integer_types = external global [11 x %struct.tree_node*] ; <[11 x %struct.tree_node*]*> [#uses=1] + at __FUNCTION__.31164 = external constant [23 x i8], align 16 ; <[23 x i8]*> [#uses=1] + at llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @c_common_type_for_size to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define i32 @c_common_type_for_size(i32 %bits, i32 %unsignedp) nounwind { +entry: + %0 = load %struct.tree_node** getelementptr ([11 x %struct.tree_node*]* @integer_types, i32 0, i64 5), align 8 ; <%struct.tree_node*> [#uses=1] + br i1 false, label %bb16, label %bb + +bb: ; preds = %entry + tail call void @tree_class_check_failed(%struct.tree_node* %0, i32 2, i8* getelementptr ([31 x i8]* @.str1, i32 0, i64 0), i32 1785, i8* getelementptr ([23 x i8]* @__FUNCTION__.31164, i32 0, i32 0)) noreturn nounwind + unreachable + +bb16: ; preds = %entry + %tmp = add i32 %bits, %unsignedp ; [#uses=1] + ret i32 %tmp +} + +declare void @tree_class_check_failed(%struct.tree_node*, i32, i8*, i32, i8*) noreturn From nicholas at mxc.ca Mon Jan 12 22:01:52 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 12 Jan 2009 20:01:52 -0800 Subject: [llvm-commits] [llvm] r62144 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-01-12-CoalescerBug.ll In-Reply-To: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> References: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> Message-ID: <496C1230.2050703@mxc.ca> Evan Cheng wrote: > Author: evancheng > Date: Mon Jan 12 21:57:45 2009 > New Revision: 62144 > > URL: http://llvm.org/viewvc/llvm-project?rev=62144&view=rev > Log: > FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block. > > Added: > llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll > Modified: > llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > > Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62144&r1=62143&r2=62144&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) > +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jan 12 21:57:45 2009 > @@ -1731,7 +1731,20 @@ > // If it's coalescing a virtual register to a physical register, estimate > // its live interval length. This is the *cost* of scanning an entire live > // interval. If the cost is low, we'll do an exhaustive check instead. > + > + // If this is something like this: > + // BB1: > + // v1024 = op > + // ... > + // BB2: > + // ... > + // RAX = v1024 > + // > + // That is, the live interval of v1024 crosses a bb. Then we can't rely on > + // less conservative check. It's possible a sub-register is defined before > + // v1024 (or live in) and live out of BB1. > if (RHS.containsOneValue() && > + li_->intervalIsInOneMBB(RHS) && Tab! > li_->getApproximateInstructionCount(RHS) <= 10) { > // Perform a more exhaustive check for some common cases. > if (li_->conflictsWithPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) From nicholas at mxc.ca Mon Jan 12 23:00:54 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 12 Jan 2009 21:00:54 -0800 Subject: [llvm-commits] [llvm] r62144 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-01-12-CoalescerBug.ll In-Reply-To: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> References: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> Message-ID: <496C2006.4020207@mxc.ca> Evan Cheng wrote: > Author: evancheng > Date: Mon Jan 12 21:57:45 2009 > New Revision: 62144 > > URL: http://llvm.org/viewvc/llvm-project?rev=62144&view=rev > Log: > FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block. Did you forget a file? llvm[2]: Compiling SimpleRegisterCoalescing.cpp for Debug build /home/nicholas/llvm-commit/include/llvm/CodeGen/LiveIntervalAnalysis.h: In member function 'bool llvm::SimpleRegisterCoalescing::JoinIntervals(llvm::LiveInterval&, llvm::LiveInterval&, bool&)': /home/nicholas/llvm-commit/include/llvm/CodeGen/LiveIntervalAnalysis.h:467: error: 'bool llvm::LiveIntervals::intervalIsInOneMBB(const llvm::LiveInterval&) const' is private SimpleRegisterCoalescing.cpp:1747: error: within this context make[2]: *** [/home/nicholas/llvm-commit/lib/CodeGen/Debug/SimpleRegisterCoalescing.o] Error 1 Nick > > Added: > llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll > Modified: > llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > > Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62144&r1=62143&r2=62144&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) > +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jan 12 21:57:45 2009 > @@ -1731,7 +1731,20 @@ > // If it's coalescing a virtual register to a physical register, estimate > // its live interval length. This is the *cost* of scanning an entire live > // interval. If the cost is low, we'll do an exhaustive check instead. > + > + // If this is something like this: > + // BB1: > + // v1024 = op > + // ... > + // BB2: > + // ... > + // RAX = v1024 > + // > + // That is, the live interval of v1024 crosses a bb. Then we can't rely on > + // less conservative check. It's possible a sub-register is defined before > + // v1024 (or live in) and live out of BB1. > if (RHS.containsOneValue() && > + li_->intervalIsInOneMBB(RHS) && > li_->getApproximateInstructionCount(RHS) <= 10) { > // Perform a more exhaustive check for some common cases. > if (li_->conflictsWithPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) > > Added: llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll?rev=62144&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll (added) > +++ llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll Mon Jan 12 21:57:45 2009 > @@ -0,0 +1,84 @@ > +; RUN: llvm-as < %s | llc -mtriple=x86_64-unknown-linux-gnu | grep movq | count 2 > +; PR3311 > + > + %struct.CUMULATIVE_ARGS = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } > + %struct.VEC_basic_block_base = type { i32, i32, [1 x %struct.basic_block_def*] } > + %struct.VEC_basic_block_gc = type { %struct.VEC_basic_block_base } > + %struct.VEC_edge_base = type { i32, i32, [1 x %struct.edge_def*] } > + %struct.VEC_edge_gc = type { %struct.VEC_edge_base } > + %struct.VEC_rtx_base = type { i32, i32, [1 x %struct.rtx_def*] } > + %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base } > + %struct.VEC_temp_slot_p_base = type { i32, i32, [1 x %struct.temp_slot*] } > + %struct.VEC_temp_slot_p_gc = type { %struct.VEC_temp_slot_p_base } > + %struct.VEC_tree_base = type { i32, i32, [1 x %struct.tree_node*] } > + %struct.VEC_tree_gc = type { %struct.VEC_tree_base } > + %struct._obstack_chunk = type { i8*, %struct._obstack_chunk*, [4 x i8] } > + %struct.basic_block_def = type { %struct.tree_node*, %struct.VEC_edge_gc*, %struct.VEC_edge_gc*, i8*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_il_dependent, %struct.tree_node*, %struct.edge_prediction*, i64, i32, i32, i32, i32 } > + %struct.basic_block_il_dependent = type { %struct.rtl_bb_info* } > + %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, [2 x i64] } > + %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, i32, %struct.bitmap_obstack* } > + %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack } > + %struct.block_symbol = type { [3 x %struct.rtunion], %struct.object_block*, i64 } > + %struct.c_arg_info = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i8 } > + %struct.c_language_function = type { %struct.stmt_tree_s } > + %struct.c_switch = type opaque > + %struct.control_flow_graph = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.VEC_basic_block_gc*, i32, i32, i32, %struct.VEC_basic_block_gc*, i32 } > + %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, i8*, %struct.location_t*, i32, i32, i64, i32 } > + %struct.edge_def_insns = type { %struct.rtx_def* } > + %struct.edge_prediction = type opaque > + %struct.eh_status = type opaque > + %struct.emit_status = type { i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, i32, %struct.location_t, i32, i8*, %struct.rtx_def** } > + %struct.et_node = type opaque > + %struct.expr_status = type { i32, i32, i32, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* } > + %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.control_flow_graph*, %struct.tree_node*, %struct.function*, i32, i32, i32, i32, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, i8, i32, i64, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.VEC_temp_slot_p_gc*, %struct.temp_slot*, %struct.var_refs_queue*, i32, i32, i32, i32, %struct.machine_function*, i32, i32, %struct.language_function*, %struct.htab*, %struct.rtx_def*, i32, i32, i32, %struct.location_t, %struct.VEC_tree_gc*, %struct.tree_node*, i8*, i8*, i8*, i8*, i8*, %struct.tree_node*, i8, i8, i8, i8, i8, i8 } > + %struct.htab = type { i32 (i8*)*, i32 (i8*, i8*)*, void (i8*)*, i8**, i64, i64, i64, i32, i32, i8* (i64, i64)*, void (i8*)*, i8*, i8* (i8*, i64, i64)*, void (i8*, i8*)*, i32 } > + %struct.initial_value_struct = type opaque > + %struct.lang_decl = type { i8 } > + %struct.language_function = type { %struct.c_language_function, %struct.tree_node*, %struct.tree_node*, %struct.c_switch*, %struct.c_arg_info*, i32, i32, i32, i32 } > + %struct.location_t = type { i8*, i32 } > + %struct.loop = type opaque > + %struct.machine_function = type { %struct.stack_local_entry*, i8*, %struct.rtx_def*, i32, i32, [4 x i32], i32, i32, i32 } > + %struct.object_block = type { %struct.section*, i32, i64, %struct.VEC_rtx_gc*, %struct.VEC_rtx_gc* } > + %struct.obstack = type { i64, %struct._obstack_chunk*, i8*, i8*, i8*, i64, i32, %struct._obstack_chunk* (i8*, i64)*, void (i8*, %struct._obstack_chunk*)*, i8*, i8 } > + %struct.omp_clause_subcode = type { i32 } > + %struct.rtl_bb_info = type { %struct.rtx_def*, %struct.rtx_def*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, %struct.rtx_def*, %struct.rtx_def*, i32 } > + %struct.rtunion = type { i8* } > + %struct.rtx_def = type { i16, i8, i8, %struct.u } > + %struct.section = type { %struct.unnamed_section } > + %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* } > + %struct.stack_local_entry = type opaque > + %struct.stmt_tree_s = type { %struct.tree_node*, i32 } > + %struct.temp_slot = type opaque > + %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %union.tree_ann_d*, i8, i8, i8, i8, i8 } > + %struct.tree_decl_common = type { %struct.tree_decl_minimal, %struct.tree_node*, i8, i8, i8, i8, i8, i32, i32, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, i64, %struct.lang_decl* } > + %struct.tree_decl_minimal = type { %struct.tree_common, %struct.location_t, i32, %struct.tree_node*, %struct.tree_node* } > + %struct.tree_decl_non_common = type { %struct.tree_decl_with_vis, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node* } > + %struct.tree_decl_with_rtl = type { %struct.tree_decl_common, %struct.rtx_def*, i32 } > + %struct.tree_decl_with_vis = type { %struct.tree_decl_with_rtl, %struct.tree_node*, %struct.tree_node*, i8, i8, i8, i8 } > + %struct.tree_function_decl = type { %struct.tree_decl_non_common, i32, i8, i8, i64, %struct.function* } > + %struct.tree_node = type { %struct.tree_function_decl } > + %struct.u = type { %struct.block_symbol } > + %struct.unnamed_section = type { %struct.omp_clause_subcode, void (i8*)*, i8*, %struct.section* } > + %struct.var_refs_queue = type { %struct.rtx_def*, i32, i32, %struct.var_refs_queue* } > + %struct.varasm_status = type opaque > + %union.tree_ann_d = type opaque > + at .str1 = external constant [31 x i8] ; <[31 x i8]*> [#uses=1] > + at integer_types = external global [11 x %struct.tree_node*] ; <[11 x %struct.tree_node*]*> [#uses=1] > + at __FUNCTION__.31164 = external constant [23 x i8], align 16 ; <[23 x i8]*> [#uses=1] > + at llvm.used = appending global [1 x i8*] [ i8* bitcast (i32 (i32, i32)* @c_common_type_for_size to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] > + > +define i32 @c_common_type_for_size(i32 %bits, i32 %unsignedp) nounwind { > +entry: > + %0 = load %struct.tree_node** getelementptr ([11 x %struct.tree_node*]* @integer_types, i32 0, i64 5), align 8 ; <%struct.tree_node*> [#uses=1] > + br i1 false, label %bb16, label %bb > + > +bb: ; preds = %entry > + tail call void @tree_class_check_failed(%struct.tree_node* %0, i32 2, i8* getelementptr ([31 x i8]* @.str1, i32 0, i64 0), i32 1785, i8* getelementptr ([23 x i8]* @__FUNCTION__.31164, i32 0, i32 0)) noreturn nounwind > + unreachable > + > +bb16: ; preds = %entry > + %tmp = add i32 %bits, %unsignedp ; [#uses=1] > + ret i32 %tmp > +} > + > +declare void @tree_class_check_failed(%struct.tree_node*, i32, i8*, i32, i8*) noreturn > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From monping at apple.com Mon Jan 12 23:42:44 2009 From: monping at apple.com (Mon Ping Wang) Date: Mon, 12 Jan 2009 21:42:44 -0800 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes Message-ID: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> This patch is to fix an assert that we get for the test case below Assertion failed: (N->getNodeId() != DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != DAGTypeLegalizer::Processed && "Invalid node ID for RAUW analysis!"), function ReplaceValue In the DAG, we get is something like %tmp1 = extract_subvector <2 x double> %tmp0, <4 x double> %vec, 0 %tmp2 = extract_element <2 x double> %tmp1, 0 %tmp3 = extract_element <2 x double> %tmp1, 1 %tmp4 = build_vector<4 x double> %tmp2, %tmp3, %tmp?, %tmp? We discover when examining the operands of %tmp1 that %vec is not a legal type and we split it. This causes us to replace all uses of %tmp1 which triggers us update %tmp2 and %tmp3 and then update the %tmp4. The problem is that when we do the update, we will add %tmp4 node twice to UpdateListener (NodesToAnalyze) i..e, we add it when we process %tmp2 and again for %tmp3. When walking through the nodes to reanalyze, the first time we see %tmp4, we update the NodeId to the NewNode. When we encounter the node again through the list, we hit the assertion since we have already updated that Node. The following patch fixes this by changing NodesToAnalyze from SmallVector to use SmallPtrSet to avoid duplicates. Please let me know of any comments. Thanks, -- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: legalize.patch Type: application/octet-stream Size: 2397 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090112/b0471de5/attachment.obj -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: vec_shuffle-29.ll Type: application/octet-stream Size: 11955 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090112/b0471de5/attachment-0001.obj From resistor at mac.com Tue Jan 13 00:05:10 2009 From: resistor at mac.com (Owen Anderson) Date: Tue, 13 Jan 2009 06:05:10 -0000 Subject: [llvm-commits] [llvm] r62150 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Message-ID: <200901130605.n0D65A2M031333@zion.cs.uiuc.edu> Author: resistor Date: Tue Jan 13 00:05:10 2009 New Revision: 62150 URL: http://llvm.org/viewvc/llvm-project?rev=62150&view=rev Log: Fix fallout from r62144. Evan, please double check this. Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=62150&r1=62149&r2=62150&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Jan 13 00:05:10 2009 @@ -391,6 +391,10 @@ /// computeNumbering - Compute the index numbering. void computeNumbering(); + /// intervalIsInOneMBB - Returns true if the specified interval is entirely + /// within a single basic block. + bool intervalIsInOneMBB(const LiveInterval &li) const; + private: /// computeIntervals - Compute live intervals. void computeIntervals(); @@ -462,10 +466,6 @@ bool anyKillInMBBAfterIdx(const LiveInterval &li, const VNInfo *VNI, MachineBasicBlock *MBB, unsigned Idx) const; - /// intervalIsInOneMBB - Returns true if the specified interval is entirely - /// within a single basic block. - bool intervalIsInOneMBB(const LiveInterval &li) const; - /// hasAllocatableSuperReg - Return true if the specified physical register /// has any super register that's allocatable. bool hasAllocatableSuperReg(unsigned Reg) const; From evan.cheng at apple.com Tue Jan 13 00:08:38 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 06:08:38 -0000 Subject: [llvm-commits] [llvm] r62151 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200901130608.n0D68crs031439@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jan 13 00:08:37 2009 New Revision: 62151 URL: http://llvm.org/viewvc/llvm-project?rev=62151&view=rev Log: Un-tabify. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62151&r1=62150&r2=62151&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jan 13 00:08:37 2009 @@ -1744,7 +1744,7 @@ // less conservative check. It's possible a sub-register is defined before // v1024 (or live in) and live out of BB1. if (RHS.containsOneValue() && - li_->intervalIsInOneMBB(RHS) && + li_->intervalIsInOneMBB(RHS) && li_->getApproximateInstructionCount(RHS) <= 10) { // Perform a more exhaustive check for some common cases. if (li_->conflictsWithPhysRegRef(RHS, LHS.reg, true, JoinedCopies)) From echeng at apple.com Tue Jan 13 00:08:36 2009 From: echeng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 22:08:36 -0800 Subject: [llvm-commits] [llvm] r62150 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h In-Reply-To: <200901130605.n0D65A2M031333@zion.cs.uiuc.edu> References: <200901130605.n0D65A2M031333@zion.cs.uiuc.edu> Message-ID: <03262753-593F-4D7B-84CC-C1B2AA6E7A07@apple.com> Thanks. Evan On Jan 12, 2009, at 10:05 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Jan 13 00:05:10 2009 > New Revision: 62150 > > URL: http://llvm.org/viewvc/llvm-project?rev=62150&view=rev > Log: > Fix fallout from r62144. Evan, please double check this. > > Modified: > llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h > > Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=62150&r1=62149&r2=62150&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original) > +++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Jan > 13 00:05:10 2009 > @@ -391,6 +391,10 @@ > /// computeNumbering - Compute the index numbering. > void computeNumbering(); > > + /// intervalIsInOneMBB - Returns true if the specified interval > is entirely > + /// within a single basic block. > + bool intervalIsInOneMBB(const LiveInterval &li) const; > + > private: > /// computeIntervals - Compute live intervals. > void computeIntervals(); > @@ -462,10 +466,6 @@ > bool anyKillInMBBAfterIdx(const LiveInterval &li, const VNInfo > *VNI, > MachineBasicBlock *MBB, unsigned Idx) > const; > > - /// intervalIsInOneMBB - Returns true if the specified interval > is entirely > - /// within a single basic block. > - bool intervalIsInOneMBB(const LiveInterval &li) const; > - > /// hasAllocatableSuperReg - Return true if the specified > physical register > /// has any super register that's allocatable. > bool hasAllocatableSuperReg(unsigned Reg) const; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From echeng at apple.com Tue Jan 13 00:08:49 2009 From: echeng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 22:08:49 -0800 Subject: [llvm-commits] [llvm] r62144 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-01-12-CoalescerBug.ll In-Reply-To: <496C1230.2050703@mxc.ca> References: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> <496C1230.2050703@mxc.ca> Message-ID: <8F5A5912-4598-4F30-B511-2377F394DA9D@apple.com> Fixed. Evan On Jan 12, 2009, at 8:01 PM, Nick Lewycky wrote: > Evan Cheng wrote: >> Author: evancheng >> Date: Mon Jan 12 21:57:45 2009 >> New Revision: 62144 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=62144&view=rev >> Log: >> FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is >> copied to a physical register, it's not necessarily defined by a >> copy. We have to watch out it doesn't clobber any sub-register that >> might be live during its live interval. If the live interval >> crosses a basic block, then it's not safe to check with the less >> conservative check (by scanning uses and defs) because it's >> possible a sub-register might be live out of the block. >> >> Added: >> llvm/trunk/test/CodeGen/X86/2009-01-12-CoalescerBug.ll >> Modified: >> llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp >> >> Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62144&r1=62143&r2=62144&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) >> +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jan 12 >> 21:57:45 2009 >> @@ -1731,7 +1731,20 @@ >> // If it's coalescing a virtual register to a physical >> register, estimate >> // its live interval length. This is the *cost* of scanning an >> entire live >> // interval. If the cost is low, we'll do an exhaustive check >> instead. >> + >> + // If this is something like this: >> + // BB1: >> + // v1024 = op >> + // ... >> + // BB2: >> + // ... >> + // RAX = v1024 >> + // >> + // That is, the live interval of v1024 crosses a bb. Then we >> can't rely on >> + // less conservative check. It's possible a sub-register is >> defined before >> + // v1024 (or live in) and live out of BB1. >> if (RHS.containsOneValue() && >> + li_->intervalIsInOneMBB(RHS) && > > Tab! > >> li_->getApproximateInstructionCount(RHS) <= 10) { >> // Perform a more exhaustive check for some common cases. >> if (li_->conflictsWithPhysRegRef(RHS, LHS.reg, true, >> JoinedCopies)) > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From echeng at apple.com Tue Jan 13 00:20:48 2009 From: echeng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 22:20:48 -0800 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> Message-ID: <5211367F-7B96-450A-9189-D9802CF3F30F@apple.com> Traversal of SmallPtrSet elements is non-deterministic. You can use either std::set or add a SmallPtrSet to supplement NodesToAnalyze SmallVector. Evan On Jan 12, 2009, at 9:42 PM, Mon Ping Wang wrote: > This patch is to fix an assert that we get for the test case below > Assertion failed: (N->getNodeId() != > DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != > DAGTypeLegalizer::Processed && "Invalid node ID for RAUW > analysis!"), function ReplaceValue > > In the DAG, we get is something like > > %tmp1 = extract_subvector <2 x double> %tmp0, <4 x double> %vec, 0 > %tmp2 = extract_element <2 x double> %tmp1, 0 > %tmp3 = extract_element <2 x double> %tmp1, 1 > %tmp4 = build_vector<4 x double> %tmp2, %tmp3, %tmp?, %tmp? > > We discover when examining the operands of %tmp1 that %vec is not a > legal type and we split it. This causes us to replace all uses of > %tmp1 which triggers us update %tmp2 and %tmp3 and then update the > %tmp4. The problem is that when we do the update, we will add %tmp4 > node twice to UpdateListener (NodesToAnalyze) i..e, we add it when > we process %tmp2 and again for %tmp3. When walking through the > nodes to reanalyze, the first time we see %tmp4, we update the > NodeId to the NewNode. When we encounter the node again through the > list, we hit the assertion since we have already updated that Node. > > The following patch fixes this by changing NodesToAnalyze from > SmallVector to use SmallPtrSet to avoid duplicates. Please let me > know of any comments. > > Thanks, > -- Mon Ping > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From isanbard at gmail.com Tue Jan 13 00:32:29 2009 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 12 Jan 2009 22:32:29 -0800 Subject: [llvm-commits] [PATCH] SmallEnumSet In-Reply-To: References: <6AEB9DE3-3F4C-4014-94EC-E47974F40487@gmail.com> Message-ID: <3583511B-04C7-4693-BFCE-308B0D44CA29@gmail.com> On Jan 12, 2009, at 12:27 PM, Talin wrote: > Before I begin, I should mention that one of my self-imposed design > constraints > is that the class should be no less efficient than using the > traditional "flags" > idiom. This means that for small sets of flags (less than 32), every > method in > this class should theoretically be optimizable down to a single > machine > instruction, and for larger sets the number of machine instructions > should be > roughly on the order of the number of machine words in the bitset. > > That being said, I have not actually *verified* that this happens - > rather, > based on my (admittedly somewhat incomplete) knowledge of what > optimizers can > and cannot do, I have attempted to apply standard rules of thumb for > writing > optimizable code. Some of those rules of thumb have evolved from > working with > LLVM itself, and may represent an unwarranted level of confidence in > the > compiler's ability to optimize, especially when the compiler isn't > LLVM-based. > > With that in mind, I believe some of my responses below will make > more sense. > That's fine, but once you create it, people will use/abuse it as much as they can. :-) So what was designed to fit into a register would be way too big. >>> This patch contains a new container class, SmallEnumSet, and unit >>> tests for it. >>> >>> SmallEnumSet is inspired by SmallVector and the other "small" sets >>> in ADT. >>> >> From looking at the code, it seems like this is very similar to the >> BitVector. The difference being that the size is known at compile >> time. Is it possible either to use the BitVector or modify >> BitVector's >> implementation so that you know the size at compile time (if that's >> important enough)? > > You would need something like SmallBitVector in order for this to > work. > BitVector *always* allocates memory, whereas SmallEnumSet *never* > does, so the > two are completely different in this respect. > > Having the structure be a fixed size is important for small sets of > flags,because it means that the structure will get passed in a > single machine > register, just as a flags field would be. > I thought about this after I wrote the email. The architecture of what you are doing seems to be there in BitVector already (or could be added to it). It would be preferable if you could reuse the BitVector code in some way. Maybe you could factor out the ivar data part like this: template struct Vec { char BitVec[N]; // ... }; template <> struct Vec<0> { char *BitVec; Vec() : BitVec(0) {} ~Vec() { delete [] BitVec; } // ... }; template class BitVectorImpl { Vec Bits; // ... }; typedef BitVectorImpl<0> BitVector; You would have to modify the places in the current BitVector where it deallocates and/or grows the "Bits" ivar, but it would be a way of getting the size stuff set at compile time. Do you think that this would be sufficient for your needs? (I haven't done tests to see if this change would hurt code size or performance, though I find it unlikely.) >>> The keys of the set are enumeration constants, which range from 0 to >>> some maximum value which is known at compile time. Internally, >>> SmallEnumSet maintains a fixed-length bit vector, so that membership >>> in the set is represented by a single bit per possible key. >>> >> Enumerated values can go from negative to positive. They don't have >> to >> start from 0. > > For enumerations that correspond to a set of flags, having values > less than zero > makes no sense. So my response to that is "don't do that". > Okay. This is less like a "set" to me and more like your "flags" description. I think that a change in name would help things along. Either with using BitVector or something else. >>> ? It has a set-like interface, so you can use "add", "contains" and >>> other set methods. >> >> The std::set doesn't use "add" or "contains". If you're going to call >> this a set, you should use the same nomenclature: e.g. "insert", >> "find". You should also have an "iterator" associated with this class >> to keep things consistent. > > Sorry, for some reason I was following the Java set protocol rather > than the C++ > one. Habit I guess. > :-) > You would probably want "test" (which returns a bool) rather than > "find" (which > returns an iterator). > Sure. I think that BitVector uses "test". >>> At the same time, SmallEnumSet retains many of the advantages of an >>> integer flags field - it allocates no memory, and can efficiently be >>> passed or returned by value between functions. >> >> This is only true if the size of the enum set is small enough that >> the >> array holding the values can be passed back efficiently (without >> calling memcpy or something similar). > > Agreed, however in practice I don't think this is a problem. > > Large collections of booleans are fairly rare; Of the ones that > exist, most are > either sparse (in which case a bit vector is not the best > representation), or > have keys which are not known at compile time or are otherwise > unbounded (in > which case, BitVector is a better choice). > > For those rare cases where this class makes sense, I think it is > best to let the > application programmer make the decision as to whether the set > should be passed > by reference or by value - by choosing whether to pass the value or > the address > between methods. > > Mainly, I expect this class to be used for fairly small sets, but I > don't want > the programmer to have to switch to a different representation if > the number of > flags bits grows to larger than 32. > Alright. Just as long as it's clear that passing by value may not be a win in all situations. >> + bool empty() const { >> + for (unsigned i = 0; i < NumWords; ++i) { >> + if (bits[i] != 0) { >> + return false; >> + } >> + } >> + >> + return true; >> + } >> >> empty() should really execute in constant time. Maybe you could >> rename >> it. BitVector uses "none()" and "any()". > > Well, it does execute in constant time(), because NumWords is a > constant :) More > seriously, I'm assuming that the compiler will unroll this loop, > especially in > the most common case where NumWords == 1. > You should check this out to make sure. I would still like to see it be O(1) for all values, though. >> + bool containsAll(const SmallEnumSet & in) const { >> + for (unsigned i = 0; i < NumWords; ++i) { >> + if ((~bits[i] & in.bits[i]) != 0) { >> + return false; >> + } >> + } >> + >> + return true; >> + } >> >> How is this different from "operator==()"? > > It's not the same - this method is a subset test, it returns true if > 'in' is a > subset of 'this'. > I see. >> + SmallEnumSet & addRange(EnumType first, EnumType last) { >> + unsigned firstWord = wordForIndex(first); >> + unsigned lastWord = wordForIndex(last); >> + if (firstWord == lastWord) { >> + bits[firstWord] |= maskForIndex(first) & ~maskForIndex(last); >> + } else { >> + bits[firstWord] |= maskForIndex(first); >> + for (unsigned i = firstWord + 1; i < lastWord; ++i) { >> + bits[i] = -1; >> + } >> + bits[lastWord] |= ~maskForIndex(last); >> + } >> + >> + return * this; >> + } >> >> Same comment above. Call this "insert", etc. This should probably >> take >> iterators. > > Unfortunately, there's no efficient way to implement iterators with > a bit vector > - advancing an iterator requires examining every potential bit to > determine > whether its on or off, so that you can skip over the ones that are > off (i.e. not > in the set.) > > Also, I don't believe that there's a compelling practical use case > for iterating > over a set like this. > That's kind of the downfall of calling this a "set". :-) >> + static SmallEnumSet noneOf() { >> + return SmallEnumSet(); >> + } >> >> This name isn't very informative. What does this mean? > > It was supposed to return the empty set. > Why not just name it "emptySet" or something? >> + static SmallEnumSet of(EnumType v0) { >> + return SmallEnumSet().add(v0); >> + } >> + >> ... >> + static SmallEnumSet of( >> + EnumType v0, EnumType v1, EnumType v2, EnumType v3, EnumType >> v4, >> + EnumType v5, EnumType v6, EnumType v7, EnumType v8, EnumType >> v9) { >> + return >> SmallEnumSet().add(v0).add(v1).add(v2).add(v3).add(v4).add(v5) >> + .add(v6).add(v7).add(v8).add(v9); >> + } >> >> Yikes! Please don't do this. Use "inserts" instead that loop over a >> vector of values or something similar. > > I want to avoid a loop because the most common use case for this > method is in > constructing constants. For example, constructing a mask: > > static Atttributes METHOD_ATTRS = Attributes.of( > InlineAttr, ExternAttr, IntrinsicAttr, PureAttr, > ConstructorAttr); > > The compiler should inline all of the calls to "add": > > this = SmallEnumSet(); > this.bits[0] |= k0; > this.bits[0] |= k1; > this.bits[0] |= k2; > this.bits[0] |= k3; > this.bits[0] |= k4; > this.bits[0] |= k5; > this.bits[0] |= k6; > this.bits[0] |= k7; > this.bits[0] |= k8; > this.bits[0] |= k9; > > And then should combine all of the constants: > > this = SmallEnumSet(); > this.bits[0] |= (k0 | k1 | k2 | k3 | k4 | k5 | k6 | k7 | k8 | k9); > > So in the end, all that happens (hopefully) is we are assigning a > constant > integer to a symbol. > We have a precedent for this with the Machine Instruction builder. We do something like: BuildMI( ... ).add(...).add(...) etc. It doesn't look glamorous, but it keeps us from having to create methods with arbitrarily long lists of parameters. And the compiler should be able to optimize the code in the same manner. >> + friend SmallEnumSet operator |( >> + const SmallEnumSet & a, const SmallEnumSet & b) { >> + return unionOf(a, b); >> + } >> + >> + friend SmallEnumSet operator &( >> + const SmallEnumSet & a, const SmallEnumSet & b) { >> + return SmallEnumSet(a).intersectWith(b); >> + } >> >> Is it necessary to make these "friend" methods? They seem to use >> publicly accessible methods. (I haven't tried to compile them without >> the friend keyword, so I don't know.) > > They don't have to be - I'm just following what I thought was a > standard idiom > for non-member operator definitions. ('friend' forces the function > to be a > non-member.) It only needs to be a friend if it has to access the internal data structures. Otherwise, it's best just to define these methods outside of the class. If they're in the header file, they need to be marked "inline". -bw From clattner at apple.com Tue Jan 13 01:06:51 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:06:51 -0800 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: <5211367F-7B96-450A-9189-D9802CF3F30F@apple.com> References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> <5211367F-7B96-450A-9189-D9802CF3F30F@apple.com> Message-ID: On Jan 12, 2009, at 10:20 PM, Evan Cheng wrote: > Traversal of SmallPtrSet elements is non-deterministic. You can use > either std::set or add a SmallPtrSet to supplement NodesToAnalyze > SmallVector. std::set of a pointer is also nondeterministic. SetVector should work though, -Chris From clattner at apple.com Tue Jan 13 01:09:29 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:09:29 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> Message-ID: <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> On Jan 12, 2009, at 5:18 PM, Dan Gohman wrote: > Hi Chris, > > The recent 176.gcc JIT regression on darwin x86-32 isolated down to > this commit. Can you investigate? Absolutely. -Chris > > > Thanks, > > Dan > > On Jan 8, 2009, at 11:47 PM, Chris Lattner wrote: > >> Author: lattner >> Date: Fri Jan 9 01:47:06 2009 >> New Revision: 61985 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=61985&view=rev >> Log: >> Implement rdar://6480391, extending of equality icmp's to avoid a >> truncation. >> I noticed this in the code compiled for a routine using std::map, >> which produced >> this code: >> %25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind >> readonly >> %.lobit.i = lshr i32 %25, 31 ; [#uses=1] >> %tmp.i = trunc i32 %.lobit.i to i8 ; [#uses=1] >> %toBool = icmp eq i8 %tmp.i, 0 ; [#uses=1] >> br i1 %toBool, label %bb3, label %bb4 >> which compiled to: >> >> call L_memcmp$stub >> shrl $31, %eax >> testb %al, %al >> jne LBB1_11 ## >> >> with this change, we compile it to: >> >> call L_memcmp$stub >> testl %eax, %eax >> js LBB1_11 >> >> This triggers all the time in common code, with patters like this: >> >> %169 = and i32 %ply, 1 ; [#uses=1] >> %170 = trunc i32 %169 to i8 ; [#uses=1] >> %toBool = icmp ne i8 %170, 0 ; [#uses=1] >> >> %7 = lshr i32 %6, 24 ; [#uses=1] >> %9 = trunc i32 %7 to i8 ; [#uses=1] >> %10 = icmp ne i8 %9, 0 ; [#uses=1] >> >> etc >> >> >> Modified: >> llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >> llvm/trunk/test/Transforms/InstCombine/cast.ll >> llvm/trunk/test/Transforms/InstCombine/icmp.ll >> >> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=61985&r1=61984&r2=61985&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >> (original) >> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri >> Jan 9 01:47:06 2009 >> @@ -6343,6 +6343,28 @@ >> const APInt &RHSV = RHS->getValue(); >> >> switch (LHSI->getOpcode()) { >> + case Instruction::Trunc: >> + if (ICI.isEquality() && LHSI->hasOneUse()) { >> + // Simplify icmp eq (trunc x to i8), 42 -> icmp eq x, 42| >> highbits if all >> + // of the high bits truncated out of x are known. >> + unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(), >> + SrcBits = LHSI->getOperand(0)->getType()- >>> getPrimitiveSizeInBits(); >> + APInt Mask(APInt::getHighBitsSet(SrcBits, SrcBits-DstBits)); >> + APInt KnownZero(SrcBits, 0), KnownOne(SrcBits, 0); >> + ComputeMaskedBits(LHSI->getOperand(0), Mask, KnownZero, >> KnownOne); >> + >> + // If all the high bits are known, we can do this xform. >> + if ((KnownZero|KnownOne).countLeadingOnes() >= SrcBits- >> DstBits) { >> + // Pull in the high bits from known-ones set. >> + APInt NewRHS(RHS->getValue()); >> + NewRHS.zext(SrcBits); >> + NewRHS |= KnownOne; >> + return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), >> + ConstantInt::get(NewRHS)); >> + } >> + } >> + break; >> + >> case Instruction::Xor: // (icmp pred (xor X, XorCST), CI) >> if (ConstantInt *XorCST = dyn_cast(LHSI- >>> getOperand(1))) { >> // If this is a comparison that tests the signbit (X < 0) or >> (x > -1), >> >> Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=61985&r1=61984&r2=61985&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/Transforms/InstCombine/cast.ll (original) >> +++ llvm/trunk/test/Transforms/InstCombine/cast.ll Fri Jan 9 >> 01:47:06 2009 >> @@ -1,7 +1,5 @@ >> ; Tests to make sure elimination of casts is working correctly >> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ >> -; RUN: grep %c | notcast >> -; END. >> +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c | >> notcast >> >> @inbuf = external global [32832 x i8] ; <[32832 x i8]*> >> [#uses=1] >> >> @@ -238,3 +236,21 @@ >> ret i16 %c2 >> } >> >> +; icmp sgt i32 %a, -1 >> +; rdar://6480391 >> +define i1 @test36(i32 %a) { >> + %b = lshr i32 %a, 31 >> + %c = trunc i32 %b to i8 >> + %d = icmp eq i8 %c, 0 >> + ret i1 %d >> +} >> + >> +; ret i1 false >> +define i1 @test37(i32 %a) { >> + %b = lshr i32 %a, 31 >> + %c = or i32 %b, 512 >> + %d = trunc i32 %c to i8 >> + %e = icmp eq i8 %d, 11 >> + ret i1 %e >> +} >> + >> >> Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=61985&r1=61984&r2=61985&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original) >> +++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Fri Jan 9 >> 01:47:06 2009 >> @@ -1,5 +1,4 @@ >> ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp >> -; END. >> >> define i32 @test1(i32 %X) { >> entry: >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue Jan 13 01:22:23 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Jan 2009 07:22:23 -0000 Subject: [llvm-commits] [llvm] r62155 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Message-ID: <200901130722.n0D7MNPC001387@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 13 01:22:22 2009 New Revision: 62155 URL: http://llvm.org/viewvc/llvm-project?rev=62155&view=rev Log: make -march=cpp handle the nocapture attribute, make it assert if it sees attributes it doesn't know. Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=62155&r1=62154&r2=62155&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Tue Jan 13 01:22:22 2009 @@ -450,28 +450,25 @@ unsigned index = PAL.getSlot(i).Index; Attributes attrs = PAL.getSlot(i).Attrs; Out << "PAWI.Index = " << index << "U; PAWI.Attrs = 0 "; - if (attrs & Attribute::SExt) - Out << " | Attribute::SExt"; - if (attrs & Attribute::ZExt) - Out << " | Attribute::ZExt"; - if (attrs & Attribute::StructRet) - Out << " | Attribute::StructRet"; - if (attrs & Attribute::InReg) - Out << " | Attribute::InReg"; - if (attrs & Attribute::NoReturn) - Out << " | Attribute::NoReturn"; - if (attrs & Attribute::NoUnwind) - Out << " | Attribute::NoUnwind"; - if (attrs & Attribute::ByVal) - Out << " | Attribute::ByVal"; - if (attrs & Attribute::NoAlias) - Out << " | Attribute::NoAlias"; - if (attrs & Attribute::Nest) - Out << " | Attribute::Nest"; - if (attrs & Attribute::ReadNone) - Out << " | Attribute::ReadNone"; - if (attrs & Attribute::ReadOnly) - Out << " | Attribute::ReadOnly"; +#define HANDLE_ATTR(X) \ + if (attrs & Attribute::X) \ + Out << " | Attribute::" #X; \ + attrs &= ~Attribute::X; + + HANDLE_ATTR(SExt); + HANDLE_ATTR(ZExt); + HANDLE_ATTR(StructRet); + HANDLE_ATTR(InReg); + HANDLE_ATTR(NoReturn); + HANDLE_ATTR(NoUnwind); + HANDLE_ATTR(ByVal); + HANDLE_ATTR(NoAlias); + HANDLE_ATTR(Nest); + HANDLE_ATTR(ReadNone); + HANDLE_ATTR(ReadOnly); + HANDLE_ATTR(NoCapture); +#undef HANDLE_ATTR + assert(attrs == 0 && "Unhandled attribute!"); Out << ";"; nl(Out); Out << "Attrs.push_back(PAWI);"; From clattner at apple.com Tue Jan 13 01:22:54 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:22:54 -0800 Subject: [llvm-commits] [llvm] r62071 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp utils/TableGen/IntrinsicEmitter.cpp In-Reply-To: <496BD07B.7000402@lip6.fr> References: <200901120241.n0C2fbvx026680@zion.cs.uiuc.edu> <496BD07B.7000402@lip6.fr> Message-ID: <47C34E25-1A4A-4EE8-BD7B-DB7248229A13@apple.com> On Jan 12, 2009, at 3:21 PM, Nicolas Geoffray wrote: > Hi Chris, > > This patch is making llc -march=cpp output invalid LLVM C++ API code. > When compiling a .ll file with only: > > declare void @llvm.memcpy.i32(i8 *, i8 *, i32, i32) > > llc -march=cpp outputs: > > SmallVector Attrs; > AttributeWithIndex PAWI; > PAWI.Index = 1U; PAWI.Attrs = 0 ; > Attrs.push_back(PAWI); > PAWI.Index = 2U; PAWI.Attrs = 0 ; > Attrs.push_back(PAWI); > PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; > Attrs.push_back(PAWI); > func_llvm_memcpy_i32_PAL = AttrListPtr::get(Attrs.begin(), > Attrs.end()); > > > Which gives an assertion error when being executed: > Assertion failed: (Attrs[i].Attrs != Attribute::None && "Pointless > attribute!"), function get, file Attributes.cpp, line 136. Hi Nicolas, This looks like a latent bug in -march=cpp. Please see if r62155 fixes it for you, -Chris From clattner at apple.com Tue Jan 13 01:32:06 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:32:06 -0800 Subject: [llvm-commits] [llvm] r62125 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp In-Reply-To: <200901130020.n0D0KpvA019669@zion.cs.uiuc.edu> References: <200901130020.n0D0KpvA019669@zion.cs.uiuc.edu> Message-ID: On Jan 12, 2009, at 4:20 PM, Devang Patel wrote: > Author: dpatel > Date: Mon Jan 12 18:20:51 2009 > New Revision: 62125 > > URL: http://llvm.org/viewvc/llvm-project?rev=62125&view=rev > Log: > Start using DebugInfo API to emit debug info. Ok, nice progress! > > if (!Slot) { > // FIXME - breaks down when the context is an inlined function. > DIDescriptor ParentDesc; > - DIDescriptor *DB = new DIBlock(V); > + DIDescriptor *DB = new DIDescriptor(V); Why are you 'new'ing these things? The descriptors are meant to be very light-weight objects that are just handles on existing global variable descriptors. There should be no reason to new them, just create (through various methods on DIFactory) new global variable descriptors themselves. -Chris From clattner at apple.com Tue Jan 13 01:36:34 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:36:34 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r62109 - in /llvm-gcc-4.2/trunk/gcc: llvm-debug.cpp llvm-debug.h In-Reply-To: <200901122227.n0CMR1qi015183@zion.cs.uiuc.edu> References: <200901122227.n0CMR1qi015183@zion.cs.uiuc.edu> Message-ID: <456F4C5C-7063-43DF-A7FC-508F28122859@apple.com> On Jan 12, 2009, at 2:27 PM, Devang Patel wrote: > Author: dpatel > Date: Mon Jan 12 16:27:00 2009 > New Revision: 62109 > > URL: http://llvm.org/viewvc/llvm-project?rev=62109&view=rev > Log: > Do not generate multiple compile_unit, it has many issues in current > implementation. The code generator is not set up to handle multiple > complete or partial compile_units as per dwarf specification. On > darwin, the tool chain expects one compile_unit per .o file. FWIW, I completely agree with this change. I think it makes a lot more sense to focus on being as good as GCC's debug info (even if buggy and not optimal) and then try to improve on it as a separate step. Trying to represent headers as their own compile units sounds great, but causes lots of problems in practice. -Chris From echeng at apple.com Tue Jan 13 01:39:54 2009 From: echeng at apple.com (Evan Cheng) Date: Mon, 12 Jan 2009 23:39:54 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> Message-ID: <88EE2695-E7AC-474B-B812-5409F69F1088@apple.com> I think it's failing in a lazy compilation callback. Dan, is that right? Evan On Jan 12, 2009, at 11:09 PM, Chris Lattner wrote: > > On Jan 12, 2009, at 5:18 PM, Dan Gohman wrote: > >> Hi Chris, >> >> The recent 176.gcc JIT regression on darwin x86-32 isolated down to >> this commit. Can you investigate? > > Absolutely. > > -Chris > >> >> >> Thanks, >> >> Dan >> >> On Jan 8, 2009, at 11:47 PM, Chris Lattner wrote: >> >>> Author: lattner >>> Date: Fri Jan 9 01:47:06 2009 >>> New Revision: 61985 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=61985&view=rev >>> Log: >>> Implement rdar://6480391, extending of equality icmp's to avoid a >>> truncation. >>> I noticed this in the code compiled for a routine using std::map, >>> which produced >>> this code: >>> %25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind >>> readonly >>> %.lobit.i = lshr i32 %25, 31 ; [#uses=1] >>> %tmp.i = trunc i32 %.lobit.i to i8 ; [#uses=1] >>> %toBool = icmp eq i8 %tmp.i, 0 ; [#uses=1] >>> br i1 %toBool, label %bb3, label %bb4 >>> which compiled to: >>> >>> call L_memcmp$stub >>> shrl $31, %eax >>> testb %al, %al >>> jne LBB1_11 ## >>> >>> with this change, we compile it to: >>> >>> call L_memcmp$stub >>> testl %eax, %eax >>> js LBB1_11 >>> >>> This triggers all the time in common code, with patters like this: >>> >>> %169 = and i32 %ply, 1 ; [#uses=1] >>> %170 = trunc i32 %169 to i8 ; [#uses=1] >>> %toBool = icmp ne i8 %170, 0 ; [#uses=1] >>> >>> %7 = lshr i32 %6, 24 ; [#uses=1] >>> %9 = trunc i32 %7 to i8 ; [#uses=1] >>> %10 = icmp ne i8 %9, 0 ; [#uses=1] >>> >>> etc >>> >>> >>> Modified: >>> llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>> llvm/trunk/test/Transforms/InstCombine/cast.ll >>> llvm/trunk/test/Transforms/InstCombine/icmp.ll >>> >>> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=61985&r1=61984&r2=61985&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>> (original) >>> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri >>> Jan 9 01:47:06 2009 >>> @@ -6343,6 +6343,28 @@ >>> const APInt &RHSV = RHS->getValue(); >>> >>> switch (LHSI->getOpcode()) { >>> + case Instruction::Trunc: >>> + if (ICI.isEquality() && LHSI->hasOneUse()) { >>> + // Simplify icmp eq (trunc x to i8), 42 -> icmp eq x, 42| >>> highbits if all >>> + // of the high bits truncated out of x are known. >>> + unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(), >>> + SrcBits = LHSI->getOperand(0)->getType()- >>>> getPrimitiveSizeInBits(); >>> + APInt Mask(APInt::getHighBitsSet(SrcBits, SrcBits-DstBits)); >>> + APInt KnownZero(SrcBits, 0), KnownOne(SrcBits, 0); >>> + ComputeMaskedBits(LHSI->getOperand(0), Mask, KnownZero, >>> KnownOne); >>> + >>> + // If all the high bits are known, we can do this xform. >>> + if ((KnownZero|KnownOne).countLeadingOnes() >= SrcBits- >>> DstBits) { >>> + // Pull in the high bits from known-ones set. >>> + APInt NewRHS(RHS->getValue()); >>> + NewRHS.zext(SrcBits); >>> + NewRHS |= KnownOne; >>> + return new ICmpInst(ICI.getPredicate(), LHSI- >>> >getOperand(0), >>> + ConstantInt::get(NewRHS)); >>> + } >>> + } >>> + break; >>> + >>> case Instruction::Xor: // (icmp pred (xor X, XorCST), CI) >>> if (ConstantInt *XorCST = dyn_cast(LHSI- >>>> getOperand(1))) { >>> // If this is a comparison that tests the signbit (X < 0) or >>> (x > -1), >>> >>> Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=61985&r1=61984&r2=61985&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/test/Transforms/InstCombine/cast.ll (original) >>> +++ llvm/trunk/test/Transforms/InstCombine/cast.ll Fri Jan 9 >>> 01:47:06 2009 >>> @@ -1,7 +1,5 @@ >>> ; Tests to make sure elimination of casts is working correctly >>> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ >>> -; RUN: grep %c | notcast >>> -; END. >>> +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c | >>> notcast >>> >>> @inbuf = external global [32832 x i8] ; <[32832 x i8]*> >>> [#uses=1] >>> >>> @@ -238,3 +236,21 @@ >>> ret i16 %c2 >>> } >>> >>> +; icmp sgt i32 %a, -1 >>> +; rdar://6480391 >>> +define i1 @test36(i32 %a) { >>> + %b = lshr i32 %a, 31 >>> + %c = trunc i32 %b to i8 >>> + %d = icmp eq i8 %c, 0 >>> + ret i1 %d >>> +} >>> + >>> +; ret i1 false >>> +define i1 @test37(i32 %a) { >>> + %b = lshr i32 %a, 31 >>> + %c = or i32 %b, 512 >>> + %d = trunc i32 %c to i8 >>> + %e = icmp eq i8 %d, 11 >>> + ret i1 %e >>> +} >>> + >>> >>> Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=61985&r1=61984&r2=61985&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original) >>> +++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Fri Jan 9 >>> 01:47:06 2009 >>> @@ -1,5 +1,4 @@ >>> ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp >>> -; END. >>> >>> define i32 @test1(i32 %X) { >>> entry: >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Tue Jan 13 01:43:51 2009 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Jan 2009 07:43:51 -0000 Subject: [llvm-commits] [llvm] r62158 - in /llvm/trunk: include/llvm/ADT/ilist.h include/llvm/Instruction.h lib/VMCore/Instruction.cpp Message-ID: <200901130743.n0D7hpD5002157@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 13 01:43:51 2009 New Revision: 62158 URL: http://llvm.org/viewvc/llvm-project?rev=62158&view=rev Log: add a new insertAfter method, patch by Tom Jablin! Modified: llvm/trunk/include/llvm/ADT/ilist.h llvm/trunk/include/llvm/Instruction.h llvm/trunk/lib/VMCore/Instruction.cpp Modified: llvm/trunk/include/llvm/ADT/ilist.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=62158&r1=62157&r2=62158&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/ilist.h (original) +++ llvm/trunk/include/llvm/ADT/ilist.h Tue Jan 13 01:43:51 2009 @@ -384,6 +384,13 @@ return New; } + iterator insertAfter(iterator where, NodeTy *New) { + if (empty()) + return insert(begin(), New); + else + return insert(++where, New); + } + NodeTy *remove(iterator &IT) { assert(IT != end() && "Cannot remove end of list!"); NodeTy *Node = &*IT; Modified: llvm/trunk/include/llvm/Instruction.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=62158&r1=62157&r2=62158&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.h (original) +++ llvm/trunk/include/llvm/Instruction.h Tue Jan 13 01:43:51 2009 @@ -101,6 +101,10 @@ /// immediately before the specified instruction. void insertBefore(Instruction *InsertPos); + /// insertAfter - Insert an unlinked instructions into a basic block + /// immediately after the specified instruction. + void insertAfter(Instruction *InsertPos); + /// moveBefore - Unlink this instruction from its current basic block and /// insert it into the basic block that MovePos lives in, right before /// MovePos. Modified: llvm/trunk/lib/VMCore/Instruction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instruction.cpp?rev=62158&r1=62157&r2=62158&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Instruction.cpp (original) +++ llvm/trunk/lib/VMCore/Instruction.cpp Tue Jan 13 01:43:51 2009 @@ -74,6 +74,12 @@ InsertPos->getParent()->getInstList().insert(InsertPos, this); } +/// insertAfter - Insert an unlinked instructions into a basic block +/// immediately after the specified instruction. +void Instruction::insertAfter(Instruction *InsertPos) { + InsertPos->getParent()->getInstList().insertAfter(InsertPos, this); +} + /// moveBefore - Unlink this instruction from its current basic block and /// insert it into the basic block that MovePos lives in, right before /// MovePos. From clattner at apple.com Tue Jan 13 01:57:05 2009 From: clattner at apple.com (Chris Lattner) Date: Mon, 12 Jan 2009 23:57:05 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <88EE2695-E7AC-474B-B812-5409F69F1088@apple.com> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> <88EE2695-E7AC-474B-B812-5409F69F1088@apple.com> Message-ID: <7AA146BC-D736-48BB-A2EE-3BDA63C88686@apple.com> On Jan 12, 2009, at 11:39 PM, Evan Cheng wrote: > I think it's failing in a lazy compilation callback. Dan, is that > right? I'm seeing a miscompilation. Working on it. -Chris From baldrick at free.fr Tue Jan 13 01:57:28 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 08:57:28 +0100 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll In-Reply-To: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> References: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> Message-ID: <200901130857.29043.baldrick@free.fr> Hi Dale, > @@ -180,14 +180,12 @@ > Function *Callee = CS.getCalledFunction(); > Function *Caller = TheCall->getParent()->getParent(); > > - // Don't inline a directly recursive call. > - if (Caller == Callee || > // Don't inline functions which can be redefined at link-time to mean > // something else. > // FIXME: We allow link-once linkage since in practice all versions of > // the function have the same body (C++ ODR) - but the LLVM definition > // of LinkOnceLinkage doesn't require this. > - (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || > + if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || the comment (containing the FIXME) is now indented funny. Also, it is probably OK to inline a function with weak linkage (mayBeOverridden) into itself. Ciao, Duncan. From baldrick at free.fr Tue Jan 13 02:11:20 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 09:11:20 +0100 Subject: [llvm-commits] [llvm] r62144 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/X86/2009-01-12-CoalescerBug.ll In-Reply-To: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> References: <200901130357.n0D3vjQ1026930@zion.cs.uiuc.edu> Message-ID: <200901130911.20909.baldrick@free.fr> Hi Evan, > FIX llvm-gcc bootstrap on x86_64 linux. If a virtual register is copied to a physical register, it's not necessarily defined by a copy. We have to watch out it doesn't clobber any sub-register that might be live during its live interval. If the live interval crosses a basic block, then it's not safe to check with the less conservative check (by scanning uses and defs) because it's possible a sub-register might be live out of the block. thanks for fixing this. I don't know how you managed to work out what was going wrong - maybe your spider-sense helped :) Ciao, Duncan. From baldrick at free.fr Tue Jan 13 02:15:31 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 09:15:31 +0100 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> Message-ID: <200901130915.32203.baldrick@free.fr> Hi Mon Ping, > This patch is to fix an assert that we get for the test case below > Assertion failed: (N->getNodeId() != > DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != > DAGTypeLegalizer::Processed && "Invalid node ID for RAUW > analysis!"), function ReplaceValue > > In the DAG, we get is something like > > %tmp1 = extract_subvector <2 x double> %tmp0, <4 x double> %vec, 0 > %tmp2 = extract_element <2 x double> %tmp1, 0 > %tmp3 = extract_element <2 x double> %tmp1, 1 > %tmp4 = build_vector<4 x double> %tmp2, %tmp3, %tmp?, %tmp? > > We discover when examining the operands of %tmp1 that %vec is not a > legal type and we split it. This causes us to replace all uses of > %tmp1 which triggers us update %tmp2 and %tmp3 and then update the > %tmp4. The problem is that when we do the update, we will add %tmp4 > node twice to UpdateListener (NodesToAnalyze) i..e, we add it when we > process %tmp2 and again for %tmp3. When walking through the nodes to > reanalyze, the first time we see %tmp4, we update the NodeId to the > NewNode. When we encounter the node again through the list, we hit > the assertion since we have already updated that Node. > > The following patch fixes this by changing NodesToAnalyze from > SmallVector to use SmallPtrSet to avoid duplicates. Please let me > know of any comments. thanks for looking into this. I used SmallVector in order to make things deterministic - the NodesDeleted set was, as a side-effect, supposed to avoid duplicates IIRC. I will try to analyze this later today. Ciao, Duncan. From monping at apple.com Tue Jan 13 02:16:11 2009 From: monping at apple.com (Mon Ping Wang) Date: Tue, 13 Jan 2009 00:16:11 -0800 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> <5211367F-7B96-450A-9189-D9802CF3F30F@apple.com> Message-ID: Thanks. I'll switch it to use SetVector. -- Mon Ping On Jan 12, 2009, at 11:06 PM, Chris Lattner wrote: > > On Jan 12, 2009, at 10:20 PM, Evan Cheng wrote: > >> Traversal of SmallPtrSet elements is non-deterministic. You can use >> either std::set or add a SmallPtrSet to supplement NodesToAnalyze >> SmallVector. > > std::set of a pointer is also nondeterministic. SetVector should work > though, > > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From monping at apple.com Tue Jan 13 02:24:11 2009 From: monping at apple.com (Mon Ping Wang) Date: Tue, 13 Jan 2009 00:24:11 -0800 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: <200901130915.32203.baldrick@free.fr> References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> <200901130915.32203.baldrick@free.fr> Message-ID: Hi Duncan, Thanks for the info and looking into this further. -- Mon Ping On Jan 13, 2009, at 12:15 AM, Duncan Sands wrote: > Hi Mon Ping, > >> This patch is to fix an assert that we get for the test case below >> Assertion failed: (N->getNodeId() != >> DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != >> DAGTypeLegalizer::Processed && "Invalid node ID for RAUW >> analysis!"), function ReplaceValue >> >> In the DAG, we get is something like >> >> %tmp1 = extract_subvector <2 x double> %tmp0, <4 x double> %vec, 0 >> %tmp2 = extract_element <2 x double> %tmp1, 0 >> %tmp3 = extract_element <2 x double> %tmp1, 1 >> %tmp4 = build_vector<4 x double> %tmp2, %tmp3, %tmp?, %tmp? >> >> We discover when examining the operands of %tmp1 that %vec is not a >> legal type and we split it. This causes us to replace all uses of >> %tmp1 which triggers us update %tmp2 and %tmp3 and then update the >> %tmp4. The problem is that when we do the update, we will add %tmp4 >> node twice to UpdateListener (NodesToAnalyze) i..e, we add it when we >> process %tmp2 and again for %tmp3. When walking through the nodes to >> reanalyze, the first time we see %tmp4, we update the NodeId to the >> NewNode. When we encounter the node again through the list, we hit >> the assertion since we have already updated that Node. >> >> The following patch fixes this by changing NodesToAnalyze from >> SmallVector to use SmallPtrSet to avoid duplicates. Please let me >> know of any comments. > > thanks for looking into this. I used SmallVector in order to make > things deterministic - the NodesDeleted set was, as a side-effect, > supposed to avoid duplicates IIRC. I will try to analyze this later > today. > > Ciao, > > Duncan. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nicolas.geoffray at lip6.fr Tue Jan 13 03:18:04 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Jan 2009 10:18:04 +0100 Subject: [llvm-commits] [llvm] r62071 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp utils/TableGen/IntrinsicEmitter.cpp In-Reply-To: <47C34E25-1A4A-4EE8-BD7B-DB7248229A13@apple.com> References: <200901120241.n0C2fbvx026680@zion.cs.uiuc.edu> <496BD07B.7000402@lip6.fr> <47C34E25-1A4A-4EE8-BD7B-DB7248229A13@apple.com> Message-ID: <496C5C4C.7040409@lip6.fr> Chris Lattner wrote: > > Hi Nicolas, > > This looks like a latent bug in -march=cpp. Please see if r62155 > fixes it for you, > > Yes it does, and I understand why it failed now. Thanks! Nicolas > -Chris > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From nicholas at mxc.ca Tue Jan 13 03:18:58 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Tue, 13 Jan 2009 09:18:58 -0000 Subject: [llvm-commits] [llvm] r62160 - in /llvm/trunk: include/llvm/Analysis/ lib/Analysis/ test/Analysis/ScalarEvolution/ Message-ID: <200901130918.n0D9Ixe9015731@zion.cs.uiuc.edu> Author: nicholas Date: Tue Jan 13 03:18:58 2009 New Revision: 62160 URL: http://llvm.org/viewvc/llvm-project?rev=62160&view=rev Log: Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295, PR3296 and PR3302. Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h llvm/trunk/lib/Analysis/ScalarEvolution.cpp llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Tue Jan 13 03:18:58 2009 @@ -225,7 +225,6 @@ return getMulExpr(Ops); } SCEVHandle getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); - SCEVHandle getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS); SCEVHandle getAddRecExpr(const SCEVHandle &Start, const SCEVHandle &Step, const Loop *L); SCEVHandle getAddRecExpr(std::vector &Operands, Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpander.h Tue Jan 13 03:18:58 2009 @@ -14,7 +14,7 @@ #ifndef LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H #define LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H -#include "llvm/Instruction.h" +#include "llvm/Instructions.h" #include "llvm/Type.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" @@ -104,8 +104,6 @@ Value *visitUDivExpr(SCEVUDivExpr *S); - Value *visitSDivExpr(SCEVSDivExpr *S); - Value *visitAddRecExpr(SCEVAddRecExpr *S); Value *visitSMaxExpr(SCEVSMaxExpr *S); @@ -119,3 +117,4 @@ } #endif + Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h (original) +++ llvm/trunk/include/llvm/Analysis/ScalarEvolutionExpressions.h Tue Jan 13 03:18:58 2009 @@ -25,7 +25,7 @@ // These should be ordered in terms of increasing complexity to make the // folders simpler. scConstant, scTruncate, scZeroExtend, scSignExtend, scAddExpr, scMulExpr, - scUDivExpr, scSDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr, scUnknown, + scUDivExpr, scAddRecExpr, scUMaxExpr, scSMaxExpr, scUnknown, scCouldNotCompute }; @@ -358,55 +358,6 @@ //===--------------------------------------------------------------------===// - /// SCEVSDivExpr - This class represents a binary signed division operation. - /// - class SCEVSDivExpr : public SCEV { - friend class ScalarEvolution; - - SCEVHandle LHS, RHS; - SCEVSDivExpr(const SCEVHandle &lhs, const SCEVHandle &rhs) - : SCEV(scSDivExpr), LHS(lhs), RHS(rhs) {} - - virtual ~SCEVSDivExpr(); - public: - const SCEVHandle &getLHS() const { return LHS; } - const SCEVHandle &getRHS() const { return RHS; } - - virtual bool isLoopInvariant(const Loop *L) const { - return LHS->isLoopInvariant(L) && RHS->isLoopInvariant(L); - } - - virtual bool hasComputableLoopEvolution(const Loop *L) const { - return LHS->hasComputableLoopEvolution(L) && - RHS->hasComputableLoopEvolution(L); - } - - SCEVHandle replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym, - const SCEVHandle &Conc, - ScalarEvolution &SE) const { - SCEVHandle L = LHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); - SCEVHandle R = RHS->replaceSymbolicValuesWithConcrete(Sym, Conc, SE); - if (L == LHS && R == RHS) - return this; - else - return SE.getSDivExpr(L, R); - } - - - virtual const Type *getType() const; - - void print(std::ostream &OS) const; - void print(std::ostream *OS) const { if (OS) print(*OS); } - - /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const SCEVSDivExpr *S) { return true; } - static inline bool classof(const SCEV *S) { - return S->getSCEVType() == scSDivExpr; - } - }; - - - //===--------------------------------------------------------------------===// /// SCEVAddRecExpr - This node represents a polynomial recurrence on the trip /// count of the specified loop. /// @@ -599,8 +550,6 @@ return ((SC*)this)->visitMulExpr((SCEVMulExpr*)S); case scUDivExpr: return ((SC*)this)->visitUDivExpr((SCEVUDivExpr*)S); - case scSDivExpr: - return ((SC*)this)->visitSDivExpr((SCEVSDivExpr*)S); case scAddRecExpr: return ((SC*)this)->visitAddRecExpr((SCEVAddRecExpr*)S); case scSMaxExpr: Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Tue Jan 13 03:18:58 2009 @@ -112,7 +112,6 @@ SCEV::~SCEV() {} void SCEV::dump() const { print(cerr); - cerr << '\n'; } uint32_t SCEV::getBitWidth() const { @@ -325,26 +324,6 @@ return LHS->getType(); } - -// SCEVSDivs - Only allow the creation of one SCEVSDivExpr for any particular -// input. Don't use a SCEVHandle here, or else the object will never be -// deleted! -static ManagedStatic, - SCEVSDivExpr*> > SCEVSDivs; - -SCEVSDivExpr::~SCEVSDivExpr() { - SCEVSDivs->erase(std::make_pair(LHS, RHS)); -} - -void SCEVSDivExpr::print(std::ostream &OS) const { - OS << "(" << *LHS << " /s " << *RHS << ")"; -} - -const Type *SCEVSDivExpr::getType() const { - return LHS->getType(); -} - - // SCEVAddRecExprs - Only allow the creation of one SCEVAddRecExpr for any // particular input. Don't use a SCEVHandle here, or else the object will never // be deleted! @@ -1130,12 +1109,9 @@ } SCEVHandle ScalarEvolution::getUDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) { - if (LHS == RHS) - return getIntegerSCEV(1, LHS->getType()); // X udiv X --> 1 - if (SCEVConstant *RHSC = dyn_cast(RHS)) { if (RHSC->getValue()->equalsInt(1)) - return LHS; // X udiv 1 --> X + return LHS; // X udiv 1 --> x if (SCEVConstant *LHSC = dyn_cast(LHS)) { Constant *LHSCV = LHSC->getValue(); @@ -1144,34 +1120,13 @@ } } + // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't overflow. + SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)]; if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS); return Result; } -SCEVHandle ScalarEvolution::getSDivExpr(const SCEVHandle &LHS, const SCEVHandle &RHS) { - if (LHS == RHS) - return getIntegerSCEV(1, LHS->getType()); // X sdiv X --> 1 - - if (SCEVConstant *RHSC = dyn_cast(RHS)) { - if (RHSC->getValue()->equalsInt(1)) - return LHS; // X sdiv 1 --> X - - if (RHSC->getValue()->isAllOnesValue()) - return getNegativeSCEV(LHS); // X sdiv -1 --> -X - - if (SCEVConstant *LHSC = dyn_cast(LHS)) { - Constant *LHSCV = LHSC->getValue(); - Constant *RHSCV = RHSC->getValue(); - return getUnknown(ConstantExpr::getSDiv(LHSCV, RHSCV)); - } - } - - SCEVSDivExpr *&Result = (*SCEVSDivs)[std::make_pair(LHS, RHS)]; - if (Result == 0) Result = new SCEVSDivExpr(LHS, RHS); - return Result; -} - /// SCEVAddRecExpr::get - Get a add recurrence expression for the /// specified loop. Simplify the expression as much as possible. @@ -1522,7 +1477,7 @@ /// specified less-than comparison will execute. If not computable, return /// UnknownValue. isSigned specifies whether the less-than is signed. SCEVHandle HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, - bool isSigned, bool trueWhenEqual); + bool isSigned); /// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB /// (which may not be an immediate predecessor) which has exactly one @@ -1532,13 +1487,7 @@ /// executesAtLeastOnce - Test whether entry to the loop is protected by /// a conditional between LHS and RHS. - bool executesAtLeastOnce(const Loop *L, bool isSigned, bool trueWhenEqual, - SCEV *LHS, SCEV *RHS); - - /// potentialInfiniteLoop - Test whether the loop might jump over the exit value - /// due to wrapping. - bool potentialInfiniteLoop(SCEV *Stride, SCEV *RHS, bool isSigned, - bool trueWhenEqual); + bool executesAtLeastOnce(const Loop *L, bool isSigned, SCEV *LHS, SCEV *RHS); /// getConstantEvolutionLoopExitValue - If we know that the specified Phi is /// in the header of its containing loop, we know the loop executes a @@ -1777,7 +1726,7 @@ return MinOpRes; } - // SCEVUDivExpr, SCEVSDivExpr, SCEVUnknown + // SCEVUDivExpr, SCEVUnknown return 0; } @@ -1807,9 +1756,6 @@ case Instruction::UDiv: return SE.getUDivExpr(getSCEV(U->getOperand(0)), getSCEV(U->getOperand(1))); - case Instruction::SDiv: - return SE.getSDivExpr(getSCEV(U->getOperand(0)), - getSCEV(U->getOperand(1))); case Instruction::Sub: return SE.getMinusSCEV(getSCEV(U->getOperand(0)), getSCEV(U->getOperand(1))); @@ -1853,7 +1799,7 @@ break; case Instruction::LShr: - // Turn logical shift right of a constant into an unsigned divide. + // Turn logical shift right of a constant into a unsigned divide. if (ConstantInt *SA = dyn_cast(U->getOperand(1))) { uint32_t BitWidth = cast(V->getType())->getBitWidth(); Constant *X = ConstantInt::get( @@ -2079,46 +2025,24 @@ break; } case ICmpInst::ICMP_SLT: { - SCEVHandle TC = HowManyLessThans(LHS, RHS, L, true, false); + SCEVHandle TC = HowManyLessThans(LHS, RHS, L, true); if (!isa(TC)) return TC; break; } case ICmpInst::ICMP_SGT: { SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS), - SE.getNotSCEV(RHS), L, true, false); + SE.getNotSCEV(RHS), L, true); if (!isa(TC)) return TC; break; } case ICmpInst::ICMP_ULT: { - SCEVHandle TC = HowManyLessThans(LHS, RHS, L, false, false); + SCEVHandle TC = HowManyLessThans(LHS, RHS, L, false); if (!isa(TC)) return TC; break; } case ICmpInst::ICMP_UGT: { SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS), - SE.getNotSCEV(RHS), L, false, false); - if (!isa(TC)) return TC; - break; - } - case ICmpInst::ICMP_SLE: { - SCEVHandle TC = HowManyLessThans(LHS, RHS, L, true, true); - if (!isa(TC)) return TC; - break; - } - case ICmpInst::ICMP_SGE: { - SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS), - SE.getNotSCEV(RHS), L, true, true); - if (!isa(TC)) return TC; - break; - } - case ICmpInst::ICMP_ULE: { - SCEVHandle TC = HowManyLessThans(LHS, RHS, L, false, true); - if (!isa(TC)) return TC; - break; - } - case ICmpInst::ICMP_UGE: { - SCEVHandle TC = HowManyLessThans(SE.getNotSCEV(LHS), - SE.getNotSCEV(RHS), L, false, true); + SE.getNotSCEV(RHS), L, false); if (!isa(TC)) return TC; break; } @@ -2553,26 +2477,16 @@ return Comm; } - if (SCEVUDivExpr *UDiv = dyn_cast(V)) { - SCEVHandle LHS = getSCEVAtScope(UDiv->getLHS(), L); + if (SCEVUDivExpr *Div = dyn_cast(V)) { + SCEVHandle LHS = getSCEVAtScope(Div->getLHS(), L); if (LHS == UnknownValue) return LHS; - SCEVHandle RHS = getSCEVAtScope(UDiv->getRHS(), L); + SCEVHandle RHS = getSCEVAtScope(Div->getRHS(), L); if (RHS == UnknownValue) return RHS; - if (LHS == UDiv->getLHS() && RHS == UDiv->getRHS()) - return UDiv; // must be loop invariant + if (LHS == Div->getLHS() && RHS == Div->getRHS()) + return Div; // must be loop invariant return SE.getUDivExpr(LHS, RHS); } - if (SCEVSDivExpr *SDiv = dyn_cast(V)) { - SCEVHandle LHS = getSCEVAtScope(SDiv->getLHS(), L); - if (LHS == UnknownValue) return LHS; - SCEVHandle RHS = getSCEVAtScope(SDiv->getRHS(), L); - if (RHS == UnknownValue) return RHS; - if (LHS == SDiv->getLHS() && RHS == SDiv->getRHS()) - return SDiv; // must be loop invariant - return SE.getSDivExpr(LHS, RHS); - } - // If this is a loop recurrence for a loop that does not contain L, then we // are dealing with the final value computed by the loop. if (SCEVAddRecExpr *AddRec = dyn_cast(V)) { @@ -2824,7 +2738,6 @@ /// executesAtLeastOnce - Test whether entry to the loop is protected by /// a conditional between LHS and RHS. bool ScalarEvolutionsImpl::executesAtLeastOnce(const Loop *L, bool isSigned, - bool trueWhenEqual, SCEV *LHS, SCEV *RHS) { BasicBlock *Preheader = L->getLoopPreheader(); BasicBlock *PreheaderDest = L->getHeader(); @@ -2857,36 +2770,20 @@ switch (Cond) { case ICmpInst::ICMP_UGT: - if (isSigned || trueWhenEqual) continue; + if (isSigned) continue; std::swap(PreCondLHS, PreCondRHS); Cond = ICmpInst::ICMP_ULT; break; case ICmpInst::ICMP_SGT: - if (!isSigned || trueWhenEqual) continue; + if (!isSigned) continue; std::swap(PreCondLHS, PreCondRHS); Cond = ICmpInst::ICMP_SLT; break; case ICmpInst::ICMP_ULT: - if (isSigned || trueWhenEqual) continue; + if (isSigned) continue; break; case ICmpInst::ICMP_SLT: - if (!isSigned || trueWhenEqual) continue; - break; - case ICmpInst::ICMP_UGE: - if (isSigned || !trueWhenEqual) continue; - std::swap(PreCondLHS, PreCondRHS); - Cond = ICmpInst::ICMP_ULE; - break; - case ICmpInst::ICMP_SGE: - if (!isSigned || !trueWhenEqual) continue; - std::swap(PreCondLHS, PreCondRHS); - Cond = ICmpInst::ICMP_SLE; - break; - case ICmpInst::ICMP_ULE: - if (isSigned || !trueWhenEqual) continue; - break; - case ICmpInst::ICMP_SLE: - if (!isSigned || !trueWhenEqual) continue; + if (!isSigned) continue; break; default: continue; @@ -2905,47 +2802,11 @@ return false; } -/// potentialInfiniteLoop - Test whether the loop might jump over the exit value -/// due to wrapping around 2^n. -bool ScalarEvolutionsImpl::potentialInfiniteLoop(SCEV *Stride, SCEV *RHS, - bool isSigned, bool trueWhenEqual) { - // Return true when the distance from RHS to maxint > Stride. - - SCEVConstant *SC = dyn_cast(Stride); - if (!SC) - return true; - - if (SC->getValue()->isZero()) - return true; - if (!trueWhenEqual && SC->getValue()->isOne()) - return false; - - SCEVConstant *R = dyn_cast(RHS); - if (!R) - return true; - - // If negative, it wraps around every iteration, but we don't care about that. - APInt S = SC->getValue()->getValue().abs(); - - uint32_t Width = R->getValue()->getBitWidth(); - APInt Dist = (isSigned ? APInt::getSignedMaxValue(Width) - : APInt::getMaxValue(Width)) - - R->getValue()->getValue(); - - // Because we're looking at distance, we perform an unsigned comparison, - // regardless of the sign of the computation. - if (trueWhenEqual) - return !S.ult(Dist); - else - return !S.ule(Dist); -} - /// HowManyLessThans - Return the number of times a backedge containing the /// specified less-than comparison will execute. If not computable, return /// UnknownValue. SCEVHandle ScalarEvolutionsImpl:: -HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, - bool isSigned, bool trueWhenEqual) { +HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, bool isSigned) { // Only handle: "ADDREC < LoopInvariant". if (!RHS->isLoopInvariant(L)) return UnknownValue; @@ -2954,56 +2815,34 @@ return UnknownValue; if (AddRec->isAffine()) { - SCEVHandle Stride = AddRec->getOperand(1); - if (potentialInfiniteLoop(Stride, RHS, isSigned, trueWhenEqual)) - return UnknownValue; - - // We don't handle this correctly at the moment. The problem is that when - // the stride is negative, we're not counting how many times 'less-than' is - // true as we approach it, we're counting how far away we are from wrapping - // around the backside. - if (isSigned && - cast(Stride)->getValue()->getValue().isNegative()) + // FORNOW: We only support unit strides. + SCEVHandle One = SE.getIntegerSCEV(1, RHS->getType()); + if (AddRec->getOperand(1) != One) return UnknownValue; - // We know the LHS is of the form {n,+,s} and the RHS is some loop-invariant - // m. So, we count the number of iterations in which {n,+,s} < m is true. - // Note that we cannot simply return max(m-n,0)/s because it's not safe to + // We know the LHS is of the form {n,+,1} and the RHS is some loop-invariant + // m. So, we count the number of iterations in which {n,+,1} < m is true. + // Note that we cannot simply return max(m-n,0) because it's not safe to // treat m-n as signed nor unsigned due to overflow possibility. - // - // Assuming that the loop will run at least once, we know that it will - // run (m-n)/s times. // First, we get the value of the LHS in the first iteration: n SCEVHandle Start = AddRec->getOperand(0); - SCEVHandle One = SE.getIntegerSCEV(1, RHS->getType()); - - // If the expression is less-than-or-equal to, we need to extend the - // loop by one iteration. - // - // The loop won't actually run (m-n)/s times because the loop iterations - // might not divide cleanly. For example, if you have {2,+,5} u< 10 the - // division would equal one, but the loop runs twice putting the - // induction variable at 12. - SCEVHandle End = SE.getAddExpr(RHS, Stride); - if (!trueWhenEqual) - End = SE.getMinusSCEV(End, One); - - if (!executesAtLeastOnce(L, isSigned, trueWhenEqual, - SE.getMinusSCEV(Start, One), RHS)) { - // If not, we get the value of the LHS in the first iteration in which - // the above condition doesn't hold. This equals to max(m,n). - End = isSigned ? SE.getSMaxExpr(End, Start) - : SE.getUMaxExpr(End, Start); + if (executesAtLeastOnce(L, isSigned, + SE.getMinusSCEV(AddRec->getOperand(0), One), RHS)) { + // Since we know that the condition is true in order to enter the loop, + // we know that it will run exactly m-n times. + return SE.getMinusSCEV(RHS, Start); + } else { + // Then, we get the value of the LHS in the first iteration in which the + // above condition doesn't hold. This equals to max(m,n). + SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start) + : SE.getUMaxExpr(RHS, Start); + + // Finally, we subtract these two values to get the number of times the + // backedge is executed: max(m,n)-n. + return SE.getMinusSCEV(End, Start); } - - // Finally, we subtract these two values to get the number of times the - // backedge is executed: (max(m,n)-n)/s. - // - // Note that a trip count is always positive. Using SDiv here produces - // wrong answers when Start < End. - return SE.getUDivExpr(SE.getMinusSCEV(End, Start), Stride); } return UnknownValue; Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Tue Jan 13 03:18:58 2009 @@ -143,15 +143,6 @@ return InsertBinop(Instruction::UDiv, LHS, RHS, InsertPt); } -Value *SCEVExpander::visitSDivExpr(SCEVSDivExpr *S) { - // Do not fold sdiv into ashr, unless you know that LHS is positive. On - // negative values, it rounds the wrong way. - - Value *LHS = expand(S->getLHS()); - Value *RHS = expand(S->getRHS()); - return InsertBinop(Instruction::SDiv, LHS, RHS, InsertPt); -} - Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) { const Type *Ty = S->getType(); const Loop *L = S->getLoop(); Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-LessThanOrEqual.ll Tue Jan 13 03:18:58 2009 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& \ ; RUN: grep {Loop bb: (7 + (-1 \\* %argc)) iterations!} +; XFAIL: * define i32 @main(i32 %argc, i8** %argv) nounwind { entry: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll Tue Jan 13 03:18:58 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& grep {/u 3} +; XFAIL: * define i32 @f(i32 %x) nounwind readnone { entry: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll Tue Jan 13 03:18:58 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& grep {/u 3} +; XFAIL: * define i32 @f(i32 %x) nounwind readnone { entry: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll Tue Jan 13 03:18:58 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {255 iterations} +; XFAIL: * define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind { bb1.thread: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll Tue Jan 13 03:18:58 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {0 smax} +; XFAIL: * define i32 @f(i32 %c.idx.val) { Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll Tue Jan 13 03:18:58 2009 @@ -1,5 +1,6 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& \ ; RUN: grep {(((-1 \\* %i0) + (100005 smax %i0)) /u 5)} +; XFAIL: * define i32 @foo0(i32 %i0) nounwind { entry: Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll?rev=62160&r1=62159&r2=62160&view=diff ============================================================================== --- llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll (original) +++ llvm/trunk/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll Tue Jan 13 03:18:58 2009 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& grep {/u 5} +; XFAIL: * define i8 @foo0(i8 %i0) nounwind { entry: From baldrick at free.fr Tue Jan 13 05:36:34 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 11:36:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62163 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200901131136.n0DBaak5021128@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 05:36:29 2009 New Revision: 62163 URL: http://llvm.org/viewvc/llvm-project?rev=62163&view=rev Log: Revert r62076 "Load / store alignments...": on x86-64 linux it causes the compiler to crash on the following tests: FrontendC/2004-05-07-VarArrays.c FrontendC/2007-03-01-VarSizeArrayIdx.c FrontendC/2007-03-27-ArrayCompatible.c FrontendC++/2005-02-20-BrokenReferenceTest.cpp It also causes the compiler to crash during the x86-32 Ada build due to trying to create an LValue with an alignment of zero. Finally, it is not at all clear to me that this is the right approach (see discussion on mailing list). Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=62163&r1=62162&r2=62163&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jan 13 05:36:29 2009 @@ -1150,18 +1150,9 @@ case IMAGPART_EXPR: return EmitLV_XXXXPART_EXPR(exp, 1); // Constants. - case LABEL_DECL: { - Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); - return LValue(Ptr, DECL_ALIGN(exp) / 8); - } - case COMPLEX_CST: { - Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); - return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); - } - case STRING_CST: { - Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); - return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); - } + case LABEL_DECL: return TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); + case COMPLEX_CST: return LValue(TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp)); + case STRING_CST: return LValue(TreeConstantToLLVM::EmitLV_STRING_CST(exp)); // Type Conversion. case VIEW_CONVERT_EXPR: return EmitLV_VIEW_CONVERT_EXPR(exp); @@ -1174,11 +1165,9 @@ case WITH_SIZE_EXPR: // The address is the address of the operand. return EmitLV(TREE_OPERAND(exp, 0)); - case INDIRECT_REF: { + case INDIRECT_REF: // The lvalue is just the address. - tree Op = TREE_OPERAND(exp, 0); - return LValue(Emit(Op, 0), expr_align(Op) / 8); - } + return Emit(TREE_OPERAND(exp, 0), 0); } } @@ -2301,7 +2290,7 @@ LValue LV = EmitLV(exp); bool isVolatile = TREE_THIS_VOLATILE(exp); const Type *Ty = ConvertType(TREE_TYPE(exp)); - unsigned Alignment = LV.getAlignment(); + unsigned Alignment = expr_align(exp) / 8; if (TREE_CODE(exp) == COMPONENT_REF) if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))))) @@ -2974,7 +2963,7 @@ LValue LV = EmitLV(lhs); bool isVolatile = TREE_THIS_VOLATILE(lhs); - unsigned Alignment = LV.getAlignment(); + unsigned Alignment = expr_align(lhs) / 8; if (TREE_CODE(lhs) == COMPONENT_REF) if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(lhs, 0))))) @@ -3168,7 +3157,7 @@ LValue LV = EmitLV(Op); assert(!LV.isBitfield() && "Expected an aggregate operand!"); bool isVolatile = TREE_THIS_VOLATILE(Op); - unsigned Alignment = LV.getAlignment(); + unsigned Alignment = expr_align(Op) / 8; EmitAggregateCopy(Target, MemRef(LV.Ptr, Alignment, isVolatile), TREE_TYPE(exp)); @@ -5896,10 +5885,9 @@ Value *Decl = DECL_LLVM(exp); if (Decl == 0) { if (errorcount || sorrycount) { - const Type *Ty = ConvertType(TREE_TYPE(exp)); - const PointerType *PTy = PointerType::getUnqual(Ty); - LValue LV(ConstantPointerNull::get(PTy), 1); - return LV; + const PointerType *Ty = + PointerType::getUnqual(ConvertType(TREE_TYPE(exp))); + return ConstantPointerNull::get(Ty); } assert(0 && "INTERNAL ERROR: Referencing decl that hasn't been laid out"); abort(); @@ -5936,13 +5924,7 @@ // type void. if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL); const PointerType *PTy = PointerType::getUnqual(Ty); - unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1; - if (DECL_ALIGN_UNIT(exp)) { - if (DECL_USER_ALIGN(exp) || Alignment < (unsigned)DECL_ALIGN_UNIT(exp)) - Alignment = DECL_ALIGN_UNIT(exp); - } - - return LValue(BitCastToType(Decl, PTy), Alignment); + return BitCastToType(Decl, PTy); } LValue TreeToLLVM::EmitLV_ARRAY_REF(tree exp) { @@ -5950,23 +5932,22 @@ // of ElementTy in the case of ARRAY_RANGE_REF. tree Array = TREE_OPERAND(exp, 0); - tree ArrayTreeType = TREE_TYPE(Array); + tree ArrayType = TREE_TYPE(Array); tree Index = TREE_OPERAND(exp, 1); tree IndexType = TREE_TYPE(Index); - tree ElementType = TREE_TYPE(ArrayTreeType); + tree ElementType = TREE_TYPE(ArrayType); - assert((TREE_CODE (ArrayTreeType) == ARRAY_TYPE || - TREE_CODE (ArrayTreeType) == POINTER_TYPE || - TREE_CODE (ArrayTreeType) == REFERENCE_TYPE || - TREE_CODE (ArrayTreeType) == BLOCK_POINTER_TYPE) && + assert((TREE_CODE (ArrayType) == ARRAY_TYPE || + TREE_CODE (ArrayType) == POINTER_TYPE || + TREE_CODE (ArrayType) == REFERENCE_TYPE || + TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) && "Unknown ARRAY_REF!"); // As an LLVM extension, we allow ARRAY_REF with a pointer as the first // operand. This construct maps directly to a getelementptr instruction. Value *ArrayAddr; - unsigned ArrayAlign; - if (TREE_CODE(ArrayTreeType) == ARRAY_TYPE) { + if (TREE_CODE(ArrayType) == ARRAY_TYPE) { // First subtract the lower bound, if any, in the type of the index. tree LowerBound = array_ref_low_bound(exp); if (!integer_zerop(LowerBound)) @@ -5975,10 +5956,8 @@ LValue ArrayAddrLV = EmitLV(Array); assert(!ArrayAddrLV.isBitfield() && "Arrays cannot be bitfields!"); ArrayAddr = ArrayAddrLV.Ptr; - ArrayAlign = ArrayAddrLV.Alignment; } else { ArrayAddr = Emit(Array, 0); - ArrayAlign = expr_align(ArrayTreeType) / 8; } Value *IndexVal = Emit(Index, 0); @@ -5992,27 +5971,20 @@ IndexVal = CastToSIntType(IndexVal, IntPtrTy); // If this is an index into an LLVM array, codegen as a GEP. - if (isArrayCompatible(ArrayTreeType)) { + if (isArrayCompatible(ArrayType)) { Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), IndexVal }; Value *Ptr = Builder.CreateGEP(ArrayAddr, Idxs, Idxs + 2); - const Type *ATy = cast(ArrayAddr->getType())->getElementType(); - const Type *ElementTy = cast(ATy)->getElementType(); - unsigned Alignment = MinAlign(ArrayAlign, TD.getTypePaddedSize(ElementTy)); - return LValue(BitCastToType(Ptr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), - Alignment); + return BitCastToType(Ptr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } // If we are indexing over a fixed-size type, just use a GEP. - if (isSequentialCompatible(ArrayTreeType)) { - const Type *ElementTy = ConvertType(ElementType); - const Type *PtrElementTy = PointerType::getUnqual(ElementTy); + if (isSequentialCompatible(ArrayType)) { + const Type *PtrElementTy = PointerType::getUnqual(ConvertType(ElementType)); ArrayAddr = BitCastToType(ArrayAddr, PtrElementTy); Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal); - unsigned Alignment = MinAlign(ArrayAlign, TD.getABITypeAlignment(ElementTy)); - return LValue(BitCastToType(Ptr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), - Alignment); + return BitCastToType(Ptr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } // Otherwise, just do raw, low-level pointer arithmetic. FIXME: this could be @@ -6020,21 +5992,14 @@ // float foo(int w, float A[][w], int g) { return A[g][0]; } ArrayAddr = BitCastToType(ArrayAddr, PointerType::getUnqual(Type::Int8Ty)); - if (VOID_TYPE_P(TREE_TYPE(ArrayTreeType))) { - unsigned Alignment = MinAlign(ArrayAlign, - TD.getABITypeAlignment(Type::Int8Ty)); - return LValue(Builder.CreateGEP(ArrayAddr, IndexVal), Alignment); - } + if (VOID_TYPE_P(TREE_TYPE(ArrayType))) + return Builder.CreateGEP(ArrayAddr, IndexVal); Value *TypeSize = Emit(array_ref_element_size(exp), 0); TypeSize = CastToUIntType(TypeSize, IntPtrTy); IndexVal = Builder.CreateMul(IndexVal, TypeSize); Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal); - unsigned Alignment = MinAlign(ArrayAlign, - cast(IndexVal)->getZExtValue()); - return LValue(BitCastToType(Ptr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), - Alignment); + return BitCastToType(Ptr,PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } /// getFieldOffsetInBits - Return the offset (in bits) of a FIELD_DECL in a @@ -6063,9 +6028,8 @@ LValue TreeToLLVM::EmitLV_COMPONENT_REF(tree exp) { LValue StructAddrLV = EmitLV(TREE_OPERAND(exp, 0)); - tree FieldDecl = TREE_OPERAND(exp, 1); - unsigned LVAlign = DECL_PACKED(FieldDecl) ? 1 : StructAddrLV.Alignment; - + tree FieldDecl = TREE_OPERAND(exp, 1); + assert((TREE_CODE(DECL_CONTEXT(FieldDecl)) == RECORD_TYPE || TREE_CODE(DECL_CONTEXT(FieldDecl)) == UNION_TYPE || TREE_CODE(DECL_CONTEXT(FieldDecl)) == QUAL_UNION_TYPE)); @@ -6100,9 +6064,7 @@ // the offset from BitStart. if (MemberIndex) { const StructLayout *SL = TD.getStructLayout(cast(StructTy)); - unsigned Offset = SL->getElementOffset(MemberIndex); - BitStart -= Offset * 8; - LVAlign = MinAlign(LVAlign, Offset); + BitStart -= SL->getElementOffset(MemberIndex) * 8; } // If the FIELD_DECL has an annotate attribute on it, emit it. @@ -6188,7 +6150,6 @@ Offset = Builder.CreateAdd(Offset, ConstantInt::get(Offset->getType(), ByteOffset)); BitStart -= ByteOffset*8; - LVAlign = MinAlign(LVAlign, ByteOffset); } Value *Ptr = CastToType(Instruction::PtrToInt, StructAddrLV.Ptr, @@ -6260,7 +6221,6 @@ // Compute the byte offset, and add it to the pointer. unsigned ByteOffset = NumAlignmentUnits*ByteAlignment; - LVAlign = MinAlign(LVAlign, ByteOffset); Constant *Offset = ConstantInt::get(TD.getIntPtrType(), ByteOffset); FieldPtr = CastToType(Instruction::PtrToInt, FieldPtr, @@ -6282,18 +6242,17 @@ // Okay, everything is good. Return this as a bitfield if we can't // return it as a normal l-value. (e.g. "struct X { int X : 32 };" ). - // Conservatively return LValue with alignment 1. if (BitfieldSize != LLVMValueBitSize || BitStart != 0) - return LValue(FieldPtr, 1, BitStart, BitfieldSize); + return LValue(FieldPtr, BitStart, BitfieldSize); } else { // Make sure we return a pointer to the right type. - const Type *EltTy = ConvertType(TREE_TYPE(exp)); - FieldPtr = BitCastToType(FieldPtr, PointerType::getUnqual(EltTy)); + FieldPtr = BitCastToType(FieldPtr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } assert(BitStart == 0 && "It's a bitfield reference or we didn't get to the field!"); - return LValue(FieldPtr, LVAlign); + return LValue(FieldPtr); } LValue TreeToLLVM::EmitLV_BIT_FIELD_REF(tree exp) { @@ -6325,28 +6284,17 @@ } // If this is referring to the whole field, return the whole thing. - if (BitStart == 0 && BitSize == ValueSizeInBits) { - return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), - Ptr.Alignment); - } + if (BitStart == 0 && BitSize == ValueSizeInBits) + return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy))); - return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), 1, - BitStart, BitSize); + return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), BitStart, + BitSize); } LValue TreeToLLVM::EmitLV_XXXXPART_EXPR(tree exp, unsigned Idx) { LValue Ptr = EmitLV(TREE_OPERAND(exp, 0)); - assert(!Ptr.isBitfield() && - "REALPART_EXPR / IMAGPART_EXPR operands cannot be bitfields!"); - unsigned Alignment; - if (Idx == 0) - // REALPART alignment is same as the complex operand. - Alignment = Ptr.Alignment; - else - // IMAGPART alignment = MinAlign(Ptr.Alignment, sizeof field); - Alignment = MinAlign(Ptr.Alignment, - TD.getTypePaddedSize(Ptr.Ptr->getType())); - return LValue(Builder.CreateStructGEP(Ptr.Ptr, Idx), Alignment); + assert(!Ptr.isBitfield() && "BIT_FIELD_REF operands cannot be bitfields!"); + return LValue(Builder.CreateStructGEP(Ptr.Ptr, Idx)); } LValue TreeToLLVM::EmitLV_VIEW_CONVERT_EXPR(tree exp) { @@ -6362,30 +6310,24 @@ } else { // If the input is a scalar, emit to a temporary. Value *Dest = CreateTemporary(ConvertType(TREE_TYPE(Op))); - StoreInst *S = Builder.CreateStore(Emit(Op, 0), Dest); + Builder.CreateStore(Emit(Op, 0), Dest); // The type is the type of the expression. Dest = BitCastToType(Dest, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); - return LValue(Dest, S->getAlignment()); + return LValue(Dest); } } LValue TreeToLLVM::EmitLV_EXC_PTR_EXPR(tree exp) { CreateExceptionValues(); // Cast the address pointer to the expected type. - unsigned Alignment = TD.getABITypeAlignment(cast(ExceptionValue-> - getType())->getElementType()); - return LValue(BitCastToType(ExceptionValue, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), - Alignment); + return BitCastToType(ExceptionValue, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } LValue TreeToLLVM::EmitLV_FILTER_EXPR(tree exp) { CreateExceptionValues(); - unsigned Alignment = - TD.getABITypeAlignment(cast(ExceptionSelectorValue-> - getType())->getElementType()); - return LValue(ExceptionSelectorValue, Alignment); + return ExceptionSelectorValue; } //===----------------------------------------------------------------------===// Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=62163&r1=62162&r2=62163&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Tue Jan 13 05:36:29 2009 @@ -251,30 +251,23 @@ }; /// LValue - This struct represents an lvalue in the program. In particular, -/// the Ptr member indicates the memory that the lvalue lives in. Alignment -/// is the alignment of the memory (in bytes).If this is a bitfield reference, -/// BitStart indicates the first bit in the memory that is part of the field -/// and BitSize indicates the extent. +/// the Ptr member indicates the memory that the lvalue lives in. If this is +/// a bitfield reference, BitStart indicates the first bit in the memory that +/// is part of the field and BitSize indicates the extent. /// /// "LValue" is intended to be a light-weight object passed around by-value. struct LValue { Value *Ptr; - unsigned char Alignment; unsigned char BitStart; unsigned char BitSize; - LValue(Value *P, unsigned Align) - : Ptr(P), Alignment(Align), BitStart(255), BitSize(255) {} - LValue(Value *P, unsigned Align, unsigned BSt, unsigned BSi) - : Ptr(P), Alignment(Align), BitStart(BSt), BitSize(BSi) { + LValue(Value *P) : Ptr(P), BitStart(255), BitSize(255) {} + LValue(Value *P, unsigned BSt, unsigned BSi) + : Ptr(P), BitStart(BSt), BitSize(BSi) { assert(BitStart == BSt && BitSize == BSi && "Bit values larger than 256?"); - } - - unsigned getAlignment() const { - assert(Alignment && "LValue alignment cannot be zero!"); - return Alignment; } + bool isBitfield() const { return BitStart != 255; } }; From baldrick at free.fr Tue Jan 13 05:52:49 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 12:52:49 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> Message-ID: <200901131252.49945.baldrick@free.fr> Hi Evan, > Load / store alignments should be the alignments of the memory object used to construct the LValue, not the alignments of the values being loaded / stored. I've reverted this because it was causing several failures in the testsuite, and also broke the Ada build. Also, I don't see how this approach can work without major changes. Consider the following part of your patch: > @@ -5956,8 +5975,10 @@ ... > } else { > ArrayAddr = Emit(Array, 0); > + ArrayAlign = expr_align(ArrayTreeType) / 8; > } This is the case of when we are doing "a[i]", where "a" is a pointer. There's no reason to think that "a" points to aligned memory, so using the type alignment is wrong. So where to get the alignment from? We get the pointer "a" from Emit, which doesn't provide alignment info for the pointee. As far as I can see either Emit needs to return more info (complicated to implement) or we need to dig down into the gcc tree to get the underlying object and extract its alignment. In other words, we need to do what we expected expr_align to do (only it wasn't). I think we should just make expr_align more intelligent. Since we are the only users of it, there is no danger involved in changing it. Ciao, Duncan. PS: I didn't check, but presumably this same problem occurs elsewhere: we get a pointer from Emit and need alignment for the pointee. From baldrick at free.fr Tue Jan 13 06:21:51 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 13:21:51 +0100 Subject: [llvm-commits] Link failing due to debug info Message-ID: <200901131321.52282.baldrick@free.fr> Hi Devang, I'm seeing lots of failures like this in the Ada testsuite: gnatlink a87b59a.ali --GCC=gcc-4.2.llvm-objects-32/gcc/xgcc -B/home/duncan/LLVM/gcc-4.2.llvm-objects-32/gcc/ gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xa0): undefined reference to `llvm.dbg.global_variable643' gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xb8): undefined reference to `llvm.dbg.global_variable641' gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xd0): undefined reference to `llvm.dbg.global_variable639' ... Any idea what that's about? I can send you the corresponding LLVM IR if that would help. Best wishes, Duncan. From baldrick at free.fr Tue Jan 13 07:48:45 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 13:48:45 -0000 Subject: [llvm-commits] [llvm] r62165 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Message-ID: <200901131348.n0DDmj9V025987@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 07:48:44 2009 New Revision: 62165 URL: http://llvm.org/viewvc/llvm-project?rev=62165&view=rev Log: Correct a comment. Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=62165&r1=62164&r2=62165&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 13 07:48:44 2009 @@ -1715,7 +1715,7 @@ } else if (GS.StoredType == GlobalStatus::isStoredOnce) { // If the initial value for the global was an undef value, and if only // one other value was stored into it, we can just change the - // initializer to be an undef value, then delete all stores to the + // initializer to be the stored value, then delete all stores to the // global. This allows us to mark it constant. if (Constant *SOVConstant = dyn_cast(GS.StoredOnceValue)) if (isa(GV->getInitializer())) { From baldrick at free.fr Tue Jan 13 07:58:46 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 14:58:46 +0100 Subject: [llvm-commits] [llvm] r61129 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <200812170849.mBH8nnn5016096@zion.cs.uiuc.edu> References: <200812170849.mBH8nnn5016096@zion.cs.uiuc.edu> Message-ID: <200901131458.46537.baldrick@free.fr> Hi Mon Ping, > Fix expansion of vsetcc to set the high bit for true instead of 1. ... > SDValue In1 = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, TmpEltVT, > Tmp1, DAG.getIntPtrConstant(i)); > Ops[i] = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType(In1), In1, > - DAG.getNode(ISD::EXTRACT_VECTOR_ELT, TmpEltVT, > - Tmp2, DAG.getIntPtrConstant(i)), > - CC); > - Ops[i] = DAG.getNode(ISD::SIGN_EXTEND, EltVT, Ops[i]); > + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, TmpEltVT, > + Tmp2, DAG.getIntPtrConstant(i)), > + CC); > + Ops[i] = DAG.getNode(ISD::SELECT, EltVT, Ops[i], > + DAG.getConstant(EltVT.getIntegerVTBitMask(),EltVT), > + DAG.getConstant(0, EltVT)); wouldn't it make more sense to use a SELECT_CC rather than a SETCC+SELECT pair? Ciao, Duncan. From baldrick at free.fr Tue Jan 13 08:04:14 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 14:04:14 -0000 Subject: [llvm-commits] [llvm] r62166 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Message-ID: <200901131404.n0DE4FVh026668@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 08:04:14 2009 New Revision: 62166 URL: http://llvm.org/viewvc/llvm-project?rev=62166&view=rev Log: Correct a comment - this is not a sign extension. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp?rev=62166&r1=62165&r2=62166&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Tue Jan 13 08:04:14 2009 @@ -329,7 +329,7 @@ if (TLI.isBigEndian()) std::swap(Lo, Hi); - // Signed extend to the promoted type. + // Extend to the promoted type. SDValue Odd = DAG.getNode(ISD::TRUNCATE, MVT::i1, OldIdx); SDValue Res = DAG.getNode(ISD::SELECT, NewVT, Odd, Hi, Lo); return DAG.getNode(ISD::ANY_EXTEND, TLI.getTypeToTransformTo(OldVT), Res); From baldrick at free.fr Tue Jan 13 08:42:40 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 14:42:40 -0000 Subject: [llvm-commits] [llvm] r62167 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.cpp LegalizeTypes.h Message-ID: <200901131442.n0DEgeR9028091@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 08:42:39 2009 New Revision: 62167 URL: http://llvm.org/viewvc/llvm-project?rev=62167&view=rev Log: Fix some typos. Also, the WidenedVectors map was not being cleaned by ExpungeNode. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=62167&r1=62166&r2=62167&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Tue Jan 13 08:42:39 2009 @@ -574,6 +574,12 @@ RemapValue(I->second); } + for (DenseMap::iterator I = WidenedVectors.begin(), + E = WidenedVectors.end(); I != E; ++I) { + assert(I->first.getNode() != N); + RemapValue(I->second); + } + for (DenseMap >::iterator I = ExpandedIntegers.begin(), E = ExpandedIntegers.end(); I != E; ++I){ assert(I->first.getNode() != N); @@ -817,7 +823,7 @@ AnalyzeNewValue(Result); SDValue &OpEntry = WidenedVectors[Op]; - assert(OpEntry.getNode() == 0 && "Node is already promoted!"); + assert(OpEntry.getNode() == 0 && "Node already widened!"); OpEntry = Result; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=62167&r1=62166&r2=62167&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Tue Jan 13 08:42:39 2009 @@ -65,7 +65,7 @@ ExpandFloat, // Split this float type into two of half the size. ScalarizeVector, // Replace this one-element vector with its element type. SplitVector, // This vector type should be split into smaller vectors. - WidenVector // This vector type should be widened into larger vectors. + WidenVector // This vector type should be widened into a larger vector. }; /// ValueTypeActions - This is a bitvector that contains two bits for each @@ -73,11 +73,7 @@ /// enum from TargetLowering. This can be queried with "getTypeAction(VT)". TargetLowering::ValueTypeActionImpl ValueTypeActions; - /// getTypeAction - Return how we should legalize values of this type, either - /// it is already legal, or we need to promote it to a larger integer type, or - /// we need to expand it into multiple registers of a smaller integer type, or - /// we need to split a vector type into smaller vector types, or we need to - /// convert it to a different type of the same size. + /// getTypeAction - Return how we should legalize values of this type. LegalizeAction getTypeAction(MVT VT) const { switch (ValueTypeActions.getTypeAction(VT)) { default: @@ -118,12 +114,14 @@ } /// IgnoreNodeResults - Pretend all of this node's results are legal. + /// FIXME: Remove once PR2957 is done. bool IgnoreNodeResults(SDNode *N) const { return N->getOpcode() == ISD::TargetConstant || IgnoredNodesResultsSet.count(N); } /// IgnoredNode - Set of nodes whose result don't need to be legal. + /// FIXME: Remove once PR2957 is done. DenseSet IgnoredNodesResultsSet; /// PromotedIntegers - For integer nodes that are below legal width, this map @@ -150,8 +148,8 @@ /// which operands are the expanded version of the input. DenseMap > SplitVectors; - /// WidenVectors - For vector nodes that need to be widened, indicates - /// the widen value to use. + /// WidenedVectors - For vector nodes that need to be widened, indicates + /// the widened value to use. DenseMap WidenedVectors; /// ReplacedValues - For values that have been replaced with another, @@ -570,6 +568,13 @@ //===--------------------------------------------------------------------===// // Vector Widening Support: LegalizeVectorTypes.cpp //===--------------------------------------------------------------------===// + + /// GetWidenedVector - Given a processed vector Op which was widened into a + /// larger vector, this method returns the larger vector. The elements of + /// the returned vector consist of the elements of Op followed by elements + /// containing rubbish. For example, if Op is a v2i32 that was widened to a + /// v4i32, then this method returns a v4i32 for which the first two elements + /// are the same as those of Op, while the last two elements contain rubbish. SDValue GetWidenedVector(SDValue Op) { SDValue &WidenedOp = WidenedVectors[Op]; RemapValue(WidenedOp); From baldrick at free.fr Tue Jan 13 09:15:47 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 15:15:47 -0000 Subject: [llvm-commits] [llvm] r62168 - /llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Message-ID: <200901131515.n0DFFlaX029216@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 09:15:46 2009 New Revision: 62168 URL: http://llvm.org/viewvc/llvm-project?rev=62168&view=rev Log: Mark this XFAIL for the moment. Modified: llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Modified: llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c?rev=62168&r1=62167&r2=62168&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c (original) +++ llvm/trunk/test/FrontendC/2008-03-24-BitField-And-Alloca.c Tue Jan 13 09:15:46 2009 @@ -1,5 +1,6 @@ // RUN: %llvmgcc -O2 -S %s -o - | not grep alloca // RUN: %llvmgcc -m32 -S %s -o - | grep store | not grep {align 8} +// XFAIL: * enum { PP_C, From baldrick at free.fr Tue Jan 13 09:17:14 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 15:17:14 -0000 Subject: [llvm-commits] [llvm] r62169 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp test/CodeGen/X86/2009-01-13-DoubleUpdate.ll Message-ID: <200901131517.n0DFHEGg029269@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 13 09:17:14 2009 New Revision: 62169 URL: http://llvm.org/viewvc/llvm-project?rev=62169&view=rev Log: When replacing uses and the same node is reached via two paths, process it once not twice, d'oh! Analysis, testcase and original patch thanks to Mon Ping Wang. Added: llvm/trunk/test/CodeGen/X86/2009-01-13-DoubleUpdate.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=62169&r1=62168&r2=62169&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Tue Jan 13 09:17:14 2009 @@ -15,7 +15,7 @@ #include "LegalizeTypes.h" #include "llvm/CallingConv.h" -#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SetVector.h" #include "llvm/Support/CommandLine.h" #include "llvm/Target/TargetData.h" using namespace llvm; @@ -628,13 +628,11 @@ class VISIBILITY_HIDDEN NodeUpdateListener : public SelectionDAG::DAGUpdateListener { DAGTypeLegalizer &DTL; - SmallVectorImpl &NodesToAnalyze; - SmallPtrSet &NodesDeleted; + SmallSetVector &NodesToAnalyze; public: explicit NodeUpdateListener(DAGTypeLegalizer &dtl, - SmallVectorImpl &nta, - SmallPtrSet &nd) - : DTL(dtl), NodesToAnalyze(nta), NodesDeleted(nd) {} + SmallSetVector &nta) + : DTL(dtl), NodesToAnalyze(nta) {} virtual void NodeDeleted(SDNode *N, SDNode *E) { assert(N->getNodeId() != DAGTypeLegalizer::ReadyToProcess && @@ -647,14 +645,14 @@ // In theory the deleted node could also have been scheduled for analysis. // So add it to the set of nodes which will not be analyzed. - NodesDeleted.insert(N); + NodesToAnalyze.remove(N); // In general nothing needs to be done for E, since it didn't change but // only gained new uses. However N -> E was just added to ReplacedValues, // and the result of a ReplacedValues mapping is not allowed to be marked // NewNode. So if E is marked NewNode, then it needs to be analyzed. if (E->getNodeId() == DAGTypeLegalizer::NewNode) - NodesToAnalyze.push_back(E); + NodesToAnalyze.insert(E); } virtual void NodeUpdated(SDNode *N) { @@ -664,7 +662,7 @@ assert(N->getNodeId() != DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != DAGTypeLegalizer::Processed && "Invalid node ID for RAUW deletion!"); - NodesToAnalyze.push_back(N); + NodesToAnalyze.insert(N); } }; } @@ -684,9 +682,8 @@ // Anything that used the old node should now use the new one. Note that this // can potentially cause recursive merging. - SmallVector NodesToAnalyze; - SmallPtrSet NodesDeleted; - NodeUpdateListener NUL(*this, NodesToAnalyze, NodesDeleted); + SmallSetVector NodesToAnalyze; + NodeUpdateListener NUL(*this, NodesToAnalyze); DAG.ReplaceAllUsesOfValueWith(From, To, &NUL); // The old node may still be present in a map like ExpandedIntegers or @@ -698,10 +695,6 @@ SDNode *N = NodesToAnalyze.back(); NodesToAnalyze.pop_back(); - // Do not analyze deleted nodes! - if (NodesDeleted.count(N)) - continue; - // Analyze the node's operands and recalculate the node ID. assert(N->getNodeId() != DAGTypeLegalizer::ReadyToProcess && N->getNodeId() != DAGTypeLegalizer::Processed && Added: llvm/trunk/test/CodeGen/X86/2009-01-13-DoubleUpdate.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-01-13-DoubleUpdate.ll?rev=62169&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2009-01-13-DoubleUpdate.ll (added) +++ llvm/trunk/test/CodeGen/X86/2009-01-13-DoubleUpdate.ll Tue Jan 13 09:17:14 2009 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -disable-mmx -enable-legalize-types-checking + +declare <2 x double> @llvm.x86.sse2.min.pd(<2 x double>, <2 x double>) nounwind readnone + +define void @__mindd16(<16 x double>* sret %vec.result, <16 x double> %x, double %y) nounwind { +entry: + %tmp3.i = shufflevector <16 x double> zeroinitializer, <16 x double> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 > ; <<8 x double>> [#uses=1] + %tmp10.i.i = shufflevector <8 x double> %tmp3.i, <8 x double> undef, <4 x i32> < i32 4, i32 5, i32 6, i32 7 > ; <<4 x double>> [#uses=1] + %tmp3.i2.i.i = shufflevector <4 x double> %tmp10.i.i, <4 x double> undef, <2 x i32> < i32 0, i32 1 > ; <<2 x double>> [#uses=1] + %0 = tail call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> zeroinitializer, <2 x double> %tmp3.i2.i.i) nounwind ; <<2 x double>> [#uses=1] + %tmp5.i3.i.i = shufflevector <2 x double> %0, <2 x double> undef, <4 x i32> < i32 0, i32 1, i32 undef, i32 undef > ; <<4 x double>> [#uses=1] + %tmp6.i4.i.i = shufflevector <4 x double> zeroinitializer, <4 x double> %tmp5.i3.i.i, <4 x i32> < i32 4, i32 5, i32 2, i32 3 > ; <<4 x double>> [#uses=1] + %tmp14.i8.i.i = shufflevector <4 x double> %tmp6.i4.i.i, <4 x double> zeroinitializer, <4 x i32> < i32 0, i32 1, i32 4, i32 5 > ; <<4 x double>> [#uses=1] + %tmp13.i.i = shufflevector <4 x double> %tmp14.i8.i.i, <4 x double> undef, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef > ; <<8 x double>> [#uses=1] + %tmp14.i.i = shufflevector <8 x double> zeroinitializer, <8 x double> %tmp13.i.i, <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11 > ; <<8 x double>> [#uses=1] + %tmp5.i = shufflevector <8 x double> %tmp14.i.i, <8 x double> undef, <16 x i32> < i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef > ; <<16 x double>> [#uses=1] + %tmp6.i = shufflevector <16 x double> %x, <16 x double> %tmp5.i, <16 x i32> < i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15 > ; <<16 x double>> [#uses=1] + %tmp14.i = shufflevector <16 x double> %tmp6.i, <16 x double> zeroinitializer, <16 x i32> < i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23 > ; <<16 x double>> [#uses=1] + store <16 x double> %tmp14.i, <16 x double>* %vec.result + ret void +} From baldrick at free.fr Tue Jan 13 09:18:28 2009 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Jan 2009 16:18:28 +0100 Subject: [llvm-commits] Patch: avoid reanalyze a node twice in LegalizeTypes In-Reply-To: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> References: <9A3A63A5-1727-456A-8913-F4413CA1B6EA@apple.com> Message-ID: <200901131618.29385.baldrick@free.fr> Hi Mon Ping, I committed a modified version of your patch. Now that I remember how this was all supposed to work, it is clear that I simply didn't think of this possibility, d'oh! Thanks for solving this, Duncan. From echeng at apple.com Tue Jan 13 11:13:35 2009 From: echeng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 09:13:35 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200901131252.49945.baldrick@free.fr> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901131252.49945.baldrick@free.fr> Message-ID: <23786B55-3283-49C6-84C3-392A41478C2E@apple.com> I'll look into these issues. Evan On Jan 13, 2009, at 3:52 AM, Duncan Sands wrote: > Hi Evan, > >> Load / store alignments should be the alignments of the memory >> object used to construct the LValue, not the alignments of the >> values being loaded / stored. > > I've reverted this because it was causing several failures in the > testsuite, and also broke the Ada build. Also, I don't see how this > approach can work without major changes. Consider the following part > of your patch: > >> @@ -5956,8 +5975,10 @@ > ... >> } else { >> ArrayAddr = Emit(Array, 0); >> + ArrayAlign = expr_align(ArrayTreeType) / 8; >> } > > This is the case of when we are doing "a[i]", where "a" is a pointer. > There's no reason to think that "a" points to aligned memory, so > using the type alignment is wrong. So where to get the alignment > from? We get the pointer "a" from Emit, which doesn't provide > alignment > info for the pointee. As far as I can see either Emit needs to return > more info (complicated to implement) or we need to dig down into the > gcc > tree to get the underlying object and extract its alignment. In other > words, we need to do what we expected expr_align to do (only it > wasn't). > I think we should just make expr_align more intelligent. Since we > are the > only users of it, there is no danger involved in changing it. > > Ciao, > > Duncan. > > PS: I didn't check, but presumably this same problem occurs elsewhere: > we get a pointer from Emit and need alignment for the pointee. From dpatel at apple.com Tue Jan 13 11:18:59 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 09:18:59 -0800 Subject: [llvm-commits] [llvm] r62125 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp In-Reply-To: References: <200901130020.n0D0KpvA019669@zion.cs.uiuc.edu> Message-ID: On Jan 12, 2009, at 11:32 PM, Chris Lattner wrote: >> if (!Slot) { >> // FIXME - breaks down when the context is an inlined function. >> DIDescriptor ParentDesc; >> - DIDescriptor *DB = new DIBlock(V); >> + DIDescriptor *DB = new DIDescriptor(V); > > Why are you 'new'ing these things? The descriptors are meant to be > very light-weight objects that are just handles on existing global > variable descriptors. There should be no reason to new them, just > create (through various methods on DIFactory) new global variable > descriptors themselves. Yup. That's what I am doing other places. I'll change this. - Devang From dpatel at apple.com Tue Jan 13 11:21:34 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 09:21:34 -0800 Subject: [llvm-commits] Link failing due to debug info In-Reply-To: <200901131321.52282.baldrick@free.fr> References: <200901131321.52282.baldrick@free.fr> Message-ID: <5833A76F-3C78-4FCE-B7C2-171860D672D6@apple.com> On Jan 13, 2009, at 4:21 AM, Duncan Sands wrote: > Hi Devang, I'm seeing lots of failures like this in the Ada testsuite: > > gnatlink a87b59a.ali --GCC=gcc-4.2.llvm-objects-32/gcc/xgcc -B/home/ > duncan/LLVM/gcc-4.2.llvm-objects-32/gcc/ > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xa0): > undefined reference to `llvm.dbg.global_variable643' > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xb8): > undefined reference to `llvm.dbg.global_variable641' > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xd0): > undefined reference to `llvm.dbg.global_variable639' > ... > > Any idea what that's about? I can send you the corresponding LLVM IR > if that would help. Yes, please send me corresponding LLVM IR. Thanks, - Devang > > > Best wishes, > > Duncan. From gohman at apple.com Tue Jan 13 12:02:44 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 10:02:44 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <88EE2695-E7AC-474B-B812-5409F69F1088@apple.com> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> <88EE2695-E7AC-474B-B812-5409F69F1088@apple.com> Message-ID: It's a miscompilation on x86-32. The abort I saw was on x86-64, however the abort doesn't appear to be a recent regression. Dan On Jan 12, 2009, at 11:39 PM, Evan Cheng wrote: > I think it's failing in a lazy compilation callback. Dan, is that > right? > > Evan > On Jan 12, 2009, at 11:09 PM, Chris Lattner wrote: > >> >> On Jan 12, 2009, at 5:18 PM, Dan Gohman wrote: >> >>> Hi Chris, >>> >>> The recent 176.gcc JIT regression on darwin x86-32 isolated down to >>> this commit. Can you investigate? >> >> Absolutely. >> >> -Chris >> >>> >>> >>> Thanks, >>> >>> Dan >>> >>> On Jan 8, 2009, at 11:47 PM, Chris Lattner wrote: >>> >>>> Author: lattner >>>> Date: Fri Jan 9 01:47:06 2009 >>>> New Revision: 61985 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=61985&view=rev >>>> Log: >>>> Implement rdar://6480391, extending of equality icmp's to avoid a >>>> truncation. >>>> I noticed this in the code compiled for a routine using std::map, >>>> which produced >>>> this code: >>>> %25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind >>>> readonly >>>> %.lobit.i = lshr i32 %25, 31 ; [#uses=1] >>>> %tmp.i = trunc i32 %.lobit.i to i8 ; [#uses=1] >>>> %toBool = icmp eq i8 %tmp.i, 0 ; [#uses=1] >>>> br i1 %toBool, label %bb3, label %bb4 >>>> which compiled to: >>>> >>>> call L_memcmp$stub >>>> shrl $31, %eax >>>> testb %al, %al >>>> jne LBB1_11 ## >>>> >>>> with this change, we compile it to: >>>> >>>> call L_memcmp$stub >>>> testl %eax, %eax >>>> js LBB1_11 >>>> >>>> This triggers all the time in common code, with patters like this: >>>> >>>> %169 = and i32 %ply, 1 ; [#uses=1] >>>> %170 = trunc i32 %169 to i8 ; [#uses=1] >>>> %toBool = icmp ne i8 %170, 0 ; [#uses=1] >>>> >>>> %7 = lshr i32 %6, 24 ; [#uses=1] >>>> %9 = trunc i32 %7 to i8 ; [#uses=1] >>>> %10 = icmp ne i8 %9, 0 ; [#uses=1] >>>> >>>> etc >>>> >>>> >>>> Modified: >>>> llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>>> llvm/trunk/test/Transforms/InstCombine/cast.ll >>>> llvm/trunk/test/Transforms/InstCombine/icmp.ll >>>> >>>> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=61985&r1=61984&r2=61985&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp >>>> (original) >>>> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Fri >>>> Jan 9 01:47:06 2009 >>>> @@ -6343,6 +6343,28 @@ >>>> const APInt &RHSV = RHS->getValue(); >>>> >>>> switch (LHSI->getOpcode()) { >>>> + case Instruction::Trunc: >>>> + if (ICI.isEquality() && LHSI->hasOneUse()) { >>>> + // Simplify icmp eq (trunc x to i8), 42 -> icmp eq x, 42| >>>> highbits if all >>>> + // of the high bits truncated out of x are known. >>>> + unsigned DstBits = LHSI->getType()- >>>> >getPrimitiveSizeInBits(), >>>> + SrcBits = LHSI->getOperand(0)->getType()- >>>>> getPrimitiveSizeInBits(); >>>> + APInt Mask(APInt::getHighBitsSet(SrcBits, SrcBits-DstBits)); >>>> + APInt KnownZero(SrcBits, 0), KnownOne(SrcBits, 0); >>>> + ComputeMaskedBits(LHSI->getOperand(0), Mask, KnownZero, >>>> KnownOne); >>>> + >>>> + // If all the high bits are known, we can do this xform. >>>> + if ((KnownZero|KnownOne).countLeadingOnes() >= SrcBits- >>>> DstBits) { >>>> + // Pull in the high bits from known-ones set. >>>> + APInt NewRHS(RHS->getValue()); >>>> + NewRHS.zext(SrcBits); >>>> + NewRHS |= KnownOne; >>>> + return new ICmpInst(ICI.getPredicate(), LHSI- >>>>> getOperand(0), >>>> + ConstantInt::get(NewRHS)); >>>> + } >>>> + } >>>> + break; >>>> + >>>> case Instruction::Xor: // (icmp pred (xor X, XorCST), CI) >>>> if (ConstantInt *XorCST = dyn_cast(LHSI- >>>>> getOperand(1))) { >>>> // If this is a comparison that tests the signbit (X < 0) or >>>> (x > -1), >>>> >>>> Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=61985&r1=61984&r2=61985&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/test/Transforms/InstCombine/cast.ll (original) >>>> +++ llvm/trunk/test/Transforms/InstCombine/cast.ll Fri Jan 9 >>>> 01:47:06 2009 >>>> @@ -1,7 +1,5 @@ >>>> ; Tests to make sure elimination of casts is working correctly >>>> -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \ >>>> -; RUN: grep %c | notcast >>>> -; END. >>>> +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep %c | >>>> notcast >>>> >>>> @inbuf = external global [32832 x i8] ; <[32832 x i8]*> >>>> [#uses=1] >>>> >>>> @@ -238,3 +236,21 @@ >>>> ret i16 %c2 >>>> } >>>> >>>> +; icmp sgt i32 %a, -1 >>>> +; rdar://6480391 >>>> +define i1 @test36(i32 %a) { >>>> + %b = lshr i32 %a, 31 >>>> + %c = trunc i32 %b to i8 >>>> + %d = icmp eq i8 %c, 0 >>>> + ret i1 %d >>>> +} >>>> + >>>> +; ret i1 false >>>> +define i1 @test37(i32 %a) { >>>> + %b = lshr i32 %a, 31 >>>> + %c = or i32 %b, 512 >>>> + %d = trunc i32 %c to i8 >>>> + %e = icmp eq i8 %d, 11 >>>> + ret i1 %e >>>> +} >>>> + >>>> >>>> Modified: llvm/trunk/test/Transforms/InstCombine/icmp.ll >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/icmp.ll?rev=61985&r1=61984&r2=61985&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/test/Transforms/InstCombine/icmp.ll (original) >>>> +++ llvm/trunk/test/Transforms/InstCombine/icmp.ll Fri Jan 9 >>>> 01:47:06 2009 >>>> @@ -1,5 +1,4 @@ >>>> ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep icmp >>>> -; END. >>>> >>>> define i32 @test1(i32 %X) { >>>> entry: >>>> >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nunoplopes at sapo.pt Tue Jan 13 12:33:50 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 13 Jan 2009 18:33:50 -0000 Subject: [llvm-commits] [test-suite] r62171 - in /test-suite/trunk: External/SPEC/CFP2006/ External/SPEC/CINT2000/252.eon/ MultiSource/Applications/ MultiSource/Applications/lambda-0.1.3/ MultiSource/Benchmarks/mediabench/g721/g721encode/ SingleSource/Benchmarks/Adobe-C++/ SingleSource/Benchmarks/CoyoteBench/ SingleSource/Benchmarks/Shootout-C++/ Message-ID: <200901131833.n0DIXpP6003814@zion.cs.uiuc.edu> Author: nlopes Date: Tue Jan 13 12:33:49 2009 New Revision: 62171 URL: http://llvm.org/viewvc/llvm-project?rev=62171&view=rev Log: remove uneeded executable bits from a few files (and save some precious disk space :P) Modified: test-suite/trunk/External/SPEC/CFP2006/Makefile (props changed) test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile (props changed) test-suite/trunk/MultiSource/Applications/Makefile (props changed) test-suite/trunk/MultiSource/Applications/lambda-0.1.3/lambda.cc (props changed) test-suite/trunk/MultiSource/Applications/lambda-0.1.3/node.cc (props changed) test-suite/trunk/MultiSource/Applications/lambda-0.1.3/parse.cc (props changed) test-suite/trunk/MultiSource/Applications/lambda-0.1.3/token_stream.cc (props changed) test-suite/trunk/MultiSource/Benchmarks/mediabench/g721/g721encode/encode.c (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_algorithms.h (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_results.h (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_shared_tests.h (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_timer.h (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/functionobjects.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/loop_unroll.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/simple_types_loop_invariant.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_vector.cpp (props changed) test-suite/trunk/SingleSource/Benchmarks/CoyoteBench/Makefile (props changed) test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile (props changed) Propchange: test-suite/trunk/External/SPEC/CFP2006/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/External/SPEC/CINT2000/252.eon/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Applications/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Applications/lambda-0.1.3/lambda.cc ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Applications/lambda-0.1.3/node.cc ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Applications/lambda-0.1.3/parse.cc ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Applications/lambda-0.1.3/token_stream.cc ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/MultiSource/Benchmarks/mediabench/g721/g721encode/encode.c ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_algorithms.h ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_results.h ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_shared_tests.h ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/benchmark_timer.h ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/functionobjects.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/loop_unroll.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/simple_types_constant_folding.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/simple_types_loop_invariant.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_abstraction.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Adobe-C++/stepanov_vector.cpp ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/CoyoteBench/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Propchange: test-suite/trunk/SingleSource/Benchmarks/Shootout-C++/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* From alenhar2 at cs.uiuc.edu Tue Jan 13 12:48:13 2009 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 13 Jan 2009 12:48:13 -0600 Subject: [llvm-commits] CVS: llvm-www/pubs/2009-03-ASPLOS-Recovery.pdf 2009-03-ASPLOS-Recovery.html Message-ID: <200901131848.n0DImDX5000459@gravity.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2009-03-ASPLOS-Recovery.pdf added (r1.1) 2009-03-ASPLOS-Recovery.html updated: 1.1 -> 1.2 --- Log message: Asplos camera ready --- Diffs of the changes: (+1552 -1) 2009-03-ASPLOS-Recovery.html | 16 2009-03-ASPLOS-Recovery.pdf | 1537 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1552 insertions(+), 1 deletion(-) Index: llvm-www/pubs/2009-03-ASPLOS-Recovery.pdf diff -c /dev/null llvm-www/pubs/2009-03-ASPLOS-Recovery.pdf:1.1 *** /dev/null Tue Jan 13 12:47:35 2009 --- llvm-www/pubs/2009-03-ASPLOS-Recovery.pdf Tue Jan 13 12:47:25 2009 *************** *** 0 **** --- 1,1847 ---- + %PDF-1.2 + 7 0 obj + << + /Type/Encoding + /Differences[1/dotaccent/fi/fl/fraction/hungarumlaut/Lslash/lslash/ogonek/ring 11/breve/minus + 14/Zcaron/zcaron/caron/dotlessi/dotlessj/ff/ffi/ffl/notequal/infinity/lessequal/greaterequal/partialdiff/summation/product/pi/grave/quotesingle/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde + 128/Euro/integral/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE/Omega/radical/approxequal + 147/quotedblleft/quotedblright/bullet/endash/emdash/tilde/trademark/scaron/guilsinglright/oe/Delta/lozenge/Ydieresis + 161/exclamdown/cent/sterling/currency/yen/brokenbar/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis] + >> + endobj + 10 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F1 + /FontDescriptor 9 0 R + /BaseFont/KZESHG+NimbusRomNo9L-Medi + /FirstChar 1 + /LastChar 255 + /Widths[333 556 556 167 333 667 278 333 333 0 333 570 0 667 444 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 278 250 333 555 500 500 1000 833 333 333 333 500 570 250 333 250 + 278 500 500 500 500 500 500 500 500 500 500 333 333 570 570 570 500 930 722 667 722 + 722 667 611 778 778 389 500 778 667 944 722 778 611 778 722 556 667 722 722 1000 + 722 722 667 333 278 333 581 500 333 500 556 444 556 444 333 500 556 278 333 556 278 + 833 556 500 556 556 444 389 333 556 500 722 500 500 444 394 220 394 520 0 0 0 333 + 500 500 1000 500 500 333 1000 556 333 1000 0 0 0 0 0 0 500 500 350 500 1000 333 1000 + 389 333 722 0 0 722 0 333 500 500 500 500 220 500 333 747 300 500 570 333 747 333 + 400 570 300 300 333 556 540 250 333 300 330 500 750 750 750 500 722 722 722 722 722 + 722 1000 722 667 667 667 667 389 389 389 389 722 722 778 778 778 778 778 570 778 + 722 722 722 722 722 611 556 500 500 500 500 500 500 722 444 444 444 444 444 278 278 + 278 278 500 556 500 500 500 500 500 570 500 556 556 556 556 500 556 500] + >> + endobj + 11 0 obj + << + /Type/Encoding + /Differences[0/minus/periodcentered/multiply/asteriskmath/divide/diamondmath/plusminus/minusplus/circleplus/circleminus/circlemultiply/circledivide/circledot/circlecopyrt/openbullet/bullet/equivasymptotic/equivalence/reflexsubset/reflexsuperset/lessequal/greaterequal/precedesequal/followsequal/similar/approxequal/propersubset/propersuperset/lessmuch/greatermuch/precedes/follows/arrowleft/arrowright/arrowup/arrowdown/arrowboth/arrownortheast/arrowsoutheast/similarequal/arrowdblleft/arrowdblright/arrowdblup/arrowdbldown/arrowdblboth/arrownorthwest/arrowsouthwest/proportional/prime/infinity/element/owner/triangle/triangleinv/negationslash/mapsto/universal/existential/logicalnot/emptyset/Rfractur/Ifractur/latticetop/perpendicular/aleph/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/union/intersection/unionmulti/logicaland/logicalor/turnstileleft/turnstileright/floorleft/floorright/ceilingleft/ceilingright/braceleft/braceright/angbracketleft/angbracketright/bar/bardbl/arro! wbothv/arrowdblbothv/backslash/wreathproduct/radical/coproduct/nabla/integral/unionsq/intersectionsq/subsetsqequal/supersetsqequal/section/dagger/daggerdbl/paragraph/club/diamond/heart/spade/arrowleft + 161/minus/periodcentered/multiply/asteriskmath/divide/diamondmath/plusminus/minusplus/circleplus/circleminus + 173/circlemultiply/circledivide/circledot/circlecopyrt/openbullet/bullet/equivasymptotic/equivalence/reflexsubset/reflexsuperset/lessequal/greaterequal/precedesequal/followsequal/similar/approxequal/propersubset/propersuperset/lessmuch/greatermuch/precedes/follows/arrowleft/spade] + >> + endobj + 14 0 obj + << + /Encoding 11 0 R + /Type/Font + /Subtype/Type1 + /Name/F2 + /FontDescriptor 13 0 R + /BaseFont/USVGSE+CMSY10 + /FirstChar 33 + /LastChar 196 + /Widths[1000 500 500 1000 1000 1000 777.8 1000 1000 611.1 611.1 1000 1000 1000 777.8 + 275 1000 666.7 666.7 888.9 888.9 0 0 555.6 555.6 666.7 500 722.2 722.2 777.8 777.8 + 611.1 798.5 656.8 526.5 771.4 527.8 718.7 594.9 844.5 544.5 677.8 762 689.7 1200.9 + 820.5 796.1 695.6 816.7 847.5 605.6 544.6 625.8 612.8 987.8 713.3 668.3 724.7 666.7 + 666.7 666.7 666.7 666.7 611.1 611.1 444.4 444.4 444.4 444.4 500 500 388.9 388.9 277.8 + 500 500 611.1 500 277.8 833.3 750 833.3 416.7 666.7 666.7 777.8 777.8 444.4 444.4 + 444.4 611.1 777.8 777.8 777.8 777.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 777.8 277.8 777.8 500 777.8 500 777.8 777.8 777.8 777.8 0 0 777.8 + 777.8 777.8 1000 500 500 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 777.8 + 777.8 777.8 1000 1000 777.8 777.8 1000 777.8] + >> + endobj + 17 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F3 + /FontDescriptor 16 0 R + /BaseFont/QRXYSG+NimbusRomNo9L-Regu + /FirstChar 1 + /LastChar 255 + /Widths[333 556 556 167 333 611 278 333 333 0 333 564 0 611 444 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 180 250 333 408 500 500 833 778 333 333 333 500 564 250 333 250 + 278 500 500 500 500 500 500 500 500 500 500 278 278 564 564 564 444 921 722 667 667 + 722 611 556 722 722 333 389 722 611 889 722 722 556 722 667 556 611 722 722 944 722 + 722 611 333 278 333 469 500 333 444 500 444 500 444 333 500 500 278 278 500 278 778 + 500 500 500 500 333 389 278 500 500 722 500 500 444 480 200 480 541 0 0 0 333 500 + 444 1000 500 500 333 1000 556 333 889 0 0 0 0 0 0 444 444 350 500 1000 333 980 389 + 333 722 0 0 722 0 333 500 500 500 500 200 500 333 760 276 500 564 333 760 333 400 + 564 300 300 333 500 453 250 333 300 310 500 750 750 750 444 722 722 722 722 722 722 + 889 667 611 611 611 611 333 333 333 333 722 722 722 722 722 722 722 564 722 722 722 + 722 722 722 556 500 444 444 444 444 444 444 667 444 444 444 444 444 278 278 278 278 + 500 500 500 500 500 500 500 564 500 500 500 500 500 500 500 500] + >> + endobj + 20 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F4 + /FontDescriptor 19 0 R + /BaseFont/THXRQU+NimbusSanL-Regu + /FirstChar 1 + /LastChar 255 + /Widths[333 500 500 167 333 556 222 333 333 0 333 584 0 611 500 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 191 278 278 355 556 556 889 667 222 333 333 389 584 278 333 278 + 278 556 556 556 556 556 556 556 556 556 556 278 278 584 584 584 556 1015 667 667 + 722 722 667 611 778 722 278 500 667 556 833 722 778 667 778 722 667 611 722 667 944 + 667 667 611 278 278 278 469 556 222 556 556 500 556 556 278 556 556 222 222 500 222 + 833 556 556 556 556 333 500 278 556 500 722 500 500 500 334 260 334 584 0 0 0 222 + 556 333 1000 556 556 333 1000 667 333 1000 0 0 0 0 0 0 333 333 350 556 1000 333 1000 + 500 333 944 0 0 667 0 333 556 556 556 556 260 556 333 737 370 556 584 333 737 333 + 400 584 333 333 333 556 537 278 333 333 365 556 834 834 834 611 667 667 667 667 667 + 667 1000 722 667 667 667 667 278 278 278 278 722 722 778 778 778 778 778 584 778 + 722 722 722 722 667 667 611 556 556 556 556 556 556 889 500 556 556 556 556 278 278 + 278 278 556 556 556 556 556 556 556 584 611 556 556 556 556 500 556 500] + >> + endobj + 23 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F5 + /FontDescriptor 22 0 R + /BaseFont/NJETST+NimbusRomNo9L-MediItal + /FirstChar 1 + /LastChar 255 + /Widths[333 556 556 167 333 611 278 333 333 0 333 606 0 611 389 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 278 250 389 555 500 500 833 778 333 333 333 500 570 250 333 250 + 278 500 500 500 500 500 500 500 500 500 500 333 333 570 570 570 500 832 667 667 667 + 722 667 667 722 778 389 500 667 611 889 722 722 611 722 667 556 611 722 667 889 667 + 611 611 333 278 333 570 500 333 500 500 444 500 444 333 500 556 278 278 500 278 778 + 556 500 500 500 389 389 278 556 444 667 500 444 389 348 220 348 570 0 0 0 333 500 + 500 1000 500 500 333 1000 556 333 944 0 0 0 0 0 0 500 500 350 500 1000 333 1000 389 + 333 722 0 0 611 0 389 500 500 500 500 220 500 333 747 266 500 606 333 747 333 400 + 570 300 300 333 576 500 250 333 300 300 500 750 750 750 500 667 667 667 667 667 667 + 944 667 667 667 667 667 389 389 389 389 722 722 722 722 722 722 722 570 722 722 722 + 722 722 611 611 500 500 500 500 500 500 500 722 444 444 444 444 444 278 278 278 278 + 500 556 500 500 500 500 500 570 500 556 556 556 556 444 500 444] + >> + endobj + 26 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F6 + /FontDescriptor 25 0 R + /BaseFont/OESSYC+NimbusRomNo9L-ReguItal + /FirstChar 1 + /LastChar 255 + /Widths[333 500 500 167 333 556 278 333 333 0 333 675 0 556 389 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 214 250 333 420 500 500 833 778 333 333 333 500 675 250 333 250 + 278 500 500 500 500 500 500 500 500 500 500 333 333 675 675 675 500 920 611 611 667 + 722 611 611 722 722 333 444 667 556 833 667 722 611 722 611 500 556 722 611 833 611 + 556 556 389 278 389 422 500 333 500 500 444 500 444 278 500 500 278 278 444 278 722 + 500 500 500 500 389 389 278 500 444 667 444 444 389 400 275 400 541 0 0 0 333 500 + 556 889 500 500 333 1000 500 333 944 0 0 0 0 0 0 556 556 350 500 889 333 980 389 + 333 667 0 0 556 0 389 500 500 500 500 275 500 333 760 276 500 675 333 760 333 400 + 675 300 300 333 500 523 250 333 300 310 500 750 750 750 500 611 611 611 611 611 611 + 889 667 611 611 611 611 333 333 333 333 722 667 722 722 722 722 722 675 722 722 722 + 722 722 556 611 500 500 500 500 500 500 500 667 444 444 444 444 444 278 278 278 278 + 500 500 500 500 500 500 500 675 500 500 500 500 500 444 500 444] + >> + endobj + 29 0 obj + << + /Encoding 11 0 R + /Type/Font + /Subtype/Type1 + /Name/F7 + /FontDescriptor 28 0 R + /BaseFont/BSWYAO+CMSY6 + /FirstChar 33 + /LastChar 196 + /Widths[1222.2 638.9 638.9 1222.2 1222.2 1222.2 963 1222.2 1222.2 768.5 768.5 1222.2 + 1222.2 1222.2 963 365.7 1222.2 833.3 833.3 1092.6 1092.6 0 0 703.7 703.7 833.3 638.9 + 898.1 898.1 963 963 768.5 989.9 813.3 678.4 961.2 671.3 879.9 746.7 1059.3 709.3 + 846.3 938.8 854.5 1427.2 1005.7 973 878.4 1008.3 1061.4 762 711.3 774.4 785.2 1222.7 + 883.7 823.9 884 833.3 833.3 833.3 833.3 833.3 768.5 768.5 574.1 574.1 574.1 574.1 + 638.9 638.9 509.3 509.3 379.6 638.9 638.9 768.5 638.9 379.6 1000 924.1 1027.8 541.7 + 833.3 833.3 963 963 574.1 574.1 574.1 768.5 963 963 963 963 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 963 379.6 963 638.9 963 638.9 963 963 + 963 963 0 0 963 963 963 1222.2 638.9 638.9 963 963 963 963 963 963 963 963 963 963 + 963 963 1222.2 1222.2 963 963 1222.2 963] + >> + endobj + 30 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F8 + /FontDescriptor 16 0 R + /BaseFont/QRXYSG+NimbusRomNo9L-Regu + /FirstChar 1 + /LastChar 255 + /Widths[333 556 556 167 333 611 278 333 333 0 333 564 0 611 444 333 278 0 0 0 0 0 + 0 0 0 0 0 0 0 333 180 250 333 408 500 500 833 778 333 333 333 500 564 250 333 250 + 278 500 500 500 500 500 500 500 500 500 500 278 278 564 564 564 444 921 722 667 667 + 722 611 556 722 722 333 389 722 611 889 722 722 556 722 667 556 611 722 722 944 722 + 722 611 333 278 333 469 500 333 444 500 444 500 444 333 500 500 278 278 500 278 778 + 500 500 500 500 333 389 278 500 500 722 500 500 444 480 200 480 541 0 0 0 333 500 + 444 1000 500 500 333 1000 556 333 889 0 0 0 0 0 0 444 444 350 500 1000 333 980 389 + 333 722 0 0 722 0 333 500 500 500 500 200 500 333 760 276 500 564 333 760 333 400 + 564 300 300 333 500 453 250 333 300 310 500 750 750 750 444 722 722 722 722 722 722 + 889 667 611 611 611 611 333 333 333 333 722 722 722 722 722 722 722 564 722 722 722 + 722 722 722 556 500 444 444 444 444 444 444 667 444 444 444 444 444 278 278 278 278 + 500 500 500 500 500 500 500 564 500 500 500 500 500 500 500 500] + >> + endobj + 33 0 obj + << + /Encoding 11 0 R + /Type/Font + /Subtype/Type1 + /Name/F9 + /FontDescriptor 32 0 R + /BaseFont/CQGCRA+CMSY7 + /FirstChar 33 + /LastChar 196 + /Widths[1138.9 585.3 585.3 1138.9 1138.9 1138.9 892.9 1138.9 1138.9 708.3 708.3 1138.9 + 1138.9 1138.9 892.9 329.4 1138.9 769.8 769.8 1015.9 1015.9 0 0 646.8 646.8 769.8 + 585.3 831.4 831.4 892.9 892.9 708.3 917.6 753.4 620.2 889.5 616.1 818.4 688.5 978.6 + 646.5 782.1 871.7 791.7 1342.7 935.6 905.8 809.2 935.9 981 702.2 647.8 717.8 719.9 + 1135.1 818.9 764.4 823.1 769.8 769.8 769.8 769.8 769.8 708.3 708.3 523.8 523.8 523.8 + 523.8 585.3 585.3 462.3 462.3 339.3 585.3 585.3 708.3 585.3 339.3 938.5 859.1 954.4 + 493.6 769.8 769.8 892.9 892.9 523.8 523.8 523.8 708.3 892.9 892.9 892.9 892.9 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 892.9 339.3 892.9 585.3 + 892.9 585.3 892.9 892.9 892.9 892.9 0 0 892.9 892.9 892.9 1138.9 585.3 585.3 892.9 + 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 892.9 1138.9 1138.9 892.9 + 892.9 1138.9 892.9] + >> + endobj + 35 0 obj + << + /Filter[/FlateDecode] + /Length 4182 + >> + stream + x??ZI???r??W???M(l?}q[?????????]]a???E?g2?:????~x?LY??q?M???o8A?O??J??????j?l}? + 'w]?e{n?Y?d??????h?????l??k?W?'?h???!{e?A??!(" + ?g??\????9???p??y?B??=????Y????T???7?mI<1??5??mN?=???????Ko;?????P??mZ?????4f?{?-?????zk?O+gH??X???V + ??3??m?$u(X5??,???Z???87???????8?T??|n??y???f???k??n??7?? "??d!? ???2?D?k???S?'WP1^ + %?? "RG??]k????Q)??`am??-l???+?>*?|aq??H#?D{K!ReBe?4A'??U????+ ?$??(!|?p?,?h????p??1!?????(?:??U?S?????@%j??? ?7???B4??96z????2zE?1K??f??T???f???C%0q??+???:? ? ZOJ0??>?$ ?? + ?&U?J m???c}T*???} ?????7EfX$???}??-6?|???X?@N?#A g?v?m?^*4?{u?K?&???U??}?R%2??????(U:??q??0@??x??~/?9??????d?????f+W?\4??? ?q??,???? cH??????d??)?+?y?_l-?%???????N??????E?????m 3?i^7du?~r??/?dD?d?b??9?Kqn3?Pu????9"????KW z ???D???SFEr??m???#7?9Foyt"^?? ?9?z?>??lZ??t%?G2?B?????G???H?lao??T)?WS?!?X???????????)1???O?12??P?????s?:?M????|*?8??o%???&???????D + sE?jv:????-'s?]?*6PH?*W?Df??? )?? _j??%??m+???+?-\?EWB???{gm-}??KFU???BJ19?$???][??,%|nw? ??Q?M?Y + + (??N?e????(?:I?L??b??o*hY??Q?N???????I?????d??b??????C}h?#??l??B?+ 9y8?&51SB~D???3r?????> + endobj + 6 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 37 0 R + >> + endobj + 40 0 obj + << + /Filter[/FlateDecode] + /Length 4811 + >> + stream + x??[?r?H???W?26????N???]?L?uY?U????B?i{???#?i;??sgy???m#F:HR;?d;??P)?????I?:??>???xg?6C4?V|-a??$?t? ?n<7w??rW??????`n#?&???m3??-Vv??-}0??E?6T ??m??y?r?M??r?y[?????nW???h4e9.?s????????????HS,????n???MUa'??N-9?gUK4E/nQu.?????t???????gw???- + ?????jP??U5//Tu?4I*??}?,[;?%$???|??=~vOR???? ??,2?4??[fB?g???9 + ??E&??G?Q??RiV????3????~X?????`|} b2??S~(?XA???????x/q?? + 0To??lm?? + ?p? + m;??\?KD+?????x??z?@???sC? ???; 9?[????*????J?Ps?L>5????@9????{>8?wk??R???\8ZL}??A?L?7??u?M??:^?^??UbO?SA?9?1V 5??O?????????E??`?a??a?'? x %? ??u'?S?+???85)??V?????|? Y?S?s? + ;J&H*?V?$?`%?g+ ??n7R??k???G?i>? 4 [???J?q???????U???<>??_????Cc? n\??C~?^M??s?W??D?.X?x?F?2??c?Tf + ?x?I8? y??2?????????????1?t???:)I??Z:? ?6?X~?Q40EH???0V:?BF??Zkd?6?R??4V2???!?q?s????? ?f^??L? ??s:??>?m????I'?P????????XL?/?>E??mA??7?a????'?Ws??,M??5 ??A??????s????????:{??vL??z?9??cQvn??!?g?RoV#?????^???7???+ ??1?ch1J)[Q??#G???2h???h?h???t4?&??? q???????$ *v? + ???L?k??M???????&?&??Qo????s?X^z*???????x??u6?????l??r???)j?e9??&?????F???????6?v&?"7?,???0???+??P???Bm??3?8?/?Abar??] ?9????^m??????y??f?8 at Q9???(?K??W3?2?[????!?%l??F{???-???????f?t7?????????5b????I??D??? ??T???9_???f???D^???????`/?qp?C/$9???]H?|??6=i??5???to\?3???????G?4??????,??????m????'????r?6??@?? b0D??j?(?????????j -??}*???????:???k\?b??A? ? ^??+nar d?.?+H?P[d???????"??eo7d^U q?%?? "p??63??1?4?r{}?}e7?> + endobj + 39 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 41 0 R + >> + endobj + 46 0 obj + << + /Encoding 7 0 R + /Type/Font + /Subtype/Type1 + /Name/F10 + /FontDescriptor 45 0 R + /BaseFont/IMJIEZ+NimbusMonL-Regu + /FirstChar 1 + /LastChar 255 + /Widths[600 600 600 600 600 600 600 600 600 0 600 600 0 600 600 600 600 0 0 0 0 0 + 0 0 0 0 0 0 0 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 0 0 0 600 600 + 600 600 600 600 600 600 600 600 600 0 0 0 0 0 0 600 600 600 600 600 600 600 600 600 + 600 0 0 600 0 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 + 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600] + >> + endobj + 47 0 obj + << + /Type/Encoding + /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/alpha/beta/gamma/delta/epsilon1/zeta/eta/theta/iota/kappa/lambda/mu/nu/xi/pi/rho/sigma/tau/upsilon/phi/chi/psi/omega/epsilon/theta1/pi1/rho1/sigma1/phi1/arrowlefttophalf/arrowleftbothalf/arrowrighttophalf/arrowrightbothalf/arrowhookleft/arrowhookright/triangleright/triangleleft/zerooldstyle/oneoldstyle/twooldstyle/threeoldstyle/fouroldstyle/fiveoldstyle/sixoldstyle/sevenoldstyle/eightoldstyle/nineoldstyle/period/comma/less/slash/greater/star/partialdiff/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/flat/natural/sharp/slurbelow/slurabove/lscript/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/dotlessi/dotlessj/weierstrass/vector/tie/psi + 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/alpha/beta/gamma/delta/epsilon1/zeta/eta/theta/iota/kappa/lambda/mu/nu/xi/pi/rho/sigma/tau/upsilon/phi/chi/psi/tie] + >> + endobj + 50 0 obj + << + /Encoding 47 0 R + /Type/Font + /Subtype/Type1 + /Name/F11 + /FontDescriptor 49 0 R + /BaseFont/ERLIMD+CMMI10 + /FirstChar 33 + /LastChar 196 + /Widths[622.5 466.3 591.4 828.1 517 362.8 654.2 1000 1000 1000 1000 277.8 277.8 500 + 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 777.8 500 777.8 500 530.9 + 750 758.5 714.7 827.9 738.2 643.1 786.2 831.3 439.6 554.5 849.3 680.6 970.1 803.5 + 762.8 642 790.6 759.3 613.2 584.4 682.8 583.3 944.4 828.5 580.6 682.6 388.9 388.9 + 388.9 1000 1000 416.7 528.6 429.2 432.8 520.5 465.6 489.6 477 576.2 344.5 411.8 520.6 + 298.4 878 600.2 484.7 503.1 446.4 451.2 468.8 361.1 572.5 484.7 715.9 571.5 490.3 + 465 322.5 384 636.5 500 277.8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 615.3 833.3 762.8 694.4 742.4 831.3 779.9 583.3 666.7 612.2 0 0 772.4 + 639.7 565.6 517.7 444.4 405.9 437.5 496.5 469.4 353.9 576.2 583.3 602.5 494 437.5 + 570 517 571.4 437.2 540.3 595.8 625.7 651.4 277.8] + >> + endobj + 53 0 obj + << + /Encoding 11 0 R + /Type/Font + /Subtype/Type1 + /Name/F12 + /FontDescriptor 52 0 R + /BaseFont/BAJWVJ+CMSY9 + /FirstChar 33 + /LastChar 196 + /Widths[1027.8 513.9 513.9 1027.8 1027.8 1027.8 799.4 1027.8 1027.8 628.1 628.1 1027.8 + 1027.8 1027.8 799.4 279.3 1027.8 685.2 685.2 913.6 913.6 0 0 571 571 685.2 513.9 + 742.3 742.3 799.4 799.4 628.1 821.1 673.6 542.6 793.8 542.4 736.3 610.9 871 562.7 + 696.6 782.2 707.9 1229.2 842.1 816.3 716.8 839.3 873.9 622.4 563.2 642.3 632.1 1017.5 + 732.4 685 742 685.2 685.2 685.2 685.2 685.2 628.1 628.1 456.8 456.8 456.8 456.8 513.9 + 513.9 399.7 399.7 285.5 513.9 513.9 628.1 513.9 285.5 856.5 770.7 856.5 428.2 685.2 + 685.2 799.4 799.4 456.8 456.8 456.8 628.1 799.4 799.4 799.4 799.4 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 799.4 285.5 799.4 513.9 799.4 513.9 + 799.4 799.4 799.4 799.4 0 0 799.4 799.4 799.4 1027.8 513.9 513.9 799.4 799.4 799.4 + 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 799.4 1027.8 1027.8 799.4 799.4 1027.8 + 799.4] + >> + endobj + 54 0 obj + << + /Filter[/FlateDecode] + /Length 4737 + >> + stream + x??[K??????W??T??C|????=???]{??{r??E?$?P????\????/AB"?=H<$???SF???I??x???_??2,??ooO????????????K?t??????|1???i???f?='? ?e?Mv?u??A?2$ ?7.??:????`???i??]???MM?als????DQb????? ???6?????8?Lv0?k?????q?7[???????@q?3???R??k?V???3?6?p???e????n?J?????"??8?c???nC????. at K?0w?3< ???t??\u';?q? ?? ????=?qT(??+ ?h?n??????n?`??????PM???D`h{??/?????>?"??????+4?????u????y7)??d?*YQBJ?????A?8&U?7?}nC??y?2?Z??< ???? #??[?&dgG??H ??????R(?7L????????y?gp2bB??7G??A????&???=??M?_*????Q???B??O?%W?&o[Tf?(???b??A????;/????X?1??;?3?C??2b4?????????|??t?iw??-??=?lJKYO7?/?K3????C???,6?@??????.??bU?y qItr?S????N???4I=??8????Bk\k{&??g??????6??au|g5"??-,?A?[}?Z ?G?????(s???o-??a}???%f?:????t??V??c k.??,?"?n? + )??P????$G];6?.|<8s6I????????<??&???8d? ?:[dY?|???J?w??84:|??Q????uA??7HHv?k?0N}??wu??1??;??O??*???*%?G? w?.?;B,80??????u??L??&4???,??!?????Z??????$!????wYX??u?f?Y?u/???q#?q?"??W?r?Cg[?Z??;????`????G?`??b???Jb?G??M?? D??????B? + ???b5??>?????H9???A??-O????z?????+ ?B??e??H?????t?????  ;?????q+ _9 B????H'?^?1?@??????Q?{??\?*34?swB?????2??K?5%-??????o?B?|? + A:??:??}{??,v??>~2??%??????++ g?N'Q*?$ ?8z?cF??e: ?N"?4'Ge????0???u'S??kG?f%?Y??)l=.+I?i?f?????9???l?C?X????B?$+?&??cNd??r?_-~y?!B?FzW\w??~??dU|dm#??M15R?8'? + ?b.?8???s??F???Z?K+???v?????*^R]? w?+ endstream + endobj + 55 0 obj + << + /F6 26 0 R + /F3 17 0 R + /F1 10 0 R + /F10 46 0 R + /F11 50 0 R + /F12 53 0 R + >> + endobj + 43 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 55 0 R + >> + endobj + 58 0 obj + << + /Filter[/FlateDecode] + /Length 4722 + >> + stream + x??[M??? ??W??0q????ww?E?v??N?????c???N???$???@O?(Y?$?|H)O?O?O?????_??S?T?e???????}???????y?????,??v?g???t???????C]??(??????????}[????? S?n???Lm^? ???5?;???W????^??B?$T???HT]???n?w?8????H?k=r???v???t2?c6M????}C????k7?C}?.:w;p= ??K?')??{95#S4Y????~"?????h????????P????z???0??}?Z??????i?cjW??????4??K??\???????i?D?s]?L???e??z??0??E ??]? ?Os?&$z???w????'????2???Lh?? h????!he???/??T???????w?q9E*i???????????2#???S?X???????????s?'???O????T??9e??S????|??Rj?Rzc}6???????G??^d??,?~!l????????8T?s?8??t?Z???b??*?(???????G??J?????Dz?`??_b<">T=+lD?S}???X_??HG?AC6y?G]wZ???p??h????q=w??NYNi?L*,h5cp??d>&DO?J?e??????????;&3d???m?y?I?!s??,?e_R5?L,?R!?&Bg??????Z???N???-$???v+ =??I?gM??$3t ~?HRM5H????v???A??kW6gk??t???h?B?g?p??t&??AM+ [?M????QN*{?ZL????JE??..?D?i??_j??6?A?~??+ HN?/F???????'???ID?izVm?sr?s???3A????L>?^v9)?'???mC??f^?e?S! q!??B???!7!/??y????O? ??P??L????????????".??t'?6???RidS????2 37 ?Yy?W?e??f??f? R=[?~?7Z?I?J98qf?N? CnV?H?????g?&!Q????o?e ??~L?5%???_p?h* h??t?/E?/??Wm??R?L?A?$~???????R? ?'5}?f?.v??b????*s#??b?U?F?*g????r)?? ?Z"??8??+ V?+?????ek????3?????[??Y-???9?WQ?z]-?(r=G?Z??`?Au?t?"%T??v?A]?F? ?r./?t?^????n???/?? ???;?j27?@??.? e??p?@??F??Y?{Y???M|?s?[??????C7g?Y=/????%???'!|05?+G??&?????/???TQ?q6?+?z?????>??O???#???ir^k??,??qG???$?*?????xg?S2???????r?????p?? + 4Q@?????F????????b?;w????T#c?,??*?4?u?GJ??/.|?7'v?????\?g1 + endstream + endobj + 59 0 obj + << + /F3 17 0 R + /F1 10 0 R + /F6 26 0 R + /F11 50 0 R + >> + endobj + 57 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 59 0 R + >> + endobj + 62 0 obj + << + /Filter[/FlateDecode] + /Length 4647 + >> + stream + x??[I???u??W???(B+ ?ZL? + ?j???o?D&+ ?0|z}???'yz:D??C?O?????Z??????`??N??w/??=?"{z?@W????????????}w+?v????z + ?7 ???_???}?5???"??E%?BR??zR1m???EW????c?;?????F???H?y:/"Ug?< ??Y????U?T?0 ?Sw?Da??v??$????2Rw?(?]?N??}???~}?/?V?c] ?U?9N?W???J?9?|??J????#?*>i1?5u??T????_????L???$ ??3?&???C???$A??yd?V??V??:?.Wu?????????a????7Y???9q&!?????3C??????NP??p?????BC??????6 + ?> + ?0?34|T.P???`?R?0???L???? ??=L.08/, ??,??? ??0?P(n"???#i??y} X$ SY$ ?? ?????P??!=???Z????J?^Z?N??g}???g?2N?X6MW?c?????}T?6??C?1???c-???d?Q??v#????Tp??V}{?%???\ 1?]??@???[{- ?L 3??????M?f z`\?h??6?, ? ? 7K?????zHF?6??+ ??1i?P?i8??>?????? + 52?4?pX?????????0v4Xxl??0??????A???T?]ZN??Jn???\6C??Z???? +KB???$#? bkh??n?gbm ???&U?]???Ao2?w4x+?z?/E??7?O?}?^?}b?\???c?C+`?Qs?p????????S/?????u???p*??3?O????f[7????M?*\ ????#??P}?4D??uX-^???7?-Rc???m?&N ?I?~p??1,Dc???????R??d?f?HC?*' + TA?W?\4?,?????????dt?????>@??,V;]b??Z?+ ?????nt(X?`7?T??{;2Ab??l(|)?f\?? ?>???1??n??c+o???83????dh ??B??0Q? ??????%?????????B%??a??w?7??]y?r?f????3??TwN?????D7?4?A?_?;??@???4?B??T(?H 6? ??????????+|?8???"T/\_??u'GE????\?#&???y,?????yf,X? e????eC,b??( YG)4q?>??F?????:(?????A?C ?n?????K??PG7k?????0?g?#7??H??n???b??0??#q?h?M?J ?S????7?q????/??$?Ia?c`?? ?-5L?$f?a?>z????WiH??h????9gI ?+???Iv?L??96??a???2??D?&??MJa?????h?Y??x??$c+??????#?m??Z?4??gM1{? + y?<???lJ???????J Z?24ZQB o?m43/??N?r?Z?o?-)-?_??Ly&-$B5??W \>???w? Q??+ Y> + endobj + 61 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 63 0 R + >> + endobj + 66 0 obj + << + /Filter[/FlateDecode] + /Length 4472 + >> + stream + x??[[s?8r~???[?*?!^w?????6??Te\?????5HP?O6.???F_?n?Oq?O?O????????/???????????O?"??????s?14??lU??_W?(?7??]?????g4\?7???}??\75?;??][On@???'7??? ?e?_/??+JhITe??o?p?hkw'wu??u???????t?G???]??e?*???Lg??????/??o4??|7^??F?n? ?A83??t1!????????????t???ax?iC????????S???&9?y?iR??~B?V{lo'????d^r?=? v"?.k??.5??? ????;?a:?[w?$\???t??Qxe???7xR????\??D+ ??Ejl?-,=N(?H I?O???k+ )C?B??j??1U,)??L?>@???????"&x??)?/?F =h???????i3&,??00R?I???J&H?r?+?7?i?%#EJ??{???Xx2??g ??E????9?(?J???%|??????R?*?"?T??7??i?Aq1??I??? ?+M??B?+ K8Z;??" + ?j??78e?%?~?? ??&>x]L????m?&N???[D?????D??e?G3??"?n?1??$^???m??*X???wV??mN:??u???????[F?s??????w4i?s??&?i M{4?iv??{?.$??f???\?i?0]-3?|?7???Fi??8??y?*?R@?? {?,Tt?Y ??/nC3?5DGxl? 4? ??? ??S?W????E?"?H??????l?uh?????pHh/??????? (???????h??\B???/)???A?k?J?:?f7?M ??? Q??%?? + Gy?6E,^)Z0??+ ?t? r/?????[?J?,????? + ????UK??????U>*?.?/?s????[??|?+ K????Ad?/?2??T?%????????M?s?a?}?)/$  z78?77?x8)4D(n?qk@??Xc??????/)?????y?bi?????AY8pG??0??A aw>_??1??o??K????T^?d?? r"???{?8?i??]??,??Q?? +M??? ?????VP?Y?s?<1?????)??Hm??oBEO?"????y?D?>? U%!?*?~Q??7????$??l???D???Y???8n?Z???]!s??????J^T?x?EU#zx??|??}7j.-??V;?UvJ??5f??H???>????sgA????YQ?< ?Wz???w?1?X???-???????& ?? X?]za????SL??`??}??c??v????????ObS>?G??C?u??Fa????Ph?!?k?? ????)YVy??B???+??j???? ??2e?{S???)?--n at KC??.?zm?1??f?`??"????? ?4?? j_? SE?????p?Z?????,???m???/??Z + endstream + endobj + 67 0 obj + << + /F3 17 0 R + /F10 46 0 R + /F1 10 0 R + >> + endobj + 65 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 67 0 R + >> + endobj + 70 0 obj + << + /Filter[/FlateDecode] + /Length 5980 + >> + stream + x??[K??8r??W?O?"?8$?v??n??c7&<3????K?$nS???????;3????~\ ???ROa?O?')????????"(?????K???dA?=????7Cw??/?????r_5?G?W????????s???hS?[Sl?m?p?5??Q???q??????????i??z? o&????H??X?U?]??M??a?A#?l`?/Q???U???%N??m[l?v????????_????????}Up?????(?T??l)??????sY?YeS3???IPX?i?b??????,??z?2??}}??E?0*??4:?D???J?G?8m??F??@??R?{Y?????_?+ ]?w?????T:????o?}y9?<?x?=?X]1???a>????u6,?=???+LH??0?s??}w?u??&?5?%!?% 1I MG}?r?@?/C??z?tD?%????T=T9WcI6c???? ?$??]?+ ???k????c????K?m ??d?e??????gta?TkHUN?????w4l?\??8????X?rij??"5\?}?(^bfSV????b???0?~?.?g???)ZcwWlp?"&?]?i+,PR??6???~C|V?? T????g3??3)?T??9?c?@?F????1?k?g?;@? + ???????.V!\???z0?tC~W?M}?4???*J$+ ???8??%???l?_?3k?aE????0?A?Y?(:??m??????GA??"f??????????oO?_?HY1?*q?l???1w???(??&????&6.81?q??| "|A>.??XY????`?A??y?iC?v?AcZ.?(???A????FF"?? ?-Q.???f?????/Fy,}T|??"?7??Q??h??b?1Y???J?j?j!? + ?B???_.d ???0Y???]!4AB*.??%|??????<?CQ?y + ]??"?H????S"~?L?&??`???0?? i?A???hRX???,?sv???????E`????x?=?"?1(?????t?o? C + ?o!?ql?I?>??3?j0?????"???}0s??? ?`?N-?W/j?-?mX???L4??2? + ??)uTO* ??ppc????????????%???|??????????????(???1??????>27[RqE?}+ + ?? ??????????yt`?2#?9(????????????X&wp??\?z??1???????f????nx?23"v?` ??????a??a?\??_???y?%?A}???@S\?Q???=?M????;??&??????,?C?`?~#??Y??z?K??8?^S?3??`??c ??f?V}S?x?????????8??S?\a7.?PI???????}????MOB??RE1h_?2?=~??Ms? + ?{ + ??*?0/b `H{???#?L?Vz???\?h?????H??;nQ????????J????8??]???????????????;L?Wi?v?v??*Hp??Z'???r?????O(???S??h????E/!??????\ + endstream + endobj + 71 0 obj + << + /F3 17 0 R + /F1 10 0 R + /F6 26 0 R + /F9 33 0 R + >> + endobj + 69 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 71 0 R + >> + endobj + 74 0 obj + << + /Filter[/FlateDecode] + /Length 4964 + >> + stream + x?};Iw??????|4???''?o??>?????`?+ b??7?Z?Mu????u??????i????AO????zT?J/3??Q? l[?=????P??VL?L????O??v???;x???}K]?O?0+???W???????UPp?????j8= + ???3???~(?r?Y ?f?hV??!y?^??|2?%??????!?9U???????V???C????????A?3?h????`#?/Q???rk?c????xC7?i???????nG)?}??Vvd????(?Gv/rK? + ??Y?"?+??? W?h?T???T"?h 3??qHg>c?I?Z$C?????f ???]??#=f?8?e??S?L???? ??7?A???r?Y/$??C????K?????@e?????)??g??r?? ?e?J?t???{??i0 hl2??W?????"E??0???o???e?3?b???????}n??7R?:?????=81/?/?9oFGi???W??Bm??????c?? ???D???-A?!s?] ????^?)m?1TN???k7?+ ???????1&z?+3??o?Qd??EW????????b???h??$??? I?#DD???]}???o?????Y?^/??B?`?v?VM??h ?+?8-?j?W?-Jj?L????|?? + @'???????W`?W:G?[_??;??q??g9#??#????? + Zt?q@| ???Z??*.z?g`o??D ???Ne?64?Mvm??g??@eZ??? bd??X?KPD??.K{\ ??\????7'bF??? ?X`E?????Mxt??????e???#? I?K??:Q?77??1+ ?4???H?O??????U??!???Q??}g???????{p\J???? E??!??0 ????|?\j)?J???????~s(.Wn????#?e2&??:Nxr#???C?w2n??1?#~&g ?????????l??o?JXU???h?Kn?6??6?H??????!%??=U ??8N?KW???9w7f??A????l??,???=?8???/p?Y?o$"?7?)q%?t??J;???CcL'???+ i]???U,V?????k>mju?x??ts{?IJk\???] ?v'?5??X2R?$???3??Y???u??V#?t??????N??Yni?t?atuc????Y?=??H2U????-?R?Q#????wK&A??K??)8??n?" + ??m???PQr;Cs??Y7??Mv3??_5??=I#??`<?/?8?< b??+????<^???8"+ ?(??a???m?&????D>????O[ ?H?Lw???4??#??p? + ??M??[@????$M????h???b%??n?4??(?????}[B?j????? O??7?????(t??r??aV???i$??5R+ ???}+?r + ???? ? ???w??bOD?#?H~?m> + endobj + 73 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 75 0 R + >> + endobj + 78 0 obj + << + /Filter[/FlateDecode] + /Length 5266 + >> + stream + x??;?r?6r?? + U??Ui?+ ??FU?w???U?=??"56}w??;? \???$???q`V?m??@????k??h??v?0W???1z??j"?? + ?-?I$??????L? .h???t?_?W_?[??#e?Y#?Aj?J?}???[??4H?C????J?9?d???4#???/??>?;????xmj???????????e?.?f?F??S?O??w?`??q???@?}?J[??8k??????N??cT??G Lg ???[*?????]?Ru?? xx# ?`???5?`N??w?t???\[::{*0?????Bw9#???\???? "???}?'s????e???m?1?rqk??%?E????-??m?^ru.'?{?&l1?1?id??T?<???B???]F#?\G???t?d???/?M\??l?y????"](?(t??u???IP???8???Zdn??L7??0?>Iq??{?e?N? G,?pV^??9?????t?M?(j??????G?????r? !?2'??c ?{{t8?t?se????L? NL?-?}A?C???B??}??x?sx?N)/5HnD??u+ ?og?z*?t???3???(;???p?A ??3?m??.b??.POME????}???q ?I?jz??z?gS????Y&?R?P??]?R?G??G?? ?W?????|6?????BTw???P?(?????D-|?)OM?L????4?????$]?Q&9??????~Xv???V!?????!jd? ?K]?q? ?O??w??+???S???W?x??y?S??z??5??~??J?/?&0?w,U??? o????d?2X$??????A??a?u???VYQ? =?RU?r?A??[?:Q?s?q)*d22Q???K|???K8?????zO a.[S???C?p???f????=?OX???? g}??D???W?L??oO?qe??t,o?Js???BM????JOB????! ~?O?/l???v???XDE???M Q)j|o???\? [24Xh8???>h??+T??7?S???}?K??@??M`???? 4?jhN?8Mcl?????^Ln?????????`??q&????? o??8+ ???L0??-)??&k??+ ?:??[?.????qV?v???9s?:)X;H?Xw?;????!??,b????+?=? ~????0??????Is??x)??]{u?_\%'x?m?xF?????-??w2? ???>?????&?d??'??f???;??????S;?Ja5?8q???S??(??C?`^JD?Gih????Hi*???h??0Q??[j??2)0?????y?oH??;;????p??L????v{??6??8]$?,?????4F????"??????H???J?z0?{??????&???F I?;??+ ?:K???90?q?Qx???W??ql????G?}?????% + M???}???'?? + endstream + endobj + 79 0 obj + << + /F3 17 0 R + /F10 46 0 R + /F6 26 0 R + /F1 10 0 R + /F12 53 0 R + >> + endobj + 77 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 79 0 R + >> + endobj + 82 0 obj + << + /Type/Encoding + /Differences[0/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/exclam/quotedblright/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/exclamdown/equal/questiondown/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/quotedblleft/bracketright/circumflex/dotaccent/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/endash/emdash/hungarumlaut/tilde/dieresis/suppress + 160/space/Gamma/Delta/Theta/Lambda/Xi/Pi/Sigma/Upsilon/Phi/Psi 173/Omega/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/acute/caron/breve/macron/ring/cedilla/germandbls/ae/oe/oslash/AE/OE/Oslash/suppress/dieresis] + >> + endobj + 85 0 obj + << + /Encoding 82 0 R + /Type/Font + /Subtype/Type1 + /Name/F13 + /FontDescriptor 84 0 R + /BaseFont/AWDWUD+CMR10 + /FirstChar 33 + /LastChar 196 + /Widths[277.8 500 833.3 500 833.3 777.8 277.8 388.9 388.9 500 777.8 277.8 333.3 277.8 + 500 500 500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 + 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 + 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 + 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 + 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8 444.4 500 1000 500 + 500 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 625 833.3 + 777.8 694.4 666.7 750 722.2 777.8 722.2 777.8 0 0 722.2 583.3 555.6 555.6 833.3 833.3 + 277.8 305.6 500 500 500 500 500 750 444.4 500 722.2 777.8 500 902.8 1013.9 777.8 + 277.8 500] + >> + endobj + 86 0 obj + << + /Filter[/FlateDecode] + /Length 5043 + >> + stream + x??[K???q??W??atx????iIy?5?^w?:ht??1????;?zg??h????U?Y?o?y????????w????Cx??Yr??|???????w??3?u????a:Y???=#???????_??z???@??u?????~?.???|?????????Eawy?"??]{?$`}G;?D?$??w.?b?/?J? b?;BE ?????Y .5?v?P???"??J?o?????]??????u?0???7??HO?Zj?p??c?A??Ce????7?????3?#z??v?/q??? ??N?J?M????|?1???Fb3?7?^,"S?pu?????????}???0????????4?3???9???74vNo?X + ???D??g????B???U"??.;? ???v??(>???n???G??? ??6?????h{??F;????"?f!+ 2??E=?u R??m ??]??x??7??P?!L?E?H'^v??? ?}c,,???'?>}! c??,??k?=????7Vv?6?+ 6??2v ????`='Q@?t??8?;?t?Z???[#E?n?_??p????c?\?f???FE>?&V??,?]??\4c?b??9??"g???i???F,??"?s????p^Fq???????KT?G?c?}'>?C}?(,??????)?|???2W?K?f?i~J?X3v1 + 3??j?q6]H*?k?u?3Z????W??(?q6??o8W?~?v????(??4???Kt?N??3??:??Y\?[?+ 7??e??(??Er p??Y??[??ON?d????9?/??_l ??zT??Il??????????????????R???.?+?N?? ??mBO`f??`?4~?+ hA?5)??mZ??+R???7 A?h???_??@\???&3??M&(6??h?;P??FW4??d?41P4??? ?'?7h2?i?I??= uC?8p9???i???i@?#6?;?2??2?C????Y?A n???????T"??????j?_QTQ~??F?NX%????JE?*?#?=?R?????O?]??I??q???+ ?>.?i?n E "2 ^?f????K5t~??'???}Gv?&U}?{k? ??n?????Th?)????X^+ ????B??C?H???R???6p$W:lr(sT?h???}??C?t1v??v$ {?x?c??d??*??????F???N?Hw???( <|??x0=??zK? ???h??K????u? ?/S??)????E?m?p=?#?h???'??xR??.&'?&0??QL????"1????W=w???!?d?Yx?(H???I??P_q????0?????i?S9????5h^? ?ipD??Vu?g~c=D)??$*???Q??????,MF??K??# ???)+ pr?2?#??????&??? ]?x?&v?y????.???k??YJ&?@???H?? ?y*?8??Fj???;??l$?d???M??Y??{?z=U?|?C}e?+wC??`?????Qa8??0 ??????????2V K??XQ??qQ??a???d[????? >_? ?E??#??RD ={?A?;???7.KhL??%1??J?H??g?Q?$?sq^?F???????S?????P?\?)????ZK?a4???5G?o!'??L??k3?E]?????g????! NnZt??yGzR?+ \????^??I?? ????t??`I*7i??(???sOR?p?|q`?Od??T+??C?c???`@??r??5???? ????+????KJ??Ne????k????A"-???cn?Z??=o=?%??&??2\K????; ?q+?E?l??????p??0a?J????$?/)j?/%??TF???7V + g/???????J\????#??R + endstream + endobj + 87 0 obj + << + /F3 17 0 R + /F1 10 0 R + /F13 85 0 R + /F11 50 0 R + >> + endobj + 81 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 87 0 R + >> + endobj + 90 0 obj + << + /Filter[/FlateDecode] + /Length 4581 + >> + stream + x?}[[s???~???L_?I! J???'g???{N?????,????????oAR?'-{???????A~???/O?|o?u?}x:>????*]g????????*NwAwr+ ?W)????c_?QTLC:????`?f?G|po?"_n???2D???~4?j}??4??{9?Qef@?4?w?z??????Q+??-?z?x??cS?9??g??O?%?|?}?????q?N2?????eY???????E?u?????;???dt?)??P(%?????+ ?D,????^???Sx?????uH?Xk???+ p?py6(???7)???J5?E?1Qj???n??Q^X?{p????????H??KLl`c?????ts????&?X}?"+?????PK????,??????.???m??2?z???+F?%rF????`Z????n??L? G?+V>?>???YDI??%??~??,??l?H?l?[????????j ??????+ :??B + @4?^f?????????A? 7W??'/qLxu?h??? ej??;{?HQ?!?????{???a???????/T?i=????=???????0??;JQM?g???f??????????p??% ??ed7c)?"??? + ?B'??x?2?G??x?]DS?w?eq?????e??I y(????H9h ?BS? !?I??9At?8?? 2?????????_?j5E????????? + endstream + endobj + 91 0 obj + << + /F3 17 0 R + /F1 10 0 R + /F6 26 0 R + >> + endobj + 89 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 91 0 R + >> + endobj + 94 0 obj + << + /Filter[/FlateDecode] + /Length 5723 + >> + stream + x??[I{?6?????-??Xl??o??K?n?'?I:??-????n???j IT&s??B??U?N?qN?O????????{??v?<???OR;?p?????N?????$??u?ri?mU???zUBjT??N???x???j?S=T?}u?i;??????p??n?G??????,?????37?????RMQ=???[Y????+??,???ZOM??L + ????k????,?h?????^?7?[~???U/???~0.?-???Rek#??~??@??E?5???i[?3?r?~???R?q???;?+ ?o????C;?R|?7?8~??;? + ?{+ 6 + ??h7?I????X??o?M????@S???&0&?OZ???M}}[ok?????&k^?S??G????V0????8????-??3?K`??? ???.h?? ?d?C???i`k?M|Vj???06e?+ ?????????c`&???N?#????p?u???e???Y??W???BT?????9:???sb??e??n-[??q??7?Xm?~+ ?M???uB???kp?y???????I1??;??????????`????p??8?I?ec??;!1S?E'???5?S?????i?Y~Y??,?9?Op??8?+ 6?H? + H,Y?WX???q??A?k??? L??y4B?M$?fg???????#; ?Y??w?)X????Jv+?BQ?+ ??????+ ? q?L???oX??????H% ???,??e~?b???`^?-?&0??- ???]?jAtv???= ???<??????ha+ ?? R;?U?X???,uI?????z?????R3~??#??N + ? ?;????,1???`?r?Y??C??'??????#?MG(??/1??W+d?#?????P(1??$j2P?F?4(z? ?? ?;:c???,???yf ??B????q-?9iI) c?1??t??\4????????%??h(H??"??&=&?g??0?t?8?w?R7 d?????i???T6?%?br?|?W 2 H????r?d???%kJ??~????B??\4?,/????o[??8?q?Kij?H?M?2?e??+ ?+ e ??Q??+?s?' sZ?????+ 5?Al???? G????????????H4>./?@??+ m??? + ??? + ??I?U??'w?5?ls?''?(O0???j?9jX?J?-??y~?W+ Y?? ????t&R??.l6?7Y?U44??RjJ at 5?+ v?iR??E?uS0k~???t? + ?H???M???j_ + ???~?K?~?!?????:'?l?? ??b?@-W'????xi@?|???? ?c;?u???|#?}?? + ???D?h'g?? ??]?={?????R*-????Ou??v^o?=?w???qx?OM????SGw????+ ???????nl???"?\?$?s%??/ 7tD?????hx&N?> + endobj + 93 0 obj + << + /ProcSet[/PDF/Text/ImageC] + /Font 95 0 R + >> + endobj + 9 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-168 -341 1000 960] + /FontName/KZESHG+NimbusRomNo9L-Medi + /ItalicAngle 0 + /StemV 140 + /FontFile 8 0 R + /Flags 4 + >> + endobj + 8 0 obj + << + /Filter[/FlateDecode] + /Length1 1658 + /Length2 17770 + /Length3 532 + /Length 18711 + >> + stream + x???ct?m?&?bs??????m???m;??m???Y??S?????g?>???g?????5q???9??2????P???????? gac???dg#g?-K?hb?+g?#'u:[???:y+ D???P?%ahbgk?0??1??9? ????2?_??Z?????????5???????????BK?X[???????%ch ??g+ ??v??.@)??E`a?fe????????+ Xs??l??v??R@?=??sl i???i?????F???zV?????????@#???????D?????? ????5?(?7/M0%?????????n???r??Q + ?H????wdZ>1#?2??L????nX????K????*??4m??zf?u? K??'??^?jc??o?I?????%????}??S?2QF? W at 3)??Fin??N/sO??????c??? ?g??M?g?``?v??6j=# '??_? T?uHa_???'???M???2? ?E$??>??X/?J!??,??D???q?Sd?'e3{?7Q???`?:?? ? ?1??7v?????]}????6??G?:???Yo?K?? M?6n~,???+ 9??^YW8????d;?rosg4????8??????!H??J??N??&?Y7v??*&W?w??+ ????9?+k2???&??:qpLJ.?0?H?)u?O?X??g?gN???T~?????+ @?;????????P??????$????K> + ???'cD?m-??`?M?M????,???L?j;?oAq:`2?}??b??? ??K?M??a????$?~??N??t??QU(???& ?$??Fu$ }Q4?~\n]??e?~2? ???'?2hbKQn???@????0f????n?"?a?Pt??e#??W???Di?????0?3?1a?Ku0r!????*&Qt????uT+????7?=??]U>O??????"?D???{*?;_?fi4??%??%?`r99?[??g?7]?:t??T?`?.?[???+~?-??]{??M5??]s&?? ?????=??T? ?d?C?Y???h?? $?w?_??[#?{? V? ?8??????2c?l?RjP?WFu?????RMi???`Vn?6?????????{?-???h? ??*?n???V?J$??????R??o?z???7??v%SU???Nox???_????????ax?U??/+??"?XG?~???8?h^:y???AS???8<~?:? S at y????R0*-?L}???Q?UJZ??\J?j??bH?W%t???????I??p?|??W??C?k'????>?? ?L8 at e?(?)?????e?K???v??? LR??%??f eT?,$J????L????????_ 5?/"`R?????????#?????????j??R?""?#?7????1?l?@???? ~?bC???? + ?Y#?X??#5s.?z???q&P??x?d!??vp??Yi???\? 2$5?C??? rv7(ijSI ?w??@X???Mh??Tf=?Jw????d?\?`D??K???gi???7M?]xa????,"?2????xl??????????DO?????? b@???[??Jo??z?\"????r? ?n?????U???A???2?,????x)?????z5??????v????a????? t??f?????R??'?~??? + ?F?? j?}Xa?7???v?{&m?)J%z??Fo:?s????i=kC?2E?9%????????????-? >??%? + qq?S??p?]?=??{@?X]??jc??????e?:L$??|W4????&?z + ????v?TWy?????a???D/??Lk???????:9???wzT??~????? yH4?R%??B7??????2?)C??? ?U??? + ??????`?`?Z??cS?W???k?????~????K?E??:????>f???2 + 0???nW?????8& + ???r:Y+???P???h@?A?@? ??3n]kdr????+ ?0Z?e?}???H>??Pa??y?$??I???h??%f???rvCNL??????? + @M!???Jq?????H@&?.?i[?02hl???%?! $b????0\)6??h??P?_?????^!??Dp???_6mu.??:?3?q?Ra?[G? R?2?C?Y????r???Q?z$?(gp??=,k "??"??.?????i7???W?8??\8eh?y????9? ?F6,???????Q2????I?3??U??m?X7D???i????????5?J???gb1??????i?|aG???BuF`u???????e?*:k???g????,z{N?+ ?????q? f????k?????Z+5^v?`?L?-????U?.? ??K7!/L]bt?ZF?????$ RVq?{?]?~,B?E%M?<&F?*e??T? u5 ??B?@?u??L??????)?R?25??~#???ocLr???????e??C?Q?q?_q???Z?J??p?$??8?W??W2? ?$?Ep?????4O?1`??f ?yb????j????????\?:?v#W??G?#W!?X??[!"/???o??] ?.H????X ?U????/ u??t??????l?9???????? ??DD??~??vN?Bg??q????/P?}???\+ ,Rd???Y??S?|J???NMr?b?U??qL%=???_??q????m??????P?%?(!??D????????@??gqYX????;=????j ??S{????D?M???>?????(X ?G?|?w???u??{?^????w???:??v???_>(??I$fJ ????XN?????6o??K?????*?\???? 2_Cs??D?l?????? + ?r"? T??t????#p???$???JRS?J?vG?? ?[??????n Z!a? + ?\H*???.????ID?x???????3!;?O?b???M q6?X??V?~\Z&1?u?dU(z}?4?????@/???D??D??(?? ??????=?g??Ib???%o;????p X??I?!??????_U? ]?O[?.kFkNT-?:??V\??MEY?j?n?????X??????v?C?????G.7???_l?.A?F\?H,??????&Xn?E'g?y???j$???T???m???????h+ ????M???Qsfc?X{320T???R6mt??!!Y???4????k?b?i??`Q#????>?b????X?????g????????P???S??? ??Z?p????C i???4????s[gMhkwI?B?k#;????o?q???????U??'???'???S???1y?c?e?U?????????r?"?X??e$??????2???m??3???? + s???4?9?B7?]????)?6n%?-k???%?D?Da??,??V???2?-?11+??4?B????2{?u??V?8.???????,???TM0?7???%?-??b??Vtm?YD????q+ q??L?f.???B-??????e??c}u???d?x??????41?.|I???S????4kVa?N??????I??M?H?Ff???>?9?R??k?=??a???? ?LSGq??P?;7???????I?????? ????U + ?ib4?_?? K?6????0v(?XM^T?bT9f???????????:c~tB6[T?` ?????y?+ ??N?5 ?[???E?]?*F???o1????N`?=???~??1?b??ai???2??/V?9????-????1??P????k?Z??W??lIg??=9B!C?_?w??+}?"??P??6M?kA:y*?P<&? ~??GD????m 54h? ????????o?C8n????!??? ???j?J?3'4???O6????Q?M??-? ?(???????pn ' `b??2???1u ?/????jR?t??)M??ct?????X??db???r?Oj????\????IZ???u?-M? ??k??#o??????#??U?s%?s???8 ?!Vi???A??Z?:?Y??|?`??|?+ ?.M?????T;??ta????8?tI? d???0>G??.??h$?? + %?_?^2g???>?F{ykHqm???+WF????'???G + ?f?f?p??.???????]?Yd?!?j???Y\?:?G?????W??4~p-5k?????P??mI?gG??h1!# ??p??By~+yK?[??? ?????u?J??4h??F???L??+ 3?_??l?J ??v.????xm at o ????4SU?%TnP????????G?.?H??;M??Gls^0??R????:?????mU?H+G???'M?????Q??`???N?e/0???(&Ru?????d??????7R?g>?.??IxK?@3.~???/?&.?:??&J???H??d-????)?BT????????b??m?y????r,??+?r???NW?k L.F?f?3???8?'?rc)?? ??.????S!??1N?v???!a??Q?#?:?o???????{?BM?6?sP}B?k?a=^h4?o7????{?+???v???/???_??B{U?f?r??4x/?"?oeg?g?t?S??i?2??G?A??????t??? + ?.?b)?ZUU?Q6Y?v?f?P ?8?1'?7?k@ S???? ]#???1?bPZ??????L?+ ??@*????bT?????V??? D? ?i?_??I?w????k??????em?+]Q[???p??QuN?=?Q?M?????}??Y?T?}- ??g??Y ???6CD????????V?????9.??`C?????4vY?>??&?>\ + + o????????#W=????rI???z(&?&h*VUj??'???y?t???9Y?? + ?????]w??/??3??????=?n?m:????qR3?3 S???&???7???{Vb3??{???%#?????\1??u?????.????c??w?,Cz?w???dG?b&UH?????Y???;?=?fK?M??UK??L[w?Y"o?3???*???98????4??r?eHuK=5S???(?eQK?o?h??,)??n?????D???????]?2 ?? ?z?L???~i?????6??Q????? + !+ ????e???? +???C??]pq???F(1????S?W???e????E??n??L?Y-?k;??b?X?!????v???;??K6??5????~?7?m?y???R?2?Tk?f????Nc?p?3?} ?Ew]?5???C44$?????F#??H????c?%??vb~P$?q?????? $?????Sb??wl ?S??Q?_Z???Kx?Z??V}??H?6?L??z, ?4???]??a????{???T?Mu???T?????GA?q???????;@{3???3!g??q?? ?bS?DEbg?PL??C??:?im?+?$=)"?? ?Ji??????VvwE??;s?????(??R?$???-M??kba??iSV'ZL\??`RqG?:?/?C??QZ&H?[S??Z]m?G?PDc????????O??L0+ W????#???????-?M*d?/d|??T,?X??~j??I?d???n?????9w????z??s~? K???????j|Nt'n'?-???{??W?bl?????x16???n?S??7?????????? Mi@??w?U??+ ??"?%??;nn??w???W?&????8,??Q?b?> + endobj + 12 0 obj + << + /Filter[/FlateDecode] + /Length1 724 + /Length2 734 + /Length3 533 + /Length 1253 + >> + stream + x?SU ?uL?OJu??+?5?3?Rp? ?44P0?3?RUu.JM,???sI,I?R0??4Tp,MW04U00?22?25??RUp?/?,?L?(Q?p??2Wp?M-?LN?S?M,?H?????????ZR????????R??Z?ZT?????eh????\????????r?g^Z??9D8??+ @W????T*???q???mK??dgaq??n?99~?? ???!????S U??[PZ?Z?????Z???4<?8?????\tY?????d????T]C=cS?Df?[fEjJ at fIr?BZbNq*X<5/?)??;D?48?=?U??????????T?r0??SQf?B?????!P!?X?h???%??d??+?$??$??0]???_Q?kd??kiLj??f + ????? + C?2 KS=]L ,? ?L.-*J?+'??a??L`(??V?&s??#???#??5????J??N???a?z?&CI??M??X??????;w\[?????g???4?0???3??????;??n??Y???(?$???g???0?eX?W????1?J???]aKu????z]X?????U- ????%6? t??6??,??`????N|+??Kg??d?q;?)yA??W??p?q3??z???]??K?&j???u?~x???? ??*?????wO???\v??wv%?|????3?:Y?Y}?|v??????X???d?/?y?a^?:?????-?w^fy??s?????????[???????????|?g????????;???????} + [??????????~???m7 {??????hr=????wZ??????}???W???7m3?p?0, H?IM,*??M,???+ endstream + endobj + 16 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-168 -281 1000 924] + /FontName/QRXYSG+NimbusRomNo9L-Regu + /ItalicAngle 0 + /StemV 85 + /FontFile 15 0 R + /Flags 4 + >> + endobj + 15 0 obj + << + /Filter[/FlateDecode] + /Length1 1662 + /Length2 21814 + /Length3 532 + /Length 22750 + >> + stream + x???ct?}?&?v*?m????t:???m?N??t??cM??33g???|?9j??o????ZEE???$f?df)??bbcf?(??????????,???\TT??? ????)???mi??4???????+ ??7+]?# ?????x+ ?(?u?Y?R?\uY?U???????6?`?>E??? ??f\??P??????c?%%?~??5?%?FxpX??aT???%?K???=??k??????pD??L??A?Q] ????[???N??????B??7??????R ???R????+ ?)???.x?)^$?)x? y1Z???+???=??U%4??P???? ?8???T??%2?Qo?SZ?8k??+?,?????????9?$?k??'?:?D?kSS???|hE?1"?? 8T??????9=?Q?k?!IY?%??m??1??R"??~iH???4??Q?;a.??*h??\?3??N0???%?4e???h&?A?U??Fl0?R?[???L?8?:?l???@??!?,db;?2?v?irv??|??G??v?n?0?fQ??uXq??"???_?=? p'?m???g ??>D?O=?J?om??M,2?{?????Z{???J?0*P?@! ?2?????????6 + ????A??J?? ? ?????JN"s??=????b4?O???W[??S?}?????E????)???'S8??9????????????n?P??q??Zo?????}X???~?*?? ?%???R??8T??? ?&??/??????k?????j????~W??l*+???N + ?M??????+ ?\-?/?2???_?/aT?n?ZV???:w??>???????1?k??H?7???Q?1????-u?f?+r7p?=??????jG?????co?Ggf?????j????I??[?`?X?????4??\???y??Rd???S~??????'??W?ju}-!???ru5N???_??hN66???Z??????eGdsO?V?zH???VR?0:?g?4|S'?.????Z??M?`?z?n???F|??v?????p?4??????- ?X??Z????g?FY????8kR???4??[?????v?gP?L???!??t???5??Z_$V?2??,??:???:??H???V???=w???F\?PWd/?,?' i????c\?}??????<"??I?]`??q?r?)=CNW-(^- ???;?a??9??@UN`5??????Q?h??\??X?h?d?+ ?T?f??Bz$8}?UY' + ? ??J?L?~9g?+??G?fr]???r?3?(?3?0f".?? ???=???n??X?{@??%b+m?[I???%?????O?????h?B}X????ES??/?p ?u???; + ??????? ?(??i????3???91!?|??F?69?z??h,?5??8???b??H??y???T?I?r|Z(???V?HA? ?=*x????s??? ???6???u/jV??^.???? V??#/?>? G ???/??1??3:{?kk????3???Dd????T???g?w?F??? ? ?GZ??`???????t1&mft?}???)????-?O????x???(}?f\a??N???ouue?^???cK8=D !?\?w?u?a?yP?R?#GK]aW?>????p?????hc?????t)???? ZM8?Nt?:?????m??~%?4?j??\?????`L??&???f?" + ???L ?X z?3?%?{?,????????'???4?Ga?@H? '??Wa?H??\?Q??????Q??g? ????h??? ??d?? ??? ??Y??W/P??@]??Z?|5??????????'??6w ???8?_0????NpzX??????M?3uw|Sb??~{h??h???G?!???????E2L7H??zA?qi??9? T*5$??'???????T4?@Z??f?K pmW?A???w????l^????*????P?%??6????7?x?_?B?e?????a`:oRr4? ?????68??????????(?3?p?J?ku?3]d????[p???<$?????T.???o!?_??SKG??C??}?!+ .d????(???!,>??????$x???|??;???X?Hb ?{)b??*?w?cm3?+?A?;????!5L[`?='G???\? 8??<[?B?a>t:?@???????~-l? ?h??a4???1!?S???J??)?%?u?82X???~?cW?(0U??????E??u?SH?Esl??9?k?Vs?Kw?????[1?????? 8?R(uYN???e??`?n?a5F? + ?? ^????8?????9??^??8A????/?D??ab?|?~ ???V???z?zH????~^c?"?Y7.???9???J????KV? (?jr ????23F?E?b#?f????????la:??7?a^#????H?????q??!?/??m?v?U8???H + >D5?x?Dj???)tS?k??c?K????H????2?? + 2??H???6?pX?+).??N??@?)?????:K?<?? + $?G?I?PCm&???:???~?U~J?#v??og???M:g'y?S?'l??{?{{T&k?rd>?-\P? ????n?gsZ??Q#?&?+5<?x?1?RQ!o.*? QA????J???,??9Qj3?%&P?????DS;???ZX?Sy?kVox ?.B#?*_ ???\??\\????\????iMVq??i,???XT??8g6??U????!?7?h?R????g????t???X?????????G??."???+[_.???????"?c????F?=?????a??b\??o??Z?P ?8"??@???of?\kC?K>?s6p????Sj??(o`H???N???, K(P6?3Y?X?AJ*U??F?9=a??E?fK$.|?|c ?? + 1Ls?P?b????A4 s?????eFNB????%Wj2???????(1W?? + ??k??:d??<#A????????e?.??C???FQqEY?1?l?YQ? ?????o?'?n?,???.iw2{???????N??????b.???$??v QQ??Cj?<. + ??(WF%??????????}?????+??????q?*????XVHY?d77j?n?p?Q???*?p?-????4d?-?c?F?%?o???Sl?&?R???(W?? i??? ?%J??J??? ?!0?Jq?8*??ml??9???9????ID???????V???po ??b6}[??@^RX_?,q/???9??;?Ss?r88????-~:=s?{-?P???????*???I????c#???%?]?.Nv(??-"Q?=8???'?Zl00f?????$9?M5?}@O??a???~6 + ?V?T???8?? + ????+???2-w??X???[?9?Ip^?Z??m?:???z?v??qi?_?XU ??kk4*?a2&rM???Hc?~lQT$????H??x+< ?Ogr??o{}??P?+????Z???CI?r?.(????;???`~0????:M??F&?}??iP+?{k?@????? ??\????" @? 8%DO????q??1?I???????b? Z$._ltwN?1???\????;?R?D?UDvx ??:@9I?cZ??,?ok'O?fDwY]???Tq?T1?Qg ?&???$9;?q??Kn}??]???]f??=/;?":p??. ?1G???|9?(?! + ? ???vN_???????a??4` O??~?O@|0&P??s7??6?v?~?????ZU"^?v???1u?;g?r?4-???rh?7!h????4M?e???|?V,'??U???C2?????????dGT????????8k?>????G??????1Z_B?L?????l?K8??T6_.??Z[fz?:?-?v0?fT?ZTT?????NN??x?N?????AC?3'????y??'L":o????????pH'???7bf"?y??nm}???0???$ X ???(KI ??v3??????J + ?pZ]?Li?3????q??1+?Q;?~9??\?&v??[??%?[?/X??y??M!4\"9??n??/????C???z?=)(`0LT9??c?z ?T???#.??M?$>u????7???A?7oj?I?a?I? + ???????Kaz$?]?? ??_J??Ga????-J#??[??????o60???? ???? aP?kVh?????J(`+ ???S??v??!??;??4????a+ ?B?0#?????U/gHi + $??qg?%6??o??LV??2??,}?;7??\s:&?'? Gd??G?a??MJ????e??S? + g|?y?@.???n?_0e?x??R?rW? ?/?I?[Ay????????k'Y #??? 7?h??D3??PB?y????;@????R???????8[??vZ???OEZv?v???????;???????dU0??Q:u?_[N?2????S??Q?%?ns)?d???C?/s?^?2;!?????????????Y????2"?/)??#??.m\?.9????o?^>+y?)aS?hgS$???'????W??A???nC??n?0??K????.?3???????g??,vd? ???8)????E%????????&'??t?/???? + ???16?u??????g?A`?????????@?n{??????3sZK????? ??-?WS ?~????bE?d? ?k?G%?????,o?C???1?O?/????@&????????????o?g???????ZUV??s(????x??Z?P?f??+1V???$??????J&??????7?%???X??n ????????f?? _??(|6????4W?5?j??P?M?p??q??A?q?qyO?;/????p??Z?n??ab&:?????r????8?#b?J??uz???d?Jb??{??????[x?.o?????m???S???*?n?x?,???r?l??{WQ??(+???\V?T' )??,=???[??? @5Z? ???J??)?QA?u???4? + UK??Q????B;??????^J>?Hg*#??? 1*?$0??kS?0?0?????B@?6?N=??A?z^????a?????$Y?)? ?1T?~?i?)??.?????*2?c?ZM?(??W????s|???#???h??????@\9a"???X=???a??? + x??Qp.????\?F ?????vw??Xpu??l3??7.?}fd?HN??H>?v???0?}p6a????[??<?S?S.IJ^?o&??9?O?S_Yl]???Dv?R9*?b????:";???????s?g??5H???FGU??qM????????d?.?T??%??@_?%Y?cn?'?^GI?I???~??A????? ????????P0Q| ?????7C0?C?o?h0\????)??VY1??_?#o??\???O???g?(+ %?L????B???wKN=?CB??9?P??u??+ ?i???[??q? =lw?#?~?q? 1?2FCw??1????9??ML?|?H?Z??Y?O??nX?$v??\>?o???G??q :??2?h?y?lp?}g????????+ ?F/S?)??-??(?????8b??R???_?!c??\? + ? &? ?|?????????{?.b~?B??Y^)?U?X??;Y???S?!?+ ??????>???!%w[!?;??"???']j?$?Y????????F???b?????*??/c???9??;uyD:*???4?????9QK)?hbdTI????T??(?_P?I3?a?n?L?0????s:j?{KP???k?kMj?N |??IV???@?????69e??.???f???qi?8?{????f?#?????''KHcc@??? + ? x???nK2???a??6??? ???V?????-T\?lx&?I?bo?m????'\1?H???l?? g??q??{?'????U???43?X ?L?????=v3?%T7B?*[??rMIc??W;r`?N?F???[$ !YQ??X6???*T? + JE?t???m??533PY???1Y#?_??" ?{??N??? h? ??????X???n ^$???cQ??j(?h?|??Y??q??m??????~hr??[??q)??iy????esngb\?^S}X?WV?|;S^????$t;???=???????4??V-?2#???y???P?a\z_?6[???X?0D?F\??F?H????)?'????Vz/K??????m3!???5>B;? }?l?8&???%'T?V??? ? D?B$??cKG?%?2??^R+t;??9??w]&??P??!?b?sV?j?wJow??`X?^?????? G??(????C?B???hv?~?Lz?1usZ???.??E},U?Ml???z?~1??5??}?????s?A]???? ???F???m??%,?2??v?4????9??(#??R???Z?v?~???B?J?x?p??z??&mw?I??d?sO%?+ 'NE_ ~?S??J?r?????S???K[??????\????????`o??[l*bSb???*????P?{?d?H??!?[????sg?N??????z?_iVK?G9)~ + ?z???????D?????a????:^?7??(???~9m?( + tb[??????m4h?f???f?????9?m?l?t????????`??????@(??(? + ?:??(G???|>?b???? )2 ??#u??`Z??O&?[??m?5??H? }~|f?{8??4m? k?,??}??f)???y??G0%?)m?????>?#?>?Hr?:b?@??????^jT??j?%C5F ??E?0P?WR??q?0yv?_4???3?m??c?1???????U?`?s?W??)*e=??? + ??@???m? ?&cZ?=W???j?k??]QO??~?fEX??9E???i+??wp&N??c????%?N???K?????w?s/?? ???}z,?gV(?? + ?hJuds}?N? J?8???D/??[?^?o]?4&tJ+j?-?$*lf?t[??BB???4?_F???T??(?a?G???y?????R??= ?Uof?v?R"??b3?M?s??g??????mb%?Z?cp-]n?B ?????G?k???E??.??aE?C.Q?B??}??4W?? '?6???[??s+ 1?W??96dP?U{"?\?????~a???6@?,&??fJ?,?W3????6?{dk?7N?M???????RF?cGch??1?u???U????????.ct?q|p??/-??f?J??? ??Mc??z??gJQ???1W%"?oE? ?????7?????`??]`v?j??~.4????x?????";`??o??%????t??7?????NsIgU??F?????????$Da@??ua???^??~La?) LQ8vX?????}?r???p???J??>_}????j?zlkD?d???? ??????V??xg(??7???`u??[ + [??_)?,I?V??\????3??? ?f%??.???????8+?i?????n9??~B?&T??a?e?A???????k2?f(?]?Y?i*y%???)a<??:?ZB???g?h+ ?Q{?Xi + ????S[?sPvocX??r????????0Re?%4Z7? ?D?WnR P?:B??????? w???C???P??dd~!??5? ???Iz/? f??r???-e|?"?l@???$?*?????`U>hz??jU?YuA??@???????Z!??(D???^???lB?Q?????e?~b5? z0?ZM? {~??j 8C?Y????[???x????)!??&???Pq\?????_ ?e??J???^???L?3>?????=Jm)?{?m??????#? ?/?? %?/?)?????J???n2???gG?9?@??Ftw/??bni??p ?/Al}??Ui?y? ?e!3?y??????@?X??hmNA???:?]9??&hf?4=5d|gB????????p???9??????? ????p?[???u???V,?U?i??D?-??XL???^m?t??(???J???_R?~DM&???????? + Do????q\0?????Pp????t)??f?#& 1??w?i? r???y + z????b??]'C&????2????P?.uRY?aL?c??U??`u?!???a o??A??@??G??????{?d???O80nA ?U`?/???? qk??fS[??>??????????1?????Ny???;?n8??@uQzX^??m=???9P?^"QK?J.???P?j*?????11;??b?n????6??y?q???~:?^p?h???=~ ???1=xgb?W?????;?????=|g? + B2:???{?3??{????(??????UcO???????#??_?????V^N}??}R?F}^???OA?S?B??D?????C????X;V-????h_C?? ?O% ??????nS?f?8??GW"?7y??^?c????_y?8???????UP???j??? + ?;\??f?6??wix????? ?w?3?J???a????v??\=?????? ?Q4?>????0???ol>????MVZ????$/?#??????f:?!???X7j???+;?DD?>???h@?t??l?????vS???C?kr<??I?z?y,RUU?nda?\???U????Jp??w?@p|?zp???kP???wxw?: + ;?J???_n8?Gf?n?z???Nv[?6?Q??N?$??L_^?????9M?r???n@?y??~?c??m$3???2??5?y?}}C??%?? ???? 7??????: ~??t???oR?p???:??j[8?l?q??????R@???7k:W??G?&???`?????m??8??l?:???h?Nx?NM^,??L??k????????j???M? st?7;?????[I???&d+Y???6D??hM* UgB???~RF{[??????'?t?3o_/=???"? ?,Cf?]lyLO?????fKg?:?7i^+ V3?_+ endstream + endobj + 19 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-174 -285 1001 953] + /FontName/THXRQU+NimbusSanL-Regu + /ItalicAngle 0 + /StemV 85 + /FontFile 18 0 R + /Flags 4 + >> + endobj + 18 0 obj + << + /Filter[/FlateDecode] + /Length1 1185 + /Length2 9210 + /Length3 544 + /Length 10037 + >> + stream + x??zeT???-n?C??V????%@???-?V???xq + E?{q+V?? + ??q????=???}{?%~{??2?Zs??12F??5u??l\?@??.P6.vNa?:?? + ??tQe???+ s + + ?q=?9y?? + hB????+ u??p???1v[v????P9W??<0??L Y?7?????9??z??? ?????? ??C??)??3??? ?A|???B??+ ??=?_??0??{5 ??p?srr8?x?{e?|?6?.N>???A+ ???????????@?? ??KR??? ??~???gO+ "J? gz?N??L$2h?jo?C??#?{??hVm?bg?r3LS|I?cmjTK??{?azy??$v?X?>:?T??P?g?^]?g?Xz??f~?<??????#?`?@???y??w??od???9??! ?4@?5_? G?_? (@]-)~????O??>$?3??????~M?A??6V??U?*)????,4?_g????\?*?J?C?{(??n?iG'?o?e?N8??_Rg??R+[%?dJ?0z??C$>G?v??N????g?G:K`?.????????= ???V}??????n??#????!;?G??e? + ??I?~??^?Y??Q??As???I?kh??3?C?smQ{@~l?pgW?%??&?xBc???!& ?x???c&y2V}??Ize5?D2*BeX|,???u??+2Y?HH????? + ?2)tg?k???W?'?????n$??c????.??????Z?_?4M???AD?j???mQ?????e"????Xv????w;?;????-?K??_?oz????8??3?d?s? ???>ZhR$??b7 ]?? I!?8\[???sO-g?qJ>?Ji?? + ???b?V??0Z]e???1D? ??/8?'+? /Lj???L?;j??hf'N?Sw????? ?=??!v6??#??.???q???????[jE??zQt^' ,???U????7??????oz?????!???????}'?????7?Gb?R:??+ [:????????W*???`??/????k?;sW?E???9?_?l?????K{??E+f????V??M k????F?W`??B?ch???????FJ????8??c???#q??q????>?????&t?6?S???f???0{??`}'L??YqY<~??"????sS?Pf';J?,???I?????????j,D?j? + ???x?3???@??????$??%_*iy?3??^T??I??????+??X? + ??7?c???`?9se?9??L??N?)?????o?X?Z?):?^m?G?F?? ZGT???N???????t??_????????!??s??????H?N??S?Ph.???N???z??'????P??Z?????T??1o??1>E?0S}VA?????/$??d o7**B?;?3??[UR?_$|5??:S?6#F??8!?P3A????{m~/Z??????????n?}???SF?e???E.g?X?y]?????? ?f?@??'?rd!f??U???{???~?m?C ?oy?QQ??v9??U??U???:C??E/???? ?A-??J?i?,??????65??%?????*??Rvv??f???Z?3?T?{K'?}9?+f?N?@?[ 5\%??r4|?K ?;Az????k??q???@?????X?(???D?)?I?gw(y?H??%?f)d??C??:4 + eX????se???)q?h????#??+??5??3?~H?H??????I^??g????k???[oP??p?yC? + @???????K??$????.??)?e?O ???-?#???qxd?k?4??Q?C?c?????$?W????z?U??2c?M????I?V?s?EgeL????r[nh?c,??4%?}W???<<=A8?m????YZ????????\??? ??x?5`??(?D!??b???C?_Q????xe???v0?y????&??>s??Iy???5?,???7Yvp???z?}????O?_?#W?XJs?m?f?$?r???$?????G?? ?~??????????q?@p?7?}?Y?q?????[??} + Q?GG???7\?5 \;c?0?????;pY#t????v%????vyl??????????9??(??[?=???pF???N????76#????????????A>a???k_?:?" ???2?"~.x???1??,???i?o?????-R?A1???2?6?a[7)dK????AZt??lG?s?????w?,SAT|?>?(?OK??9???D??m?C??So?lP?????@???IX?????4S?A/2qw[??*9wM?"u*?c2? ?ji???Lg?%?!{?=????n?O??F,?\??|:?E?;^??e??>\+?V\??OE???}??????7.{v;????P??H?M?c??e??w???NJ?*?jL?;????K6??'w???kf%???p?????J???b_>??i????Z?x?tx?L?$ ?=9?Q??R*?a??+\D?N T?Ed+??}D???f?L%:?????! ? 4V??????&l?I??mvM??A??MG??????????x????? + ?????B?????f?\??????6 y????Ye?S*??t??[???r?C?k??}??f?????v????bY?wR ?b??????V^????????&=?N?? Z?+A\Y9 ? + p?%d????R??????!??????b?~???f2???6??? ?aJ?,?N??4?Tj???`????U?? + u?tQ:=p+Z++ Qd 9?%o + D&I?>?m?????y/?M?l?dU??????s?!?U,M??b?? 'y}?6??G??r??Ja??rsx?Xob??????`??(? zu?~R???bp??n2?p??????6??' J????u??W){?_??ze????:???qh,fb?Z?i?Zn??? ?G??O?z?z??????????=???r:?w?K??U7|???QY?#$U????<?L?r?J5??p??S?v)??O?e?1IFa??Y????08|?_X?Cs1#?w?????) ???\?8???\"??":=?o)? g????g????????G/??G?Zo?&T?4;OM0??.??$4A??C?^?L g(?,????!D??D]?????_???{]?C^?)e?-?l?????|~0????-? + h??????Xgk[[{Z???1{???b? + ?N??Qr>G?$WW???h???]3?????a??;?PQ??(?P?W?]r\>?I?@?i?m?XM???x?]c???6?&dY???u}?:? ??{>+ ?[?bWOU???????????o?.?=??9[?nc?UE?"c??g0???????$2PT???V????:)??wr???6?iv???????4?d???????Ju???*.???'?? ??G?*|??T ?E)%?}u%?7????28Z?x8??[/??? ???6M?pQ?yQ?7????7*?T+???????O???Q.\??3 ?},????%.???C?? D????S???0;??Rt?6?C?&??n;???e?E?+?????1?J\$??xi.?????t??Y'???&?X????8m???L????l(=vO?cD??5?K + ??W??2@???rLi?Q?U?7 + ?Y7d?3????0U|b[(`Z?V9H??????W??l??t????z?~?F?e?P?&?.&`??-ZP+ nM?g??hG$w$LFQ??*])x> + endobj + 21 0 obj + << + /Filter[/FlateDecode] + /Length1 1674 + /Length2 13071 + /Length3 532 + /Length 13964 + >> + stream + x??xeP\??&wwk?????]h?qwM @pw????[ ?\?????g????????tUw?w???Y{U?ME???$f6J?\???Y?J {375???O?Ih?u5??????$???? ????+?? ?+ ??T??c``???/????5??. ++ ????,?J?]n ?;!Gg??????L???b? rt?GU???G??????v??`?wK ???_%??{?y????\+ ???|n?*?.???V)?3_????f?.????n?#??k?GE/??D?u??b??X?Q??t???y???????:????.????????????Vw?L ~`nR??C!??? ?Xk#?????J|???.]A?r?????' ??+?b4???G{??e??????xZ??R"yn?@??S??V?5??&??VQ? /?_1??T.??Rtu?:????? ?5??????Z?????.?a???/|~TS} ???g?a+?q3????????+q? ???Yu??U??X???e`fFZ4}?Q9??????04X[?A?Z?iU?0?? + CF?!????/?'?"?!y???c?:n???Z??efM??zu????Z????2Q? ?m?6??u????$ + {zj?.H????ZsvN|?|o? ??.ah^7:<) + ?J?g???s???9?C? X2?p?wp7? + .?j!+D??.?2??? + ??`?t)?v ?$????f?*M???????D?@?n??E+????H??:D????GG??A?"_?????qH???sE???zF?4?_Y?Snp?}B8??cV?=a8?07?????ME??}????=t?M??[&1j??p\???e?q?r??#e?_D??WQ?????????u? ???J????U? ??`?\q??u?3???)?t?y?.m?D??b???feX ?P?K?N?????????5??????Rg???$o???"+?? ???? ??!w?[?k????V}?,M?fl5?;???q9[#fgYGQY??IU?Z??/????X'???????8??????gt?^??B??Mm.??5????????56?????.?w{???l??P? ?? Kdl@??????z??U>?y;A*x?Wb?ij???>??y?S???=?`4???f?D_P?????Y +  + ?????j8??rU?= ?-kz6 ??m??+ ?j.?J3&??Y??G~?4????????!L???qu??T?[?9????@???>?M?Uw$????\^Q?-?q??yEe.???|z????????fZ7?2-s??y3!BH???n??|?7?(???n?f} "??h??0??N?????+ 4??i.?q+??sv*. ??6k?tR|?s?7Pn? %h??d???????l??d_"?`I3??Q??T??Bj8?by??C?RJ_[I????c??b??D{????u??b>[? ??K????H??-???g??73?'???I?!e??????Qh??|?L^???r7?q?`?Z?V??2n_*???j?x?l_F?@Q B?l??j?w???l???$?%???]Z??;????T=?4Z ????#????????(k,??~????R? ?$o2?n???;"? ???,Ke5D'%??.????????^????>CGkj?p + + ?????4L?}? + ?L????|???????[???GI?$?y???Az??g?i#??/??X??9t????]=Qa?64??R?_dm????O???-??D???nJm?[?2? ??!v?NY??!???>#??j??@??DI?+ ???I_??9??Q"??7y4?"X??>?c?!?????V3u?????????~F??*;??2??*X?8?M?46tCon??T???zOBv?X?V?y??E[?>$??4u??9M????sz??h7O9J?U????T?WO[8?"??qYq?Y??{8 + ???V??q?RTOI%UA?t??4*?z?[????l?3?d? ?? + k???TJ??i|????U????{??i?s?KIh`?g?4q??>?x3?6?l?X??cu~??}????U?15?h??Ni7???~???K????b????=1E?|??? ??$?R}d2??2?pK]???}???(???iP??[Ig%??????s??i????9\?CD??1??Pud/??????U???I`(??t? ??H???Q???F?_Q??z6?????#%?Y??g?V&??X?/7:+ v + ???+ ???????"?????Vx?)?????g?H?LP?}v?y??B(?????0?W?AoD??B?%??,,+ ???d?c?:v???????????58 )?(??- I?#T???AD??x7???]?i????7Q???O_;?_????l??]I?Q?~?:??? + ???o?? ?w ??@?????D???j/????8?_???v /4Mh.?x?7*?}u??? ?D?3??^O?b?]6?4??>??? ???<+ jp?TQ)?????nc??nua9?]?>ei p?ms+ I???+?{??HQ?#?`?.r??k??B????;S???:???X?f?g???=??\f?X/Z?B????????o \???NJ??'3??E?3;^j[????8h????@d????(RM??????????zo??4??q??v???"s???Y?4?O???q?L?Y?(?9??=?+ ?{;?\????;dH?g?-?%/''?6$!Yv?lg??\?Q?`?'??\??=??????A??~?c???.?'F?wv????3Tq???t???6??$???g??|2??d??]?]??\?D?ybN?%@??? + ^?qd??P?O?L??Pz?bh?%?p?L# ?L???U??I????0? ? k-?/+(????(?c?E?8??]}t?5?~~?X@??m??p?H + ?? 8??????????*BU??8??n??? N???Df&7?Y?#?>og2?%????mU?l??????g???B????Cl>??d]d[?jW??????: + Ka??2?U???T:??W at cr ?C?OS??l?? ???1??c???8???~^wq????????R??)???????o}??J?N?\????PZUU??;???Ve|0R???MS???p?|????ZU?t?????Bs?!?r:`:??SN??n!????|????X?f?=kIHaT??I%|5??7??g?(?1??o??A? ???:???B???,6??8?? + =^u???x??B?rz%???? "??F????v6pz1??|???v??[$?,???????X?2%?Y?????0? ?F+ ??????Y?????L????????o?~?=??!O??_?y?=v7???;?h????\'?=1L?M=,?h???G? ??m?AH8???e?U?y+?DMQ?!???????Ql??? ??q?M??N?_?????cU55$?1h???P?3?:a-;t?IE1o?5???M?_?????U????QY?2NF"??bf?#n_EAa?????? ??,??p???Tl???g=XO?@&??o8y???????k?o?j?D)??S%?M?????{\??u?? + ???D??r?M?@p???N,?)1???o???\??8g???j??a?4XG?>vrr$g?c??J?P!?G2Z?`??9W??;G%?IB?A??j???H6F?Pr? ? +  l8b?_???'j?t5MV?l???($??}???n ??????r9K:???J??j???_*???p!?/??|????'Dxa?]?9=???0P???t_L?3?b???5??F??N????Y????h???E2????@C??zN?_?+ endstream + endobj + 25 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-169 -270 1010 924] + /FontName/OESSYC+NimbusRomNo9L-ReguItal + /ItalicAngle -15.5 + /StemV 78 + /FontFile 24 0 R + /Flags 68 + >> + endobj + 24 0 obj + << + /Filter[/FlateDecode] + /Length1 1679 + /Length2 18005 + /Length3 532 + /Length 18960 + >> + stream + x???ctfm?&?b????m?*????mVl?6*?m?;9?~_??}?9??{?Xk?{^s^??c??+? ??mm????????????????\?t?@Sg)'+?_? ??\?h?dnk#j?????@#+ ?K???  a?7??rn!;????yO+ ?9??f?????????o??eX???}???V5?@/????!???]?t_?fM?H??sH?|?j?d???!??v??F`p*??qf?5???? ?|?nh ?-??m??gvB?T?j?^?x???w#]*???f?501gLY????i?w=fT????pI*4r4I?#P5!~S??ByE?3{????mqQ????`???U;?m??y?U??&?}?5?C??6???:mW????l?#C???d?x?5*?`(JSc?H=???'?hT???^PLu?a?px}??&KdU?l?C?P?V[Qyc??C?k???I-???/?C?????#u?)?yFW?B]??????"H?T?J?p??mx?}??7???!??#XI?Tz-?*B????N??????????s'+`\?44????W??]?8?Ru??52???c?B????^?????????6tG?????m ?K?"Ya?N?(??.?-C4X7t?D?*???????C4Q?+?io ?->ix.???#H0L?6?j$?e??O-R?????R????u: ?m?D??r???G???SQ??d?????$??1?^??E^HE??m3??)#K?~??mY?? ?@???A??k???S????U??=?Q??@????%I-{_a5eMeR?b+ B?E?-????K??_?Ga?JBn?Z{????W?!8?(-zb????&[+ ????+??9???.:oo?? \{fw????b?@ #???i??????e???.???Ci4P??????{???m?*Q???????? + ?PR????????N?G?? N ???MF`y??, ?D??N?mCVwI??E`5??D?n?t[???????[}K??3?b??^???qa8i????O???W?oT?A???W0?????s?H?RF??Q??0O?N?t$h??x~???]?#:iQL2?-?v?v?|J?pu??q???w??b?$?|[??Y???'????~?+0Y??????k???L???w2?c[??/??;??*??K???+ ??|Om?l??Y??;U?l???[?84I??????Q?h??D??O?? b?\ ????>^??Aq?C??y??w????\??gs`????g??( ??}???bK_p+ ???ht?????i? f&??@8sZ??t???n??YEqP?n0??????,?8,C???f?O(wx#?{?????5-??1?M????L?K?Z*H ??f??44??N%K???+^E/??K?[???F??"?????},??? ??;p ???=% ??????:/?c???>Ic:h???Q?9^?p: ?]H9??Ev???U}/????????????h@????mb?P?[Bo????of?f?H???G????|??Pa IM?S?.???L?/?;Fq??&?Z???M?IS!?h?oW??"/3??x?4?w?^?@i{???6;?N??w?{{?]b??????????j??+ ??[??;????E?SD??U??????? mv?#?03???(?u??Q*6?,Y@??E?3+ ???? 5?a ?Kv".?????0?Y?[ 3'S,.P??fE?9????*Z????1h?p??T ??}}??M????h?i???ts?W+????? JYT??= ??)??GA?????v[[4"U?c+ ?v{{?%?P}`M??6?Nw@??"??,?6??'??V#s/?x?\???]@&? ???8??y???L????\LDd??a4???L_?^?6.?d??"???msj??????0?z????b???! ??????S?N??eC[13?i??!?????v???77?E?ft?Eb + B??e???????????z??`?????e?M???D?`??????????|?w?a+ ??|U?-bE?|?Ur??L?%+j??A]?]p?M??i>?y(>???@C??e_M?;1I??]? ???????????M???/??d\?r????d?~V5????cS???oy:\ 1Zx??Q???t?`, + ??yq?L??? P@!S????f????W??K???EqW?d???????X???.??x??6c ??"?. j `?X?O2??yIg?Y????Dw! ?x???G???(8???????*~??G??%\]??Gm?)?????:?r$?$5fM4??y?????|t???B ?o?_?@SX???????Md?|?R?????????.)?;???+?=???-????+ ?J?????B?c???????n???Qw????8????O???????*? HG?W???hQh?????&y???Rg?B?i?????Q?R??W???h + ?????D?[B?awr?w?????'Z4u?SS? + ?I?~????jY?1)?I1WTs'k^+ ??G????? + jt???n???z?{?y??"?t??;???Mj?1??I?k???){??^?b????t???~@G[??e?????U?sP?u??????i?!??(D??C???f? ?4H???p?R?-M?Bu??PC + A2???c.??oz???F??Ag ??mi?1 ???????c???4c~?7?S??L????????Cf1?~&?N?z:?B?%[~*?t!???Cfi?8"l?K??&?g???:?$/i??z?f?7?T )L???k?????w<?0;??NP!??# ??g?y9f?????frr?G?????????U?Ae + "??;????I??q0L?V??2?H? ?#(P??J_a5"i|?L_?X??@C??p@?????SK?@?o??L???x??-%/7?y?;?QNB?s??-??7??+ ???'?p??M?+??C^? + I??E?'N|?~?R??!r?,L*????VkY??|????1????Y?o?7?*'???*????????\?)4??G??????????Pl?C?\|7?+????w?X?A:??|\E??-J?a!????{Q?-?\pO?}k?1?/?:?p??o???OW]?j&??pw<$?sj(p??{??/g???oK?p}?"??b?,v???@?z$???a?{0-S?tmm?~p?z)w??FTb? S?u/?L?%??U??I?b 37????)???&??E?h[D?6O??3?_1?s6l&?`????i????J ??[??Q1??(?q?O{kA?O???\??t?O??i?d ???5D?EY|>L? ??^P?????????A \???E@???R(???h????????&Iws?>????->r?k]?????K??????-|??<???5??[?@S?V? ?K??*m???AJ#(k?????v?T?8??F?KG?B??m???t?J?2*?U?!J?a???5?'??p?9hkpiFaV??'??A?z???3??C??'??j?q??2??E??#|?6?p + l???o??;e?r?v??z?=j? ?9??}?u???b????-?W?~?n?JB?L?:I???I"gp????m??f???py??J)9t Xf?yo?x????o|???9?3?@(??S??t?h-/?????????- at i?7??=?7??pD?Z????D:???o?s?c`?@?v^??#?@?I???1???{?g???sKP??f/???X2??I????!?C?y?T???S/??????]?????????e"??>;??l??@Og"??l??+??z?????????F?Ep?$??????B????u??* ???Q?]K/????j??~`??? ??;???5?>?J??V??? e? ??}??)??????_????z??u?i???5Y??c?^??b?h\alH????J???*??#??L)a?\???s? + ?7?O!+ ??????rB????`???j??????[?YN????W??[?g??g?T6 S?pL!??Vx5?=??=?x???XB?n/9F?????????????.^fk??sh???fO??c??V?h5Q??? + * :?$????qc?hG=??0??CZ*?Qq??M $Z??u0???y??t????Jce9'??x?: ? ?LR N?^??????hK???^??+TAenQ??/?g,??N ????h???? + ?/9.i??+ k? N`S???:??,???EZ????6???=??=??k?m??X??/f???????=2????????????+ ?Q?&?L?? ??_?jG?t??E????n???T??~?? -X?qL)??Dy%pS?KOIA??FE?"?????#"/( ?&?????M??{|?]??"???}?m??v??X?tG?????T?Fk ?-HY???V?T????xre*??I?t?`t?N?`?N?hRO??b?Z5=T??????????[H?????o? ?+ *??ak ???,???,m=7|}Z?\4u?}?<*Q?U9,,T????8???a?n%)?n?m??R???H%?H? I??'sRh??M?$????S-??k??|EI?T]@(?v??"!??*???Q?o??/7?G??8?b.E"?b?P?????G`l?At ????E?Z???#s + ??+N?\?d??@?T?4?)i?9e at M09K? k???????@?????vc????@?j???v>/YA8?/??#?J???=4???h~????7? [??A?4?S8???r%~2???~?I?????j?eU? 6Z?q+???DNR?(8]x)??]?Nl???u-?? jW^??1g???ec?J??\?? + ????,[?#+R?]??y)?????????91??>?G????0s&??U6,?}o??f+ f??&W??~+????V?K???7m?}?JN???|?r!?@s?\g8/+ {???xhy?/??x ?^????? ?^??Z??4}W?A:?H3???MZ'?Ko? H/Am=?[?6?\?8E????B~f?/=?<????d???????-j?dP;B???" ?t???|F?+ ?v?,K]??????#???t.??a??0?y??s??HC-??I?1c??j ?U?`??D?0?Kd?,???Q???+ ??nWr0A??NL=v?R?p???? ?7?? ?B???t??"?{?A)#Y?LO????"?%mh???l???q%?l1???M??????r ??4?]??L?=C?lQ8??k4???????ouB6? l?L????+???(??????~????R????i?? C?/?g?H + ?]?C??????J????-?? |??F?}>P???46B<0????E?ZY?w??=V?? + ??X?v??]q??w??????n?y+?????Vq?k|@????????Gf???_???Q???a???\D?-??????W~A??bwr?A?S????L?j????d??rsRK-@??(???? + N%fe?S!J?.?u?V????@%?????2??????q??i???SK%.?v????f?e??b? ?Y??aJs???f?_*?=+r?a?#????? ?u"???w??U??????? O?t??"??s?b?3z????,?e??'???q????3&c???> + endobj + 27 0 obj + << + /Filter[/FlateDecode] + /Length1 720 + /Length2 751 + /Length3 533 + /Length 1267 + >> + stream + x?SU ?uL?OJu??+?5?3?Rp? ?4S0?3?RUu.JM,???sI,I?R0??4Tp,MW04U00?22?26??RUp?/?,?L?(Q?p??2Wp?M-?LN?S?M,?H?????????ZR????????R??Z?ZT?????eh????\????????r?g^Z??9D8??+ @W????T*???q???mK??dgaq??n?99~?? ?A??!????S U??[PZ?Z?????Z???4<?6?????\tY?????d????T]C=cS?Df?[fEjJ at fIr?BZbNq*X<5/?)??;D?)8})??sne??v?f?;5???I:???&???V????j???_?J?Mw??v?????R??j???h?P???)?[??'M:g?_??????7??1?[?G?+ p?6?a?s??=????}?8p.?<*`m????5????Wll9?mW?2???@?????;??8??? + 6?p?0, H?IM,*??M,???+ endstream + endobj + 32 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-15 -951 1252 782] + /FontName/CQGCRA+CMSY7 + /ItalicAngle -14.035 + /StemV 93 + /FontFile 31 0 R + /Flags 68 + >> + endobj + 31 0 obj + << + /Filter[/FlateDecode] + /Length1 721 + /Length2 1244 + /Length3 533 + /Length 1783 + >> + stream + x???kXg?1?BB9HAA&f??S????? i8?4%!?@2?0? j)X??rP+ ( ??PP?R? +  + "*?? ? + hA????t????zu??????????}xl`??'??|E?? $??+ ??r@77???+ DA|?8/31?h@Ym?d?o?DH,?p ???????A?g?f5H???c?????2???#\?_??od?(?e ?eRH 0Ei'V'?I?9??f7`??*? 1????'?62??Z?_???uW? ??f??ct?N???k3?V??2L????q???y??-???e????_Q}????????*?0?????E?*??.??:??m??wW9?R?7?06A?j??????????4???&?4????1??dWaA??K=???????n?G??U???Y??????^??+ ???C_n?pnJ??o?]??????_?tdt?n`*?7?bhSY3??k?8?h?K 9zPz?,%-?????N??X??p??H?? ???g??????(????rl? n"?????G>??R?}?? Ay at R??yx?Z|??{???R?XR????]2?i+;??y#?w?N??1:????s_????G??"?+?8b?H??a0?+ endstream + endobj + 45 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-12 -237 650 811] + /FontName/IMJIEZ+NimbusMonL-Regu + /ItalicAngle 0 + /StemV 41 + /FontFile 44 0 R + /Flags 4 + >> + endobj + 44 0 obj + << + /Filter[/FlateDecode] + /Length1 1644 + /Length2 14864 + /Length3 532 + /Length 15747 + >> + stream + x??wePf??%^??~@???;??|???{???^X????^??p???7???Ow???q"????re??;???)? ?+ 4 ??+ ??? ????g3?M>a?g????A??h$g?hh + 0??????vek#????5?S??? ?cbd????????_?g?? hm????E??:???  ??S?&?)?????'??Y?????/??qx?}A:f?o+ +k-a??????'?,??m?g-????????H?iMH?????=??6????????????i?Fp?)??k??kN?????? ??L+?8??????????+C????&???j??'?:e]????\??? ?8X?m???]!2?q??Y*>Ptr?d?l???Z???? + ?m???*D?:?R{?6?S????m.Z??l?;???{%F?B?Sq ???2???q%???????o??6Z??IV-M ?"???|??????? t ?n????\???~?H?M-??i??D*L<}?8??iy?4(%(?_??Z???P????????|??tt4??3?-?P{?:Y???"??????@?U??&?;?'&?C+'????N?W????R?*n??????? ???K??,\? ??Y?+k???C??&????+9??D??#???7???h?QwA%?.????3?? ?4'?b??d??&??u??Id?(?H????!-?(?&????"??????yC????Q??P?????????? ?MK???0?]vG?????x9p? ?G???Q4z(?????(i?uD??w?+A??G???H#|;??t?z???a? ;?=???+ ?u?@?o??A_+ zn_?_Y&?+?T?~H???i??-???H?????o???L?s ??3(????)|?kT?>?T)1ylz?w???|\?$]??n ????7?n??B?q0?=p?]? + ??d1?Kv;/????mc??<e_.??"??H??0? ??Q??Et???????F??O??????j@?????;??,?Aa???n???U??z??? ;?W?e?n??>p{U.(v???0|\?y??>!B?!!X9+ H??U??C???k)?V?! ????d3?m?yy(-?1?????? ?k?vr7??;????a??Gz?????U??ea?A?E ?^??g????Y? R({ ?a?8????*?4/????????,?G!\.??U??!????????ytG07???w/??Cb>o?+ ???O??@????%=?dYi????db?r$??D???x=????}0c??3!=k???"???G???B????????????K?e?/??????e?51iG?????????????X???c?3??id}???{R?i? ?\*??g?1vx?>?P?D?H/^)?s_?6?m`M??je?#?????{???)???gf?DHAI??'c????t3????u{@0????oO??2????2s??4?s~?????#????????]MG!+ -?`-?'????P??|??P??/V??" + ?u?n???r?+ 2?A?Y???@r?M>?w??1? //#????K&<*?Q????3??????D???????s"?k3? ???? ?eg???NY%Y??%??{ ?j< ?3???%m???? + ??? 2??n?????Yz?u?|??@?m?0t )F??5?? ??' + 2??[??F?xU? ? ?4N\????????)??N????.J?????+?VJr?f??]??.s??WD???$?????????RQz6?k??S?????`?w?*??H?v?G8??-???ha??????ib=??$Cx??0?!??????a?????c?P?4H???JY????????????BC???K??I??x?-{?_J2??????v???1 ?^??]?n?3?U??sx?4?e\sA&>u????q???m???,??.P?????? ???F?R????Mt?"????-?R2??dG?S[OK0k?????J_??b?y???%&u'? 6R?????????j8???????[?h?_>i?O1????D+a?E?/?.q??.???????tR?????t?5 n?u ????W ?U???(??O?????=H????{??M?3EmBv + ^??~!$MHu??:uI??n!??I???fI>!.???S?{?3????!???Z??????5??,?????3>??t?nM?|???vg,?? ???????????+b.oQ???!???FR??????,??+?\?GE??????&????????)?W?? ?X?????8iv??C?I????E???????????????N at 2,?5 ?%w[??kKW(?a?WHE?|??o??P???U%?cv??????q!?a?y?????ZA??q2??"???ajR???????w?]l&???e!???g???m??t??! ??A*z??0???f?????Zp A??s??"??3?T?k?3S???=???,uE??????~?M?? Al?v?1? ?dD5?:b?q??u??3A)?K??_???_eV(g??j?GN.??d? O??W|?n?J????8?'sw?v?t?b??/?{??????>?E?FF*?1????????.??3$????? ?L?+/???? ?p?IR?#*P?X??u?b{E ??)?w"??K-?Z?KJ??c?#??r????qH??eF??????????0L???n???o? + 6g?z?L???i|?g?v??ut?@??4PL????\q?$fm*???;??&???Uj?x??[ ??1????J??,]??:?(???$}??k7?/???(?-4??*???k nS???j?\?????k????????4 ??? *+ ."??:??<?Z?????R??T??O??@Yi????????+??$3???+?ZqU7?D??/>???@c??r?-????[M ?K?W?'??~?K?.U=?@2?Cy?.?R????2???s????rV??????c????Q!?jMD8?b=???]?9?bG??=??O????'??>?g?SR???te??-?*??f?N2@????\??gU?#??w:'???z?? + ?C"A???$ly?^?????c??[?i2V.?M??;???dC??d+P U???wR??t??????`?A???G?b?"??????R`?6wNY9?u?D\??D??? z?????5?b 1?3??Q???e??meh?,c?da?c?;\?????EEB(:[?z?M? ???p?>)^0S?#?@?\O?y9U?)????~?i????rx?G?71v???N?????Y??(?-y?????0}:????^1??????t???????u{#??E?]]?dC= + ????`?l???7z>C??pa5??4???1????w?M{?>?T?]?>0??S?a?t ??s?34?0V&????+^?gC??la^8~\???I}?$?B"????????`??^?^??????c??6z?9&D????$?g?@l^N????O?oM???^?D????`??h]??+ ??]#7?p?:?_^?z?????/?(??< ? ?'N?`??m??c?k2G??M?!T????????x8P???x?i?+b??^#? ,??Z&????6C??s ?>x5UV???0???Lc???9????D?nJI??????????)??????v?(?P-?=?+3/u??C?k?,T 5???Z??W(???[9ki?p?9?5C?z???5=a???Js??;}?I???$?c?d???????,?????????-T?4??Q4ug??O??Z????~/?t??R4\?I??K??????(???J??d?S4C ?2{qW?O|???`???]?Se?A???f]???u??}P]??h?A?M????b???m?Gz?????Zl???a3s??F???GM@??>R?{?vhN?yo?N^?:8?9?i*C+ b?Z?G+ ?o???^*(?{s????mzO? ?E?/c???:?????&????9B~??']??<??]???&?s?v???U!?})???K??????o???`?#????kH?? K ???Vly+6?SF??j???B???_L???y 7s?T???{1{8b?O~<7?^???$??I?w?X|???? ?Z????\v$?????{??i??ZT?? + !?0,?pn????F[H?Z??7??L? + w?1??d???[?? ?T?U??BpG?;KFv??D??0?'E???h??| ??k86GzM?s@??????.?~+ :?m????[@$_?n'?6 ??/9^/ ?D;??XB?>?????*???%????1l??s?_?!8 at c?V ?*?7???n+ ????x???X??9?|????xo?M?????z.?(?{WCQ?R2Z{?[?\u?)???{w??V2?? 5=?u7?a??????^S??%?M???????ig???_?~??}%M<?3?[?;S?}K?j#"?!K?????)?F??V?0???"??}oJ?%?x? + a???> + endobj + 48 0 obj + << + /Filter[/FlateDecode] + /Length1 727 + /Length2 2601 + /Length3 533 + /Length 3146 + >> + stream + x???y?J?????S??`+ ??N4"??$k2?? x(??7???'???7??i SK???JNZ?EF,y~l??? O]n?E?~????"???????A~?f?*??+??~8????v\?qH?6s?6?5_??`U%?????7?J???j?,c?9)/?N??a?K+ m-4??d???? ????}????[cI?7???L0??]a?????)?wSI?1-??G? ?s?? -?::??C?9??????????????????? 7?!?l?{`l???X??????_?9??{?m\??? ?M^??!??pR |?J8?Ts?|?w? ?8)???&zd??J?{?A???????8?????5??LSi?iI??1?%?55sg???3?u????q??,???9???=a??K??f?|I?0?c????c-?%tH??|?&????W????&??:?"??%w[???]???2?C??ldT?3?? ?H?%???2?@???1?R?T?5/p]??\o??C?:????[?/??-?x"~[m%??C?~??G?????^`?~????1~??a?t?+???q?k?^y"?r????=Y?l??*???i>??????i?'ys?Y?KjKi??k?y?{???????Pnqm?w??? + ^ \m[]?>???????>/???????RX?Zi?k? + }???U` + u?]????aF4 ~:s??/??A?????S? ??o{?j:?????????|????N? + @L?~z?????^?;?}>??+?Y?????j[o????|??i??????z? ??c?@r?d{6??fs?1C?A?nI?5wM??[???F??????6??K??? ??:Q??? ?+ ?AQ??/#?'x?????S??H? ?^??)?i~?h???n?L?+??FT>????|??j?L?S????`???NS'??=1faF??W??????>?@Y;p????m?Wpcw????'?$qV?UH? ?k? + ?CZ?JU?y??,?"???? ??n??K????}Q??r???? ??p\?(4?2??]$w??Z?E???????N?x?B>F??@??S?O???Eh??????QL????W?? ??b??~?q?? t?#??E???ew?[e_k???????m??V?Sf???c?H???vi;?Be'??????|1?O?? ?ZvM????#??-?kL???/?+l???1?~?????7:}*4 P'?kT??>?8??z-(?^??????ul??@|??????0?U?K?^B?-\47??saT}i?JIy2j7:??????jk????#7"?u#?????U?2??c???k??~?qX???x(e;?3~???l;?p$i,>?ph? ?4<?xRr5??6?e???u?{2P+ rr?y?h??c9???.)&sU?????????7? s?? ?.{?F.???*??Wt?^H?NJ\$l?h?X?????W?"5? + ???|?&l???UF^3?k??? ??????3?|l???nJ??.f8??=??f???91?VkW???_L'x? ]c????B?Fi?|?*+r?~\(F??X?"???????+ endstream + endobj + 52 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-30 -958 1146 777] + /FontName/BAJWVJ+CMSY9 + /ItalicAngle -14.035 + /StemV 87 + /FontFile 51 0 R + /Flags 68 + >> + endobj + 51 0 obj + << + /Filter[/FlateDecode] + /Length1 721 + /Length2 604 + /Length3 533 + /Length 1117 + >> + stream + x?SU ?uL?OJu??+?5?3?Rp? ??T0?3?RUu.JM,???sI,I?R0??4Tp,MW04U00?22?22??RUp?/?,?L?(Q?p??2Wp?M-?LN?S?M,?H?????????ZR????????R??Z?ZT?????eh????\????????r?g^Z??9D8??+ @W????T*???q???mK??dgaq??n?99~?? ?A??!????S U??[PZ?Z?????Z???4<?6?????\tY?????d????T]C=cS?Df?[fEjJ at fIr?BZbNq*X<5/?)??;D???+}???????c>??[m?x????? ??r?LOq??????vq????RE?fs???*?fqw????7k?%?UrgN?WP????Q????o????????L?)??}?[?[??W;?2m????tg?+WE?????R?7o???<0KO??i??????P?F $??&???&esq+ endstream + endobj + 84 0 obj + << + /Type/FontDescriptor + /CapHeight 850 + /Ascent 850 + /Descent -200 + /FontBBox[-251 -250 1009 969] + /FontName/AWDWUD+CMR10 + /ItalicAngle 0 + /StemV 69 + /FontFile 83 0 R + /Flags 4 + >> + endobj + 83 0 obj + << + /Filter[/FlateDecode] + /Length1 720 + /Length2 3262 + /Length3 533 + /Length 3810 + >> + stream + x???y8?m???j?R?Y??K???6???lcf0?fFY&?E??dOEY??????-S?Qd+?!??z??=?????x?{??w???q????}??u^?? + ????FD ??4?p?@??+ VSWWa?&??????"+ ??L?D???4?????U,?|???I*?@ ??`A??~????PK$p?~ + Kf?? =???)?G?H|?qu?!?/-U????uzQ?j1v???Q?D1*X;w8%j?????,?'?Q1}????VH??S??.\??o + ??!?G&??!o?'???i!??N???b F?fc????aO?? + ??^?1??:?k!?uR?Z? ?4??aK????G?h?\?5?=xW??????1?+ ? ?yJ???12?&"???!??tq?E?T???&?:%?px?gm9=4?gi?d??oZ?-??)?V??.????????.+7+$????h^???????/???9.?????q???n???K>vmz??T5?X<???7?"Bk#???\??g??#l ??[Y????Kz?r??Q?n??#?K?>?B3??a?pS?56??????????PExW???Qg????x??db??{h~??w??!?/??gFy?g?ke?q?x?s???e?p?J??[?nyZ?o????bl????\]????????m?2?o?S???????H;+ ?????qh?%??C~M?/c??8????????j?:f=?????????=???bgXE3F???~??c\x?m#????U>???YQ: R?q?N??Y4??m?????7??1???m?=2T??K?)?q??????'??GF mC?qb?*E????L??:@??]?l+?-I#Qi????A?3k?2W??W???1?SX??+ >+??v??i????7? ??+?y?????]??;fD>?]??#vR?l?e=???VCOZoG??:u;?5$?w(??4?I?r?>????_???5???tw?v????'??#e????f+Z???S=8@?7???? ?M??x?????qR + ?o~?SF??tY)?)???0p =??IIC_??^?v??Nb???S???)`jO?%??u?^G??.??o?)?i???]???KO??:="?;v???u?n???#?&??m6^????? >??jzV??`??NyK7?;8j?_???)??+|???YWm?????Q?c??n?39 ??????yL[bk??+?!? ???/9v?h?~?OR??AMY???y??????vF??u~?????????u?Rlgy??i?W4?K*+ endstream + endobj + 1 0 obj + << + /Creator( TeX output 2009.01.12:1055) + /Producer(dvipdfm 0.13.2c, Copyright \251 1998, by Mark A. Wicks) + /CreationDate(D:20090112105510-06'00') + >> + endobj + 5 0 obj + << + /Type/Page + /Resources 6 0 R + /Contents[34 0 R 4 0 R 35 0 R 36 0 R] + /Parent 96 0 R + >> + endobj + 38 0 obj + << + /Type/Page + /Resources 39 0 R + /Contents[34 0 R 4 0 R 40 0 R 36 0 R] + /Parent 96 0 R + >> + endobj + 42 0 obj + << + /Type/Page + /Resources 43 0 R + /Contents[34 0 R 4 0 R 54 0 R 36 0 R] + /Parent 96 0 R + >> + endobj + 96 0 obj + << + /Type/Pages + /Count 3 + /Kids[5 0 R 38 0 R 42 0 R] + /Parent 3 0 R + >> + endobj + 56 0 obj + << + /Type/Page + /Resources 57 0 R + /Contents[34 0 R 4 0 R 58 0 R 36 0 R] + /Parent 97 0 R + >> + endobj + 60 0 obj + << + /Type/Page + /Resources 61 0 R + /Contents[34 0 R 4 0 R 62 0 R 36 0 R] + /Parent 97 0 R + >> + endobj + 64 0 obj + << + /Type/Page + /Resources 65 0 R + /Contents[34 0 R 4 0 R 66 0 R 36 0 R] + /Parent 97 0 R + >> + endobj + 97 0 obj + << + /Type/Pages + /Count 3 + /Kids[56 0 R 60 0 R 64 0 R] + /Parent 3 0 R + >> + endobj + 68 0 obj + << + /Type/Page + /Resources 69 0 R + /Contents[34 0 R 4 0 R 70 0 R 36 0 R] + /Parent 98 0 R + >> + endobj + 72 0 obj + << + /Type/Page + /Resources 73 0 R + /Contents[34 0 R 4 0 R 74 0 R 36 0 R] + /Parent 98 0 R + >> + endobj + 76 0 obj + << + /Type/Page + /Resources 77 0 R + /Contents[34 0 R 4 0 R 78 0 R 36 0 R] + /Parent 98 0 R + >> + endobj + 98 0 obj + << + /Type/Pages + /Count 3 + /Kids[68 0 R 72 0 R 76 0 R] + /Parent 3 0 R + >> + endobj + 80 0 obj + << + /Type/Page + /Resources 81 0 R + /Contents[34 0 R 4 0 R 86 0 R 36 0 R] + /Parent 99 0 R + >> + endobj + 88 0 obj + << + /Type/Page + /Resources 89 0 R + /Contents[34 0 R 4 0 R 90 0 R 36 0 R] + /Parent 99 0 R + >> + endobj + 92 0 obj + << + /Type/Page + /Resources 93 0 R + /Contents[34 0 R 4 0 R 94 0 R 36 0 R] + /Parent 99 0 R + >> + endobj + 99 0 obj + << + /Type/Pages + /Count 3 + /Kids[80 0 R 88 0 R 92 0 R] + /Parent 3 0 R + >> + endobj + 3 0 obj + << + /Type/Pages + /Count 12 + /Kids[96 0 R 97 0 R 98 0 R 99 0 R] + /MediaBox[0 0 595 842] + >> + endobj + 34 0 obj + << + /Length 1 + >> + stream + + endstream + endobj + 36 0 obj + << + /Length 1 + >> + stream + + endstream + endobj + 4 0 obj + << + /Length 33 + >> + stream + 1.00028 0 0 1.00028 72 769.82 cm + endstream + endobj + 100 0 obj + << + >> + endobj + 101 0 obj + null + endobj + 102 0 obj + << + >> + endobj + 2 0 obj + << + /Type/Catalog + /Pages 3 0 R + /Outlines 100 0 R + /Threads 101 0 R + /Names 102 0 R + >> + endobj + xref + 0 103 + 0000000000 65535 f + 0000196948 00000 n + 0000199048 00000 n + 0000198697 00000 n + 0000198898 00000 n + 0000197112 00000 n + 0000017561 00000 n + 0000000009 00000 n + 0000080849 00000 n + 0000080649 00000 n + 0000001823 00000 n + 0000002966 00000 n + 0000099871 00000 n + 0000099676 00000 n + 0000004582 00000 n + 0000101438 00000 n + 0000101237 00000 n + 0000005533 00000 n + 0000124503 00000 n + 0000124305 00000 n + 0000006672 00000 n + 0000134866 00000 n + 0000134656 00000 n + 0000007812 00000 n + 0000149157 00000 n + 0000148947 00000 n + 0000008956 00000 n + 0000168427 00000 n + 0000168234 00000 n + 0000010097 00000 n + 0000011036 00000 n + 0000170001 00000 n + 0000169807 00000 n + 0000012175 00000 n + 0000198798 00000 n + 0000013184 00000 n + 0000198848 00000 n + 0000017440 00000 n + 0000197214 00000 n + 0000022562 00000 n + 0000017622 00000 n + 0000022507 00000 n + 0000197318 00000 n + 0000031561 00000 n + 0000172094 00000 n + 0000171898 00000 n + 0000022624 00000 n + 0000023758 00000 n + 0000188152 00000 n + 0000187958 00000 n + 0000024712 00000 n + 0000191606 00000 n + 0000191412 00000 n + 0000025659 00000 n + 0000026659 00000 n + 0000031470 00000 n + 0000197506 00000 n + 0000036486 00000 n + 0000031623 00000 n + 0000036419 00000 n + 0000197610 00000 n + 0000041336 00000 n + 0000036548 00000 n + 0000041269 00000 n + 0000197714 00000 n + 0000046000 00000 n + 0000041398 00000 n + 0000045944 00000 n + 0000197903 00000 n + 0000052182 00000 n + 0000046062 00000 n + 0000052116 00000 n + 0000198007 00000 n + 0000057349 00000 n + 0000052244 00000 n + 0000057282 00000 n + 0000198111 00000 n + 0000062830 00000 n + 0000057411 00000 n + 0000062751 00000 n + 0000198300 00000 n + 0000069901 00000 n + 0000062892 00000 n + 0000193024 00000 n + 0000192836 00000 n + 0000063797 00000 n + 0000064716 00000 n + 0000069833 00000 n + 0000198404 00000 n + 0000074673 00000 n + 0000069963 00000 n + 0000074618 00000 n + 0000198508 00000 n + 0000080587 00000 n + 0000074735 00000 n + 0000080532 00000 n + 0000197422 00000 n + 0000197818 00000 n + 0000198215 00000 n + 0000198612 00000 n + 0000198980 00000 n + 0000199003 00000 n + 0000199025 00000 n + trailer + << + /Size 103 + /Root 2 0 R + /Info 1 0 R + >> + startxref + 199146 + %%EOF Index: llvm-www/pubs/2009-03-ASPLOS-Recovery.html diff -u llvm-www/pubs/2009-03-ASPLOS-Recovery.html:1.1 llvm-www/pubs/2009-03-ASPLOS-Recovery.html:1.2 --- llvm-www/pubs/2009-03-ASPLOS-Recovery.html:1.1 Fri Dec 5 12:32:02 2008 +++ llvm-www/pubs/2009-03-ASPLOS-Recovery.html Tue Jan 13 12:47:25 2009 @@ -33,7 +33,21 @@ fatal faults with minimal collateral impact during a recovery event. -

To Appear ASPLOS 2009

+

To Appear:

+
+ "Recovery Domains: An Organizing Principle for Recoverable Operating Systems"
+ Andrew Lenharth, Samuel T. King, and and Vikram Adve.
+ Proceedings of the Fourteenth International Conference on + Architectural Support for Programming Languages and Operating Systems + (ASPLOS '09), + Washington DC, March, 2009. +
+ +

Download:

+

Paper:

+
From gohman at apple.com Tue Jan 13 13:03:01 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 11:03:01 -0800 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll In-Reply-To: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> References: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> Message-ID: Hi Dale, These tests: Applications/SPASS/SPASS Benchmarks/Olden/perimeter/perimeter regressed as of this commit. The failure is an assertion failure in opt: Assertion failed: (i && "Cannot find callsite to replace!"), function replaceCallSite, file lib/Analysis/IPA/CallGraph.cpp, line 303. Dan On Jan 12, 2009, at 2:11 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Jan 12 16:11:50 2009 > New Revision: 62107 > > URL: http://llvm.org/viewvc/llvm-project?rev=62107&view=rev > Log: > Enable recursive inlining. Reduce inlining threshold > back to 200; 400 seems to be too high, loses more than > it gains. > > > Added: > llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll > Modified: > llvm/trunk/lib/Transforms/IPO/Inliner.cpp > llvm/trunk/lib/Transforms/Utils/InlineCost.cpp > > Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=62107&r1=62106&r2=62107&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon Jan 12 16:11:50 2009 > @@ -31,8 +31,8 @@ > STATISTIC(NumDeleted, "Number of functions deleted because all > callers found"); > > static cl::opt > -InlineLimit("inline-threshold", cl::Hidden, cl::init(400), > - cl::desc("Control the amount of inlining to perform > (default = 400)")); > +InlineLimit("inline-threshold", cl::Hidden, cl::init(200), > + cl::desc("Control the amount of inlining to perform > (default = 200)")); > > Inliner::Inliner(void *ID) > : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} > @@ -168,8 +168,7 @@ > for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi) > if (Function *Callee = CallSites[CSi].getCalledFunction()) { > // Calls to external functions are never inlinable. > - if (Callee->isDeclaration() || > - CallSites[CSi].getInstruction()->getParent()- > >getParent() ==Callee){ > + if (Callee->isDeclaration()) { > if (SCC.size() == 1) { > std::swap(CallSites[CSi], CallSites.back()); > CallSites.pop_back(); > @@ -190,7 +189,8 @@ > if (InlineCallIfPossible(CS, CG, SCCFunctions, > getAnalysis())) { > // Remove any cached cost info for this caller, as > inlining the callee > - // has increased the size of the caller. > + // has increased the size of the caller (which may be > the same as the > + // callee). > resetCachedCostInfo(Caller); > > // Remove this call site from the list. If possible, use > > Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=62107&r1=62106&r2=62107&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Jan 12 > 16:11:50 2009 > @@ -180,14 +180,12 @@ > Function *Callee = CS.getCalledFunction(); > Function *Caller = TheCall->getParent()->getParent(); > > - // Don't inline a directly recursive call. > - if (Caller == Callee || > // Don't inline functions which can be redefined at link-time > to mean > // something else. > // FIXME: We allow link-once linkage since in practice all > versions of > // the function have the same body (C++ ODR) - but the LLVM > definition > // of LinkOnceLinkage doesn't require this. > - (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || > + if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) > || > // Don't inline functions marked noinline. > Callee->hasFnAttr(Attribute::NoInline) || > NeverInline.count(Callee)) > return llvm::InlineCost::getNever(); > > Added: llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll?rev=62107&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll > (added) > +++ llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll > Mon Jan 12 16:11:50 2009 > @@ -0,0 +1,92 @@ > +; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {call.*fib} | > count 4 > +; First call to fib from fib is inlined, producing 2 instead of 1, > total 3. > +; Second call to fib from fib is not inlined because new body of > fib exceeds > +; inlining limit of 200. Plus call in main = 4 total. > + > +; ModuleID = '' > +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- > i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- > f80:128:128" > +target triple = "i386-apple-darwin9.6" > +@"\01LC" = internal constant [5 x i8] c"%ld\0A\00" ; <[5 x i8]*> > [#uses=1] > + > +define i32 @fib(i32 %n) nounwind { > +entry: > + %n_addr = alloca i32 ; [#uses=4] > + %retval = alloca i32 ; [#uses=2] > + %0 = alloca i32 ; [#uses=3] > + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > + store i32 %n, i32* %n_addr > + %1 = load i32* %n_addr, align 4 ; [#uses=1] > + %2 = icmp ule i32 %1, 1 ; [#uses=1] > + br i1 %2, label %bb, label %bb1 > + > +bb: ; preds = %entry > + store i32 1, i32* %0, align 4 > + br label %bb2 > + > +bb1: ; preds = %entry > + %3 = load i32* %n_addr, align 4 ; [#uses=1] > + %4 = sub i32 %3, 2 ; [#uses=1] > + %5 = call i32 @fib(i32 %4) nounwind ; [#uses=1] > + %6 = load i32* %n_addr, align 4 ; [#uses=1] > + %7 = sub i32 %6, 1 ; [#uses=1] > + %8 = call i32 @fib(i32 %7) nounwind ; [#uses=1] > + %9 = add i32 %5, %8 ; [#uses=1] > + store i32 %9, i32* %0, align 4 > + br label %bb2 > + > +bb2: ; preds = %bb1, %bb > + %10 = load i32* %0, align 4 ; [#uses=1] > + store i32 %10, i32* %retval, align 4 > + br label %return > + > +return: ; preds = %bb2 > + %retval3 = load i32* %retval ; [#uses=1] > + ret i32 %retval3 > +} > + > +define i32 @main(i32 %argc, i8** %argv) nounwind { > +entry: > + %argc_addr = alloca i32 ; [#uses=2] > + %argv_addr = alloca i8** ; [#uses=2] > + %retval = alloca i32 ; [#uses=2] > + %N = alloca i32 ; [#uses=2] > + %0 = alloca i32 ; [#uses=2] > + %iftmp.0 = alloca i32 ; [#uses=3] > + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] > + store i32 %argc, i32* %argc_addr > + store i8** %argv, i8*** %argv_addr > + %1 = load i32* %argc_addr, align 4 ; [#uses=1] > + %2 = icmp eq i32 %1, 2 ; [#uses=1] > + br i1 %2, label %bb, label %bb1 > + > +bb: ; preds = %entry > + %3 = load i8*** %argv_addr, align 4 ; [#uses=1] > + %4 = getelementptr i8** %3, i32 1 ; [#uses=1] > + %5 = load i8** %4, align 4 ; [#uses=1] > + %6 = call i32 @atoi(i8* %5) nounwind ; [#uses=1] > + store i32 %6, i32* %iftmp.0, align 4 > + br label %bb2 > + > +bb1: ; preds = %entry > + store i32 43, i32* %iftmp.0, align 4 > + br label %bb2 > + > +bb2: ; preds = %bb1, %bb > + %7 = load i32* %iftmp.0, align 4 ; [#uses=1] > + store i32 %7, i32* %N, align 4 > + %8 = load i32* %N, align 4 ; [#uses=1] > + %9 = call i32 @fib(i32 %8) nounwind ; [#uses=1] > + %10 = call i32 (i8*, ...)* @printf(i8* getelementptr ([5 x i8]* > @"\01LC", i32 0, i32 0), i32 %9) nounwind ; [#uses=0] > + store i32 0, i32* %0, align 4 > + %11 = load i32* %0, align 4 ; [#uses=1] > + store i32 %11, i32* %retval, align 4 > + br label %return > + > +return: ; preds = %bb2 > + %retval3 = load i32* %retval ; [#uses=1] > + ret i32 %retval3 > +} > + > +declare i32 @atoi(i8*) > + > +declare i32 @printf(i8*, ...) nounwind > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Jan 13 13:08:45 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 19:08:45 -0000 Subject: [llvm-commits] [llvm] r62173 - /llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Message-ID: <200901131908.n0DJ8j5p004928@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 13:08:45 2009 New Revision: 62173 URL: http://llvm.org/viewvc/llvm-project?rev=62173&view=rev Log: Avoid referring to edge D after the Succs or Preds arrays have been modified, to avoid trouble in the (unlikely) scenario that D is a reference to an element in one of those arrays. Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAG.cpp?rev=62173&r1=62172&r2=62173&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Tue Jan 13 13:08:45 2009 @@ -75,8 +75,8 @@ ++NumPredsLeft; if (!isScheduled) ++N->NumSuccsLeft; - N->Succs.push_back(P); Preds.push_back(D); + N->Succs.push_back(P); if (P.getLatency() != 0) { this->setDepthDirty(); N->setHeightDirty(); @@ -105,8 +105,8 @@ } assert(FoundSucc && "Mismatching preds / succs lists!"); Preds.erase(I); - // Update the bookkeeping; - if (D.getKind() == SDep::Data) { + // Update the bookkeeping. + if (P.getKind() == SDep::Data) { --NumPreds; --N->NumSuccs; } From wangmp at apple.com Tue Jan 13 13:09:28 2009 From: wangmp at apple.com (Mon Ping Wang) Date: Tue, 13 Jan 2009 11:09:28 -0800 Subject: [llvm-commits] [llvm] r61129 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <200901131458.46537.baldrick@free.fr> References: <200812170849.mBH8nnn5016096@zion.cs.uiuc.edu> <200901131458.46537.baldrick@free.fr> Message-ID: <0E3310F8-4846-4CDC-9026-EE5CC9A3238F@apple.com> Hi Duncan, Yes, it would be cleaner to use SELECT_CC instead of SETCC+SELECT pair. I'll do the cleanup soon for it. Thanks, -- Mon Ping On Jan 13, 2009, at 5:58 AM, Duncan Sands wrote: > Hi Mon Ping, > >> Fix expansion of vsetcc to set the high bit for true instead of 1. > ... >> SDValue In1 = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, TmpEltVT, >> Tmp1, DAG.getIntPtrConstant(i)); >> Ops[i] = DAG.getNode(ISD::SETCC, TLI.getSetCCResultType >> (In1), In1, >> - DAG.getNode(ISD::EXTRACT_VECTOR_ELT, >> TmpEltVT, >> - Tmp2, >> DAG.getIntPtrConstant(i)), >> - CC); >> - Ops[i] = DAG.getNode(ISD::SIGN_EXTEND, EltVT, Ops[i]); >> + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, >> TmpEltVT, >> + Tmp2, >> DAG.getIntPtrConstant(i)), >> + CC); >> + Ops[i] = DAG.getNode(ISD::SELECT, EltVT, Ops[i], >> + DAG.getConstant >> (EltVT.getIntegerVTBitMask(),EltVT), >> + DAG.getConstant(0, EltVT)); > > wouldn't it make more sense to use a SELECT_CC rather than a SETCC > +SELECT pair? > > Ciao, > > Duncan. From sanjiv.gupta at microchip.com Tue Jan 13 13:18:48 2009 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Tue, 13 Jan 2009 19:18:48 -0000 Subject: [llvm-commits] [llvm] r62174 - in /llvm/trunk/lib/Target/PIC16: Makefile PIC16.h PIC16AsmPrinter.cpp PIC16AsmPrinter.h PIC16ISelLowering.cpp PIC16ISelLowering.h PIC16InstrInfo.cpp PIC16InstrInfo.td PIC16RegisterInfo.cpp PIC16RegisterInfo.h PIC16TargetAsmInfo.cpp PIC16TargetAsmInfo.h Message-ID: <200901131918.n0DJImOC005247@zion.cs.uiuc.edu> Author: sgupta Date: Tue Jan 13 13:18:47 2009 New Revision: 62174 URL: http://llvm.org/viewvc/llvm-project?rev=62174&view=rev Log: Checking in conditionals, function call, arrays and libcalls implementation. Modified: llvm/trunk/lib/Target/PIC16/Makefile llvm/trunk/lib/Target/PIC16/PIC16.h llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h Modified: llvm/trunk/lib/Target/PIC16/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/Makefile?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/Makefile (original) +++ llvm/trunk/lib/Target/PIC16/Makefile Tue Jan 13 13:18:47 2009 @@ -1,10 +1,10 @@ ##===- lib/Target/PIC16/Makefile ---------------------------*- Makefile -*-===## -# +# # The LLVM Compiler Infrastructure # -# This file is distributed under the University of Illinois Open Source +# This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. -# +# ##===----------------------------------------------------------------------===## LEVEL = ../../.. LIBRARYNAME = LLVMPIC16 Modified: llvm/trunk/lib/Target/PIC16/PIC16.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16.h?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16.h Tue Jan 13 13:18:47 2009 @@ -15,12 +15,39 @@ #ifndef LLVM_TARGET_PIC16_H #define LLVM_TARGET_PIC16_H +#include +#include + namespace llvm { class PIC16TargetMachine; class FunctionPass; class MachineCodeEmitter; class raw_ostream; +namespace PIC16CC { + enum CondCodes { + EQ, + NE, + LT, + LE, + GT, + GE + }; +} + + inline static const char *PIC16CondCodeToString(PIC16CC::CondCodes CC) { + switch (CC) { + default: assert(0 && "Unknown condition code"); + case PIC16CC::NE: return "ne"; + case PIC16CC::EQ: return "eq"; + case PIC16CC::LT: return "lt"; + case PIC16CC::LE: return "le"; + case PIC16CC::GT: return "gt"; + case PIC16CC::GE: return "ge"; + } + } + + FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM); FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS, PIC16TargetMachine &TM); Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Tue Jan 13 13:18:47 2009 @@ -24,6 +24,33 @@ using namespace llvm; #include "PIC16GenAsmWriter.inc" +bool PIC16AsmPrinter::inSameBank (char *s1, char *s2){ + + assert (s1 && s2 && "Null pointer assignment"); + + if ((*s1 == '.') && (*s2 == '.')) { //skip if they both start with '.' + s1++; + s2++; + } + while (*s1 && *s2) { + if (*s1 != *s2) + goto _NotInSameBank; + + if ((*s1 == '.') && (*s2 == '.')) //both symbols in same function + goto _InSameBank; //in the same bank + + s1++; + s2++; + } + + if (*s1 && *s1) { + _InSameBank: + return true; + } + + _NotInSameBank: + return false; +} bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) { std::string NewBankselLabel; @@ -45,8 +72,8 @@ // generate banksel. const MachineOperand &BS = MI->getOperand(Operands-1); if (((int)BS.getImm() == 1) && - (strcmp (CurrentBankselLabelInBasicBlock.c_str(), - NewBankselLabel.c_str()))) { + (!inSameBank ((char *)CurrentBankselLabelInBasicBlock.c_str(), + (char *)NewBankselLabel.c_str()))) { CurrentBankselLabelInBasicBlock = NewBankselLabel; O << "\tbanksel "; printOperand(MI, Operands-2); @@ -73,9 +100,11 @@ // Emit the function variables. emitFunctionData(MF); std::string codeSection; - codeSection = "code." + CurrentFnName + ".#"; + codeSection = "code." + CurrentFnName + ".# " + "CODE"; + const Section *fCodeSection = TAI->getNamedSection(codeSection.c_str(), + SectionFlags::Code); O << "\n"; - SwitchToTextSection (codeSection.c_str(),F); + SwitchToSection (fCodeSection); // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); @@ -130,11 +159,21 @@ O << MO.getSymbolName(); break; + case MachineOperand::MO_MachineBasicBlock: + printBasicBlockLabel(MO.getMBB()); + return; + default: assert(0 && " Operand type not supported."); } } +void PIC16AsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) { + int CC = (int)MI->getOperand(opNum).getImm(); + O << PIC16CondCodeToString((PIC16CC::CondCodes)CC); +} + + bool PIC16AsmPrinter::doInitialization (Module &M) { bool Result = AsmPrinter::doInitialization(M); // FIXME:: This is temporary solution to generate the include file. @@ -166,6 +205,10 @@ O << "\tglobal " << Name << ".args\n"; } } + + // Emit header file to include declaration of library functions + O << "\t#include C16IntrinsicCalls.INC\n"; + // Emit declarations for external globals. for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; I++) { @@ -177,8 +220,7 @@ } } void PIC16AsmPrinter::EmitInitData (Module &M) { - std::string iDataSection = "idata.#"; - SwitchToDataSection(iDataSection.c_str()); + SwitchToSection(TAI->getDataSection()); for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { if (!I->hasInitializer()) // External global require no code. @@ -244,8 +286,7 @@ void PIC16AsmPrinter::EmitRomData (Module &M) { - std::string romDataSection = "romdata.#"; - SwitchToRomDataSection(romDataSection.c_str()); + SwitchToSection(TAI->getReadOnlySection()); IsRomData = true; for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { @@ -274,11 +315,9 @@ IsRomData = false; } - void PIC16AsmPrinter::EmitUnInitData (Module &M) { - std::string uDataSection = "udata.#"; - SwitchToUDataSection(uDataSection.c_str()); + SwitchToSection(TAI->getBSSSection_()); const TargetData *TD = TM.getTargetData(); for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); @@ -300,6 +339,7 @@ const Type *Ty = C->getType(); unsigned Size = TD->getTypePaddedSize(Ty); + O << name << " " <<"RES"<< " " << Size ; O << "\n"; } @@ -317,29 +357,24 @@ std::string FuncName = Mang->getValueName(F); const Module *M = F->getParent(); const TargetData *TD = TM.getTargetData(); - + unsigned FrameSize = 0; // Emit the data section name. O << "\n"; - std::string fDataSection = "fdata." + CurrentFnName + ".#"; - SwitchToUDataSection(fDataSection.c_str(), F); + std::string SectionName = "fdata." + CurrentFnName + ".# " + "UDATA"; + + const Section *fDataSection = TAI->getNamedSection(SectionName.c_str(), + SectionFlags::Writeable); + SwitchToSection(fDataSection); //Emit function return value. O << CurrentFnName << ".retval:\n"; const Type *RetType = F->getReturnType(); - if (RetType->getTypeID() != Type::VoidTyID) { - unsigned RetSize = TD->getTypePaddedSize(RetType); - if (RetSize > 0) - O << CurrentFnName << ".retval" << " RES " << RetSize; - } + unsigned RetSize = 0; + if (RetType->getTypeID() != Type::VoidTyID) + RetSize = TD->getTypePaddedSize(RetType); + // Emit function arguments. O << CurrentFnName << ".args:\n"; - for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); - AI != AE; ++AI) { - std::string ArgName = Mang->getValueName(AI); - const Type *ArgTy = AI->getType(); - unsigned ArgSize = TD->getTypePaddedSize(ArgTy); - O << CurrentFnName << ".args." << ArgName << " RES " << ArgSize; - } // Emit the function variables. // In PIC16 all the function arguments and local variables are global. @@ -358,22 +393,28 @@ Constant *C = I->getInitializer(); const Type *Ty = C->getType(); unsigned Size = TD->getTypePaddedSize(Ty); + FrameSize += Size; // Emit memory reserve directive. O << VarName << " RES " << Size << "\n"; } - emitFunctionTempData(MF); + emitFunctionTempData(MF, FrameSize); + if (RetSize > FrameSize) + O << CurrentFnName << ".dummy" << "RES" << (RetSize - FrameSize); } -void PIC16AsmPrinter::emitFunctionTempData(MachineFunction &MF) { +void PIC16AsmPrinter::emitFunctionTempData(MachineFunction &MF, + unsigned &FrameSize) { // Emit temporary variables. MachineFrameInfo *FrameInfo = MF.getFrameInfo(); if (FrameInfo->hasStackObjects()) { int indexBegin = FrameInfo->getObjectIndexBegin(); int indexEnd = FrameInfo->getObjectIndexEnd(); - if (indexBegin < indexEnd) + if (indexBegin < indexEnd) { + FrameSize += indexEnd - indexBegin; O << CurrentFnName << ".tmp RES"<< " " <hasSection()) - NS = TAI->getSwitchToSectionDirective() + GV->getSection(); - else - NS = NewSection; - - // If we're already in this section, we're done. - if (CurrentSection == NS) return; - - // Close the current section, if applicable. - if (TAI->getSectionEndDirectiveSuffix() && !CurrentSection.empty()) - O << CurrentSection << TAI->getSectionEndDirectiveSuffix() << '\n'; - - CurrentSection = NS; - - if (!CurrentSection.empty()){} - O << CurrentSection << (static_cast(TAI))-> - getUDataSectionStartSuffix() << '\n'; - - IsInTextSection = false; -} - -/// The function is same as AsmPrinter::SwitchtoDataSection except the call -/// to getRomDataSectionStartSuffix. -void PIC16AsmPrinter::SwitchToRomDataSection(const char *NewSection, - const GlobalValue *GV) { - std::string NS; - if (GV && GV->hasSection()) - NS = TAI->getSwitchToSectionDirective() + GV->getSection(); - else - NS = NewSection; - - // If we're already in this section, we're done. - if (CurrentSection == NS) return; - - // Close the current section, if applicable. - if (TAI->getSectionEndDirectiveSuffix() && !CurrentSection.empty()) - O << CurrentSection << TAI->getSectionEndDirectiveSuffix() << '\n'; - - CurrentSection = NS; - - if (!CurrentSection.empty()) {} - O << CurrentSection << (static_cast< const PIC16TargetAsmInfo *>(TAI))-> - getRomDataSectionStartSuffix() << '\n'; - - IsInTextSection = false; -} - Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.h Tue Jan 13 13:18:47 2009 @@ -36,10 +36,7 @@ bool runOnMachineFunction(MachineFunction &F); void printOperand(const MachineInstr *MI, int opNum); - void SwitchToUDataSection(const char *NewSection, - const GlobalValue *GV = NULL); - void SwitchToRomDataSection(const char *NewSection, - const GlobalValue *GV = NULL); + void printCCOperand(const MachineInstr *MI, int opNum); bool printInstruction(const MachineInstr *MI); // definition autogenerated. bool printMachineInstruction(const MachineInstr *MI); void EmitExternsAndGlobals (Module &M); @@ -48,11 +45,12 @@ void EmitRomData (Module &M); virtual void EmitConstantValueOnly(const Constant *CV); void emitFunctionData(MachineFunction &MF); - void emitFunctionTempData(MachineFunction &MF); + void emitFunctionTempData(MachineFunction &MF, unsigned &FrameSize); protected: bool doInitialization(Module &M); bool doFinalization(Module &M); + bool inSameBank(char *s1, char *s2); private: std::string CurrentBankselLabelInBasicBlock; Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.cpp Tue Jan 13 13:18:47 2009 @@ -1,4 +1,3 @@ -//===-- PIC16ISelLowering.cpp - PIC16 DAG Lowering Implementation ---------===// // // The LLVM Compiler Infrastructure // @@ -19,8 +18,11 @@ #include "llvm/DerivedTypes.h" #include "llvm/GlobalValue.h" #include "llvm/Function.h" +#include "llvm/CallingConv.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineRegisterInfo.h" #include @@ -38,6 +40,20 @@ setShiftAmountType(MVT::i8); setShiftAmountFlavor(Extend); + // SRA library call names + setPIC16LibCallName(PIC16ISD::SRA_I8, "__intrinsics.sra.i8"); + setPIC16LibCallName(PIC16ISD::SRA_I16, "__intrinsics.sra.i16"); + setPIC16LibCallName(PIC16ISD::SRA_I32, "__intrinsics.sra.i32"); + + // SLL library call names + setPIC16LibCallName(PIC16ISD::SLL_I8, "__intrinsics.sll.i8"); + setPIC16LibCallName(PIC16ISD::SLL_I16, "__intrinsics.sll.i16"); + setPIC16LibCallName(PIC16ISD::SLL_I32, "__intrinsics.sll.i32"); + + // SRL library call names + setPIC16LibCallName(PIC16ISD::SRL_I8, "__intrinsics.srl.i8"); + setPIC16LibCallName(PIC16ISD::SRL_I16, "__intrinsics.srl.i16"); + setPIC16LibCallName(PIC16ISD::SRL_I32, "__intrinsics.srl.i32"); setOperationAction(ISD::GlobalAddress, MVT::i16, Custom); @@ -60,8 +76,29 @@ setOperationAction(ISD::AND, MVT::i8, Custom); setOperationAction(ISD::XOR, MVT::i8, Custom); + setOperationAction(ISD::FrameIndex, MVT::i16, Custom); + setOperationAction(ISD::CALL, MVT::i16, Custom); + setOperationAction(ISD::RET, MVT::Other, Custom); + + setOperationAction(ISD::SRA, MVT::i8, Custom); + setOperationAction(ISD::SRA, MVT::i16, Custom); + setOperationAction(ISD::SRA, MVT::i32, Custom); + + setOperationAction(ISD::SHL, MVT::i8, Custom); setOperationAction(ISD::SHL, MVT::i16, Custom); setOperationAction(ISD::SHL, MVT::i32, Custom); + setOperationAction(ISD::SRL, MVT::i8, Custom); + setOperationAction(ISD::SRL, MVT::i16, Custom); + setOperationAction(ISD::SRL, MVT::i32, Custom); + + // PIC16 does not have a SETCC, expand it to SELECT_CC. + setOperationAction(ISD::SETCC, MVT::i8, Expand); + setOperationAction(ISD::SELECT, MVT::i8, Expand); + setOperationAction(ISD::BRCOND, MVT::Other, Expand); + setOperationAction(ISD::BRIND, MVT::Other, Expand); + + setOperationAction(ISD::SELECT_CC, MVT::i8, Custom); + setOperationAction(ISD::BR_CC, MVT::i8, Custom); //setOperationAction(ISD::TRUNCATE, MVT::i16, Custom); setTruncStoreAction(MVT::i16, MVT::i8, Custom); @@ -71,6 +108,100 @@ computeRegisterProperties(); } +static void PopulateResults(SDValue N, SmallVectorImpl&Results) { + if (N.getOpcode() == ISD::MERGE_VALUES) { + int NumResults = N.getNumOperands(); + for( int i = 0; i < NumResults; i++) + Results.push_back(N.getOperand(i)); + } + else + Results.push_back(N); +} + +MVT PIC16TargetLowering::getSetCCResultType(MVT ValType) const { + return MVT::i8; +} + + +void +PIC16TargetLowering::setPIC16LibCallName(PIC16ISD::PIC16LibCall Call, + const char *Name) { + PIC16LibCallNames[Call] = Name; +} + +const char * +PIC16TargetLowering::getPIC16LibCallName(PIC16ISD::PIC16LibCall Call) { + return PIC16LibCallNames[Call]; +} + +SDValue +PIC16TargetLowering::MakePIC16LibCall(PIC16ISD::PIC16LibCall Call, + MVT RetVT, const SDValue *Ops, + unsigned NumOps, bool isSigned, + SelectionDAG &DAG) { + + TargetLowering::ArgListTy Args; + Args.reserve(NumOps); + + TargetLowering::ArgListEntry Entry; + for (unsigned i = 0; i != NumOps; ++i) { + Entry.Node = Ops[i]; + Entry.Ty = Entry.Node.getValueType().getTypeForMVT(); + Entry.isSExt = isSigned; + Entry.isZExt = !isSigned; + Args.push_back(Entry); + } + SDValue Callee = DAG.getExternalSymbol(getPIC16LibCallName(Call), MVT::i8); + + const Type *RetTy = RetVT.getTypeForMVT(); + std::pair CallInfo = + LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false, + false, CallingConv::C, false, Callee, Args, DAG); + + return CallInfo.first; +} + +SDValue +PIC16TargetLowering::getCurrentFrame(SelectionDAG &DAG) { + MachineFunction &MF = DAG.getMachineFunction(); + const Function *Func = MF.getFunction(); + const std::string FuncName = Func->getName(); + + // this is causing memory waste + // because for every call new memory will be allocated + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; + sprintf(tmpName, "%s.tmp", FuncName.c_str()); + + // if the external symbol of the same name already exists then + // it will not create the new one. + return DAG.getTargetExternalSymbol(tmpName, MVT::i8); +} + +void +PIC16TargetLowering::getCurrentFrameIndex(SelectionDAG &DAG, SDValue &ES, + unsigned SlotSize, int &FromFI) { + MachineFunction &MF = DAG.getMachineFunction(); + const Function *Func = MF.getFunction(); + const std::string FuncName = Func->getName(); + + // this is causing memory waste + // because for every call new memory will be allocated + char *tmpName = new char [strlen(FuncName.c_str()) + 6]; + sprintf(tmpName, "%s.tmp", FuncName.c_str()); + + // if the external symbol of the same name already exists then + // it will not create the new one. + ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8); + + // Alignment is always 1 + //FromFI = MF.getFrameInfo()->CreateStackObject(SlotSize, 1); + FromFI = MF.getFrameInfo()->CreateStackObject(1, 1); + int FI; + for(unsigned i=1;iCreateStackObject(1, 1); + } +} + const char *PIC16TargetLowering::getTargetNodeName(unsigned Opcode) const { switch (Opcode) { default: return NULL; @@ -80,12 +211,18 @@ case PIC16ISD::MTHI: return "PIC16ISD::MTHI"; case PIC16ISD::Banksel: return "PIC16ISD::Banksel"; case PIC16ISD::PIC16Load: return "PIC16ISD::PIC16Load"; + case PIC16ISD::PIC16LdWF: return "PIC16ISD::PIC16LdWF"; case PIC16ISD::PIC16Store: return "PIC16ISD::PIC16Store"; + case PIC16ISD::PIC16StWF: return "PIC16ISD::PIC16StWF"; case PIC16ISD::BCF: return "PIC16ISD::BCF"; case PIC16ISD::LSLF: return "PIC16ISD::LSLF"; case PIC16ISD::LRLF: return "PIC16ISD::LRLF"; case PIC16ISD::RLF: return "PIC16ISD::RLF"; case PIC16ISD::RRF: return "PIC16ISD::RRF"; + case PIC16ISD::CALL: return "PIC16ISD::CALL"; + case PIC16ISD::SUBCC: return "PIC16ISD::SUBCC"; + case PIC16ISD::SELECT_ICC: return "PIC16ISD::SELECT_ICC"; + case PIC16ISD::BRCOND: return "PIC16ISD::BRCOND"; case PIC16ISD::Dummy: return "PIC16ISD::Dummy"; } } @@ -93,32 +230,68 @@ void PIC16TargetLowering::ReplaceNodeResults(SDNode *N, SmallVectorImpl&Results, SelectionDAG &DAG) { + switch (N->getOpcode()) { case ISD::GlobalAddress: Results.push_back(ExpandGlobalAddress(N, DAG)); return; + case ISD::ExternalSymbol: + Results.push_back(ExpandExternalSymbol(N, DAG)); + return; case ISD::STORE: Results.push_back(ExpandStore(N, DAG)); return; case ISD::LOAD: - Results.push_back(ExpandLoad(N, DAG)); + PopulateResults(ExpandLoad(N, DAG), Results); return; case ISD::ADD: -// return ExpandAdd(N, DAG); + // Results.push_back(ExpandAdd(N, DAG)); return; - case ISD::SHL: { + case ISD::SHL: + case ISD::SRL: + case ISD::SRA: + { SDValue Res = ExpandShift(N, DAG); if (Res.getNode()) Results.push_back(Res); return; } + case ISD::FrameIndex: + Results.push_back(ExpandFrameIndex(N, DAG)); + return; default: assert (0 && "not implemented"); return; } } -SDValue PIC16TargetLowering::ExpandStore(SDNode *N, SelectionDAG &DAG) { +SDValue PIC16TargetLowering::ExpandFrameIndex(SDNode *N, SelectionDAG &DAG) { + + // Currently handling FrameIndex of size MVT::i16 only + // One example of this scenario is when return value is written on + // FrameIndex#0 + + if (N->getValueType(0) != MVT::i16) + return SDValue(); + + // Expand the FrameIndex into ExternalSymbol and a Constant node + // The constant will represent the frame index number + // Get the current function frame + MachineFunction &MF = DAG.getMachineFunction(); + const Function *Func = MF.getFunction(); + const std::string Name = Func->getName(); + + FrameIndexSDNode *FR = dyn_cast(SDValue(N,0)); + int Index = FR->getIndex(); + + SDValue FI[2]; + FI[0] = DAG.getTargetFrameIndex(Index, MVT::i8); + FI[1] = DAG.getTargetFrameIndex(Index + 1, MVT::i8); + return DAG.getNode(ISD::BUILD_PAIR, N->getValueType(0), FI[0], FI[1]); +} + + +SDValue PIC16TargetLowering::ExpandStore(SDNode *N, SelectionDAG &DAG) { StoreSDNode *St = cast(N); SDValue Chain = St->getChain(); SDValue Src = St->getValue(); @@ -131,7 +304,8 @@ if (ValueType == MVT::i8) { return DAG.getNode (PIC16ISD::PIC16Store, MVT::Other, Chain, Src, - PtrLo, PtrHi, DAG.getConstant (0, MVT::i8)); + PtrLo, PtrHi, + DAG.getConstant (0 + StoreOffset, MVT::i8)); } else if (ValueType == MVT::i16) { // Get the Lo and Hi parts from MERGE_VALUE or BUILD_PAIR. @@ -200,7 +374,8 @@ getChain(Store2)); SDValue RetHi = DAG.getNode(ISD::TokenFactor, MVT::Other, getChain(Store3), getChain(Store4)); - return DAG.getNode(ISD::TokenFactor, MVT::Other, RetLo, RetHi); + return DAG.getNode(ISD::TokenFactor, MVT::Other, RetLo, RetHi); + } else { assert (0 && "value type not supported"); @@ -208,6 +383,18 @@ } } +SDValue PIC16TargetLowering::ExpandExternalSymbol(SDNode *N, SelectionDAG &DAG) +{ + ExternalSymbolSDNode *ES = dyn_cast(SDValue(N, 0)); + + SDValue TES = DAG.getTargetExternalSymbol(ES->getSymbol(), MVT::i8); + + SDValue Lo = DAG.getNode(PIC16ISD::Lo, MVT::i8, TES); + SDValue Hi = DAG.getNode(PIC16ISD::Hi, MVT::i8, TES); + + return DAG.getNode(ISD::BUILD_PAIR, MVT::i16, Lo, Hi); +} + // ExpandGlobalAddress - SDValue PIC16TargetLowering::ExpandGlobalAddress(SDNode *N, SelectionDAG &DAG) { GlobalAddressSDNode *G = dyn_cast(SDValue(N, 0)); @@ -218,8 +405,7 @@ SDValue Lo = DAG.getNode(PIC16ISD::Lo, MVT::i8, TGA); SDValue Hi = DAG.getNode(PIC16ISD::Hi, MVT::i8, TGA); - SDValue BP = DAG.getNode(ISD::BUILD_PAIR, MVT::i16, Lo, Hi); - return BP; + return DAG.getNode(ISD::BUILD_PAIR, MVT::i16, Lo, Hi); } bool PIC16TargetLowering::isDirectAddress(const SDValue &Op) { @@ -259,6 +445,15 @@ return false; } +// Extract the out flag +SDValue PIC16TargetLowering::getOutFlag(SDValue &Op) { + SDValue Flag = Op.getValue(Op.getNode()->getNumValues() - 1); + + assert (Flag.getValueType() == MVT::Flag && "Node does not have an out Flag"); + + return Flag; +} + // To extract chain value from the SDValue Nodes // This function will help to maintain the chain extracting // code at one place. In case of any change in future it will @@ -266,6 +461,11 @@ SDValue PIC16TargetLowering::getChain(SDValue &Op) { SDValue Chain = Op.getValue(Op.getNode()->getNumValues() - 1); + // If the last value returned in Flag then the chain is + // second last value returned. + if (Chain.getValueType() == MVT::Flag) + Chain = Op.getValue(Op.getNode()->getNumValues() - 2); + // All nodes may not produce a chain. Therefore following assert // verifies that the node is returning a chain only. assert (Chain.getValueType() == MVT::Other && "Node does not have a chain"); @@ -274,35 +474,40 @@ } void PIC16TargetLowering::GetExpandedParts(SDValue Op, SelectionDAG &DAG, + SDValue &Lo, SDValue &Hi) { SDNode *N = Op.getNode(); - unsigned NumValues = N->getNumValues(); - std::vector VTs; MVT NewVT; std::vector Opers; - - // EXTRACT_ELEMENT should have same number and type of values that the - // node replacing the EXTRACT_ELEMENT should have. (i.e. extracted element) - // Some nodes such as LOAD and PIC16Load have more than one values. In such - // cases EXTRACT_ELEMENT should have more than one values. Therefore creating - // vector of Values for EXTRACT_ELEMENT. This list will have same number of - // values as the extracted element will have. - - for (unsigned i=0;i < NumValues; ++i) { - NewVT = getTypeToTransformTo(N->getValueType(i)); - VTs.push_back(NewVT); - } + NewVT = getTypeToTransformTo(N->getValueType(0)); // extract the lo component Opers.push_back(Op); Opers.push_back(DAG.getConstant(0,MVT::i8)); - Lo = DAG.getNode(ISD::EXTRACT_ELEMENT,VTs,&Opers[0],Opers.size()); - + Lo = DAG.getNode(ISD::EXTRACT_ELEMENT,NewVT,&Opers[0],Opers.size()); // extract the hi component Opers.clear(); Opers.push_back(Op); Opers.push_back(DAG.getConstant(1,MVT::i8)); - Hi = DAG.getNode(ISD::EXTRACT_ELEMENT,VTs,&Opers[0],Opers.size()); + Hi = DAG.getNode(ISD::EXTRACT_ELEMENT,NewVT,&Opers[0],Opers.size()); +} + +// Legalize FrameIndex into ExternalSymbol and offset. +void +PIC16TargetLowering::LegalizeFrameIndex(SDValue Op, SelectionDAG &DAG, + SDValue &ES, int &Offset) { + + MachineFunction &MF = DAG.getMachineFunction(); + const Function *Func = MF.getFunction(); + const std::string Name = Func->getName(); + + char *tmpName = new char [strlen(Name.c_str()) + 8]; + sprintf(tmpName, "%s.args", Name.c_str()); + ES = DAG.getTargetExternalSymbol(tmpName, MVT::i8); + FrameIndexSDNode *FR = dyn_cast(Op); + Offset = FR->getIndex(); + + return; } // This function legalizes the PIC16 Addresses. If the Pointer is @@ -332,12 +537,35 @@ if (OperLeft.getOpcode() == ISD::Constant) { Offset = dyn_cast(OperLeft)->getZExtValue(); Ptr = OperRight; - } else { - Ptr = OperLeft; + } else if (OperRight.getOpcode() == ISD::Constant) { Offset = dyn_cast(OperRight)->getZExtValue(); + Ptr = OperLeft; + } + } + + // If the pointer is Type i8 and an external symbol + // then treat it as direct address. + // One example for such case is storing and loading + // from function frame during a call + if (Ptr.getValueType() == MVT::i8) { + switch (Ptr.getOpcode()) { + case ISD::TargetExternalSymbol: + Lo = Ptr; + Hi = DAG.getConstant(1, MVT::i8); + return; } } + if (Ptr.getOpcode() == ISD::BUILD_PAIR && + Ptr.getOperand(0).getOpcode() == ISD::TargetFrameIndex) { + + int FrameOffset; + LegalizeFrameIndex(Ptr.getOperand(0), DAG, Lo, FrameOffset); + Hi = DAG.getConstant(1, MVT::i8); + Offset += FrameOffset; + return; + } + if (isDirectAddress(Ptr) && !isRomAddress(Ptr)) { // Direct addressing case for RAM variables. The Hi part is constant // and the Lo part is the TGA itself. @@ -361,17 +589,17 @@ return; } -//SDNode *PIC16TargetLowering::ExpandAdd(SDNode *N, SelectionDAG &DAG) { -// SDValue OperLeft = N->getOperand(0); -// SDValue OperRight = N->getOperand(1); -// -// if((OperLeft.getOpcode() == ISD::Constant) || -// (OperRight.getOpcode() == ISD::Constant)) { -// return NULL; -// } -// -// // These case are yet to be handled -// return NULL; +//SDValue PIC16TargetLowering::ExpandAdd(SDNode *N, SelectionDAG &DAG) { + //SDValue OperLeft = N->getOperand(0); + //SDValue OperRight = N->getOperand(1); + + //if((OperLeft.getOpcode() == ISD::Constant) || + //(OperRight.getOpcode() == ISD::Constant)) { + //return SDValue(); + //} + + // These case are yet to be handled + //return SDValue(); //} SDValue PIC16TargetLowering::ExpandLoad(SDNode *N, SelectionDAG &DAG) { @@ -484,70 +712,124 @@ SDValue Value = N->getOperand(0); SDValue Amt = N->getOperand(1); SDValue BCF, BCFInput; - SDVTList Tys; SDValue ShfCom; // Shift Component - Lo component should be shifted SDValue RotCom; // Rotate Component- Hi component should be rotated - PIC16ISD::NodeType ShfNode = PIC16ISD::Dummy, RotNode = PIC16ISD::Dummy; - - // Currently handling Constant shift only - if (Amt.getOpcode() != ISD::Constant) - return SDValue(); - // Following code considers 16 bit left-shift only - if (N->getValueType(0) != MVT::i16) - return SDValue(); + PIC16ISD::PIC16LibCall CallCode; - if (N->getOpcode() == ISD::SHL) { - ShfNode = PIC16ISD::LSLF; - RotNode = PIC16ISD::RLF; - } else if (N->getOpcode() == ISD::SRL) { - ShfNode = PIC16ISD::LRLF; - RotNode = PIC16ISD::RRF; + // Shift amount should be MVT::i8 only. If it is more than that then + // extract MVT::i8 from that + if (Amt.getValueType() == MVT::i8) { + // Do Nothing - This is ok + } else if (Amt.getValueType() == MVT::i16) { + SDValue Lo, Hi; + GetExpandedParts(Amt, DAG, Lo, Hi); + Amt = Lo; // Take the Lo part as amount + + } else if (Amt.getValueType() == MVT::i32) { + SDValue Lo, Hi; + // Get MVT::i16 Components + GetExpandedParts(Amt, DAG, Lo, Hi); + // Get MVT::i8 Components + GetExpandedParts(Lo, DAG, Lo, Hi); + Amt = Lo; + + } else { + assert ( 0 && "Invalid Shift amount"); } - unsigned ShiftAmt = dyn_cast(Amt)->getZExtValue(); - SDValue StatusReg = DAG.getRegister(PIC16::STATUS, MVT::i8); - // 0th Bit in StatusReg is CarryBit - SDValue CarryBit= DAG.getConstant(0, MVT::i8); - - GetExpandedParts(Value, DAG, ShfCom, RotCom); - BCFInput = DAG.getNode(PIC16ISD::Dummy, MVT::Flag); - Tys = DAG.getVTList(MVT::i8, MVT::Flag); - for (unsigned i=0;igetValueType(0) == MVT::i8) { + switch (N->getOpcode()) { + case ISD::SRA: + CallCode = PIC16ISD::SRA_I8; + break; + case ISD::SHL: + CallCode = PIC16ISD::SLL_I8; + break; + case ISD::SRL: + CallCode = PIC16ISD::SRL_I8; + break; + default: + assert ( 0 && "This shift is not implemented yet."); + return SDValue(); + } + } else if (N->getValueType(0) == MVT::i16) { + switch (N->getOpcode()) { + case ISD::SRA: + CallCode = PIC16ISD::SRA_I16; + break; + case ISD::SHL: + CallCode = PIC16ISD::SLL_I16; + break; + case ISD::SRL: + CallCode = PIC16ISD::SRL_I16; + break; + default: + assert ( 0 && "This shift is not implemented yet."); + return SDValue(); + } + } else if (N->getValueType(0) == MVT::i32) { + switch (N->getOpcode()) { + case ISD::SRA: + CallCode = PIC16ISD::SRA_I32; + break; + case ISD::SHL: + CallCode = PIC16ISD::SLL_I32; + break; + case ISD::SRL: + CallCode = PIC16ISD::SRL_I32; + break; + default: + assert ( 0 && "This shift is not implemented yet."); + return SDValue(); + } + } else { + //assert ( 0 && "Shift for this value type not yet implemented."); + return SDValue(); } - return DAG.getNode(ISD::BUILD_PAIR, N->getValueType(0), ShfCom, RotCom); + SmallVector Ops(2); + Ops[0] = Value; + Ops[1] = Amt; + SDValue Call = MakePIC16LibCall(CallCode, N->getValueType(0), &Ops[0], 2, true, DAG); + return Call; } SDValue PIC16TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) { switch (Op.getOpcode()) { case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG); + case ISD::ADD: case ISD::ADDC: - return LowerADDC(Op, DAG); case ISD::ADDE: - return LowerADDE(Op, DAG); - case ISD::SUBE: - return LowerSUBE(Op, DAG); + return LowerADD(Op, DAG); + case ISD::SUB: case ISD::SUBC: - return LowerSUBC(Op, DAG); + case ISD::SUBE: + return LowerSUB(Op, DAG); case ISD::LOAD: return ExpandLoad(Op.getNode(), DAG); case ISD::STORE: return ExpandStore(Op.getNode(), DAG); case ISD::SHL: + case ISD::SRA: + case ISD::SRL: return ExpandShift(Op.getNode(), DAG); case ISD::OR: case ISD::AND: case ISD::XOR: return LowerBinOp(Op, DAG); + case ISD::CALL: + // This is called only from LegalizeDAG. No call is made to + // legalize CALL node from LegalizeType. + return LowerCALL(Op, DAG); + case ISD::RET: + return LowerRET(Op, DAG); + case ISD::BR_CC: + return LowerBR_CC(Op, DAG); + case ISD::SELECT_CC: + return LowerSELECT_CC(Op, DAG); } return SDValue(); } @@ -585,84 +867,304 @@ return Load.getValue(0); } + +SDValue +PIC16TargetLowering::LowerCallArguments(SDValue Op, SDValue Chain, + SDValue FrameAddress, + SDValue InFlag, + SelectionDAG &DAG) { + CallSDNode *TheCall = dyn_cast(Op); + unsigned NumOps = TheCall->getNumArgs(); + std::string Name; + SDValue Arg, StoreAt; + MVT ArgVT; + unsigned Size=0; + unsigned ArgCount=0; -SDValue PIC16TargetLowering:: LowerBinOp(SDValue Op, SelectionDAG &DAG) { - // We should have handled larger operands in type legalizer itself. - assert (Op.getValueType() == MVT::i8 && "illegal Op to lower"); - - // Return the original Op if the one of the operands is already a load. - if (Op.getOperand(0).getOpcode() == PIC16ISD::PIC16Load - || Op.getOperand(1).getOpcode() == PIC16ISD::PIC16Load) - return Op; - // Put one value on stack. - SDValue NewVal = ConvertToMemOperand (Op.getOperand(1), DAG); + // FIXME: This portion of code currently assumes only + // primitive types being passed as arguments. - return DAG.getNode(Op.getOpcode(), MVT::i8, Op.getOperand(0), NewVal); + // Legalize the address before use + SDValue PtrLo, PtrHi; + unsigned AddressOffset; + int StoreOffset = 0; + LegalizeAddress(FrameAddress, DAG, PtrLo, PtrHi, AddressOffset); + SDValue StoreRet; + + std::vector Ops; + SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); + for (unsigned i=ArgCount, Offset = 0; igetArg(i); + + StoreOffset = (Offset + AddressOffset); + + // Store the argument on frame + + Ops.clear(); + Ops.push_back(Chain); + Ops.push_back(Arg.getValue(0)); + Ops.push_back(PtrLo); + Ops.push_back(PtrHi); + Ops.push_back(DAG.getConstant(StoreOffset, MVT::i8)); + Ops.push_back(InFlag); + + StoreRet = DAG.getNode (PIC16ISD::PIC16StWF, Tys, &Ops[0], Ops.size()); + + Chain = getChain(StoreRet); + InFlag = getOutFlag(StoreRet); + + // Update the frame offset to be used for next argument + ArgVT = Arg.getValueType(); + Size = ArgVT.getSizeInBits(); + Size = Size/8; // Calculate size in bytes + Offset += Size; // Increase the frame offset + } + return Chain; } -SDValue PIC16TargetLowering:: LowerADDC(SDValue Op, SelectionDAG &DAG) { - // We should have handled larger operands in type legalizer itself. - assert (Op.getValueType() == MVT::i8 && "illegal addc to lower"); +SDValue +PIC16TargetLowering::LowerCallReturn(SDValue Op, SDValue Chain, + SDValue FrameAddress, + SDValue InFlag, + SelectionDAG &DAG) { + CallSDNode *TheCall = dyn_cast(Op); + // Currently handling primitive types only. They will come in + // i8 parts + unsigned RetVals = TheCall->getNumRetVals(); + + std::vector ResultVals; - // Nothing to do if the one of the operands is already a load. - if (Op.getOperand(0).getOpcode() == PIC16ISD::PIC16Load - || Op.getOperand(1).getOpcode() == PIC16ISD::PIC16Load) - return SDValue(); + // Return immediately if the return type is void + if (RetVals == 0) + return Chain; - // Put one value on stack. - SDValue NewVal = ConvertToMemOperand (Op.getOperand(1), DAG); - - SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); - return DAG.getNode(ISD::ADDC, Tys, Op.getOperand(0), NewVal); -} + // Call has something to return + + // Legalize the address before use + SDValue LdLo, LdHi; + unsigned LdOffset; + LegalizeAddress(FrameAddress, DAG, LdLo, LdHi, LdOffset); -SDValue PIC16TargetLowering:: LowerADDE(SDValue Op, SelectionDAG &DAG) { - // We should have handled larger operands in type legalizer itself. - assert (Op.getValueType() == MVT::i8 && "illegal adde to lower"); + SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Other, MVT::Flag); + SDValue LoadRet; + + for(unsigned i=0, Offset=0;igetNumOperands(); + + // For default cases LLVM returns the value on the function frame + // So let LLVM do this for all the cases other than character + return Op; +} + +SDValue PIC16TargetLowering::LowerCALL(SDValue Op, SelectionDAG &DAG) { + CallSDNode *TheCall = dyn_cast(Op); + SDValue Chain = TheCall->getChain(); + SDValue Callee = TheCall->getCallee(); + unsigned i =0; + if (Callee.getValueType() == MVT::i16 && + Callee.getOpcode() == ISD::BUILD_PAIR) { + // It has come from TypeLegalizer for lowering + + Callee = Callee.getOperand(0).getOperand(0); + + std::vector Ops; + Ops.push_back(Chain); + Ops.push_back(Callee); + + // Add the call arguments and their flags + unsigned NumArgs = TheCall->getNumArgs(); + for(i=0;igetArg(i)); + Ops.push_back(TheCall->getArgFlagsVal(i)); + } - // Put one value on stack. - SDValue NewVal = ConvertToMemOperand (Op.getOperand(1), DAG); + std::vector NodeTys; + unsigned NumRets = TheCall->getNumRetVals(); + for(i=0;igetRetValType(i)); + + // Return a Chain as well + NodeTys.push_back(MVT::Other); + + SDVTList VTs = DAG.getVTList(&NodeTys[0], NodeTys.size()); + SDValue NewCall = + DAG.getCall(TheCall->getCallingConv(), TheCall->isVarArg(), + TheCall->isTailCall(), TheCall->isInreg(), VTs, + &Ops[0], Ops.size()); + + return NewCall; + } - SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); - return DAG.getNode(ISD::ADDE, Tys, Op.getOperand(0), NewVal, - Op.getOperand(2)); + SDValue ZeroOperand = DAG.getConstant(0, MVT::i8); + + // Start the call sequence. + // Carring the Constant 0 along the CALLSEQSTART + // because there is nothing else to carry. + SDValue SeqStart = DAG.getCALLSEQ_START(Chain, ZeroOperand); + Chain = getChain(SeqStart); + + // For any direct call - callee will be GlobalAddressNode or + // ExternalSymbol + + // Considering the GlobalAddressNode case here. + if (GlobalAddressSDNode *G = dyn_cast(Callee)) { + GlobalValue *GV = G->getGlobal(); + Callee = DAG.getTargetGlobalAddress(GV, MVT::i8); + } + + // Considering the ExternalSymbol case here + if (ExternalSymbolSDNode *ES = dyn_cast(Callee)) { + Callee = DAG.getTargetExternalSymbol(ES->getSymbol(), MVT::i8); + } + + SDValue OperFlag = getOutFlag(Chain); // To manage the data dependency + + std::string Name; + + // Considering GlobalAddress here + if (GlobalAddressSDNode *G = dyn_cast(Callee)) + Name = G->getGlobal()->getName(); + + // Considering ExternalSymbol here + if (ExternalSymbolSDNode *ES = dyn_cast(Callee)) + Name = ES->getSymbol(); + + char *argFrame = new char [strlen(Name.c_str()) + 8]; + sprintf(argFrame, "%s.args", Name.c_str()); + SDValue ArgLabel = DAG.getTargetExternalSymbol(argFrame, MVT::i8); + + char *retName = new char [strlen(Name.c_str()) + 8]; + sprintf(retName, "%s.retval", Name.c_str()); + SDValue RetLabel = DAG.getTargetExternalSymbol(retName, MVT::i8); + + // Pass the argument to function before making the call. + SDValue CallArgs = LowerCallArguments(Op, Chain, ArgLabel, OperFlag, DAG); + Chain = getChain(CallArgs); + OperFlag = getOutFlag(CallArgs); + + SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag); + SDValue PICCall = DAG.getNode(PIC16ISD::CALL, Tys, Chain, Callee, + OperFlag); + Chain = getChain(PICCall); + OperFlag = getOutFlag(PICCall); + + + // Carrying the Constant 0 along the CALLSEQSTART + // because there is nothing else to carry. + SDValue SeqEnd = DAG.getCALLSEQ_END(Chain, ZeroOperand, ZeroOperand, + OperFlag); + Chain = getChain(SeqEnd); + OperFlag = getOutFlag(SeqEnd); + + // Lower the return value reading after the call. + return LowerCallReturn(Op, Chain, RetLabel, OperFlag, DAG); +} + +bool PIC16TargetLowering::isDirectLoad(const SDValue Op) { + if (Op.getOpcode() == PIC16ISD::PIC16Load) + if (Op.getOperand(1).getOpcode() == ISD::TargetGlobalAddress + || Op.getOperand(1).getOpcode() == ISD::TargetExternalSymbol) + return true; + return false; } -SDValue PIC16TargetLowering:: LowerSUBC(SDValue Op, SelectionDAG &DAG) { +bool PIC16TargetLowering::NeedToConvertToMemOp(SDValue Op, unsigned &MemOp) { + // Return false if one of the operands is already a direct + // load and that operand has only one use. + if (Op.getOperand(0).getOpcode() == ISD::Constant || + Op.getOperand(1).getOpcode() == ISD::Constant) + return false; + if (isDirectLoad(Op.getOperand(0))) { + if (Op.getOperand(0).hasOneUse()) + return false; + else + MemOp = 0; + } + if (isDirectLoad(Op.getOperand(1))) { + if (Op.getOperand(1).hasOneUse()) + return false; + else + MemOp = 1; + } + return true; +} + +SDValue PIC16TargetLowering:: LowerBinOp(SDValue Op, SelectionDAG &DAG) { // We should have handled larger operands in type legalizer itself. - assert (Op.getValueType() == MVT::i8 && "illegal subc to lower"); + assert (Op.getValueType() == MVT::i8 && "illegal Op to lower"); + unsigned MemOp = 1; + if (NeedToConvertToMemOp(Op, MemOp)) { + // Put one value on stack. + SDValue NewVal = ConvertToMemOperand (Op.getOperand(MemOp), DAG); - // Nothing to do if the first operand is already a load. - if (Op.getOperand(0).getOpcode() == PIC16ISD::PIC16Load) - return SDValue(); + return DAG.getNode(Op.getOpcode(), MVT::i8, Op.getOperand(MemOp ^ 1), + NewVal); + } + else { + return Op; + } +} - // Put first operand on stack. - SDValue NewVal = ConvertToMemOperand (Op.getOperand(0), DAG); +SDValue PIC16TargetLowering:: LowerADD(SDValue Op, SelectionDAG &DAG) { + // We should have handled larger operands in type legalizer itself. + assert (Op.getValueType() == MVT::i8 && "illegal add to lower"); + unsigned MemOp = 1; + if (NeedToConvertToMemOp(Op, MemOp)) { + // Put one value on stack. + SDValue NewVal = ConvertToMemOperand (Op.getOperand(MemOp), DAG); + + SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); - SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); - return DAG.getNode(ISD::SUBC, Tys, NewVal, Op.getOperand(1)); + if (Op.getOpcode() == ISD::ADDE) + return DAG.getNode(Op.getOpcode(), Tys, Op.getOperand(MemOp ^ 1), NewVal, + Op.getOperand(2)); + else + return DAG.getNode(Op.getOpcode(), Tys, Op.getOperand(MemOp ^ 1), NewVal); + } + else { + return SDValue(); + } } -SDValue PIC16TargetLowering:: LowerSUBE(SDValue Op, SelectionDAG &DAG) { +SDValue PIC16TargetLowering::LowerSUB(SDValue Op, SelectionDAG &DAG) { // We should have handled larger operands in type legalizer itself. - assert (Op.getValueType() == MVT::i8 && "illegal sube to lower"); + assert (Op.getValueType() == MVT::i8 && "illegal sub to lower"); - // Nothing to do if the first operand is already a load. - if (Op.getOperand(0).getOpcode() == PIC16ISD::PIC16Load) + // Nothing to do if the first operand is already a direct load and it has + // only one use. + if (isDirectLoad(Op.getOperand(0)) && Op.getOperand(0).hasOneUse()) return SDValue(); // Put first operand on stack. SDValue NewVal = ConvertToMemOperand (Op.getOperand(0), DAG); SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); - return DAG.getNode(ISD::SUBE, Tys, NewVal, Op.getOperand(1), - Op.getOperand(2)); + if (Op.getOpcode() == ISD::SUBE) + return DAG.getNode(Op.getOpcode(), Tys, NewVal, Op.getOperand(1), + Op.getOperand(2)); + else + return DAG.getNode(Op.getOpcode(), Tys, NewVal, Op.getOperand(1)); } // LowerFORMAL_ARGUMENTS - In Lowering FORMAL ARGUMENTS - MERGE_VALUES nodes @@ -707,3 +1209,189 @@ } return SDValue(); } + +static PIC16CC::CondCodes IntCCToPIC16CC(ISD::CondCode CC) { + switch (CC) { + default: assert(0 && "Unknown condition code!"); + case ISD::SETNE: return PIC16CC::NE; + case ISD::SETEQ: return PIC16CC::EQ; + case ISD::SETGT: return PIC16CC::GT; + case ISD::SETGE: return PIC16CC::GE; + case ISD::SETLT: return PIC16CC::LT; + case ISD::SETLE: return PIC16CC::LE; + case ISD::SETULT: return PIC16CC::LT; + case ISD::SETULE: return PIC16CC::LE; + case ISD::SETUGE: return PIC16CC::GE; + case ISD::SETUGT: return PIC16CC::GT; + } +} + +// Look at LHS/RHS/CC and see if they are a lowered setcc instruction. If so +// set LHS/RHS and SPCC to the LHS/RHS of the setcc and SPCC to the condition. +static void LookThroughSetCC(SDValue &LHS, SDValue &RHS, + ISD::CondCode CC, unsigned &SPCC) { + if (isa(RHS) && + cast(RHS)->getZExtValue() == 0 && + CC == ISD::SETNE && + (LHS.getOpcode() == PIC16ISD::SELECT_ICC && + LHS.getOperand(3).getOpcode() == PIC16ISD::SUBCC) && + isa(LHS.getOperand(0)) && + isa(LHS.getOperand(1)) && + cast(LHS.getOperand(0))->getZExtValue() == 1 && + cast(LHS.getOperand(1))->getZExtValue() == 0) { + SDValue CMPCC = LHS.getOperand(3); + SPCC = cast(LHS.getOperand(2))->getZExtValue(); + LHS = CMPCC.getOperand(0); + RHS = CMPCC.getOperand(1); + } +} + +// Returns appropriate CMP insn and corresponding condition code in PIC16CC +SDValue PIC16TargetLowering::getPIC16Cmp(SDValue LHS, SDValue RHS, + unsigned CC, SDValue &PIC16CC, + SelectionDAG &DAG) { + PIC16CC::CondCodes CondCode = (PIC16CC::CondCodes) CC; + + // PIC16 sub is literal - W. So Swap the operands and condition if needed. + // i.e. a < 12 can be rewritten as 12 > a. + if (RHS.getOpcode() == ISD::Constant) { + + SDValue Tmp = LHS; + LHS = RHS; + RHS = Tmp; + + switch (CondCode) { + default: break; + case PIC16CC::LT: + CondCode = PIC16CC::GT; + break; + case PIC16CC::GT: + CondCode = PIC16CC::LT; + break; + case PIC16CC::GE: + CondCode = PIC16CC::LE; + break; + case PIC16CC::LE: + CondCode = PIC16CC::GE; + break; + } + } + + PIC16CC = DAG.getConstant(CondCode, MVT::i8); + SDVTList VTs = DAG.getVTList (MVT::i8, MVT::Flag); + + // We can use a subtract operation to set the condition codes. But + // we need to put one operand in memory if required. + // Nothing to do if the first operand is already a direct load and it has + // only one use. + if (! (isDirectLoad(LHS) && LHS.hasOneUse())) + // Put first operand on stack. + LHS = ConvertToMemOperand (LHS, DAG); + + SDVTList Tys = DAG.getVTList(MVT::i8, MVT::Flag); + return DAG.getNode(PIC16ISD::SUBCC, VTs, LHS, RHS); +} + + +SDValue PIC16TargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) { + SDValue LHS = Op.getOperand(0); + SDValue RHS = Op.getOperand(1); + ISD::CondCode CC = cast(Op.getOperand(4))->get(); + SDValue TrueVal = Op.getOperand(2); + SDValue FalseVal = Op.getOperand(3); + unsigned ORIGCC = ~0; + + // If this is a select_cc of a "setcc", and if the setcc got lowered into + // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values. + // i.e. + // A setcc: lhs, rhs, cc is expanded by llvm to + // select_cc: result of setcc, 0, 1, 0, setne + // We can think of it as: + // select_cc: lhs, rhs, 1, 0, cc + LookThroughSetCC(LHS, RHS, CC, ORIGCC); + if (ORIGCC == ~0U) ORIGCC = IntCCToPIC16CC (CC); + + SDValue PIC16CC; + SDValue Cmp = getPIC16Cmp(LHS, RHS, ORIGCC, PIC16CC, DAG); + + return DAG.getNode (PIC16ISD::SELECT_ICC, TrueVal.getValueType(), TrueVal, + FalseVal, PIC16CC, Cmp.getValue(1)); +} + +MachineBasicBlock * +PIC16TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *BB) { + const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo(); + unsigned CC = (PIC16CC::CondCodes)MI->getOperand(3).getImm(); + + // To "insert" a SELECT_CC instruction, we actually have to insert the diamond + // control-flow pattern. The incoming instruction knows the destination vreg + // to set, the condition code register to branch on, the true/false values to + // select between, and a branch opcode to use. + const BasicBlock *LLVM_BB = BB->getBasicBlock(); + MachineFunction::iterator It = BB; + ++It; + + // thisMBB: + // ... + // TrueVal = ... + // [f]bCC copy1MBB + // fallthrough --> copy0MBB + MachineBasicBlock *thisMBB = BB; + MachineFunction *F = BB->getParent(); + MachineBasicBlock *copy0MBB = F->CreateMachineBasicBlock(LLVM_BB); + MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + BuildMI(BB, TII.get(PIC16::pic16brcond)).addMBB(sinkMBB).addImm(CC); + F->insert(It, copy0MBB); + F->insert(It, sinkMBB); + + // Update machine-CFG edges by transferring all successors of the current + // block to the new block which will contain the Phi node for the select. + sinkMBB->transferSuccessors(BB); + // Next, add the true and fallthrough blocks as its successors. + BB->addSuccessor(copy0MBB); + BB->addSuccessor(sinkMBB); + + // copy0MBB: + // %FalseValue = ... + // # fallthrough to sinkMBB + BB = copy0MBB; + + // Update machine-CFG edges + BB->addSuccessor(sinkMBB); + + // sinkMBB: + // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] + // ... + BB = sinkMBB; + BuildMI(BB, TII.get(PIC16::PHI), MI->getOperand(0).getReg()) + .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) + .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); + + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. + return BB; +} + + +SDValue PIC16TargetLowering::LowerBR_CC(SDValue Op, SelectionDAG &DAG) { + SDValue Chain = Op.getOperand(0); + ISD::CondCode CC = cast(Op.getOperand(1))->get(); + SDValue LHS = Op.getOperand(2); // LHS of the condition. + SDValue RHS = Op.getOperand(3); // RHS of the condition. + SDValue Dest = Op.getOperand(4); // BB to jump to + unsigned ORIGCC = ~0; + + // If this is a br_cc of a "setcc", and if the setcc got lowered into + // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values. + LookThroughSetCC(LHS, RHS, CC, ORIGCC); + if (ORIGCC == ~0U) ORIGCC = IntCCToPIC16CC (CC); + + // Get the Compare insn and condition code. + SDValue PIC16CC; + SDValue Cmp = getPIC16Cmp(LHS, RHS, ORIGCC, PIC16CC, DAG); + + return DAG.getNode(PIC16ISD::BRCOND, MVT::Other, Chain, Dest, PIC16CC, + Cmp.getValue(1)); +} + + Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelLowering.h Tue Jan 13 13:18:47 2009 @@ -29,7 +29,9 @@ Lo, // Low 8-bits of GlobalAddress. Hi, // High 8-bits of GlobalAddress. PIC16Load, + PIC16LdWF, PIC16Store, + PIC16StWF, Banksel, MTLO, MTHI, @@ -38,6 +40,10 @@ LRLF, // PIC16 Logical shift right RLF, // Rotate left through carry RRF, // Rotate right through carry + CALL, // PIC16 Call instruction + SUBCC, // Compare for equality or inequality. + SELECT_ICC, // Psuedo to be caught in schedular and expanded to brcond. + BRCOND, // Conditional branch. Dummy }; @@ -46,8 +52,21 @@ RAM_SPACE = 0, // RAM address space ROM_SPACE = 1 // ROM address space number is 1 }; + enum PIC16LibCall { + SRA_I8, + SLL_I8, + SRL_I8, + SRA_I16, + SLL_I16, + SRL_I16, + SRA_I32, + SLL_I32, + SRL_I32, + PIC16UnknownCall + }; } + //===--------------------------------------------------------------------===// // TargetLowering Implementation //===--------------------------------------------------------------------===// @@ -58,25 +77,37 @@ /// getTargetNodeName - This method returns the name of a target specific /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; + /// getSetCCResultType - Return the ISD::SETCC ValueType + virtual MVT getSetCCResultType(MVT ValType) const; SDValue LowerOperation(SDValue Op, SelectionDAG &DAG); SDValue LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG); - SDValue LowerADDE(SDValue Op, SelectionDAG &DAG); - SDValue LowerADDC(SDValue Op, SelectionDAG &DAG); - SDValue LowerSUBE(SDValue Op, SelectionDAG &DAG); - SDValue LowerSUBC(SDValue Op, SelectionDAG &DAG); + SDValue LowerADD(SDValue Op, SelectionDAG &DAG); + SDValue LowerSUB(SDValue Op, SelectionDAG &DAG); SDValue LowerBinOp(SDValue Op, SelectionDAG &DAG); + SDValue LowerCALL(SDValue Op, SelectionDAG &DAG); + SDValue LowerRET(SDValue Op, SelectionDAG &DAG); + SDValue LowerCallReturn(SDValue Op, SDValue Chain, SDValue FrameAddress, + SDValue InFlag, SelectionDAG &DAG); + SDValue LowerCallArguments(SDValue Op, SDValue Chain, SDValue FrameAddress, + SDValue InFlag, SelectionDAG &DAG); + SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG); + SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG); + SDValue getPIC16Cmp(SDValue LHS, SDValue RHS, unsigned OrigCC, SDValue &CC, + SelectionDAG &DAG); + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *MBB); - /// ReplaceNodeResults - Replace the results of node with an illegal result - /// type with new values built out of custom code. - /// - virtual void ReplaceNodeResults(SDNode *N, SmallVectorImpl&Results, - SelectionDAG &DAG); + virtual void ReplaceNodeResults(SDNode *N, + SmallVectorImpl &Results, + SelectionDAG &DAG); SDValue ExpandStore(SDNode *N, SelectionDAG &DAG); SDValue ExpandLoad(SDNode *N, SelectionDAG &DAG); -// SDNode *ExpandAdd(SDNode *N, SelectionDAG &DAG); + //SDValue ExpandAdd(SDNode *N, SelectionDAG &DAG); SDValue ExpandGlobalAddress(SDNode *N, SelectionDAG &DAG); + SDValue ExpandExternalSymbol(SDNode *N, SelectionDAG &DAG); SDValue ExpandShift(SDNode *N, SelectionDAG &DAG); + SDValue ExpandFrameIndex(SDNode *N, SelectionDAG &DAG); SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; SDValue PerformPIC16LoadCombine(SDNode *N, DAGCombinerInfo &DCI) const; @@ -95,6 +126,8 @@ // code at one place. In case of any change in future it will // help maintain the code SDValue getChain(SDValue &Op); + + SDValue getOutFlag(SDValue &Op); // Extract the Lo and Hi component of Op. @@ -108,13 +141,44 @@ void LegalizeAddress(SDValue Ptr, SelectionDAG &DAG, SDValue &Chain, SDValue &NewPtr, unsigned &Offset); + // FrameIndex should be broken down into ExternalSymbol and FrameOffset. + void LegalizeFrameIndex(SDValue Op, SelectionDAG &DAG, SDValue &ES, + int &Offset); + // We can not have both operands of a binary operation in W. // This function is used to put one operand on stack and generate a load. SDValue ConvertToMemOperand(SDValue Op, SelectionDAG &DAG); + // This function checks if we need to put an operand of an operation on + // stack and generate a load or not. + bool NeedToConvertToMemOp(SDValue Op, unsigned &MemOp); + /// Subtarget - Keep a pointer to the PIC16Subtarget around so that we can /// make the right decision when generating code for different targets. const PIC16Subtarget *Subtarget; + + + // Extending the LIB Call framework of LLVM + // To hold the names of PIC16LibCalls + const char *PIC16LibCallNames[PIC16ISD::PIC16UnknownCall]; + + // To set and retrieve the lib call names + void setPIC16LibCallName(PIC16ISD::PIC16LibCall Call, const char *Name); + const char *getPIC16LibCallName(PIC16ISD::PIC16LibCall Call); + + // Make PIC16 LibCall + SDValue MakePIC16LibCall(PIC16ISD::PIC16LibCall Call, MVT RetVT, + const SDValue *Ops, unsigned NumOps, bool isSigned, + SelectionDAG &DAG); + + // Check if operation has a direct load operand. + inline bool isDirectLoad(const SDValue Op); + + // Create the symbol and index for function frame + void getCurrentFrameIndex(SelectionDAG &DAG, SDValue &ES, + unsigned SlotSize, int &FI); + + SDValue getCurrentFrame(SelectionDAG &DAG); }; } // namespace llvm Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Tue Jan 13 13:18:47 2009 @@ -125,20 +125,29 @@ const TargetRegisterClass *SrcRC) const { if (DestRC == PIC16::FSR16RegisterClass) { BuildMI(MBB, I, get(PIC16::copy_fsr), DestReg).addReg(SrcReg); + return true; + } + + if (DestRC == PIC16::GPRRegisterClass) { + BuildMI(MBB, I, get(PIC16::copy_w), DestReg).addReg(SrcReg); + return true; } - return true; + // Not yet supported. + return false; } bool PIC16InstrInfo::isMoveInstr(const MachineInstr &MI, unsigned &SrcReg, unsigned &DestReg) const { - if (MI.getOpcode() == PIC16::copy_fsr) { + if (MI.getOpcode() == PIC16::copy_fsr + || MI.getOpcode() == PIC16::copy_w) { DestReg = MI.getOperand(0).getReg(); SrcReg = MI.getOperand(1).getReg(); return true; } + return false; } Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.td Tue Jan 13 13:18:47 2009 @@ -38,9 +38,22 @@ // Node specific type profiles. def SDT_PIC16Load : SDTypeProfile<1, 3, [SDTCisI8<0>, SDTCisI8<1>, SDTCisI8<2>, SDTCisI8<3>]>; + def SDT_PIC16Store : SDTypeProfile<0, 4, [SDTCisI8<0>, SDTCisI8<1>, SDTCisI8<2>, SDTCisI8<3>]>; +// PIC16ISD::CALL type prorile +def SDT_PIC16call : SDTypeProfile<0, -1, [SDTCisInt<0>]>; + +// PIC16ISD::BRCOND +def SDT_PIC16Brcond: SDTypeProfile<0, 2, + [SDTCisVT<0, OtherVT>, SDTCisI8<1>]>; + +// PIC16ISD::BRCOND +def SDT_PIC16Selecticc: SDTypeProfile<1, 3, + [SDTCisI8<0>, SDTCisI8<1>, SDTCisI8<2>, + SDTCisI8<3>]>; + //===----------------------------------------------------------------------===// // PIC16 addressing modes matching via DAG. //===----------------------------------------------------------------------===// @@ -52,7 +65,7 @@ def PIC16callseq_start : SDNode<"ISD::CALLSEQ_START", SDTI8VoidOp, [SDNPHasChain, SDNPOutFlag]>; def PIC16callseq_end : SDNode<"ISD::CALLSEQ_END", SDTI8VoidOp, - [SDNPHasChain, SDNPOutFlag]>; + [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>; // Low 8-bits of GlobalAddress. def PIC16Lo : SDNode<"PIC16ISD::Lo", SDTI8UnaryOp>; @@ -71,18 +84,37 @@ // Node to match a direct store operation. def PIC16Store : SDNode<"PIC16ISD::PIC16Store", SDT_PIC16Store, [SDNPHasChain]>; +def PIC16StWF : SDNode<"PIC16ISD::PIC16StWF", SDT_PIC16Store, + [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; // Node to match a direct load operation. def PIC16Load : SDNode<"PIC16ISD::PIC16Load", SDT_PIC16Load, [SDNPHasChain]>; +def PIC16LdWF : SDNode<"PIC16ISD::PIC16LdWF", SDT_PIC16Load, + [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; + +// Node to match PIC16 call +def PIC16call : SDNode<"PIC16ISD::CALL", SDT_PIC16call, + [SDNPHasChain , SDNPOptInFlag, SDNPOutFlag]>; + +// Node to match a comparison instruction. +def PIC16Subcc : SDNode<"PIC16ISD::SUBCC", SDTI8BinOp, [SDNPOutFlag]>; + +// Node to match a conditional branch. +def PIC16Brcond : SDNode<"PIC16ISD::BRCOND", SDT_PIC16Brcond, + [SDNPHasChain, SDNPInFlag]>; + +def PIC16Selecticc : SDNode<"PIC16ISD::SELECT_ICC", SDT_PIC16Selecticc, + [SDNPInFlag]>; -// Nodes to match bitwise operatios. -def OR : SDNode<"ISD::OR", SDTI8BinOp>; -def XOR : SDNode<"ISD::XOR", SDTI8BinOp>; -def AND : SDNode<"ISD::AND", SDTI8BinOp>; //===----------------------------------------------------------------------===// // PIC16 Operand Definitions. //===----------------------------------------------------------------------===// def i8mem : Operand; +def brtarget: Operand; + +// Operand for printing out a condition code. +let PrintMethod = "printCCOperand" in + def CCOp : Operand; include "PIC16InstrFormats.td" @@ -90,7 +122,7 @@ // PIC16 Common Classes. //===----------------------------------------------------------------------===// -// W = W Op F : Load the value from F and do Op to W +// W = W Op F : Load the value from F and do Op to W. class BinOpFW OpCode, string OpcStr, SDNode OpNode>: ByteFormat; -// F = F Op W : Load the value from F, do op with W and store in F + +// F = F Op W : Load the value from F, do op with W and store in F. class BinOpWF OpCode, string OpcStr, SDNode OpNode>: ByteFormat; +// W = W Op L : Do Op of L with W and place result in W. +class BinOpLW opcode, string OpcStr, SDNode OpNode> : + LiteralFormat; + //===----------------------------------------------------------------------===// // PIC16 Instructions. //===----------------------------------------------------------------------===// @@ -163,6 +203,9 @@ def copy_fsr: Pseudo<(outs FSR16:$dst), (ins FSR16:$src), "copy_fsr $dst, $src", []>; +def copy_w: + Pseudo<(outs GPR:$dst), (ins GPR:$src), "copy_w $dst, $src", []>; + //-------------------------- // Store to memory //------------------------- @@ -181,6 +224,14 @@ [(PIC16Store GPR:$val, texternalsym:$ptrlo, (i8 imm:$ptrhi), (i8 imm:$offset))]>; +// Store with InFlag and OutFlag +def movwf_2 : + ByteFormat<0, (outs), + (ins GPR:$val, i8mem:$ptrlo, i8imm:$ptrhi, i8imm:$offset), + "movwf ${ptrlo} + ${offset}", + [(PIC16StWF GPR:$val, texternalsym:$ptrlo, (i8 imm:$ptrhi), + (i8 imm:$offset))]>; + // Indirect store. Matched via a DAG replacement pattern. def store_indirect : ByteFormat<0, (outs), @@ -208,6 +259,16 @@ (PIC16Load texternalsym:$ptrlo, (i8 imm:$ptrhi), (i8 imm:$offset)))]>; +// Load with InFlag and OutFlag +def movf_2 : + ByteFormat<0, (outs GPR:$dst), + (ins i8mem:$ptrlo, i8imm:$ptrhi, i8imm:$offset), + "movf ${ptrlo} + ${offset}, W", + [(set GPR:$dst, + (PIC16LdWF texternalsym:$ptrlo, (i8 imm:$ptrhi), + (i8 imm:$offset)))]>; + + // Indirect load. Matched via a DAG replacement pattern. def load_indirect : ByteFormat<0, (outs GPR:$dst), @@ -218,23 +279,25 @@ //------------------------- // Bitwise operations patterns //-------------------------- -def OrFW : BinOpFW<0, "iorwf", OR>; -def XOrFW : BinOpFW<0, "xorwf", XOR>; -def AndFW : BinOpFW<0, "andwf", AND>; - -def OrWF : BinOpWF<0, "iorwf", OR>; -def XOrWF : BinOpWF<0, "xorwf", XOR>; -def AndWF : BinOpWF<0, "andwf", AND>; +let isTwoAddress = 1 in { +def OrFW : BinOpFW<0, "iorwf", or>; +def XOrFW : BinOpFW<0, "xorwf", xor>; +def AndFW : BinOpFW<0, "andwf", and>; +} + +def OrWF : BinOpWF<0, "iorwf", or>; +def XOrWF : BinOpWF<0, "xorwf", xor>; +def AndWF : BinOpWF<0, "andwf", and>; //------------------------- // Various add/sub patterns. //------------------------- -// let isTwoAddress = 1 in { +let isTwoAddress = 1 in { def addfw_1: BinOpFW<0, "addwf", add>; def addfw_2: BinOpFW<0, "addwf", addc>; def addfwc: BinOpFW<0, "addwfc", adde>; // With Carry. -// } +} def addwf_1: BinOpWF<0, "addwf", add>; def addwf_2: BinOpWF<0, "addwf", addc>; @@ -248,11 +311,12 @@ [(set GPR:$dst, (OpNode (PIC16Load diraddr:$ptrlo, (i8 imm:$ptrhi), (i8 imm:$offset)), GPR:$src))]>; -//let isTwoAddress = 1 in { +let isTwoAddress = 1 in { def subfw_1: SUBFW<0, "subwf", sub>; def subfw_2: SUBFW<0, "subwf", subc>; def subfwb: SUBFW<0, "subwfb", sube>; // With Borrow. -//} +def subfw_cc: SUBFW<0, "subwf", PIC16Subcc>; +} // [F] -= W ; class SUBWF OpCode, string OpcStr, SDNode OpNode>: @@ -267,33 +331,62 @@ def subwf_1: SUBWF<0, "subwf", sub>; def subwf_2: SUBWF<0, "subwf", subc>; def subwfb: SUBWF<0, "subwfb", sube>; // With Borrow. +def subwf_cc: SUBWF<0, "subwf", PIC16Subcc>; // addlw -// W += C ; add literal to W. (Without carry). May Produce a carry. -class ADDLW opcode, string OpcStr, SDNode OpNode> : - LiteralFormat; +let isTwoAddress = 1 in { +def addlw_1 : BinOpLW<0, "addlw", add>; +def addlw_2 : BinOpLW<0, "addlw", addc>; +def addlwc : BinOpLW<0, "addlwc", adde>; // With Carry. (Assembler macro). +} -// let isTwoAddress = 1 in { -def addlw_1 : ADDLW<0, "addlw", add>; -def addlw_2 : ADDLW<0, "addlw", addc>; -def addlwc : ADDLW<0, "addlwc", adde>; // With Carry. (Assembler macro). -//} +// bitwise operations involving a literal and w. +let isTwoAddress = 1 in { +def andlw : BinOpLW<0, "andlw", and>; +def xorlw : BinOpLW<0, "xorlw", xor>; +def orlw : BinOpLW<0, "iorlw", or>; +} // sublw // W = C - W ; sub W from literal. (Without borrow). class SUBLW opcode, SDNode OpNode> : LiteralFormat; -//let isTwoAddress = 1 in { +let isTwoAddress = 1 in { def sublw_1 : SUBLW<0, sub>; def sublw_2 : SUBLW<0, subc>; -//} +def sublw_cc : SUBLW<0, PIC16Subcc>; +} + +// Call instruction. +let isCall = 1 in { + def CALL: LiteralFormat<0x1, (outs), (ins i8imm:$func), + "call ${func}", + [(PIC16call diraddr:$func)]>; +} + +def pic16brcond: ControlFormat<0x0, (outs), (ins brtarget:$dst, CCOp:$cc), + "b$cc $dst", + [(PIC16Brcond bb:$dst, imm:$cc)]>; + +// Unconditional branch. +def br_uncond: ControlFormat<0x0, (outs), (ins brtarget:$dst), + "goto $dst", + [(br bb:$dst)]>; + +// SELECT_CC_* - Used to implement the SELECT_CC DAG operation. Expanded by the +// scheduler into a branch sequence. +let usesCustomDAGSchedInserter = 1 in { // Expanded by the scheduler. + def SELECT_CC_Int_ICC + : Pseudo<(outs GPR:$dst), (ins GPR:$T, GPR:$F, i8imm:$Cond), + "; SELECT_CC_Int_ICC PSEUDO!", + [(set GPR:$dst, (PIC16Selecticc GPR:$T, GPR:$F, + imm:$Cond))]>; +} + // Banksel. let isReMaterializable = 1 in { Modified: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.cpp Tue Jan 13 13:18:47 2009 @@ -79,4 +79,13 @@ return 0; } +// This function eliminates ADJCALLSTACKDOWN, +// ADJCALLSTACKUP pseudo instructions +void PIC16RegisterInfo:: +eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) const { + // Simply discard ADJCALLSTACKDOWN, + // ADJCALLSTACKUP instructions. + MBB.erase(I); +} Modified: llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16RegisterInfo.h Tue Jan 13 13:18:47 2009 @@ -51,6 +51,10 @@ virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, RegScavenger *RS=NULL) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, + MachineBasicBlock &MBB, + MachineBasicBlock::iterator I) const; + virtual void emitPrologue(MachineFunction &MF) const; virtual void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const; Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.cpp Tue Jan 13 13:18:47 2009 @@ -13,6 +13,7 @@ #include "PIC16TargetAsmInfo.h" #include "PIC16TargetMachine.h" +#include "llvm/GlobalValue.h" using namespace llvm; @@ -23,9 +24,12 @@ Data8bitsDirective = " db "; Data16bitsDirective = " db "; Data32bitsDirective = " db "; - DataSectionStartSuffix = " IDATA "; - UDataSectionStartSuffix = " UDATA "; - TextSectionStartSuffix = " CODE "; - RomDataSectionStartSuffix = " ROMDATA "; ZeroDirective = NULL; + AsciiDirective = " dt "; + AscizDirective = NULL; + BSSSection_ = getNamedSection("udata.# UDATA", + SectionFlags::Writeable | SectionFlags::BSS); + ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionFlags::None); + DataSection = getNamedSection("idata.# IDATA", SectionFlags::Writeable); + SwitchToSectionDirective = ""; } Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h?rev=62174&r1=62173&r2=62174&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16TargetAsmInfo.h Tue Jan 13 13:18:47 2009 @@ -23,17 +23,7 @@ struct PIC16TargetAsmInfo : public TargetAsmInfo { PIC16TargetAsmInfo(const PIC16TargetMachine &TM); - const char *UDataSectionStartSuffix; - const char *RomDataSectionStartSuffix; public : - const char *getUDataSectionStartSuffix() const { - return UDataSectionStartSuffix; - } - const char *getRomDataSectionStartSuffix() const { - return RomDataSectionStartSuffix; - } - - }; } // namespace llvm From dalej at apple.com Tue Jan 13 13:30:45 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 13 Jan 2009 11:30:45 -0800 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll In-Reply-To: References: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> Message-ID: On Jan 13, 2009, at 11:03 AMPST, Dan Gohman wrote: > Hi Dale, > > These tests: > > Applications/SPASS/SPASS > Benchmarks/Olden/perimeter/perimeter > > regressed as of this commit. The failure is an assertion > failure in opt: > > Assertion failed: (i && "Cannot find callsite to replace!"), function > replaceCallSite, file lib/Analysis/IPA/CallGraph.cpp, line 303. I suspected as much, thanks for tracking it down. > Dan > > On Jan 12, 2009, at 2:11 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Mon Jan 12 16:11:50 2009 >> New Revision: 62107 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=62107&view=rev >> Log: >> Enable recursive inlining. Reduce inlining threshold >> back to 200; 400 seems to be too high, loses more than >> it gains. >> >> >> Added: >> llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll >> Modified: >> llvm/trunk/lib/Transforms/IPO/Inliner.cpp >> llvm/trunk/lib/Transforms/Utils/InlineCost.cpp >> >> Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=62107&r1=62106&r2=62107&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) >> +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon Jan 12 16:11:50 >> 2009 >> @@ -31,8 +31,8 @@ >> STATISTIC(NumDeleted, "Number of functions deleted because all >> callers found"); >> >> static cl::opt >> -InlineLimit("inline-threshold", cl::Hidden, cl::init(400), >> - cl::desc("Control the amount of inlining to perform >> (default = 400)")); >> +InlineLimit("inline-threshold", cl::Hidden, cl::init(200), >> + cl::desc("Control the amount of inlining to perform >> (default = 200)")); >> >> Inliner::Inliner(void *ID) >> : CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {} >> @@ -168,8 +168,7 @@ >> for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi) >> if (Function *Callee = CallSites[CSi].getCalledFunction()) { >> // Calls to external functions are never inlinable. >> - if (Callee->isDeclaration() || >> - CallSites[CSi].getInstruction()->getParent()- >>> getParent() ==Callee){ >> + if (Callee->isDeclaration()) { >> if (SCC.size() == 1) { >> std::swap(CallSites[CSi], CallSites.back()); >> CallSites.pop_back(); >> @@ -190,7 +189,8 @@ >> if (InlineCallIfPossible(CS, CG, SCCFunctions, >> getAnalysis())) { >> // Remove any cached cost info for this caller, as >> inlining the callee >> - // has increased the size of the caller. >> + // has increased the size of the caller (which may be >> the same as the >> + // callee). >> resetCachedCostInfo(Caller); >> >> // Remove this call site from the list. If possible, use >> >> Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=62107&r1=62106&r2=62107&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) >> +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Mon Jan 12 >> 16:11:50 2009 >> @@ -180,14 +180,12 @@ >> Function *Callee = CS.getCalledFunction(); >> Function *Caller = TheCall->getParent()->getParent(); >> >> - // Don't inline a directly recursive call. >> - if (Caller == Callee || >> // Don't inline functions which can be redefined at link-time >> to mean >> // something else. >> // FIXME: We allow link-once linkage since in practice all >> versions of >> // the function have the same body (C++ ODR) - but the LLVM >> definition >> // of LinkOnceLinkage doesn't require this. >> - (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) >> || >> + if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) >> || >> // Don't inline functions marked noinline. >> Callee->hasFnAttr(Attribute::NoInline) || >> NeverInline.count(Callee)) >> return llvm::InlineCost::getNever(); >> >> Added: llvm/trunk/test/Transforms/Inline/2009-01-12- >> RecursiveInline.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll?rev=62107&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll >> (added) >> +++ llvm/trunk/test/Transforms/Inline/2009-01-12-RecursiveInline.ll >> Mon Jan 12 16:11:50 2009 >> @@ -0,0 +1,92 @@ >> +; RUN: llvm-as < %s | opt -inline | llvm-dis | grep {call.*fib} | >> count 4 >> +; First call to fib from fib is inlined, producing 2 instead of 1, >> total 3. >> +; Second call to fib from fib is not inlined because new body of >> fib exceeds >> +; inlining limit of 200. Plus call in main = 4 total. >> + >> +; ModuleID = '' >> +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- >> i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64- >> f80:128:128" >> +target triple = "i386-apple-darwin9.6" >> +@"\01LC" = internal constant [5 x i8] c"%ld\0A\00" ; <[5 x i8]*> >> [#uses=1] >> + >> +define i32 @fib(i32 %n) nounwind { >> +entry: >> + %n_addr = alloca i32 ; [#uses=4] >> + %retval = alloca i32 ; [#uses=2] >> + %0 = alloca i32 ; [#uses=3] >> + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] >> + store i32 %n, i32* %n_addr >> + %1 = load i32* %n_addr, align 4 ; [#uses=1] >> + %2 = icmp ule i32 %1, 1 ; [#uses=1] >> + br i1 %2, label %bb, label %bb1 >> + >> +bb: ; preds = %entry >> + store i32 1, i32* %0, align 4 >> + br label %bb2 >> + >> +bb1: ; preds = %entry >> + %3 = load i32* %n_addr, align 4 ; [#uses=1] >> + %4 = sub i32 %3, 2 ; [#uses=1] >> + %5 = call i32 @fib(i32 %4) nounwind ; [#uses=1] >> + %6 = load i32* %n_addr, align 4 ; [#uses=1] >> + %7 = sub i32 %6, 1 ; [#uses=1] >> + %8 = call i32 @fib(i32 %7) nounwind ; [#uses=1] >> + %9 = add i32 %5, %8 ; [#uses=1] >> + store i32 %9, i32* %0, align 4 >> + br label %bb2 >> + >> +bb2: ; preds = %bb1, %bb >> + %10 = load i32* %0, align 4 ; [#uses=1] >> + store i32 %10, i32* %retval, align 4 >> + br label %return >> + >> +return: ; preds = %bb2 >> + %retval3 = load i32* %retval ; [#uses=1] >> + ret i32 %retval3 >> +} >> + >> +define i32 @main(i32 %argc, i8** %argv) nounwind { >> +entry: >> + %argc_addr = alloca i32 ; [#uses=2] >> + %argv_addr = alloca i8** ; [#uses=2] >> + %retval = alloca i32 ; [#uses=2] >> + %N = alloca i32 ; [#uses=2] >> + %0 = alloca i32 ; [#uses=2] >> + %iftmp.0 = alloca i32 ; [#uses=3] >> + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] >> + store i32 %argc, i32* %argc_addr >> + store i8** %argv, i8*** %argv_addr >> + %1 = load i32* %argc_addr, align 4 ; [#uses=1] >> + %2 = icmp eq i32 %1, 2 ; [#uses=1] >> + br i1 %2, label %bb, label %bb1 >> + >> +bb: ; preds = %entry >> + %3 = load i8*** %argv_addr, align 4 ; [#uses=1] >> + %4 = getelementptr i8** %3, i32 1 ; [#uses=1] >> + %5 = load i8** %4, align 4 ; [#uses=1] >> + %6 = call i32 @atoi(i8* %5) nounwind ; [#uses=1] >> + store i32 %6, i32* %iftmp.0, align 4 >> + br label %bb2 >> + >> +bb1: ; preds = %entry >> + store i32 43, i32* %iftmp.0, align 4 >> + br label %bb2 >> + >> +bb2: ; preds = %bb1, %bb >> + %7 = load i32* %iftmp.0, align 4 ; [#uses=1] >> + store i32 %7, i32* %N, align 4 >> + %8 = load i32* %N, align 4 ; [#uses=1] >> + %9 = call i32 @fib(i32 %8) nounwind ; [#uses=1] >> + %10 = call i32 (i8*, ...)* @printf(i8* getelementptr ([5 x i8]* >> @"\01LC", i32 0, i32 0), i32 %9) nounwind ; [#uses=0] >> + store i32 0, i32* %0, align 4 >> + %11 = load i32* %0, align 4 ; [#uses=1] >> + store i32 %11, i32* %retval, align 4 >> + br label %return >> + >> +return: ; preds = %bb2 >> + %retval3 = load i32* %retval ; [#uses=1] >> + ret i32 %retval3 >> +} >> + >> +declare i32 @atoi(i8*) >> + >> +declare i32 @printf(i8*, ...) nounwind >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Jan 13 14:18:38 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 20:18:38 -0000 Subject: [llvm-commits] [llvm] r62176 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll test/Transforms/InstCombine/loadstore-alignment.ll Message-ID: <200901132018.n0DKIdSF007420@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 14:18:38 2009 New Revision: 62176 URL: http://llvm.org/viewvc/llvm-project?rev=62176&view=rev Log: Make instcombine ensure that all allocas are explicitly aligned at at least their preferred alignment. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62176&r1=62175&r2=62176&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 13 14:18:38 2009 @@ -10775,12 +10775,17 @@ } } - // If alloca'ing a zero byte object, replace the alloca with a null pointer. - // Note that we only do this for alloca's, because malloc should allocate and - // return a unique pointer, even for a zero byte allocation. - if (isa(AI) && AI.getAllocatedType()->isSized() && - TD->getTypePaddedSize(AI.getAllocatedType()) == 0) - return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType())); + if (isa(AI) && AI.getAllocatedType()->isSized()) { + // If alloca'ing a zero byte object, replace the alloca with a null pointer. + // Note that we only do this for alloca's, because malloc should allocate and + // return a unique pointer, even for a zero byte allocation. + if (TD->getTypePaddedSize(AI.getAllocatedType()) == 0) + return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType())); + + // If the alignment is 0 (unspecified), assign it the preferred alignment. + if (AI.getAlignment() == 0) + AI.setAlignment(TD->getPrefTypeAlignment(AI.getAllocatedType())); + } return 0; } Modified: llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll?rev=62176&r1=62175&r2=62176&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll Tue Jan 13 14:18:38 2009 @@ -1,4 +1,6 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 4} | count 4 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis > %t +; RUN: grep {, align 4} %t | count 3 +; RUN: grep {, align 8} %t | count 3 ; rdar://6480438 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin9.6" Modified: llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll?rev=62176&r1=62175&r2=62176&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/loadstore-alignment.ll Tue Jan 13 14:18:38 2009 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | count 12 +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {, align 16} | count 14 @x = external global <2 x i64>, align 16 @xx = external global [13 x <2 x i64>], align 16 From gohman at apple.com Tue Jan 13 14:24:13 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 20:24:13 -0000 Subject: [llvm-commits] [llvm] r62177 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp test/CodeGen/Generic/2006-07-03-schedulers.ll test/CodeGen/Mips/2008-07-23-fpcmp.ll Message-ID: <200901132024.n0DKODJV007698@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 14:24:13 2009 New Revision: 62177 URL: http://llvm.org/viewvc/llvm-project?rev=62177&view=rev Log: The list-td and list-tdrr schedulers don't yet support physreg scheduling dependencies. Add assertion checks to help catch this. It appears the Mips target defaults to list-td, and it has a regression test that uses a physreg dependence. Such code was liable to be miscompiled, and now evokes an assertion failure. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=62177&r1=62176&r2=62177&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Tue Jan 13 14:24:13 2009 @@ -140,8 +140,12 @@ // Top down: release successors. for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); - I != E; ++I) + I != E; ++I) { + assert(!I->isAssignedRegDep() && + "The list-td scheduler doesn't yet support physreg dependencies!"); + ReleaseSucc(SU, *I); + } SU->isScheduled = true; AvailableQueue->ScheduledNode(SU); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=62177&r1=62176&r2=62177&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 13 14:24:13 2009 @@ -816,8 +816,12 @@ // Top down: release successors for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); - I != E; ++I) + I != E; ++I) { + assert(!I->isAssignedRegDep() && + "The list-tdrr scheduler doesn't yet support physreg dependencies!"); + ReleaseSucc(SU, &*I); + } SU->isScheduled = true; AvailableQueue->ScheduledNode(SU); Modified: llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll?rev=62177&r1=62176&r2=62177&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2006-07-03-schedulers.ll Tue Jan 13 14:24:13 2009 @@ -1,10 +1,11 @@ ; RUN: llvm-as < %s | llc -pre-RA-sched=default -; RUN: llvm-as < %s | llc -pre-RA-sched=list-td -; RUN: llvm-as < %s | llc -pre-RA-sched=list-tdrr ; RUN: llvm-as < %s | llc -pre-RA-sched=list-burr ; RUN: llvm-as < %s | llc -pre-RA-sched=fast ; PR859 +; The top-down schedulers are excluded here because they don't yet support +; targets that use physreg defs. + declare i32 @printf(i8*, i32, float) define i32 @testissue(i32 %i, float %x, float %y) { Modified: llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll?rev=62177&r1=62176&r2=62177&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll (original) +++ llvm/trunk/test/CodeGen/Mips/2008-07-23-fpcmp.ll Tue Jan 13 14:24:13 2009 @@ -1,6 +1,7 @@ ; RUN: llvm-as < %s | llc -march=mips -f -o %t ; RUN: grep {c\\..*\\.s} %t | count 3 ; RUN: grep {bc1\[tf\]} %t | count 3 +; XFAIL: * target datalayout = "e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" target triple = "mipsallegrexel-psp-elf" From gohman at apple.com Tue Jan 13 14:25:24 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 20:25:24 -0000 Subject: [llvm-commits] [llvm] r62178 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200901132025.n0DKPOqs007743@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 14:25:24 2009 New Revision: 62178 URL: http://llvm.org/viewvc/llvm-project?rev=62178&view=rev Log: Use assertions to check for conditions that should never happen. Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62178&r1=62177&r2=62178&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jan 13 14:25:24 2009 @@ -104,8 +104,7 @@ // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); - if (BLR == IntB.end()) // Should never happen! - return false; + assert(BLR != IntB.end() && "Live range not found!"); VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -116,8 +115,7 @@ // AValNo is the value number in A that defines the copy, A3 in the example. LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1); - if (ALR == IntA.end()) // Should never happen! - return false; + assert(ALR != IntA.end() && "Live range not found!"); VNInfo *AValNo = ALR->valno; // If it's re-defined by an early clobber somewhere in the live range, then // it's not safe to eliminate the copy. FIXME: This is a temporary workaround. @@ -153,8 +151,7 @@ // Get the LiveRange in IntB that this value number starts with. LiveInterval::iterator ValLR = IntB.FindLiveRangeContaining(AValNo->def-1); - if (ValLR == IntB.end()) // Should never happen! - return false; + assert(ValLR != IntB.end() && "Live range not found!"); // Make sure that the end of the live range is inside the same block as // CopyMI. @@ -288,8 +285,7 @@ // BValNo is a value number in B that is defined by a copy from A. 'B3' in // the example above. LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); - if (BLR == IntB.end()) // Should never happen! - return false; + assert(BLR != IntB.end() && "Live range not found!"); VNInfo *BValNo = BLR->valno; // Get the location that B is defined at. Two options: either this value has @@ -300,8 +296,7 @@ // AValNo is the value number in A that defines the copy, A3 in the example. LiveInterval::iterator ALR = IntA.FindLiveRangeContaining(CopyIdx-1); - if (ALR == IntA.end()) // Should never happen! - return false; + assert(ALR != IntA.end() && "Live range not found!"); VNInfo *AValNo = ALR->valno; // If other defs can reach uses of this def, then it's not safe to perform // the optimization. @@ -462,8 +457,7 @@ MachineInstr *CopyMI) { unsigned CopyIdx = li_->getUseIndex(li_->getInstructionIndex(CopyMI)); LiveInterval::iterator SrcLR = SrcInt.FindLiveRangeContaining(CopyIdx); - if (SrcLR == SrcInt.end()) // Should never happen! - return false; + assert(SrcLR != SrcInt.end() && "Live range not found!"); VNInfo *ValNo = SrcLR->valno; // If other defs can reach uses of this def, then it's not safe to perform // the optimization. From gohman at apple.com Tue Jan 13 14:32:45 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 20:32:45 -0000 Subject: [llvm-commits] [llvm] r62179 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200901132032.n0DKWjVt008015@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 14:32:45 2009 New Revision: 62179 URL: http://llvm.org/viewvc/llvm-project?rev=62179&view=rev Log: Fix a few more JIT encoding issues in the BT instructions. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=62179&r1=62178&r2=62179&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Jan 13 14:32:45 2009 @@ -2675,11 +2675,11 @@ // TODO: BT with immediate operands // TODO: BTC, BTR, and BTS let Defs = [EFLAGS] in { -def BT16rr : I<0xA3, MRMSrcReg, (outs), (ins GR16:$src1, GR16:$src2), +def BT16rr : I<0xA3, MRMDestReg, (outs), (ins GR16:$src1, GR16:$src2), "bt{w}\t{$src2, $src1|$src1, $src2}", [(X86bt GR16:$src1, GR16:$src2), (implicit EFLAGS)]>, OpSize, TB; -def BT32rr : I<0xA3, MRMSrcReg, (outs), (ins GR32:$src1, GR32:$src2), +def BT32rr : I<0xA3, MRMDestReg, (outs), (ins GR32:$src1, GR32:$src2), "bt{l}\t{$src2, $src1|$src1, $src2}", [(X86bt GR32:$src1, GR32:$src2), (implicit EFLAGS)]>, TB; From gohman at apple.com Tue Jan 13 14:33:23 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 20:33:23 -0000 Subject: [llvm-commits] [llvm] r62180 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td Message-ID: <200901132033.n0DKXN7s008045@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 14:33:23 2009 New Revision: 62180 URL: http://llvm.org/viewvc/llvm-project?rev=62180&view=rev Log: Add bt instructions that take immediate operands. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=62180&r1=62179&r2=62180&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jan 13 14:33:23 2009 @@ -918,7 +918,6 @@ } // Defs = [EFLAGS] // Bit tests. -// TODO: BT with immediate operands. // TODO: BTC, BTR, and BTS let Defs = [EFLAGS] in { def BT64rr : RI<0xA3, MRMDestReg, (outs), (ins GR64:$src1, GR64:$src2), @@ -929,6 +928,18 @@ "bt{q}\t{$src2, $src1|$src1, $src2}", [(X86bt (loadi64 addr:$src1), GR64:$src2), (implicit EFLAGS)]>, TB; + +def BT64ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR64:$src1, i64i8imm:$src2), + "bt{q}\t{$src2, $src1|$src1, $src2}", + [(X86bt GR64:$src1, i64immSExt8:$src2), + (implicit EFLAGS)]>, TB; +// Note that these instructions don't need FastBTMem because that +// only applies when the other operand is in a register. When it's +// an immediate, bt is still fast. +def BT64mi8 : Ii8<0xBA, MRM4m, (outs), (ins i64mem:$src1, i64i8imm:$src2), + "bt{q}\t{$src2, $src1|$src1, $src2}", + [(X86bt (loadi64 addr:$src1), i64immSExt8:$src2), + (implicit EFLAGS)]>, TB; } // Defs = [EFLAGS] // Conditional moves Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=62180&r1=62179&r2=62180&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Jan 13 14:33:23 2009 @@ -2672,7 +2672,6 @@ } // Defs = [EFLAGS] // Bit tests. -// TODO: BT with immediate operands // TODO: BTC, BTR, and BTS let Defs = [EFLAGS] in { def BT16rr : I<0xA3, MRMDestReg, (outs), (ins GR16:$src1, GR16:$src2), @@ -2691,6 +2690,26 @@ "bt{l}\t{$src2, $src1|$src1, $src2}", [(X86bt (loadi32 addr:$src1), GR32:$src2), (implicit EFLAGS)]>, TB, Requires<[FastBTMem]>; + +def BT16ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR16:$src1, i16i8imm:$src2), + "bt{w}\t{$src2, $src1|$src1, $src2}", + [(X86bt GR16:$src1, i16immSExt8:$src2), + (implicit EFLAGS)]>, OpSize, TB; +def BT32ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR32:$src1, i32i8imm:$src2), + "bt{l}\t{$src2, $src1|$src1, $src2}", + [(X86bt GR32:$src1, i32immSExt8:$src2), + (implicit EFLAGS)]>, TB; +// Note that these instructions don't need FastBTMem because that +// only applies when the other operand is in a register. When it's +// an immediate, bt is still fast. +def BT16mi8 : Ii8<0xBA, MRM4m, (outs), (ins i16mem:$src1, i16i8imm:$src2), + "bt{w}\t{$src2, $src1|$src1, $src2}", + [(X86bt (loadi16 addr:$src1), i16immSExt8:$src2), + (implicit EFLAGS)]>, OpSize, TB; +def BT32mi8 : Ii8<0xBA, MRM4m, (outs), (ins i32mem:$src1, i32i8imm:$src2), + "bt{l}\t{$src2, $src1|$src1, $src2}", + [(X86bt (loadi32 addr:$src1), i32immSExt8:$src2), + (implicit EFLAGS)]>, TB; } // Defs = [EFLAGS] // Sign/Zero extenders From eli.friedman at gmail.com Tue Jan 13 14:54:35 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Tue, 13 Jan 2009 12:54:35 -0800 Subject: [llvm-commits] [llvm] r61426 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/bt.ll In-Reply-To: <200812250534.mBP5YdRQ015027@zion.cs.uiuc.edu> References: <200812250534.mBP5YdRQ015027@zion.cs.uiuc.edu> Message-ID: On Wed, Dec 24, 2008 at 9:34 PM, Chris Lattner wrote: > + // If the operand types disagree, extend the shift amount to match. Since > + // BT ignores high bits (like shifts) we can use anyextend. This isn't correct for the bt forms with a memory operand. -Eli From echeng at apple.com Tue Jan 13 14:58:00 2009 From: echeng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 12:58:00 -0800 Subject: [llvm-commits] [llvm] r62178 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp In-Reply-To: <200901132025.n0DKPOqs007743@zion.cs.uiuc.edu> References: <200901132025.n0DKPOqs007743@zion.cs.uiuc.edu> Message-ID: You trust my comments too much. :-) Are you sure these won't happen? Evan On Jan 13, 2009, at 12:25 PM, Dan Gohman wrote: > Author: djg > Date: Tue Jan 13 14:25:24 2009 > New Revision: 62178 > > URL: http://llvm.org/viewvc/llvm-project?rev=62178&view=rev > Log: > Use assertions to check for conditions that should never happen. > > Modified: > llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > > Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=62178&r1=62177&r2=62178&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) > +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Jan 13 > 14:25:24 2009 > @@ -104,8 +104,7 @@ > // BValNo is a value number in B that is defined by a copy from > A. 'B3' in > // the example above. > LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); > - if (BLR == IntB.end()) // Should never happen! > - return false; > + assert(BLR != IntB.end() && "Live range not found!"); > VNInfo *BValNo = BLR->valno; > > // Get the location that B is defined at. Two options: either > this value has > @@ -116,8 +115,7 @@ > > // AValNo is the value number in A that defines the copy, A3 in > the example. > LiveInterval::iterator ALR = > IntA.FindLiveRangeContaining(CopyIdx-1); > - if (ALR == IntA.end()) // Should never happen! > - return false; > + assert(ALR != IntA.end() && "Live range not found!"); > VNInfo *AValNo = ALR->valno; > // If it's re-defined by an early clobber somewhere in the live > range, then > // it's not safe to eliminate the copy. FIXME: This is a temporary > workaround. > @@ -153,8 +151,7 @@ > > // Get the LiveRange in IntB that this value number starts with. > LiveInterval::iterator ValLR = IntB.FindLiveRangeContaining(AValNo- > >def-1); > - if (ValLR == IntB.end()) // Should never happen! > - return false; > + assert(ValLR != IntB.end() && "Live range not found!"); > > // Make sure that the end of the live range is inside the same > block as > // CopyMI. > @@ -288,8 +285,7 @@ > // BValNo is a value number in B that is defined by a copy from A. > 'B3' in > // the example above. > LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx); > - if (BLR == IntB.end()) // Should never happen! > - return false; > + assert(BLR != IntB.end() && "Live range not found!"); > VNInfo *BValNo = BLR->valno; > > // Get the location that B is defined at. Two options: either > this value has > @@ -300,8 +296,7 @@ > > // AValNo is the value number in A that defines the copy, A3 in > the example. > LiveInterval::iterator ALR = > IntA.FindLiveRangeContaining(CopyIdx-1); > - if (ALR == IntA.end()) // Should never happen! > - return false; > + assert(ALR != IntA.end() && "Live range not found!"); > VNInfo *AValNo = ALR->valno; > // If other defs can reach uses of this def, then it's not safe to > perform > // the optimization. > @@ -462,8 +457,7 @@ > MachineInstr > *CopyMI) { > unsigned CopyIdx = li_->getUseIndex(li_- > >getInstructionIndex(CopyMI)); > LiveInterval::iterator SrcLR = > SrcInt.FindLiveRangeContaining(CopyIdx); > - if (SrcLR == SrcInt.end()) // Should never happen! > - return false; > + assert(SrcLR != SrcInt.end() && "Live range not found!"); > VNInfo *ValNo = SrcLR->valno; > // If other defs can reach uses of this def, then it's not safe to > perform > // the optimization. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Tue Jan 13 15:25:00 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 21:25:00 -0000 Subject: [llvm-commits] [llvm] r62184 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200901132125.n0DLP1IC010567@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 15:25:00 2009 New Revision: 62184 URL: http://llvm.org/viewvc/llvm-project?rev=62184&view=rev Log: Use dwarf writer to decide whether the module has debug info or not. Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62184&r1=62183&r2=62184&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Jan 13 15:25:00 2009 @@ -93,6 +93,9 @@ /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); + /// hasDebugInfo - Return true if debug info intrinsics are seen in + /// this module. + bool hasDebugInfo(); }; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62184&r1=62183&r2=62184&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 15:25:00 2009 @@ -4984,3 +4984,9 @@ unsigned DwarfWriter::getRecordSourceLineCount() { return DD->getRecordSourceLineCount(); } + +/// hasDebugInfo - Return true if debug info intrinsics are seen in +/// this module. +bool DwarfWriter::hasDebugInfo() { + return DD && DD->ShouldEmitDwarf(); +} Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62184&r1=62183&r2=62184&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 13 15:25:00 2009 @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/DwarfWriter.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" @@ -2040,8 +2041,8 @@ if (GA->getOffset() != 0) return false; GlobalVariable *GV = dyn_cast(GA->getGlobal()); if (!GV) return false; - MachineModuleInfo *MMI = getMachineModuleInfo(); - return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV); + DwarfWriter *DW = getDwarfWriter(); + return DW && DW->hasDebugInfo(); } From dpatel at apple.com Tue Jan 13 15:44:10 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 21:44:10 -0000 Subject: [llvm-commits] [llvm] r62185 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901132144.n0DLiAkU011279@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 15:44:10 2009 New Revision: 62185 URL: http://llvm.org/viewvc/llvm-project?rev=62185&view=rev Log: Use DwarfWriter to record dbg variables. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62185&r1=62184&r2=62185&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Jan 13 15:44:10 2009 @@ -32,7 +32,7 @@ class GlobalVariable; class MachineConstantPoolEntry; class MachineConstantPoolValue; - class MachineModuleInfo; + class DwarfWriter; class Mangler; class Section; class TargetAsmInfo; @@ -51,10 +51,10 @@ /// unsigned FunctionNumber; - /// MachineModuleInfo - This is needed because printDeclare() has to insert - /// DebugVariable entries into the dwarf table. This is a short term hack + /// DW -This is needed because printDeclare() has to insert + /// DbgVariable entries into the dwarf table. This is a short term hack /// that ought be fixed soon. - MachineModuleInfo *MMI; + DwarfWriter *DW; // GCMetadataPrinters - The garbage collection metadata printer table. typedef DenseMap gcp_map_type; Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62185&r1=62184&r2=62185&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Jan 13 15:44:10 2009 @@ -93,6 +93,10 @@ /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); + /// RecordVariable - Indicate the declaration of a local variable. + /// + void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); + /// hasDebugInfo - Return true if debug info intrinsics are seen in /// this module. bool hasDebugInfo(); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=62185&r1=62184&r2=62185&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Jan 13 15:44:10 2009 @@ -20,6 +20,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/DwarfWriter.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" @@ -162,9 +163,9 @@ SwitchToDataSection(""); // Reset back to no section. - MMI = getAnalysisToUpdate(); + MachineModuleInfo *MMI = getAnalysisToUpdate(); if (MMI) MMI->AnalyzeModule(M); - + DW = getAnalysisToUpdate(); return false; } @@ -1419,9 +1420,9 @@ /// FIXME: It doesn't really print anything rather it inserts a DebugVariable /// entry into dwarf table. void AsmPrinter::printDeclare(const MachineInstr *MI) const { - int FI = MI->getOperand(0).getIndex(); + unsigned FI = MI->getOperand(0).getIndex(); GlobalValue *GV = MI->getOperand(1).getGlobal(); - MMI->RecordVariable(GV, FI); + DW->RecordVariable(cast(GV), FI); } /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62185&r1=62184&r2=62185&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 15:44:10 2009 @@ -4985,6 +4985,12 @@ return DD->getRecordSourceLineCount(); } +/// RecordVariable - Indicate the declaration of a local variable. +/// +void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { + DD->RecordVariable(GV, FrameIndex); +} + /// hasDebugInfo - Return true if debug info intrinsics are seen in /// this module. bool DwarfWriter::hasDebugInfo() { From dalej at apple.com Tue Jan 13 15:46:21 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 13 Jan 2009 13:46:21 -0800 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll In-Reply-To: <200901130857.29043.baldrick@free.fr> References: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> <200901130857.29043.baldrick@free.fr> Message-ID: <471AB860-D287-4456-B07A-06CDFA1AEA13@apple.com> On Jan 12, 2009, at 11:57 PMPST, Duncan Sands wrote: > Hi Dale, > >> @@ -180,14 +180,12 @@ >> Function *Callee = CS.getCalledFunction(); >> Function *Caller = TheCall->getParent()->getParent(); >> >> - // Don't inline a directly recursive call. >> - if (Caller == Callee || >> // Don't inline functions which can be redefined at link-time >> to mean >> // something else. >> // FIXME: We allow link-once linkage since in practice all >> versions of >> // the function have the same body (C++ ODR) - but the LLVM >> definition >> // of LinkOnceLinkage doesn't require this. >> - (Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) >> || >> + if ((Callee->mayBeOverridden() && !Callee- >> >hasLinkOnceLinkage()) || > > the comment (containing the FIXME) is now indented funny. I don't agree, I think it was indented funny before. Let's get the whole context: // Don't inline functions which can be redefined at link-time to mean // something else. // FIXME: We allow link-once linkage since in practice all versions of // the function have the same body (C++ ODR) - but the LLVM definition // of LinkOnceLinkage doesn't require this. if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || // Don't inline functions marked noinline. Callee->hasFnAttr(Attribute::NoInline) || NeverInline.count(Callee)) return llvm::InlineCost::getNever(); I think it's better not to put comments into the middle of if statements. But given that somebody thinks that's a good idea, it makes sense to line up the comments with the part of the if statement they're describing, rather than the entire if statement. This is consistent with what's done with comments after the first. > Also, it is > probably OK to inline a function with weak linkage (mayBeOverridden) > into > itself. Maybe so. What happens if different compilations make different inlining decisions? Is the linker allowed to require that all copies of a weak function are the same? I think not. From clattner at apple.com Tue Jan 13 15:46:47 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Jan 2009 13:46:47 -0800 Subject: [llvm-commits] [llvm] r62125 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp In-Reply-To: References: <200901130020.n0D0KpvA019669@zion.cs.uiuc.edu> Message-ID: On Jan 13, 2009, at 9:18 AM, Devang Patel wrote: > > On Jan 12, 2009, at 11:32 PM, Chris Lattner wrote: > >>> if (!Slot) { >>> // FIXME - breaks down when the context is an inlined function. >>> DIDescriptor ParentDesc; >>> - DIDescriptor *DB = new DIBlock(V); >>> + DIDescriptor *DB = new DIDescriptor(V); >> >> Why are you 'new'ing these things? The descriptors are meant to be >> very light-weight objects that are just handles on existing global >> variable descriptors. There should be no reason to new them, just >> create (through various methods on DIFactory) new global variable >> descriptors themselves. > > Yup. That's what I am doing other places. I'll change this. Thanks Devang! -Chris From clattner at apple.com Tue Jan 13 15:49:57 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Jan 2009 13:49:57 -0800 Subject: [llvm-commits] [llvm] r62180 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td In-Reply-To: <200901132033.n0DKXN7s008045@zion.cs.uiuc.edu> References: <200901132033.n0DKXN7s008045@zion.cs.uiuc.edu> Message-ID: <9806F1F4-F1D5-409E-BA30-72B63BB10F94@apple.com> On Jan 13, 2009, at 12:33 PM, Dan Gohman wrote: > Author: djg > Date: Tue Jan 13 14:33:23 2009 > New Revision: 62180 > > URL: http://llvm.org/viewvc/llvm-project?rev=62180&view=rev > Log: > Add bt instructions that take immediate operands. Cool, do we actually generate these now? Can you add a testcase? -Chris From clattner at apple.com Tue Jan 13 16:28:19 2009 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Jan 2009 14:28:19 -0800 Subject: [llvm-commits] [llvm] r61985 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll test/Transforms/InstCombine/icmp.ll In-Reply-To: <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> References: <200901090747.n097l7Pm031353@zion.cs.uiuc.edu> <8B711D90-F73A-4C1D-AE73-6056FDE03100@apple.com> <6A4599D4-D0D0-480A-BB6C-0820537E6796@apple.com> Message-ID: <10D4DB80-624C-42A8-9D70-59E98C96F8A0@apple.com> On Jan 12, 2009, at 11:09 PM, Chris Lattner wrote: > > On Jan 12, 2009, at 5:18 PM, Dan Gohman wrote: > >> Hi Chris, >> >> The recent 176.gcc JIT regression on darwin x86-32 isolated down to >> this commit. Can you investigate? > > Absolutely. Woo, you (accidentally) fixed this with r62179 :) -Chris From dalej at apple.com Tue Jan 13 16:43:37 2009 From: dalej at apple.com (Dale Johannesen) Date: Tue, 13 Jan 2009 22:43:37 -0000 Subject: [llvm-commits] [llvm] r62189 - in /llvm/trunk: lib/Transforms/Utils/InlineFunction.cpp test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll Message-ID: <200901132243.n0DMhbWJ013619@zion.cs.uiuc.edu> Author: johannes Date: Tue Jan 13 16:43:37 2009 New Revision: 62189 URL: http://llvm.org/viewvc/llvm-project?rev=62189&view=rev Log: Fix testsuite regressions from recursive inlining. Added: llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=62189&r1=62188&r2=62189&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Tue Jan 13 16:43:37 2009 @@ -150,11 +150,8 @@ CallGraph &CG) { const Function *Caller = CS.getInstruction()->getParent()->getParent(); const Function *Callee = CS.getCalledFunction(); - - // Update the call graph by deleting the edge from Callee to Caller CallGraphNode *CalleeNode = CG[Callee]; CallGraphNode *CallerNode = CG[Caller]; - CallerNode->removeCallEdgeFor(CS); // Since we inlined some uninlined call sites in the callee into the caller, // add edges from the caller to all of the callees of the callee. @@ -171,6 +168,9 @@ CallerNode->addCalledFunction(CallSite::get(NewCall), I->second); } } + // Update the call graph by deleting the edge from Callee to Caller. We must + // do this after the loop above in case Caller and Callee are the same. + CallerNode->removeCallEdgeFor(CS); } Added: llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll?rev=62189&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll (added) +++ llvm/trunk/test/Transforms/Inline/2009-01-13-RecursiveInlineCrash.ll Tue Jan 13 16:43:37 2009 @@ -0,0 +1,293 @@ +; RUN: llvm-as < %s | opt -inline -argpromotion -disable-output +; ModuleID = '' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.6" + %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* } + at NumNodes = external global i32 ; [#uses=0] +@"\01LC" = external constant [43 x i8] ; <[43 x i8]*> [#uses=0] +@"\01LC1" = external constant [19 x i8] ; <[19 x i8]*> [#uses=0] +@"\01LC2" = external constant [17 x i8] ; <[17 x i8]*> [#uses=0] + +declare i32 @dealwithargs(i32, i8** nocapture) nounwind + +declare i32 @atoi(i8*) + +define internal fastcc i32 @adj(i32 %d, i32 %ct) nounwind readnone { +entry: + switch i32 %d, label %return [ + i32 0, label %bb + i32 1, label %bb10 + i32 2, label %bb5 + i32 3, label %bb15 + ] + +bb: ; preds = %entry + switch i32 %ct, label %bb3 [ + i32 1, label %return + i32 0, label %return + ] + +bb3: ; preds = %bb + ret i32 0 + +bb5: ; preds = %entry + switch i32 %ct, label %bb8 [ + i32 3, label %return + i32 2, label %return + ] + +bb8: ; preds = %bb5 + ret i32 0 + +bb10: ; preds = %entry + switch i32 %ct, label %bb13 [ + i32 1, label %return + i32 3, label %return + ] + +bb13: ; preds = %bb10 + ret i32 0 + +bb15: ; preds = %entry + switch i32 %ct, label %bb18 [ + i32 2, label %return + i32 0, label %return + ] + +bb18: ; preds = %bb15 + ret i32 0 + +return: ; preds = %bb15, %bb15, %bb10, %bb10, %bb5, %bb5, %bb, %bb, %entry + ret i32 1 +} + +declare fastcc i32 @reflect(i32, i32) nounwind readnone + +declare i32 @CountTree(%struct.quad_struct* nocapture) nounwind readonly + +define internal fastcc %struct.quad_struct* @child(%struct.quad_struct* nocapture %tree, i32 %ct) nounwind readonly { +entry: + switch i32 %ct, label %bb5 [ + i32 0, label %bb1 + i32 1, label %bb + i32 2, label %bb3 + i32 3, label %bb2 + ] + +bb: ; preds = %entry + %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] + %1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=1] + ret %struct.quad_struct* %1 + +bb1: ; preds = %entry + %2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] + %3 = load %struct.quad_struct** %2, align 4 ; <%struct.quad_struct*> [#uses=1] + ret %struct.quad_struct* %3 + +bb2: ; preds = %entry + %4 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] + %5 = load %struct.quad_struct** %4, align 4 ; <%struct.quad_struct*> [#uses=1] + ret %struct.quad_struct* %5 + +bb3: ; preds = %entry + %6 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] + %7 = load %struct.quad_struct** %6, align 4 ; <%struct.quad_struct*> [#uses=1] + ret %struct.quad_struct* %7 + +bb5: ; preds = %entry + ret %struct.quad_struct* null +} + +define internal fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* nocapture %tree, i32 %d) nounwind readonly { +entry: + %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 6 ; <%struct.quad_struct**> [#uses=1] + %1 = load %struct.quad_struct** %0, align 4 ; <%struct.quad_struct*> [#uses=4] + %2 = getelementptr %struct.quad_struct* %tree, i32 0, i32 1 ; [#uses=1] + %3 = load i32* %2, align 4 ; [#uses=2] + %4 = icmp eq %struct.quad_struct* %1, null ; [#uses=1] + br i1 %4, label %bb3, label %bb + +bb: ; preds = %entry + %5 = call fastcc i32 @adj(i32 %d, i32 %3) nounwind ; [#uses=1] + %6 = icmp eq i32 %5, 0 ; [#uses=1] + br i1 %6, label %bb3, label %bb1 + +bb1: ; preds = %bb + %7 = call fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* %1, i32 %d) nounwind ; <%struct.quad_struct*> [#uses=1] + br label %bb3 + +bb3: ; preds = %bb1, %bb, %entry + %q.0 = phi %struct.quad_struct* [ %7, %bb1 ], [ %1, %bb ], [ %1, %entry ] ; <%struct.quad_struct*> [#uses=4] + %8 = icmp eq %struct.quad_struct* %q.0, null ; [#uses=1] + br i1 %8, label %bb7, label %bb4 + +bb4: ; preds = %bb3 + %9 = getelementptr %struct.quad_struct* %q.0, i32 0, i32 0 ; [#uses=1] + %10 = load i32* %9, align 4 ; [#uses=1] + %11 = icmp eq i32 %10, 2 ; [#uses=1] + br i1 %11, label %bb5, label %bb7 + +bb5: ; preds = %bb4 + %12 = call fastcc i32 @reflect(i32 %d, i32 %3) nounwind ; [#uses=1] + %13 = call fastcc %struct.quad_struct* @child(%struct.quad_struct* %q.0, i32 %12) nounwind ; <%struct.quad_struct*> [#uses=1] + ret %struct.quad_struct* %13 + +bb7: ; preds = %bb4, %bb3 + ret %struct.quad_struct* %q.0 +} + +declare fastcc i32 @sum_adjacent(%struct.quad_struct* nocapture, i32, i32, i32) nounwind readonly + +define i32 @perimeter(%struct.quad_struct* nocapture %tree, i32 %size) nounwind readonly { +entry: + %0 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; [#uses=1] + %1 = load i32* %0, align 4 ; [#uses=1] + %2 = icmp eq i32 %1, 2 ; [#uses=1] + br i1 %2, label %bb, label %bb2 + +bb: ; preds = %entry + %3 = getelementptr %struct.quad_struct* %tree, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1] + %4 = load %struct.quad_struct** %3, align 4 ; <%struct.quad_struct*> [#uses=1] + %5 = sdiv i32 %size, 2 ; [#uses=1] + %6 = call i32 @perimeter(%struct.quad_struct* %4, i32 %5) nounwind ; [#uses=1] + %7 = getelementptr %struct.quad_struct* %tree, i32 0, i32 5 ; <%struct.quad_struct**> [#uses=1] + %8 = load %struct.quad_struct** %7, align 4 ; <%struct.quad_struct*> [#uses=1] + %9 = sdiv i32 %size, 2 ; [#uses=1] + %10 = call i32 @perimeter(%struct.quad_struct* %8, i32 %9) nounwind ; [#uses=1] + %11 = add i32 %10, %6 ; [#uses=1] + %12 = getelementptr %struct.quad_struct* %tree, i32 0, i32 3 ; <%struct.quad_struct**> [#uses=1] + %13 = load %struct.quad_struct** %12, align 4 ; <%struct.quad_struct*> [#uses=1] + %14 = sdiv i32 %size, 2 ; [#uses=1] + %15 = call i32 @perimeter(%struct.quad_struct* %13, i32 %14) nounwind ; [#uses=1] + %16 = add i32 %15, %11 ; [#uses=1] + %17 = getelementptr %struct.quad_struct* %tree, i32 0, i32 2 ; <%struct.quad_struct**> [#uses=1] + %18 = load %struct.quad_struct** %17, align 4 ; <%struct.quad_struct*> [#uses=1] + %19 = sdiv i32 %size, 2 ; [#uses=1] + %20 = call i32 @perimeter(%struct.quad_struct* %18, i32 %19) nounwind ; [#uses=1] + %21 = add i32 %20, %16 ; [#uses=1] + ret i32 %21 + +bb2: ; preds = %entry + %22 = getelementptr %struct.quad_struct* %tree, i32 0, i32 0 ; [#uses=1] + %23 = load i32* %22, align 4 ; [#uses=1] + %24 = icmp eq i32 %23, 0 ; [#uses=1] + br i1 %24, label %bb3, label %bb23 + +bb3: ; preds = %bb2 + %25 = call fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* %tree, i32 0) nounwind ; <%struct.quad_struct*> [#uses=4] + %26 = icmp eq %struct.quad_struct* %25, null ; [#uses=1] + br i1 %26, label %bb8, label %bb4 + +bb4: ; preds = %bb3 + %27 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; [#uses=1] + %28 = load i32* %27, align 4 ; [#uses=1] + %29 = icmp eq i32 %28, 1 ; [#uses=1] + br i1 %29, label %bb8, label %bb6 + +bb6: ; preds = %bb4 + %30 = getelementptr %struct.quad_struct* %25, i32 0, i32 0 ; [#uses=1] + %31 = load i32* %30, align 4 ; [#uses=1] + %32 = icmp eq i32 %31, 2 ; [#uses=1] + br i1 %32, label %bb7, label %bb8 + +bb7: ; preds = %bb6 + %33 = call fastcc i32 @sum_adjacent(%struct.quad_struct* %25, i32 3, i32 2, i32 %size) nounwind ; [#uses=1] + br label %bb8 + +bb8: ; preds = %bb7, %bb6, %bb4, %bb3 + %retval1.1 = phi i32 [ 0, %bb6 ], [ %33, %bb7 ], [ %size, %bb4 ], [ %size, %bb3 ] ; [#uses=3] + %34 = call fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* %tree, i32 1) nounwind ; <%struct.quad_struct*> [#uses=4] + %35 = icmp eq %struct.quad_struct* %34, null ; [#uses=1] + br i1 %35, label %bb10, label %bb9 + +bb9: ; preds = %bb8 + %36 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; [#uses=1] + %37 = load i32* %36, align 4 ; [#uses=1] + %38 = icmp eq i32 %37, 1 ; [#uses=1] + br i1 %38, label %bb10, label %bb11 + +bb10: ; preds = %bb9, %bb8 + %39 = add i32 %retval1.1, %size ; [#uses=1] + br label %bb13 + +bb11: ; preds = %bb9 + %40 = getelementptr %struct.quad_struct* %34, i32 0, i32 0 ; [#uses=1] + %41 = load i32* %40, align 4 ; [#uses=1] + %42 = icmp eq i32 %41, 2 ; [#uses=1] + br i1 %42, label %bb12, label %bb13 + +bb12: ; preds = %bb11 + %43 = call fastcc i32 @sum_adjacent(%struct.quad_struct* %34, i32 2, i32 0, i32 %size) nounwind ; [#uses=1] + %44 = add i32 %43, %retval1.1 ; [#uses=1] + br label %bb13 + +bb13: ; preds = %bb12, %bb11, %bb10 + %retval1.2 = phi i32 [ %retval1.1, %bb11 ], [ %44, %bb12 ], [ %39, %bb10 ] ; [#uses=3] + %45 = call fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* %tree, i32 2) nounwind ; <%struct.quad_struct*> [#uses=4] + %46 = icmp eq %struct.quad_struct* %45, null ; [#uses=1] + br i1 %46, label %bb15, label %bb14 + +bb14: ; preds = %bb13 + %47 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; [#uses=1] + %48 = load i32* %47, align 4 ; [#uses=1] + %49 = icmp eq i32 %48, 1 ; [#uses=1] + br i1 %49, label %bb15, label %bb16 + +bb15: ; preds = %bb14, %bb13 + %50 = add i32 %retval1.2, %size ; [#uses=1] + br label %bb18 + +bb16: ; preds = %bb14 + %51 = getelementptr %struct.quad_struct* %45, i32 0, i32 0 ; [#uses=1] + %52 = load i32* %51, align 4 ; [#uses=1] + %53 = icmp eq i32 %52, 2 ; [#uses=1] + br i1 %53, label %bb17, label %bb18 + +bb17: ; preds = %bb16 + %54 = call fastcc i32 @sum_adjacent(%struct.quad_struct* %45, i32 0, i32 1, i32 %size) nounwind ; [#uses=1] + %55 = add i32 %54, %retval1.2 ; [#uses=1] + br label %bb18 + +bb18: ; preds = %bb17, %bb16, %bb15 + %retval1.3 = phi i32 [ %retval1.2, %bb16 ], [ %55, %bb17 ], [ %50, %bb15 ] ; [#uses=3] + %56 = call fastcc %struct.quad_struct* @gtequal_adj_neighbor(%struct.quad_struct* %tree, i32 3) nounwind ; <%struct.quad_struct*> [#uses=4] + %57 = icmp eq %struct.quad_struct* %56, null ; [#uses=1] + br i1 %57, label %bb20, label %bb19 + +bb19: ; preds = %bb18 + %58 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; [#uses=1] + %59 = load i32* %58, align 4 ; [#uses=1] + %60 = icmp eq i32 %59, 1 ; [#uses=1] + br i1 %60, label %bb20, label %bb21 + +bb20: ; preds = %bb19, %bb18 + %61 = add i32 %retval1.3, %size ; [#uses=1] + ret i32 %61 + +bb21: ; preds = %bb19 + %62 = getelementptr %struct.quad_struct* %56, i32 0, i32 0 ; [#uses=1] + %63 = load i32* %62, align 4 ; [#uses=1] + %64 = icmp eq i32 %63, 2 ; [#uses=1] + br i1 %64, label %bb22, label %bb23 + +bb22: ; preds = %bb21 + %65 = call fastcc i32 @sum_adjacent(%struct.quad_struct* %56, i32 1, i32 3, i32 %size) nounwind ; [#uses=1] + %66 = add i32 %65, %retval1.3 ; [#uses=1] + ret i32 %66 + +bb23: ; preds = %bb21, %bb2 + %retval1.0 = phi i32 [ 0, %bb2 ], [ %retval1.3, %bb21 ] ; [#uses=1] + ret i32 %retval1.0 +} + +declare i32 @main(i32, i8** nocapture) noreturn nounwind + +declare i32 @printf(i8*, ...) nounwind + +declare void @exit(i32) noreturn nounwind + +declare fastcc i32 @CheckOutside(i32, i32) nounwind readnone + +declare fastcc i32 @CheckIntersect(i32, i32, i32) nounwind readnone + +declare %struct.quad_struct* @MakeTree(i32, i32, i32, i32, i32, %struct.quad_struct*, i32, i32) nounwind From echeng at apple.com Tue Jan 13 16:48:58 2009 From: echeng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 14:48:58 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200901131252.49945.baldrick@free.fr> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901131252.49945.baldrick@free.fr> Message-ID: On Jan 13, 2009, at 3:52 AM, Duncan Sands wrote: > Hi Evan, > >> Load / store alignments should be the alignments of the memory >> object used to construct the LValue, not the alignments of the >> values being loaded / stored. > > I've reverted this because it was causing several failures in the > testsuite, and also broke the Ada build. Also, I don't see how this > approach can work without major changes. Consider the following part > of your patch: > >> @@ -5956,8 +5975,10 @@ > ... >> } else { >> ArrayAddr = Emit(Array, 0); >> + ArrayAlign = expr_align(ArrayTreeType) / 8; >> } > > This is the case of when we are doing "a[i]", where "a" is a pointer. > There's no reason to think that "a" points to aligned memory, so > using the type alignment is wrong. So where to get the alignment > from? We get the pointer "a" from Emit, which doesn't provide > alignment > info for the pointee. As far as I can see either Emit needs to return > more info (complicated to implement) or we need to dig down into the > gcc > tree to get the underlying object and extract its alignment. In other > words, we need to do what we expected expr_align to do (only it > wasn't). > I think we should just make expr_align more intelligent. Since we > are the > only users of it, there is no danger involved in changing it. This gets translated into low level pointer arithmetics, right? Later on llvm-convert casts it to i8*: ArrayAddr = BitCastToType(ArrayAddr, PointerType::getUnqual(Type::Int8Ty)); Is there a reason why we can't just give it the alignment of i8? Evan > > > Ciao, > > Duncan. > > PS: I didn't check, but presumably this same problem occurs elsewhere: > we get a pointer from Emit and need alignment for the pointee. From dpatel at apple.com Tue Jan 13 16:54:57 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 22:54:57 -0000 Subject: [llvm-commits] [llvm] r62190 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200901132254.n0DMswrK014026@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 16:54:57 2009 New Revision: 62190 URL: http://llvm.org/viewvc/llvm-project?rev=62190&view=rev Log: Undo previous checkin. Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62190&r1=62189&r2=62190&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Tue Jan 13 16:54:57 2009 @@ -97,9 +97,6 @@ /// void RecordVariable(GlobalVariable *GV, unsigned FrameIndex); - /// hasDebugInfo - Return true if debug info intrinsics are seen in - /// this module. - bool hasDebugInfo(); }; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62190&r1=62189&r2=62190&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 16:54:57 2009 @@ -4990,9 +4990,3 @@ void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { DD->RecordVariable(GV, FrameIndex); } - -/// hasDebugInfo - Return true if debug info intrinsics are seen in -/// this module. -bool DwarfWriter::hasDebugInfo() { - return DD && DD->ShouldEmitDwarf(); -} Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62190&r1=62189&r2=62190&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 13 16:54:57 2009 @@ -23,7 +23,6 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" -#include "llvm/CodeGen/DwarfWriter.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" @@ -2041,8 +2040,8 @@ if (GA->getOffset() != 0) return false; GlobalVariable *GV = dyn_cast(GA->getGlobal()); if (!GV) return false; - DwarfWriter *DW = getDwarfWriter(); - return DW && DW->hasDebugInfo(); + MachineModuleInfo *MMI = getMachineModuleInfo(); + return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV); } From gohman at apple.com Tue Jan 13 16:55:21 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 14:55:21 -0800 Subject: [llvm-commits] [llvm] r62180 - in /llvm/trunk/lib/Target/X86: X86Instr64bit.td X86InstrInfo.td In-Reply-To: <9806F1F4-F1D5-409E-BA30-72B63BB10F94@apple.com> References: <200901132033.n0DKXN7s008045@zion.cs.uiuc.edu> <9806F1F4-F1D5-409E-BA30-72B63BB10F94@apple.com> Message-ID: On Jan 13, 2009, at 1:49 PM, Chris Lattner wrote: > > On Jan 13, 2009, at 12:33 PM, Dan Gohman wrote: > >> Author: djg >> Date: Tue Jan 13 14:33:23 2009 >> New Revision: 62180 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=62180&view=rev >> Log: >> Add bt instructions that take immediate operands. > > Cool, do we actually generate these now? Can you add a testcase? Not yet. They need the X86ISelLowering.cpp code that matches BT to be more thorough, and it looks like they'll need some new DAGCombine logic too. Dan From dpatel at apple.com Tue Jan 13 17:02:17 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 23:02:17 -0000 Subject: [llvm-commits] [llvm] r62191 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/MachineModuleInfo.cpp Message-ID: <200901132302.n0DN2HRE014270@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 17:02:17 2009 New Revision: 62191 URL: http://llvm.org/viewvc/llvm-project?rev=62191&view=rev Log: Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between AsmPrinter and CodeGen. Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=62191&r1=62190&r2=62191&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Tue Jan 13 17:02:17 2009 @@ -1041,6 +1041,10 @@ bool CallsEHReturn; bool CallsUnwindInit; + + /// DbgInfoAvailable - True if debugging information is available + /// in this module. + bool DbgInfoAvailable; public: static char ID; // Pass identification, replacement for typeid @@ -1082,8 +1086,9 @@ /// hasDebugInfo - Returns true if valid debug info is present. /// - bool hasDebugInfo() const { return !CompileUnits.empty(); } - + bool hasDebugInfo() const { return DbgInfoAvailable; } + void setDebugInfoAvailability(bool avail) { DbgInfoAvailable = true; } + bool callsEHReturn() const { return CallsEHReturn; } void setCallsEHReturn(bool b) { CallsEHReturn = b; } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62191&r1=62190&r2=62191&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 17:02:17 2009 @@ -3604,6 +3604,7 @@ MMI = mmi; shouldEmit = true; + MMI->setDebugInfoAvailability(true); // Create DIEs for each of the externally visible global variables. ConstructGlobalVariableDIEs(); Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=62191&r1=62190&r2=62191&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Jan 13 17:02:17 2009 @@ -1630,6 +1630,7 @@ , Personalities() , CallsEHReturn(0) , CallsUnwindInit(0) +, DbgInfoAvailable(false) { // Always emit "no personality" info Personalities.push_back(NULL); From gohman at apple.com Tue Jan 13 17:23:30 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 23:23:30 -0000 Subject: [llvm-commits] [llvm] r62194 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/bt.ll Message-ID: <200901132323.n0DNNUcj015151@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 17:23:30 2009 New Revision: 62194 URL: http://llvm.org/viewvc/llvm-project?rev=62194&view=rev Log: Disable the register+memory forms of the bt instructions for now. Thanks to Eli for pointing out that these forms don't ignore the high bits of their index operands, and as such are not immediately suitable for use by isel. Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/test/CodeGen/X86/bt.ll Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=62194&r1=62193&r2=62194&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jan 13 17:23:30 2009 @@ -924,10 +924,14 @@ "bt{q}\t{$src2, $src1|$src1, $src2}", [(X86bt GR64:$src1, GR64:$src2), (implicit EFLAGS)]>, TB; -def BT64mr : RI<0xA3, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2), - "bt{q}\t{$src2, $src1|$src1, $src2}", - [(X86bt (loadi64 addr:$src1), GR64:$src2), - (implicit EFLAGS)]>, TB; + +// Unlike with the register+register form, the memory+register form of the +// bt instruction does not ignore the high bits of the index. From ISel's +// perspective, this is pretty bizarre. Disable these instructions for now. +//def BT64mr : RI<0xA3, MRMDestMem, (outs), (ins i64mem:$src1, GR64:$src2), +// "bt{q}\t{$src2, $src1|$src1, $src2}", +// [(X86bt (loadi64 addr:$src1), GR64:$src2), +// (implicit EFLAGS)]>, TB; def BT64ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR64:$src1, i64i8imm:$src2), "bt{q}\t{$src2, $src1|$src1, $src2}", Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=62194&r1=62193&r2=62194&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Jan 13 17:23:30 2009 @@ -2682,14 +2682,18 @@ "bt{l}\t{$src2, $src1|$src1, $src2}", [(X86bt GR32:$src1, GR32:$src2), (implicit EFLAGS)]>, TB; -def BT16mr : I<0xA3, MRMDestMem, (outs), (ins i16mem:$src1, GR16:$src2), - "bt{w}\t{$src2, $src1|$src1, $src2}", - [(X86bt (loadi16 addr:$src1), GR16:$src2), - (implicit EFLAGS)]>, OpSize, TB, Requires<[FastBTMem]>; -def BT32mr : I<0xA3, MRMDestMem, (outs), (ins i32mem:$src1, GR32:$src2), - "bt{l}\t{$src2, $src1|$src1, $src2}", - [(X86bt (loadi32 addr:$src1), GR32:$src2), - (implicit EFLAGS)]>, TB, Requires<[FastBTMem]>; + +// Unlike with the register+register form, the memory+register form of the +// bt instruction does not ignore the high bits of the index. From ISel's +// perspective, this is pretty bizarre. Disable these instructions for now. +//def BT16mr : I<0xA3, MRMDestMem, (outs), (ins i16mem:$src1, GR16:$src2), +// "bt{w}\t{$src2, $src1|$src1, $src2}", +// [(X86bt (loadi16 addr:$src1), GR16:$src2), +// (implicit EFLAGS)]>, OpSize, TB, Requires<[FastBTMem]>; +//def BT32mr : I<0xA3, MRMDestMem, (outs), (ins i32mem:$src1, GR32:$src2), +// "bt{l}\t{$src2, $src1|$src1, $src2}", +// [(X86bt (loadi32 addr:$src1), GR32:$src2), +// (implicit EFLAGS)]>, TB, Requires<[FastBTMem]>; def BT16ri8 : Ii8<0xBA, MRM4r, (outs), (ins GR16:$src1, i16i8imm:$src2), "bt{w}\t{$src2, $src1|$src1, $src2}", Modified: llvm/trunk/test/CodeGen/X86/bt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bt.ll?rev=62194&r1=62193&r2=62194&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/bt.ll (original) +++ llvm/trunk/test/CodeGen/X86/bt.ll Tue Jan 13 17:23:30 2009 @@ -1,7 +1,12 @@ ; RUN: llvm-as < %s | llc | grep btl -; RUN: llvm-as < %s | llc -mcpu=pentium4 | grep btl | grep esp +; RUN: llvm-as < %s | llc -mcpu=pentium4 | grep btl | not grep esp ; RUN: llvm-as < %s | llc -mcpu=penryn | grep btl | not grep esp ; PR3253 + +; The register+memory form of the BT instruction should be usable on +; pentium4, however it is currently disabled due to the register+memory +; form having different semantics than the register+register form. + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i386-apple-darwin8" From gohman at apple.com Tue Jan 13 17:24:22 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 15:24:22 -0800 Subject: [llvm-commits] [llvm] r61426 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/bt.ll In-Reply-To: References: <200812250534.mBP5YdRQ015027@zion.cs.uiuc.edu> Message-ID: <8CCFDDD8-C287-4546-AAB0-D1F92E1E5C4F@apple.com> On Jan 13, 2009, at 12:54 PM, Eli Friedman wrote: > On Wed, Dec 24, 2008 at 9:34 PM, Chris Lattner > wrote: >> + // If the operand types disagree, extend the shift amount to >> match. Since >> + // BT ignores high bits (like shifts) we can use anyextend. > > This isn't correct for the bt forms with a memory operand. Thanks for pointing this out! I've disabled the register+memory forms of the bt instructions for now in order to avoid this complication. Dan From gohman at apple.com Tue Jan 13 17:25:30 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 23:25:30 -0000 Subject: [llvm-commits] [llvm] r62195 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200901132325.n0DNPVce015219@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 17:25:30 2009 New Revision: 62195 URL: http://llvm.org/viewvc/llvm-project?rev=62195&view=rev Log: Don't use a BT instruction if the AND has multiple uses. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62195&r1=62194&r2=62195&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 13 17:25:30 2009 @@ -5034,7 +5034,9 @@ // Lower ((X >>u N) & 1) != 0 to BT. // Lower ((X >>s N) & 1) != 0 to BT. // FIXME: Is i386 or later or available only on some chips? - if (Op0.getOpcode() == ISD::AND && Op1.getOpcode() == ISD::Constant && + if (Op0.getOpcode() == ISD::AND && + Op0.hasOneUse() && + Op1.getOpcode() == ISD::Constant && Op0.getOperand(1).getOpcode() == ISD::Constant && (CC == ISD::SETEQ || CC == ISD::SETNE)) { ConstantSDNode *AndRHS = cast(Op0.getOperand(1)); From gohman at apple.com Tue Jan 13 17:27:15 2009 From: gohman at apple.com (Dan Gohman) Date: Tue, 13 Jan 2009 23:27:15 -0000 Subject: [llvm-commits] [llvm] r62196 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200901132327.n0DNRFLu015276@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 13 17:27:15 2009 New Revision: 62196 URL: http://llvm.org/viewvc/llvm-project?rev=62196&view=rev Log: BT appears to be available on all >= i386 chips. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62196&r1=62195&r2=62196&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 13 17:27:15 2009 @@ -5033,7 +5033,6 @@ // Lower (X & (1 << N)) == 0 to BT. // Lower ((X >>u N) & 1) != 0 to BT. // Lower ((X >>s N) & 1) != 0 to BT. - // FIXME: Is i386 or later or available only on some chips? if (Op0.getOpcode() == ISD::AND && Op0.hasOneUse() && Op1.getOpcode() == ISD::Constant && From echeng at apple.com Tue Jan 13 17:31:40 2009 From: echeng at apple.com (Evan Cheng) Date: Tue, 13 Jan 2009 15:31:40 -0800 Subject: [llvm-commits] [llvm] r62196 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp In-Reply-To: <200901132327.n0DNRFLu015276@zion.cs.uiuc.edu> References: <200901132327.n0DNRFLu015276@zion.cs.uiuc.edu> Message-ID: <8F692826-C4DA-454F-8930-E5E52B3F0934@apple.com> But is it a good idea to use it? Isn't it slow on some earlier x86 implementations? Evan On Jan 13, 2009, at 3:27 PM, Dan Gohman wrote: > Author: djg > Date: Tue Jan 13 17:27:15 2009 > New Revision: 62196 > > URL: http://llvm.org/viewvc/llvm-project?rev=62196&view=rev > Log: > BT appears to be available on all >= i386 chips. > > Modified: > llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > > Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62196&r1=62195&r2=62196&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 13 > 17:27:15 2009 > @@ -5033,7 +5033,6 @@ > // Lower (X & (1 << N)) == 0 to BT. > // Lower ((X >>u N) & 1) != 0 to BT. > // Lower ((X >>s N) & 1) != 0 to BT. > - // FIXME: Is i386 or later or available only on some chips? > if (Op0.getOpcode() == ISD::AND && > Op0.hasOneUse() && > Op1.getOpcode() == ISD::Constant && > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From nunoplopes at sapo.pt Tue Jan 13 17:35:49 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 13 Jan 2009 23:35:49 -0000 Subject: [llvm-commits] [llvm] r62198 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp Message-ID: <200901132335.n0DNZnSk015569@zion.cs.uiuc.edu> Author: nlopes Date: Tue Jan 13 17:35:49 2009 New Revision: 62198 URL: http://llvm.org/viewvc/llvm-project?rev=62198&view=rev Log: fix memleaks Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=62198&r1=62197&r2=62198&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Tue Jan 13 17:35:49 2009 @@ -130,6 +130,8 @@ virtual bool doFinalization(Module &M) { // Free memory... + delete IL; + delete TD; delete Mang; FPConstantMap.clear(); TypeNames.clear(); From dpatel at apple.com Tue Jan 13 17:54:55 2009 From: dpatel at apple.com (Devang Patel) Date: Tue, 13 Jan 2009 23:54:55 -0000 Subject: [llvm-commits] [llvm] r62199 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/MachineModuleInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200901132354.n0DNsuWr016259@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 17:54:55 2009 New Revision: 62199 URL: http://llvm.org/viewvc/llvm-project?rev=62199&view=rev Log: Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info. Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=62199&r1=62198&r2=62199&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Tue Jan 13 17:54:55 2009 @@ -47,7 +47,6 @@ //===----------------------------------------------------------------------===// // Forward declarations. class Constant; -class DebugInfoDesc; class GlobalVariable; class MachineBasicBlock; class MachineFunction; @@ -67,787 +66,6 @@ }; //===----------------------------------------------------------------------===// -/// DIVisitor - Subclasses of this class apply steps to each of the fields in -/// the supplied DebugInfoDesc. -class DIVisitor { -public: - DIVisitor() {} - virtual ~DIVisitor() {} - - /// ApplyToFields - Target the visitor to each field of the debug information - /// descriptor. - void ApplyToFields(DebugInfoDesc *DD); - - /// Apply - Subclasses override each of these methods to perform the - /// appropriate action for the type of field. - virtual void Apply(int &Field) = 0; - virtual void Apply(unsigned &Field) = 0; - virtual void Apply(int64_t &Field) = 0; - virtual void Apply(uint64_t &Field) = 0; - virtual void Apply(bool &Field) = 0; - virtual void Apply(std::string &Field) = 0; - virtual void Apply(DebugInfoDesc *&Field) = 0; - virtual void Apply(GlobalVariable *&Field) = 0; - virtual void Apply(std::vector &Field) = 0; -}; - -//===----------------------------------------------------------------------===// -/// DebugInfoDesc - This class is the base class for debug info descriptors. -/// -class DebugInfoDesc { -private: - unsigned Tag; // Content indicator. Dwarf values are - // used but that does not limit use to - // Dwarf writers. - -protected: - explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {} - -public: - virtual ~DebugInfoDesc() {} - - // Accessors - 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. - static unsigned TagFromGlobal(GlobalVariable *GV); - - /// VersionFromGlobal - Returns the version number from a debug info - /// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned - /// int. - static unsigned VersionFromGlobal(GlobalVariable *GV); - - /// DescFactory - Create an instance of debug info descriptor based on Tag. - /// Return NULL if not a recognized Tag. - static DebugInfoDesc *DescFactory(unsigned Tag); - - /// getLinkage - get linkage appropriate for this type of descriptor. - /// - virtual GlobalValue::LinkageTypes getLinkage() const; - - //===--------------------------------------------------------------------===// - // Subclasses should supply the following static methods. - - // Implement isa/cast/dyncast. - static bool classof(const DebugInfoDesc *) { return true; } - - //===--------------------------------------------------------------------===// - // Subclasses should supply the following virtual methods. - - /// ApplyToFields - Target the vistor to the fields of the descriptor. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const = 0; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const = 0; - -#ifndef NDEBUG - virtual void dump() = 0; -#endif -}; - -//===----------------------------------------------------------------------===// -/// AnchorDesc - Descriptors of this class act as markers for identifying -/// descriptors of certain groups. -class AnchoredDesc; -class AnchorDesc : public DebugInfoDesc { -private: - unsigned AnchorTag; // Tag number of descriptors anchored - // by this object. - -public: - AnchorDesc(); - explicit AnchorDesc(AnchoredDesc *D); - - // Accessors - unsigned getAnchorTag() const { return AnchorTag; } - - // Implement isa/cast/dyncast. - static bool classof(const AnchorDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// getLinkage - get linkage appropriate for this type of descriptor. - /// - virtual GlobalValue::LinkageTypes getLinkage() const; - - /// ApplyToFields - Target the visitor to the fields of the AnchorDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// AnchoredDesc - This class manages anchors for a variety of top level -/// descriptors. -class AnchoredDesc : public DebugInfoDesc { -private: - DebugInfoDesc *Anchor; // Anchor for all descriptors of the - // same type. - -protected: - - explicit AnchoredDesc(unsigned T); - -public: - // Accessors. - AnchorDesc *getAnchor() const { return static_cast(Anchor); } - void setAnchor(AnchorDesc *A) { Anchor = static_cast(A); } - - //===--------------------------------------------------------------------===// - // Subclasses should supply the following virtual methods. - - /// getAnchorString - Return a string used to label descriptor's anchor. - /// - virtual const char *getAnchorString() const = 0; - - /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); -}; - -//===----------------------------------------------------------------------===// -/// CompileUnitDesc - This class packages debug information associated with a -/// source/header file. -class CompileUnitDesc : public AnchoredDesc { -private: - unsigned Language; // Language number (ex. DW_LANG_C89.) - std::string FileName; // Source file name. - std::string Directory; // Source file directory. - std::string Producer; // Compiler string. - -public: - CompileUnitDesc(); - - - // Accessors - unsigned getLanguage() const { return Language; } - const std::string &getFileName() const { return FileName; } - const std::string &getDirectory() const { return Directory; } - const std::string &getProducer() const { return Producer; } - void setLanguage(unsigned L) { Language = L; } - void setFileName(const std::string &FN) { FileName = FN; } - void setDirectory(const std::string &D) { Directory = D; } - void setProducer(const std::string &P) { Producer = P; } - - // FIXME - Need translation unit getter/setter. - - // Implement isa/cast/dyncast. - static bool classof(const CompileUnitDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - - /// getAnchorString - Return a string used to label this descriptor's anchor. - /// - static const char *const AnchorString; - virtual const char *getAnchorString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// TypeDesc - This class packages debug information associated with a type. -/// -class TypeDesc : public DebugInfoDesc { -private: - enum { - FlagPrivate = 1 << 0, - FlagProtected = 1 << 1, - FlagFwdDecl = 1 << 2 - }; - DebugInfoDesc *Context; // Context debug descriptor. - std::string Name; // Type name (may be empty.) - 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.) - uint64_t Offset; // Type bit offset (may be zero.) - -protected: - unsigned Flags; // Miscellaneous flags. - -public: - explicit TypeDesc(unsigned T); - - // Accessors - DebugInfoDesc *getContext() const { return Context; } - const std::string &getName() const { return Name; } - 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; } - bool isPrivate() const { - return (Flags & FlagPrivate) != 0; - } - bool isProtected() const { - return (Flags & FlagProtected) != 0; - } - bool isForwardDecl() const { - return (Flags & FlagFwdDecl) != 0; - } - void setContext(DebugInfoDesc *C) { Context = C; } - void setName(const std::string &N) { Name = N; } - 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; } - void setOffset(uint64_t O) { Offset = O; } - void setIsPrivate() { Flags |= FlagPrivate; } - void setIsProtected() { Flags |= FlagProtected; } - void setIsForwardDecl() { Flags |= FlagFwdDecl; } - - /// ApplyToFields - Target the visitor to the fields of the TypeDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// BasicTypeDesc - This class packages debug information associated with a -/// basic type (eg. int, bool, double.) -class BasicTypeDesc : public TypeDesc { -private: - unsigned Encoding; // Type encoding. - -public: - BasicTypeDesc(); - - // Accessors - unsigned getEncoding() const { return Encoding; } - void setEncoding(unsigned E) { Encoding = E; } - - // Implement isa/cast/dyncast. - static bool classof(const BasicTypeDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - - -//===----------------------------------------------------------------------===// -/// DerivedTypeDesc - This class packages debug information associated with a -/// derived types (eg., typedef, pointer, reference.) -class DerivedTypeDesc : public TypeDesc { -private: - DebugInfoDesc *FromType; // Type derived from. - -public: - explicit DerivedTypeDesc(unsigned T); - - // Accessors - TypeDesc *getFromType() const { - return static_cast(FromType); - } - void setFromType(TypeDesc *F) { - FromType = static_cast(F); - } - - // Implement isa/cast/dyncast. - static bool classof(const DerivedTypeDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// CompositeTypeDesc - This class packages debug information associated with a -/// array/struct types (eg., arrays, struct, union, enums.) -class CompositeTypeDesc : public DerivedTypeDesc { -private: - std::vector Elements;// Information used to compose type. - -public: - explicit CompositeTypeDesc(unsigned T); - - // Accessors - std::vector &getElements() { return Elements; } - - // Implement isa/cast/dyncast. - static bool classof(const CompositeTypeDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// SubrangeDesc - This class packages debug information associated with integer -/// value ranges. -class SubrangeDesc : public DebugInfoDesc { -private: - int64_t Lo; // Low value of range. - int64_t Hi; // High value of range. - -public: - SubrangeDesc(); - - // Accessors - int64_t getLo() const { return Lo; } - int64_t getHi() const { return Hi; } - void setLo(int64_t L) { Lo = L; } - void setHi(int64_t H) { Hi = H; } - - // Implement isa/cast/dyncast. - static bool classof(const SubrangeDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// EnumeratorDesc - This class packages debug information associated with -/// named integer constants. -class EnumeratorDesc : public DebugInfoDesc { -private: - std::string Name; // Enumerator name. - int64_t Value; // Enumerator value. - -public: - EnumeratorDesc(); - - // Accessors - const std::string &getName() const { return Name; } - int64_t getValue() const { return Value; } - void setName(const std::string &N) { Name = N; } - void setValue(int64_t V) { Value = V; } - - // Implement isa/cast/dyncast. - static bool classof(const EnumeratorDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// VariableDesc - This class packages debug information associated with a -/// subprogram variable. -/// -class VariableDesc : public DebugInfoDesc { -private: - DebugInfoDesc *Context; // Context debug descriptor. - std::string Name; // Type name (may be empty.) - DebugInfoDesc *File; // Defined compile unit (may be NULL.) - unsigned Line; // Defined line# (may be zero.) - DebugInfoDesc *TyDesc; // Type of variable. - -public: - explicit VariableDesc(unsigned T); - - // Accessors - DebugInfoDesc *getContext() const { return Context; } - const std::string &getName() const { return Name; } - CompileUnitDesc *getFile() const { - return static_cast(File); - } - unsigned getLine() const { return Line; } - TypeDesc *getType() const { - return static_cast(TyDesc); - } - void setContext(DebugInfoDesc *C) { Context = C; } - void setName(const std::string &N) { Name = N; } - void setFile(CompileUnitDesc *U) { - File = static_cast(U); - } - void setLine(unsigned L) { Line = L; } - void setType(TypeDesc *T) { - TyDesc = static_cast(T); - } - - // Implement isa/cast/dyncast. - static bool classof(const VariableDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the VariableDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// GlobalDesc - This class is the base descriptor for global functions and -/// variables. -class GlobalDesc : public AnchoredDesc { -private: - DebugInfoDesc *Context; // Context debug descriptor. - std::string Name; // Global name. - std::string FullName; // Fully qualified name. - std::string LinkageName; // Name for binding to MIPS linkage. - DebugInfoDesc *File; // Defined compile unit (may be NULL.) - unsigned Line; // Defined line# (may be zero.) - DebugInfoDesc *TyDesc; // Type debug descriptor. - bool IsStatic; // Is the global a static. - bool IsDefinition; // Is the global defined in context. - -protected: - explicit GlobalDesc(unsigned T); - -public: - // Accessors - DebugInfoDesc *getContext() const { return Context; } - const std::string &getName() const { return Name; } - const std::string &getFullName() const { return FullName; } - const std::string &getLinkageName() const { return LinkageName; } - CompileUnitDesc *getFile() const { - return static_cast(File); - } - unsigned getLine() const { return Line; } - TypeDesc *getType() const { - return static_cast(TyDesc); - } - bool isStatic() const { return IsStatic; } - bool isDefinition() const { return IsDefinition; } - void setContext(DebugInfoDesc *C) { Context = C; } - void setName(const std::string &N) { Name = N; } - void setFullName(const std::string &N) { FullName = N; } - void setLinkageName(const std::string &N) { LinkageName = N; } - void setFile(CompileUnitDesc *U) { - File = static_cast(U); - } - void setLine(unsigned L) { Line = L; } - void setType(TypeDesc *T) { - TyDesc = static_cast(T); - } - void setIsStatic(bool IS) { IsStatic = IS; } - void setIsDefinition(bool ID) { IsDefinition = ID; } - - /// ApplyToFields - Target the visitor to the fields of the GlobalDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); -}; - -//===----------------------------------------------------------------------===// -/// GlobalVariableDesc - This class packages debug information associated with a -/// GlobalVariable. -class GlobalVariableDesc : public GlobalDesc { -private: - GlobalVariable *Global; // llvm global. - -public: - GlobalVariableDesc(); - - // Accessors. - GlobalVariable *getGlobalVariable() const { return Global; } - void setGlobalVariable(GlobalVariable *GV) { Global = GV; } - - // Implement isa/cast/dyncast. - static bool classof(const GlobalVariableDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the - /// GlobalVariableDesc. - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - - /// getAnchorString - Return a string used to label this descriptor's anchor. - /// - static const char *const AnchorString; - virtual const char *getAnchorString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// SubprogramDesc - This class packages debug information associated with a -/// subprogram/function. -class SubprogramDesc : public GlobalDesc { -private: - -public: - SubprogramDesc(); - - // Accessors - - // Implement isa/cast/dyncast. - static bool classof(const SubprogramDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - - /// getAnchorString - Return a string used to label this descriptor's anchor. - /// - static const char *const AnchorString; - virtual const char *getAnchorString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// BlockDesc - This descriptor groups variables and blocks nested in a block. -/// -class BlockDesc : public DebugInfoDesc { -private: - DebugInfoDesc *Context; // Context debug descriptor. - -public: - BlockDesc(); - - // Accessors - DebugInfoDesc *getContext() const { return Context; } - void setContext(DebugInfoDesc *C) { Context = C; } - - // Implement isa/cast/dyncast. - static bool classof(const BlockDesc *) { return true; } - static bool classof(const DebugInfoDesc *D); - - /// ApplyToFields - Target the visitor to the fields of the BlockDesc. - /// - virtual void ApplyToFields(DIVisitor *Visitor); - - /// getDescString - Return a string used to compose global names and labels. - /// - virtual const char *getDescString() const; - - /// getTypeString - Return a string used to label this descriptor's type. - /// - virtual const char *getTypeString() const; - -#ifndef NDEBUG - virtual void dump(); -#endif -}; - -//===----------------------------------------------------------------------===// -/// DIDeserializer - This class is responsible for casting GlobalVariables -/// into DebugInfoDesc objects. -class DIDeserializer { - // Previously defined gloabls. - std::map GlobalDescs; -public: - const std::map &getGlobalDescs() const { - return GlobalDescs; - } - - /// Deserialize - Reconstitute a GlobalVariable into it's component - /// DebugInfoDesc objects. - DebugInfoDesc *Deserialize(Value *V); - DebugInfoDesc *Deserialize(GlobalVariable *GV); -}; - -//===----------------------------------------------------------------------===// -/// DISerializer - This class is responsible for casting DebugInfoDesc objects -/// into GlobalVariables. -class DISerializer { - Module *M; // Definition space module. - PointerType *StrPtrTy; // A "i8*" type. Created lazily. - PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily. - - // Types per Tag. Created lazily. - std::map TagTypes; - - // Previously defined descriptors. - DenseMap DescGlobals; - - // Previously defined strings. - StringMap StringCache; -public: - DISerializer() - : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(), - DescGlobals(), StringCache() - {} - - // Accessors - Module *getModule() const { return M; }; - void setModule(Module *module) { M = module; } - - /// getStrPtrType - Return a "i8*" type. - /// - const PointerType *getStrPtrType(); - - /// getEmptyStructPtrType - Return a "{ }*" type. - /// - const PointerType *getEmptyStructPtrType(); - - /// getTagType - Return the type describing the specified descriptor (via - /// tag.) - const StructType *getTagType(DebugInfoDesc *DD); - - /// getString - Construct the string as constant string global. - /// - Constant *getString(const std::string &String); - - /// Serialize - Recursively cast the specified descriptor into a - /// GlobalVariable so that it can be serialized to a .bc or .ll file. - GlobalVariable *Serialize(DebugInfoDesc *DD); - - /// addDescriptor - Directly connect DD with existing GV. - void addDescriptor(DebugInfoDesc *DD, GlobalVariable *GV); -}; - -//===----------------------------------------------------------------------===// -/// DIVerifier - This class is responsible for verifying the given network of -/// GlobalVariables are valid as DebugInfoDesc objects. -class DIVerifier { - enum { - Unknown = 0, - Invalid, - Valid - }; - DenseMap Validity; // Tracks prior results. - std::map Counts; // Count of fields per Tag type. -public: - DIVerifier() - : Validity(), Counts() - {} - - /// Verify - Return true if the GlobalVariable appears to be a valid - /// serialization of a DebugInfoDesc. - bool Verify(Value *V); - bool Verify(GlobalVariable *GV); - - /// isVerified - Return true if the specified GV has already been - /// verified as a debug information descriptor. - bool isVerified(GlobalVariable *GV); -}; - -//===----------------------------------------------------------------------===// /// SourceLineInfo - This class is used to record source line correspondence. /// class SourceLineInfo { @@ -867,95 +85,6 @@ }; //===----------------------------------------------------------------------===// -/// SourceFileInfo - This class is used to track source information. -/// -class SourceFileInfo { - unsigned DirectoryID; // Directory ID number. - std::string Name; // File name (not including directory.) -public: - SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {} - - // Accessors - unsigned getDirectoryID() const { return DirectoryID; } - const std::string &getName() const { return Name; } - - /// operator== - Used by UniqueVector to locate entry. - /// - bool operator==(const SourceFileInfo &SI) const { - return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName(); - } - - /// operator< - Used by UniqueVector to locate entry. - /// - bool operator<(const SourceFileInfo &SI) const { - return getDirectoryID() < SI.getDirectoryID() || - (getDirectoryID() == SI.getDirectoryID() && getName() < SI.getName()); - } -}; - -//===----------------------------------------------------------------------===// -/// DebugVariable - This class is used to track local variable information. -/// -class DebugVariable { -private: - VariableDesc *Desc; // Variable Descriptor. - unsigned FrameIndex; // Variable frame index. - -public: - DebugVariable(VariableDesc *D, unsigned I) - : Desc(D) - , FrameIndex(I) - {} - - // Accessors. - VariableDesc *getDesc() const { return Desc; } - unsigned getFrameIndex() const { return FrameIndex; } -}; - -//===----------------------------------------------------------------------===// -/// DebugScope - This class is used to track scope information. -/// -class DebugScope { -private: - DebugScope *Parent; // Parent to this scope. - DebugInfoDesc *Desc; // Debug info descriptor for scope. - // Either subprogram or block. - unsigned StartLabelID; // Label ID of the beginning of scope. - unsigned EndLabelID; // Label ID of the end of scope. - std::vector Scopes; // Scopes defined in scope. - std::vector Variables;// Variables declared in scope. - -public: - DebugScope(DebugScope *P, DebugInfoDesc *D) - : Parent(P) - , Desc(D) - , StartLabelID(0) - , EndLabelID(0) - , Scopes() - , Variables() - {} - ~DebugScope(); - - // Accessors. - DebugScope *getParent() const { return Parent; } - DebugInfoDesc *getDesc() const { return Desc; } - unsigned getStartLabelID() const { return StartLabelID; } - unsigned getEndLabelID() const { return EndLabelID; } - std::vector &getScopes() { return Scopes; } - std::vector &getVariables() { return Variables; } - void setStartLabelID(unsigned S) { StartLabelID = S; } - void setEndLabelID(unsigned E) { EndLabelID = E; } - - /// AddScope - Add a scope to the scope. - /// - void AddScope(DebugScope *S) { Scopes.push_back(S); } - - /// AddVariable - Add a variable to the scope. - /// - void AddVariable(DebugVariable *V) { Variables.push_back(V); } -}; - -//===----------------------------------------------------------------------===// /// LandingPadInfo - This structure is used to retain landing pad info for /// the current function. /// @@ -981,19 +110,6 @@ /// class MachineModuleInfo : public ImmutablePass { private: - // Use the same deserializer/verifier for the module. - DIDeserializer DR; - DIVerifier VR; - - // CompileUnits - Uniquing vector for compile units. - UniqueVector CompileUnits; - - // Directories - Uniquing vector for directories. - UniqueVector Directories; - - // SourceFiles - Uniquing vector for source files. - UniqueVector SourceFiles; - // Lines - List of of source line correspondence. std::vector Lines; @@ -1003,13 +119,6 @@ // another label. std::vector LabelIDList; - // ScopeMap - Tracks the scopes in the current function. - std::map ScopeMap; - - // RootScope - Top level scope for the current function. - // - DebugScope *RootScope; - // FrameMoves - List of moves done by a function's prolog. Used to construct // frame maps by debug and exception handling consumers. std::vector FrameMoves; @@ -1067,19 +176,6 @@ /// void EndFunction(); - /// getDescFor - Convert a Value to a debug information descriptor. - /// - // FIXME - use new Value type when available. - DebugInfoDesc *getDescFor(Value *V); - - /// Verify - Verify that a Value is debug information descriptor. - /// - bool Verify(Value *V) { return VR.Verify(V); } - - /// isVerified - Return true if the specified GV has already been - /// verified as a debug information descriptor. - bool isVerified(GlobalVariable *GV) { return VR.isVerified(GV); } - /// AnalyzeModule - Scan the module for global debug information. /// void AnalyzeModule(Module &M); @@ -1132,82 +228,12 @@ return LabelID ? LabelIDList[LabelID - 1] : 0; } - /// RecordSource - Register a source file with debug info. Returns an source - /// ID. - unsigned RecordSource(const std::string &Directory, - const std::string &Source); - unsigned RecordSource(const CompileUnitDesc *CompileUnit); - - /// getDirectories - Return the UniqueVector of std::string representing - /// directories. - const UniqueVector &getDirectories() const { - return Directories; - } - - /// getSourceFiles - Return the UniqueVector of source files. - /// - const UniqueVector &getSourceFiles() const { - return SourceFiles; - } - /// getSourceLines - Return a vector of source lines. /// const std::vector &getSourceLines() const { return Lines; } - /// SetupCompileUnits - Set up the unique vector of compile units. - /// - void SetupCompileUnits(Module &M); - - /// getCompileUnits - Return a vector of debug compile units. - /// - const UniqueVector getCompileUnits() const; - - /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the - /// named GlobalVariable. - void getGlobalVariablesUsing(Module &M, const std::string &RootName, - std::vector &Result); - - /// getAnchoredDescriptors - Return a vector of anchored debug descriptors. - /// - template - void getAnchoredDescriptors(Module &M, std::vector &AnchoredDescs) { - T Desc; - std::vector Globals; - getGlobalVariablesUsing(M, Desc.getAnchorString(), Globals); - - for (unsigned i = 0, N = Globals.size(); i < N; ++i) { - GlobalVariable *GV = Globals[i]; - - // FIXME - In the short term, changes are too drastic to continue. - if (DebugInfoDesc::TagFromGlobal(GV) == Desc.getTag() && - DebugInfoDesc::VersionFromGlobal(GV) == LLVMDebugVersion) { - AnchoredDescs.push_back(cast(DR.Deserialize(GV))); - } - } - } - - /// RecordRegionStart - Indicate the start of a region. - /// - unsigned RecordRegionStart(Value *V); - - /// RecordRegionEnd - Indicate the end of a region. - /// - unsigned RecordRegionEnd(Value *V); - - /// RecordVariable - Indicate the declaration of a local variable. - /// - void RecordVariable(GlobalValue *GV, unsigned FrameIndex); - - /// getRootScope - Return current functions root scope. - /// - DebugScope *getRootScope() { return RootScope; } - - /// getOrCreateScope - Returns the scope associated with the given descriptor. - /// - DebugScope *getOrCreateScope(DebugInfoDesc *ScopeDesc); - /// getFrameMoves - Returns a reference to a list of moves done in the current /// function's prologue. Used to construct frame maps for debug and exception /// handling comsumers. @@ -1294,7 +320,6 @@ /// of one is required to emit exception handling info. Function *getPersonality() const; - DIDeserializer *getDIDeserializer() { return &DR; } }; // End class MachineModuleInfo } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62199&r1=62198&r2=62199&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 17:54:55 2009 @@ -749,10 +749,6 @@ /// with a source file. class CompileUnit { private: - /// Desc - Compile unit debug descriptor. - /// - CompileUnitDesc *Desc; - /// ID - File identifier for source. /// unsigned ID; @@ -761,14 +757,12 @@ /// DIE *Die; - /// DescToDieMap - Tracks the mapping of unit level debug informaton - /// descriptors to debug information entries. - std::map DescToDieMap; + /// GVToDieMap - Tracks the mapping of unit level debug informaton + /// variables to debug information entries. DenseMap GVToDieMap; - /// DescToDIEntryMap - Tracks the mapping of unit level debug informaton + /// GVToDIEntryMap - Tracks the mapping of unit level debug informaton /// descriptors to debug information entries using a DIEntry proxy. - std::map DescToDIEntryMap; DenseMap GVToDIEntryMap; /// Globals - A map of globally visible named entities for this unit. @@ -785,23 +779,10 @@ public: CompileUnit(unsigned I, DIE *D) - : ID(I), Die(D), DescToDieMap(), GVToDieMap(), DescToDIEntryMap(), + : ID(I), Die(D), GVToDieMap(), GVToDIEntryMap(), Globals(), DiesSet(InitDiesSetSize), Dies() {} - CompileUnit(CompileUnitDesc *CUD, unsigned I, DIE *D) - : Desc(CUD) - , ID(I) - , Die(D) - , DescToDieMap() - , GVToDieMap() - , DescToDIEntryMap() - , GVToDIEntryMap() - , Globals() - , DiesSet(InitDiesSetSize) - , Dies() - {} - ~CompileUnit() { delete Die; @@ -810,7 +791,6 @@ } // Accessors. - CompileUnitDesc *getDesc() const { return Desc; } unsigned getID() const { return ID; } DIE* getDie() const { return Die; } std::map &getGlobals() { return Globals; } @@ -828,19 +808,13 @@ } /// getDieMapSlotFor - Returns the debug information entry map slot for the - /// specified debug descriptor. - DIE *&getDieMapSlotFor(DebugInfoDesc *DID) { - return DescToDieMap[DID]; - } + /// specified debug variable. DIE *&getDieMapSlotFor(GlobalVariable *GV) { return GVToDieMap[GV]; } /// getDIEntrySlotFor - Returns the debug information entry proxy slot for the - /// specified debug descriptor. - DIEntry *&getDIEntrySlotFor(DebugInfoDesc *DID) { - return DescToDIEntryMap[DID]; - } + /// specified debug variable. DIEntry *&getDIEntrySlotFor(GlobalVariable *GV) { return GVToDIEntryMap[GV]; } @@ -1204,7 +1178,7 @@ /// operator== - Used by UniqueVector to locate entry. /// - bool operator==(const SourceFileInfo &SI) const { + bool operator==(const SrcFileInfo &SI) const { return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName(); } @@ -1317,10 +1291,6 @@ /// UniqueVector StringPool; - /// UnitMap - Map debug information descriptor to compile unit. - /// - std::map DescToUnitMap; - /// SectionMap - Provides a unique id per text section. /// UniqueVector SectionMap; @@ -1574,17 +1544,6 @@ /// AddSourceLine - Add location information to specified debug information /// entry. - void AddSourceLine(DIE *Die, CompileUnitDesc *File, unsigned Line) { - if (File && Line) { - CompileUnit *FileUnit = FindCompileUnit(File); - unsigned FileID = FileUnit->getID(); - AddUInt(Die, DW_AT_decl_file, 0, FileID); - AddUInt(Die, DW_AT_decl_line, 0, Line); - } - } - - /// AddSourceLine - Add location information to specified debug information - /// entry. void AddSourceLine(DIE *Die, DIVariable *V) { unsigned FileID = 0; unsigned Line = V->getLineNumber(); @@ -1690,46 +1649,6 @@ } /// AddType - Add a new type attribute to the specified entity. - /// - void AddType(DIE *Entity, TypeDesc *TyDesc, CompileUnit *Unit) { - if (!TyDesc) { - AddBasicType(Entity, Unit, "", DW_ATE_signed, sizeof(int32_t)); - } else { - // Check for pre-existence. - DIEntry *&Slot = Unit->getDIEntrySlotFor(TyDesc); - - // If it exists then use the existing value. - if (Slot) { - Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot); - return; - } - - if (SubprogramDesc *SubprogramTy = dyn_cast(TyDesc)) { - // FIXME - Not sure why programs and variables are coming through here. - // Short cut for handling subprogram types (not really a TyDesc.) - AddPointerType(Entity, Unit, SubprogramTy->getName()); - } else if (GlobalVariableDesc *GlobalTy = - dyn_cast(TyDesc)) { - // FIXME - Not sure why programs and variables are coming through here. - // Short cut for handling global variable types (not really a TyDesc.) - AddPointerType(Entity, Unit, GlobalTy->getName()); - } else { - // Set up proxy. - Slot = NewDIEntry(); - - // Construct type. - DIE Buffer(DW_TAG_base_type); - ConstructType(Buffer, TyDesc, Unit); - - // Add debug information entry to entity and unit. - DIE *Die = Unit->AddDie(Buffer); - SetDIEntry(Slot, Die); - Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot); - } - } - } - - /// AddType - Add a new type attribute to the specified entity. void AddType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) { if (Ty.isNull()) { AddBasicType(Entity, DW_Unit, "", DW_ATE_signed, sizeof(int32_t)); @@ -2040,332 +1959,6 @@ Buffer.AddChild(MemberDie); } - /// ConstructType - Adds all the required attributes to the type. - /// - void ConstructType(DIE &Buffer, TypeDesc *TyDesc, CompileUnit *Unit) { - // Get core information. - const std::string &Name = TyDesc->getName(); - uint64_t Size = TyDesc->getSize() >> 3; - - if (BasicTypeDesc *BasicTy = dyn_cast(TyDesc)) { - // Fundamental types like int, float, bool - Buffer.setTag(DW_TAG_base_type); - AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BasicTy->getEncoding()); - } else if (DerivedTypeDesc *DerivedTy = dyn_cast(TyDesc)) { - // Fetch tag. - unsigned Tag = DerivedTy->getTag(); - // FIXME - Workaround for templates. - if (Tag == DW_TAG_inheritance) Tag = DW_TAG_reference_type; - // Pointers, typedefs et al. - Buffer.setTag(Tag); - // Map to main type, void will not have a type. - if (TypeDesc *FromTy = DerivedTy->getFromType()) - AddType(&Buffer, FromTy, Unit); - } else if (CompositeTypeDesc *CompTy = dyn_cast(TyDesc)){ - // Fetch tag. - unsigned Tag = CompTy->getTag(); - - // Set tag accordingly. - if (Tag == DW_TAG_vector_type) - Buffer.setTag(DW_TAG_array_type); - else - Buffer.setTag(Tag); - - std::vector &Elements = CompTy->getElements(); - - switch (Tag) { - case DW_TAG_vector_type: - AddUInt(&Buffer, DW_AT_GNU_vector, DW_FORM_flag, 1); - // Fall thru - case DW_TAG_array_type: { - // Add element type. - if (TypeDesc *FromTy = CompTy->getFromType()) - AddType(&Buffer, FromTy, Unit); - - // Don't emit size attribute. - Size = 0; - - // Construct an anonymous type for index type. - DIE Buffer(DW_TAG_base_type); - AddUInt(&Buffer, DW_AT_byte_size, 0, sizeof(int32_t)); - AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, DW_ATE_signed); - DIE *IndexTy = Unit->AddDie(Buffer); - - // Add subranges to array type. - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { - SubrangeDesc *SRD = cast(Elements[i]); - int64_t Lo = SRD->getLo(); - int64_t Hi = SRD->getHi(); - DIE *Subrange = new DIE(DW_TAG_subrange_type); - - // If a range is available. - if (Lo != Hi) { - AddDIEntry(Subrange, DW_AT_type, DW_FORM_ref4, IndexTy); - // Only add low if non-zero. - if (Lo) AddSInt(Subrange, DW_AT_lower_bound, 0, Lo); - AddSInt(Subrange, DW_AT_upper_bound, 0, Hi); - } - - Buffer.AddChild(Subrange); - } - break; - } - case DW_TAG_structure_type: - case DW_TAG_union_type: { - // Add elements to structure type. - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { - DebugInfoDesc *Element = Elements[i]; - - if (DerivedTypeDesc *MemberDesc = dyn_cast(Element)){ - // Add field or base class. - unsigned Tag = MemberDesc->getTag(); - - // Extract the basic information. - const std::string &Name = MemberDesc->getName(); - uint64_t Size = MemberDesc->getSize(); - uint64_t Align = MemberDesc->getAlign(); - uint64_t Offset = MemberDesc->getOffset(); - - // Construct member debug information entry. - DIE *Member = new DIE(Tag); - - // Add name if not "". - if (!Name.empty()) - AddString(Member, DW_AT_name, DW_FORM_string, Name); - - // Add location if available. - AddSourceLine(Member, MemberDesc->getFile(), MemberDesc->getLine()); - - // Most of the time the field info is the same as the members. - uint64_t FieldSize = Size; - uint64_t FieldAlign = Align; - uint64_t FieldOffset = Offset; - - // Set the member type. - TypeDesc *FromTy = MemberDesc->getFromType(); - AddType(Member, FromTy, Unit); - - // Walk up typedefs until a real size is found. - while (FromTy) { - if (FromTy->getTag() != DW_TAG_typedef) { - FieldSize = FromTy->getSize(); - FieldAlign = FromTy->getAlign(); - break; - } - - FromTy = cast(FromTy)->getFromType(); - } - - // Unless we have a bit field. - if (Tag == DW_TAG_member && FieldSize != Size) { - // Construct the alignment mask. - uint64_t AlignMask = ~(FieldAlign - 1); - // Determine the high bit + 1 of the declared size. - uint64_t HiMark = (Offset + FieldSize) & AlignMask; - // Work backwards to determine the base offset of the field. - FieldOffset = HiMark - FieldSize; - // Now normalize offset to the field. - Offset -= FieldOffset; - - // Maybe we need to work from the other end. - if (TD->isLittleEndian()) Offset = FieldSize - (Offset + Size); - - // Add size and offset. - AddUInt(Member, DW_AT_byte_size, 0, FieldSize >> 3); - AddUInt(Member, DW_AT_bit_size, 0, Size); - AddUInt(Member, DW_AT_bit_offset, 0, Offset); - } - - // Add computation for offset. - DIEBlock *Block = new DIEBlock(); - AddUInt(Block, 0, DW_FORM_data1, DW_OP_plus_uconst); - AddUInt(Block, 0, DW_FORM_udata, FieldOffset >> 3); - AddBlock(Member, DW_AT_data_member_location, 0, Block); - - // Add accessibility (public default unless is base class. - if (MemberDesc->isProtected()) { - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_protected); - } else if (MemberDesc->isPrivate()) { - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_private); - } else if (Tag == DW_TAG_inheritance) { - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_public); - } - - Buffer.AddChild(Member); - } else if (GlobalVariableDesc *StaticDesc = - dyn_cast(Element)) { - // Add static member. - - // Construct member debug information entry. - DIE *Static = new DIE(DW_TAG_variable); - - // Add name and mangled name. - const std::string &Name = StaticDesc->getName(); - const std::string &LinkageName = StaticDesc->getLinkageName(); - AddString(Static, DW_AT_name, DW_FORM_string, Name); - if (!LinkageName.empty()) { - AddString(Static, DW_AT_MIPS_linkage_name, DW_FORM_string, - LinkageName); - } - - // Add location. - AddSourceLine(Static, StaticDesc->getFile(), StaticDesc->getLine()); - - // Add type. - if (TypeDesc *StaticTy = StaticDesc->getType()) - AddType(Static, StaticTy, Unit); - - // Add flags. - if (!StaticDesc->isStatic()) - AddUInt(Static, DW_AT_external, DW_FORM_flag, 1); - AddUInt(Static, DW_AT_declaration, DW_FORM_flag, 1); - - Buffer.AddChild(Static); - } else if (SubprogramDesc *MethodDesc = - dyn_cast(Element)) { - // Add member function. - - // Construct member debug information entry. - DIE *Method = new DIE(DW_TAG_subprogram); - - // Add name and mangled name. - const std::string &Name = MethodDesc->getName(); - const std::string &LinkageName = MethodDesc->getLinkageName(); - - AddString(Method, DW_AT_name, DW_FORM_string, Name); - bool IsCTor = TyDesc->getName() == Name; - - if (!LinkageName.empty()) { - AddString(Method, DW_AT_MIPS_linkage_name, DW_FORM_string, - LinkageName); - } - - // Add location. - AddSourceLine(Method, MethodDesc->getFile(), MethodDesc->getLine()); - - // Add type. - if (CompositeTypeDesc *MethodTy = - dyn_cast_or_null(MethodDesc->getType())) { - // Get argument information. - std::vector &Args = MethodTy->getElements(); - - // If not a ctor. - if (!IsCTor) { - // Add return type. - AddType(Method, dyn_cast(Args[0]), Unit); - } - - // Add arguments. - for (unsigned i = 1, N = Args.size(); i < N; ++i) { - DIE *Arg = new DIE(DW_TAG_formal_parameter); - AddType(Arg, cast(Args[i]), Unit); - AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1); - Method->AddChild(Arg); - } - } - - // Add flags. - if (!MethodDesc->isStatic()) - AddUInt(Method, DW_AT_external, DW_FORM_flag, 1); - AddUInt(Method, DW_AT_declaration, DW_FORM_flag, 1); - - Buffer.AddChild(Method); - } - } - break; - } - case DW_TAG_enumeration_type: { - // Add enumerators to enumeration type. - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { - EnumeratorDesc *ED = cast(Elements[i]); - const std::string &Name = ED->getName(); - int64_t Value = ED->getValue(); - DIE *Enumerator = new DIE(DW_TAG_enumerator); - AddString(Enumerator, DW_AT_name, DW_FORM_string, Name); - AddSInt(Enumerator, DW_AT_const_value, DW_FORM_sdata, Value); - Buffer.AddChild(Enumerator); - } - - break; - } - case DW_TAG_subroutine_type: { - // Add prototype flag. - AddUInt(&Buffer, DW_AT_prototyped, DW_FORM_flag, 1); - // Add return type. - AddType(&Buffer, dyn_cast(Elements[0]), Unit); - - // Add arguments. - for (unsigned i = 1, N = Elements.size(); i < N; ++i) { - DIE *Arg = new DIE(DW_TAG_formal_parameter); - AddType(Arg, cast(Elements[i]), Unit); - Buffer.AddChild(Arg); - } - - break; - } - default: break; - } - } - - // Add name if not anonymous or intermediate type. - if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name); - - // Add size if non-zero (derived types might be zero-sized.) - if (Size) - AddUInt(&Buffer, DW_AT_byte_size, 0, Size); - else if (isa(TyDesc)) { - // If TyDesc is a composite type, then add size even if it's zero unless - // it's a forward declaration. - if (TyDesc->isForwardDecl()) - AddUInt(&Buffer, DW_AT_declaration, DW_FORM_flag, 1); - else - AddUInt(&Buffer, DW_AT_byte_size, 0, 0); - } - - // Add source line info if available and TyDesc is not a forward - // declaration. - if (!TyDesc->isForwardDecl()) - AddSourceLine(&Buffer, TyDesc->getFile(), TyDesc->getLine()); - } - - /// NewCompileUnit - Create new compile unit and it's debug information entry. - /// - CompileUnit *NewCompileUnit(CompileUnitDesc *UnitDesc, unsigned ID) { - // Construct debug information entry. - DIE *Die = new DIE(DW_TAG_compile_unit); - AddSectionOffset(Die, DW_AT_stmt_list, DW_FORM_data4, - DWLabel("section_line", 0), DWLabel("section_line", 0), false); - AddString(Die, DW_AT_producer, DW_FORM_string, UnitDesc->getProducer()); - AddUInt (Die, DW_AT_language, DW_FORM_data1, UnitDesc->getLanguage()); - AddString(Die, DW_AT_name, DW_FORM_string, UnitDesc->getFileName()); - if (!UnitDesc->getDirectory().empty()) - AddString(Die, DW_AT_comp_dir, DW_FORM_string, UnitDesc->getDirectory()); - - // Construct compile unit. - CompileUnit *Unit = new CompileUnit(UnitDesc, ID, Die); - - // Add Unit to compile unit map. - DescToUnitMap[UnitDesc] = Unit; - - return Unit; - } - - /// GetBaseCompileUnit - Get the main compile unit. - /// - CompileUnit *GetBaseCompileUnit() const { - CompileUnit *Unit = CompileUnits[0]; - assert(Unit && "Missing compile unit."); - return Unit; - } - - /// FindCompileUnit - Get the compile unit for the given descriptor. - /// - CompileUnit *FindCompileUnit(CompileUnitDesc *UnitDesc) { - CompileUnit *Unit = DescToUnitMap[UnitDesc]; - assert(Unit && "Missing compile unit."); - return Unit; - } - /// FindCompileUnit - Get the compile unit for the given descriptor. /// CompileUnit *FindCompileUnit(DICompileUnit Unit) { @@ -2374,136 +1967,7 @@ return DW_Unit; } - /// NewGlobalVariable - Add a new global variable DIE. - /// - DIE *NewGlobalVariable(GlobalVariableDesc *GVD) { - // Get the compile unit context. - CompileUnitDesc *UnitDesc = - static_cast(GVD->getContext()); - CompileUnit *Unit = GetBaseCompileUnit(); - - // Check for pre-existence. - DIE *&Slot = Unit->getDieMapSlotFor(GVD); - if (Slot) return Slot; - - // Get the global variable itself. - GlobalVariable *GV = GVD->getGlobalVariable(); - - const std::string &Name = GVD->getName(); - const std::string &FullName = GVD->getFullName(); - const std::string &LinkageName = GVD->getLinkageName(); - // Create the global's variable DIE. - DIE *VariableDie = new DIE(DW_TAG_variable); - AddString(VariableDie, DW_AT_name, DW_FORM_string, Name); - if (!LinkageName.empty()) { - AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string, - LinkageName); - } - AddType(VariableDie, GVD->getType(), Unit); - if (!GVD->isStatic()) - AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1); - - // Add source line info if available. - AddSourceLine(VariableDie, UnitDesc, GVD->getLine()); - - // Add address. - DIEBlock *Block = new DIEBlock(); - AddUInt(Block, 0, DW_FORM_data1, DW_OP_addr); - AddObjectLabel(Block, 0, DW_FORM_udata, Asm->getGlobalLinkName(GV)); - AddBlock(VariableDie, DW_AT_location, 0, Block); - - // Add to map. - Slot = VariableDie; - - // Add to context owner. - Unit->getDie()->AddChild(VariableDie); - - // Expose as global. - // FIXME - need to check external flag. - Unit->AddGlobal(FullName, VariableDie); - - return VariableDie; - } - - /// NewSubprogram - Add a new subprogram DIE. - /// - DIE *NewSubprogram(SubprogramDesc *SPD) { - // Get the compile unit context. - CompileUnitDesc *UnitDesc = - static_cast(SPD->getContext()); - CompileUnit *Unit = GetBaseCompileUnit(); - - // Check for pre-existence. - DIE *&Slot = Unit->getDieMapSlotFor(SPD); - if (Slot) return Slot; - - // Gather the details (simplify add attribute code.) - const std::string &Name = SPD->getName(); - const std::string &FullName = SPD->getFullName(); - const std::string &LinkageName = SPD->getLinkageName(); - - DIE *SubprogramDie = new DIE(DW_TAG_subprogram); - AddString(SubprogramDie, DW_AT_name, DW_FORM_string, Name); - if (!LinkageName.empty()) { - AddString(SubprogramDie, DW_AT_MIPS_linkage_name, DW_FORM_string, - LinkageName); - } - if (SPD->getType()) AddType(SubprogramDie, SPD->getType(), Unit); - if (!SPD->isStatic()) - AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, 1); - AddUInt(SubprogramDie, DW_AT_prototyped, DW_FORM_flag, 1); - - // Add source line info if available. - AddSourceLine(SubprogramDie, UnitDesc, SPD->getLine()); - - // Add to map. - Slot = SubprogramDie; - - // Add to context owner. - Unit->getDie()->AddChild(SubprogramDie); - - // Expose as global. - Unit->AddGlobal(FullName, SubprogramDie); - - return SubprogramDie; - } - - /// NewScopeVariable - Create a new scope variable. - /// - DIE *NewScopeVariable(DebugVariable *DV, CompileUnit *Unit) { - // Get the descriptor. - VariableDesc *VD = DV->getDesc(); - - // Translate tag to proper Dwarf tag. The result variable is dropped for - // now. - unsigned Tag; - switch (VD->getTag()) { - case DW_TAG_return_variable: return NULL; - case DW_TAG_arg_variable: Tag = DW_TAG_formal_parameter; break; - case DW_TAG_auto_variable: // fall thru - default: Tag = DW_TAG_variable; break; - } - - // Define variable debug information entry. - DIE *VariableDie = new DIE(Tag); - AddString(VariableDie, DW_AT_name, DW_FORM_string, VD->getName()); - - // Add source line info if available. - AddSourceLine(VariableDie, VD->getFile(), VD->getLine()); - - // Add variable type. - AddType(VariableDie, VD->getType(), Unit); - - // Add variable address. - MachineLocation Location; - Location.set(RI->getFrameRegister(*MF), - RI->getFrameIndexOffset(*MF, DV->getFrameIndex())); - AddAddress(VariableDie, DW_AT_location, Location); - - return VariableDie; - } - - /// NewScopeVariable - Create a new scope variable. + /// NewDbgScopeVariable - Create a new scope variable. /// DIE *NewDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit) { // Get the descriptor. @@ -2688,125 +2152,6 @@ #endif } - /// ConstructScope - Construct the components of a scope. - /// - void ConstructScope(DebugScope *ParentScope, - unsigned ParentStartID, unsigned ParentEndID, - DIE *ParentDie, CompileUnit *Unit) { - // Add variables to scope. - std::vector &Variables = ParentScope->getVariables(); - for (unsigned i = 0, N = Variables.size(); i < N; ++i) { - DIE *VariableDie = NewScopeVariable(Variables[i], Unit); - if (VariableDie) ParentDie->AddChild(VariableDie); - } - - // Add nested scopes. - std::vector &Scopes = ParentScope->getScopes(); - for (unsigned j = 0, M = Scopes.size(); j < M; ++j) { - // Define the Scope debug information entry. - DebugScope *Scope = Scopes[j]; - // FIXME - Ignore inlined functions for the time being. - if (!Scope->getParent()) continue; - - unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID()); - unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID()); - - // Ignore empty scopes. - if (StartID == EndID && StartID != 0) continue; - if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue; - - if (StartID == ParentStartID && EndID == ParentEndID) { - // Just add stuff to the parent scope. - ConstructScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit); - } else { - DIE *ScopeDie = new DIE(DW_TAG_lexical_block); - - // Add the scope bounds. - if (StartID) { - AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("label", StartID)); - } else { - AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("func_begin", SubprogramCount)); - } - if (EndID) { - AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("label", EndID)); - } else { - AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("func_end", SubprogramCount)); - } - - // Add the scope contents. - ConstructScope(Scope, StartID, EndID, ScopeDie, Unit); - ParentDie->AddChild(ScopeDie); - } - } - } - - /// ConstructRootScope - Construct the scope for the subprogram. - /// - void ConstructRootScope(DebugScope *RootScope) { - // Exit if there is no root scope. - if (!RootScope) return; - - // Get the subprogram debug information entry. - SubprogramDesc *SPD = cast(RootScope->getDesc()); - - // Get the compile unit context. - CompileUnit *Unit = GetBaseCompileUnit(); - - // Get the subprogram die. - DIE *SPDie = Unit->getDieMapSlotFor(SPD); - assert(SPDie && "Missing subprogram descriptor"); - - // Add the function bounds. - AddLabel(SPDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("func_begin", SubprogramCount)); - AddLabel(SPDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("func_end", SubprogramCount)); - MachineLocation Location(RI->getFrameRegister(*MF)); - AddAddress(SPDie, DW_AT_frame_base, Location); - - ConstructScope(RootScope, 0, 0, SPDie, Unit); - } - - /// ConstructDefaultScope - Construct a default scope for the subprogram. - /// - void ConstructDefaultScope(MachineFunction *MF) { - // Find the correct subprogram descriptor. - std::vector Subprograms; - MMI->getAnchoredDescriptors(*M, Subprograms); - - for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) { - SubprogramDesc *SPD = Subprograms[i]; - - if (SPD->getName() == MF->getFunction()->getName()) { - // Get the compile unit context. - CompileUnit *Unit = GetBaseCompileUnit(); - - // Get the subprogram die. - DIE *SPDie = Unit->getDieMapSlotFor(SPD); - assert(SPDie && "Missing subprogram descriptor"); - - // Add the function bounds. - AddLabel(SPDie, DW_AT_low_pc, DW_FORM_addr, - DWLabel("func_begin", SubprogramCount)); - AddLabel(SPDie, DW_AT_high_pc, DW_FORM_addr, - DWLabel("func_end", SubprogramCount)); - - MachineLocation Location(RI->getFrameRegister(*MF)); - AddAddress(SPDie, DW_AT_frame_base, Location); - return; - } - } -#if 0 - // FIXME: This is causing an abort because C++ mangled names are compared - // with their unmangled counterparts. See PR2885. Don't do this assert. - assert(0 && "Couldn't find DIE for machine function!"); -#endif - } - /// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc /// tools to recognize the object file contains Dwarf information. void EmitInitial() { @@ -3443,18 +2788,6 @@ } } - /// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and - /// header file. - void ConstructCompileUnitDIEs() { - const UniqueVector CUW = MMI->getCompileUnits(); - - for (unsigned i = 1, N = CUW.size(); i <= N; ++i) { - unsigned ID = MMI->RecordSource(CUW[i]); - CompileUnit *Unit = NewCompileUnit(CUW[i], ID); - CompileUnits.push_back(Unit); - } - } - /// ConstructGlobalVariableDIEs - Create DIEs for each of the externally /// visible global variables. void ConstructGlobalVariableDIEs() { @@ -3502,18 +2835,6 @@ } } - /// ConstructGlobalDIEs - Create DIEs for each of the externally visible - /// global variables. - void ConstructGlobalDIEs() { - std::vector GlobalVariables; - MMI->getAnchoredDescriptors(*M, GlobalVariables); - - for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) { - GlobalVariableDesc *GVD = GlobalVariables[i]; - NewGlobalVariable(GVD); - } - } - /// ConstructSubprograms - Create DIEs for each of the externally visible /// subprograms. void ConstructSubprograms() { @@ -3553,18 +2874,6 @@ } } - /// ConstructSubprogramDIEs - Create DIEs for each of the externally visible - /// subprograms. - void ConstructSubprogramDIEs() { - std::vector Subprograms; - MMI->getAnchoredDescriptors(*M, Subprograms); - - for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) { - SubprogramDesc *SPD = Subprograms[i]; - NewSubprogram(SPD); - } - } - public: //===--------------------------------------------------------------------===// // Main entry points. @@ -3577,7 +2886,6 @@ , ValuesSet(InitValuesSetSize) , Values() , StringPool() - , DescToUnitMap() , SectionMap() , SectionSourceLines() , didInitial(false) @@ -3632,47 +2940,6 @@ EmitInitial(); } - /// SetModuleInfo - Set machine module information when it's known that pass - /// manager has created it. Set by the target AsmPrinter. - void SetModuleInfo(MachineModuleInfo *mmi) { - assert (0 && "Who is this?"); - // Make sure initial declarations are made. - if (!MMI && mmi->hasDebugInfo()) { - MMI = mmi; - shouldEmit = true; - - // Create all the compile unit DIEs. - ConstructCompileUnitDIEs(); - - // Create DIEs for each of the externally visible global variables. - ConstructGlobalDIEs(); - - // Create DIEs for each of the externally visible subprograms. - ConstructSubprogramDIEs(); - - // Prime section data. - SectionMap.insert(TAI->getTextSection()); - - // Print out .file directives to specify files for .loc directives. These - // are printed out early so that they precede any .loc directives. - if (TAI->hasDotLocAndDotFile()) { - const UniqueVector &SourceFiles = MMI->getSourceFiles(); - const UniqueVector &Directories = MMI->getDirectories(); - for (unsigned i = 1, e = SourceFiles.size(); i <= e; ++i) { - sys::Path FullPath(Directories[SourceFiles[i].getDirectoryID()]); - bool AppendOk = FullPath.appendComponent(SourceFiles[i].getName()); - assert(AppendOk && "Could not append filename to directory!"); - AppendOk = false; - Asm->EmitFile(i, FullPath.toString()); - Asm->EOL(); - } - } - - // Emit initial sections - EmitInitial(); - } - } - /// BeginModule - Emit all Dwarf sections that should come prior to the /// content. void BeginModule(Module *M) { @@ -4991,3 +4258,4 @@ void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { DD->RecordVariable(GV, FrameIndex); } + Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=62199&r1=62198&r2=62199&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Jan 13 17:54:55 2009 @@ -33,1598 +33,11 @@ char MachineModuleInfo::ID = 0; //===----------------------------------------------------------------------===// - -/// getGlobalVariablesUsing - Return all of the GlobalVariables which have the -/// specified value in their initializer somewhere. -static void -getGlobalVariablesUsing(Value *V, std::vector &Result) { - // Scan though value users. - for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) { - if (GlobalVariable *GV = dyn_cast(*I)) { - // If the user is a GlobalVariable then add to result. - Result.push_back(GV); - } else if (Constant *C = dyn_cast(*I)) { - // If the user is a constant variable then scan its users - getGlobalVariablesUsing(C, Result); - } - } -} - -/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the -/// named GlobalVariable. -static void -getGlobalVariablesUsing(Module &M, const std::string &RootName, - std::vector &Result) { - std::vector FieldTypes; - FieldTypes.push_back(Type::Int32Ty); - FieldTypes.push_back(Type::Int32Ty); - - // Get the GlobalVariable root. - GlobalVariable *UseRoot = M.getGlobalVariable(RootName, - StructType::get(FieldTypes)); - - // If present and linkonce then scan for users. - if (UseRoot && UseRoot->hasLinkOnceLinkage()) - getGlobalVariablesUsing(UseRoot, Result); -} - -/// isStringValue - Return true if the given value can be coerced to a string. -/// -static bool isStringValue(Value *V) { - if (GlobalVariable *GV = dyn_cast(V)) { - if (GV->hasInitializer() && isa(GV->getInitializer())) { - ConstantArray *Init = cast(GV->getInitializer()); - return Init->isString(); - } - } else if (Constant *C = dyn_cast(V)) { - if (GlobalValue *GV = dyn_cast(C)) - return isStringValue(GV); - else if (ConstantExpr *CE = dyn_cast(C)) { - if (CE->getOpcode() == Instruction::GetElementPtr) { - if (CE->getNumOperands() == 3 && - cast(CE->getOperand(1))->isNullValue() && - isa(CE->getOperand(2))) { - return isStringValue(CE->getOperand(0)); - } - } - } - } - return false; -} - -/// getGlobalVariable - Return either a direct or cast Global value. -/// -static GlobalVariable *getGlobalVariable(Value *V) { - if (GlobalVariable *GV = dyn_cast(V)) { - return GV; - } else if (ConstantExpr *CE = dyn_cast(V)) { - if (CE->getOpcode() == Instruction::BitCast) { - return dyn_cast(CE->getOperand(0)); - } else if (CE->getOpcode() == Instruction::GetElementPtr) { - for (unsigned int i=1; igetNumOperands(); i++) { - if (!CE->getOperand(i)->isNullValue()) - return NULL; - } - return dyn_cast(CE->getOperand(0)); - } - } - return NULL; -} - -/// isGlobalVariable - Return true if the given value can be coerced to a -/// GlobalVariable. -static bool isGlobalVariable(Value *V) { - if (isa(V) || isa(V)) { - return true; - } else if (ConstantExpr *CE = dyn_cast(V)) { - if (CE->getOpcode() == Instruction::BitCast) { - return isa(CE->getOperand(0)); - } else if (CE->getOpcode() == Instruction::GetElementPtr) { - for (unsigned int i=1; igetNumOperands(); i++) { - if (!CE->getOperand(i)->isNullValue()) - return false; - } - return isa(CE->getOperand(0)); - } - } - return false; -} - -/// getUIntOperand - Return ith operand if it is an unsigned integer. -/// -static ConstantInt *getUIntOperand(GlobalVariable *GV, unsigned i) { - // Make sure the GlobalVariable has an initializer. - if (!GV->hasInitializer()) return NULL; - - // Get the initializer constant. - ConstantStruct *CI = dyn_cast(GV->getInitializer()); - if (!CI) return NULL; - - // Check if there is at least i + 1 operands. - unsigned N = CI->getNumOperands(); - if (i >= N) return NULL; - - // Check constant. - return dyn_cast(CI->getOperand(i)); -} - -//===----------------------------------------------------------------------===// - -static unsigned CountFields(DebugInfoDesc *DD) { - unsigned Count = 0; - - switch (DD->getTag()) { - case DW_TAG_anchor: // AnchorDesc - // Tag - // AnchorTag - Count = 2; - break; - case DW_TAG_compile_unit: // CompileUnitDesc - // [DW_TAG_anchor] - // if (Version == 0) DebugVersion - // Language - // FileName - // Directory - // Producer - Count = 6; - - // Handle cases out of sync with compiler. - if (DD->getVersion() == 0) - ++Count; - - break; - case DW_TAG_variable: // GlobalVariableDesc - // [DW_TAG_anchor] - // Context - // Name - // FullName - // LinkageName - // File - // Line - // TyDesc - // IsStatic - // IsDefinition - // Global - Count = 12; - break; - case DW_TAG_subprogram: // SubprogramDesc - // [DW_TAG_anchor] - // Context - // Name - // FullName - // LinkageName - // File - // Line - // TyDesc - // IsStatic - // IsDefinition - Count = 11; - break; - case DW_TAG_lexical_block: // BlockDesc - // Tag - // Context - Count = 2; - break; - case DW_TAG_base_type: // BasicTypeDesc - // Tag - // Context - // Name - // File - // Line - // Size - // Align - // Offset - // if (Version > LLVMDebugVersion4) Flags - // Encoding - Count = 9; - - if (DD->getVersion() > LLVMDebugVersion4) - ++Count; - - break; - case DW_TAG_typedef: - case DW_TAG_pointer_type: - case DW_TAG_reference_type: - case DW_TAG_const_type: - case DW_TAG_volatile_type: - case DW_TAG_restrict_type: - case DW_TAG_member: - case DW_TAG_inheritance: // DerivedTypeDesc - // Tag - // Context - // Name - // File - // Line - // Size - // Align - // Offset - // if (Version > LLVMDebugVersion4) Flags - // FromType - Count = 9; - - if (DD->getVersion() > LLVMDebugVersion4) - ++Count; - - break; - case DW_TAG_array_type: - case DW_TAG_structure_type: - case DW_TAG_union_type: - case DW_TAG_enumeration_type: - case DW_TAG_vector_type: - case DW_TAG_subroutine_type: // CompositeTypeDesc - // Tag - // Context - // Name - // File - // Line - // Size - // Align - // Offset - // if (Version > LLVMDebugVersion4) Flags - // FromType - // Elements - Count = 10; - - if (DD->getVersion() > LLVMDebugVersion4) - ++Count; - - break; - case DW_TAG_subrange_type: // SubrangeDesc - // Tag - // Lo - // Hi - Count = 3; - break; - case DW_TAG_enumerator: // EnumeratorDesc - // Tag - // Name - // Value - Count = 3; - break; - case DW_TAG_return_variable: - case DW_TAG_arg_variable: - case DW_TAG_auto_variable: // VariableDesc - // Tag - // Context - // Name - // File - // Line - // TyDesc - Count = 6; - break; - default: - break; - } - - return Count; -} - -//===----------------------------------------------------------------------===// - -/// ApplyToFields - Target the visitor to each field of the debug information -/// descriptor. -void DIVisitor::ApplyToFields(DebugInfoDesc *DD) { - DD->ApplyToFields(this); -} - -namespace { - -//===----------------------------------------------------------------------===// -/// DIDeserializeVisitor - This DIVisitor deserializes all the fields in the -/// supplied DebugInfoDesc. -class DIDeserializeVisitor : public DIVisitor { -private: - DIDeserializer &DR; // Active deserializer. - unsigned I; // Current operand index. - ConstantStruct *CI; // GlobalVariable constant initializer. - -public: - DIDeserializeVisitor(DIDeserializer &D, GlobalVariable *GV) - : DIVisitor(), DR(D), I(0), CI(cast(GV->getInitializer())) - {} - - /// Apply - Set the value of each of the fields. - /// - virtual void Apply(int &Field) { - Constant *C = CI->getOperand(I++); - Field = cast(C)->getSExtValue(); - } - virtual void Apply(unsigned &Field) { - Constant *C = CI->getOperand(I++); - Field = cast(C)->getZExtValue(); - } - virtual void Apply(int64_t &Field) { - Constant *C = CI->getOperand(I++); - Field = cast(C)->getSExtValue(); - } - virtual void Apply(uint64_t &Field) { - Constant *C = CI->getOperand(I++); - Field = cast(C)->getZExtValue(); - } - virtual void Apply(bool &Field) { - Constant *C = CI->getOperand(I++); - Field = cast(C)->getZExtValue(); - } - virtual void Apply(std::string &Field) { - Constant *C = CI->getOperand(I++); - // Fills in the string if it succeeds - if (!GetConstantStringInfo(C, Field)) - Field.clear(); - } - virtual void Apply(DebugInfoDesc *&Field) { - Constant *C = CI->getOperand(I++); - Field = DR.Deserialize(C); - } - virtual void Apply(GlobalVariable *&Field) { - Constant *C = CI->getOperand(I++); - Field = getGlobalVariable(C); - } - virtual void Apply(std::vector &Field) { - Field.resize(0); - Constant *C = CI->getOperand(I++); - GlobalVariable *GV = getGlobalVariable(C); - if (GV && GV->hasInitializer()) { - if (ConstantArray *CA = dyn_cast(GV->getInitializer())) { - for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) { - GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i)); - DebugInfoDesc *DE = DR.Deserialize(GVE); - Field.push_back(DE); - } - } else if (GV->getInitializer()->isNullValue()) { - if (const ArrayType *T = - dyn_cast(GV->getType()->getElementType())) { - Field.resize(T->getNumElements()); - } - } - } - } -}; - -//===----------------------------------------------------------------------===// -/// DISerializeVisitor - This DIVisitor serializes all the fields in -/// the supplied DebugInfoDesc. -class DISerializeVisitor : public DIVisitor { -private: - DISerializer &SR; // Active serializer. - std::vector &Elements; // Element accumulator. - -public: - DISerializeVisitor(DISerializer &S, std::vector &E) - : DIVisitor() - , SR(S) - , Elements(E) - {} - - /// Apply - Set the value of each of the fields. - /// - virtual void Apply(int &Field) { - Elements.push_back(ConstantInt::get(Type::Int32Ty, int32_t(Field))); - } - virtual void Apply(unsigned &Field) { - Elements.push_back(ConstantInt::get(Type::Int32Ty, uint32_t(Field))); - } - virtual void Apply(int64_t &Field) { - Elements.push_back(ConstantInt::get(Type::Int64Ty, int64_t(Field))); - } - virtual void Apply(uint64_t &Field) { - Elements.push_back(ConstantInt::get(Type::Int64Ty, uint64_t(Field))); - } - virtual void Apply(bool &Field) { - Elements.push_back(ConstantInt::get(Type::Int1Ty, Field)); - } - virtual void Apply(std::string &Field) { - Elements.push_back(SR.getString(Field)); - } - virtual void Apply(DebugInfoDesc *&Field) { - GlobalVariable *GV = NULL; - - // If non-NULL then convert to global. - if (Field) GV = SR.Serialize(Field); - - // FIXME - At some point should use specific type. - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - - if (GV) { - // Set to pointer to global. - Elements.push_back(ConstantExpr::getBitCast(GV, EmptyTy)); - } else { - // Use NULL. - Elements.push_back(ConstantPointerNull::get(EmptyTy)); - } - } - virtual void Apply(GlobalVariable *&Field) { - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - if (Field) { - Elements.push_back(ConstantExpr::getBitCast(Field, EmptyTy)); - } else { - Elements.push_back(ConstantPointerNull::get(EmptyTy)); - } - } - virtual void Apply(std::vector &Field) { - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - unsigned N = Field.size(); - ArrayType *AT = ArrayType::get(EmptyTy, N); - std::vector ArrayElements; - - for (unsigned i = 0, N = Field.size(); i < N; ++i) { - if (DebugInfoDesc *Element = Field[i]) { - GlobalVariable *GVE = SR.Serialize(Element); - Constant *CE = ConstantExpr::getBitCast(GVE, EmptyTy); - ArrayElements.push_back(cast(CE)); - } else { - ArrayElements.push_back(ConstantPointerNull::get(EmptyTy)); - } - } - - Constant *CA = ConstantArray::get(AT, ArrayElements); - GlobalVariable *CAGV = new GlobalVariable(AT, true, - GlobalValue::InternalLinkage, - CA, "llvm.dbg.array", - SR.getModule()); - CAGV->setSection("llvm.metadata"); - Constant *CAE = ConstantExpr::getBitCast(CAGV, EmptyTy); - Elements.push_back(CAE); - } -}; - -//===----------------------------------------------------------------------===// -/// DIGetTypesVisitor - This DIVisitor gathers all the field types in -/// the supplied DebugInfoDesc. -class DIGetTypesVisitor : public DIVisitor { -private: - DISerializer &SR; // Active serializer. - std::vector &Fields; // Type accumulator. - -public: - DIGetTypesVisitor(DISerializer &S, std::vector &F) - : DIVisitor() - , SR(S) - , Fields(F) - {} - - /// Apply - Set the value of each of the fields. - /// - virtual void Apply(int &Field) { - Fields.push_back(Type::Int32Ty); - } - virtual void Apply(unsigned &Field) { - Fields.push_back(Type::Int32Ty); - } - virtual void Apply(int64_t &Field) { - Fields.push_back(Type::Int64Ty); - } - virtual void Apply(uint64_t &Field) { - Fields.push_back(Type::Int64Ty); - } - virtual void Apply(bool &Field) { - Fields.push_back(Type::Int1Ty); - } - virtual void Apply(std::string &Field) { - Fields.push_back(SR.getStrPtrType()); - } - virtual void Apply(DebugInfoDesc *&Field) { - // FIXME - At some point should use specific type. - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - Fields.push_back(EmptyTy); - } - virtual void Apply(GlobalVariable *&Field) { - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - Fields.push_back(EmptyTy); - } - virtual void Apply(std::vector &Field) { - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); - Fields.push_back(EmptyTy); - } -}; - -//===----------------------------------------------------------------------===// -/// DIVerifyVisitor - This DIVisitor verifies all the field types against -/// a constant initializer. -class DIVerifyVisitor : public DIVisitor { -private: - DIVerifier &VR; // Active verifier. - bool IsValid; // Validity status. - unsigned I; // Current operand index. - ConstantStruct *CI; // GlobalVariable constant initializer. - -public: - DIVerifyVisitor(DIVerifier &V, GlobalVariable *GV) - : DIVisitor() - , VR(V) - , IsValid(true) - , I(0) - , CI(cast(GV->getInitializer())) - { - } - // Accessors. - bool isValid() const { return IsValid; } - - /// Apply - Set the value of each of the fields. - /// - virtual void Apply(int &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isa(C); - } - virtual void Apply(unsigned &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isa(C); - } - virtual void Apply(int64_t &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isa(C); - } - virtual void Apply(uint64_t &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isa(C); - } - virtual void Apply(bool &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isa(C) && C->getType() == Type::Int1Ty; - } - virtual void Apply(std::string &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && - (!C || isStringValue(C) || C->isNullValue()); - } - virtual void Apply(DebugInfoDesc *&Field) { - // FIXME - Prepare the correct descriptor. - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isGlobalVariable(C); - } - virtual void Apply(GlobalVariable *&Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isGlobalVariable(C); - } - virtual void Apply(std::vector &Field) { - Constant *C = CI->getOperand(I++); - IsValid = IsValid && isGlobalVariable(C); - if (!IsValid) return; - - GlobalVariable *GV = getGlobalVariable(C); - IsValid = IsValid && GV && GV->hasInitializer(); - if (!IsValid) return; - - ConstantArray *CA = dyn_cast(GV->getInitializer()); - IsValid = IsValid && CA; - if (!IsValid) return; - - for (unsigned i = 0, N = CA->getNumOperands(); IsValid && i < N; ++i) { - IsValid = IsValid && isGlobalVariable(CA->getOperand(i)); - if (!IsValid) return; - - GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i)); - VR.Verify(GVE); - } - } -}; - -} - -//===----------------------------------------------------------------------===// - -/// TagFromGlobal - Returns the tag number from a debug info descriptor -/// GlobalVariable. Return DIIValid if operand is not an unsigned int. -unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) { - ConstantInt *C = getUIntOperand(GV, 0); - return C ? ((unsigned)C->getZExtValue() & ~LLVMDebugVersionMask) : - (unsigned)DW_TAG_invalid; -} - -/// VersionFromGlobal - Returns the version number from a debug info -/// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned -/// int. -unsigned DebugInfoDesc::VersionFromGlobal(GlobalVariable *GV) { - ConstantInt *C = getUIntOperand(GV, 0); - return C ? ((unsigned)C->getZExtValue() & LLVMDebugVersionMask) : - (unsigned)DW_TAG_invalid; -} - -/// DescFactory - Create an instance of debug info descriptor based on Tag. -/// Return NULL if not a recognized Tag. -DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) { - switch (Tag) { - case DW_TAG_anchor: return new AnchorDesc(); - case DW_TAG_compile_unit: return new CompileUnitDesc(); - case DW_TAG_variable: return new GlobalVariableDesc(); - case DW_TAG_subprogram: return new SubprogramDesc(); - case DW_TAG_lexical_block: return new BlockDesc(); - case DW_TAG_base_type: return new BasicTypeDesc(); - case DW_TAG_typedef: - case DW_TAG_pointer_type: - case DW_TAG_reference_type: - case DW_TAG_const_type: - case DW_TAG_volatile_type: - case DW_TAG_restrict_type: - case DW_TAG_member: - case DW_TAG_inheritance: return new DerivedTypeDesc(Tag); - case DW_TAG_array_type: - case DW_TAG_structure_type: - case DW_TAG_union_type: - case DW_TAG_enumeration_type: - case DW_TAG_vector_type: - case DW_TAG_subroutine_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: - case DW_TAG_arg_variable: - case DW_TAG_auto_variable: return new VariableDesc(Tag); - default: break; - } - return NULL; -} - -/// getLinkage - get linkage appropriate for this type of descriptor. -/// -GlobalValue::LinkageTypes DebugInfoDesc::getLinkage() const { - return GlobalValue::InternalLinkage; -} - -/// ApplyToFields - Target the vistor to the fields of the descriptor. -/// -void DebugInfoDesc::ApplyToFields(DIVisitor *Visitor) { - Visitor->Apply(Tag); -} - -//===----------------------------------------------------------------------===// - -AnchorDesc::AnchorDesc() -: DebugInfoDesc(DW_TAG_anchor) -, AnchorTag(0) -{} -AnchorDesc::AnchorDesc(AnchoredDesc *D) -: DebugInfoDesc(DW_TAG_anchor) -, AnchorTag(D->getTag()) -{} - -// Implement isa/cast/dyncast. -bool AnchorDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_anchor; -} - -/// getLinkage - get linkage appropriate for this type of descriptor. -/// -GlobalValue::LinkageTypes AnchorDesc::getLinkage() const { - return GlobalValue::LinkOnceLinkage; -} - -/// ApplyToFields - Target the visitor to the fields of the TransUnitDesc. -/// -void AnchorDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(AnchorTag); -} - -/// getDescString - Return a string used to compose global names and labels. A -/// A global variable name needs to be defined for each debug descriptor that is -/// anchored. NOTE: that each global variable named here also needs to be added -/// to the list of names left external in the internalizer. -/// ExternalNames.insert("llvm.dbg.compile_units"); -/// ExternalNames.insert("llvm.dbg.global_variables"); -/// ExternalNames.insert("llvm.dbg.subprograms"); -const char *AnchorDesc::getDescString() const { - switch (AnchorTag) { - case DW_TAG_compile_unit: return CompileUnitDesc::AnchorString; - case DW_TAG_variable: return GlobalVariableDesc::AnchorString; - case DW_TAG_subprogram: return SubprogramDesc::AnchorString; - default: break; - } - - assert(0 && "Tag does not have a case for anchor string"); - return ""; -} - -/// getTypeString - Return a string used to label this descriptors type. -/// -const char *AnchorDesc::getTypeString() const { - return "llvm.dbg.anchor.type"; -} - -#ifndef NDEBUG -void AnchorDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "AnchorTag(" << AnchorTag << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -AnchoredDesc::AnchoredDesc(unsigned T) -: DebugInfoDesc(T) -, Anchor(NULL) -{} - -/// ApplyToFields - Target the visitor to the fields of the AnchoredDesc. -/// -void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Anchor); -} - -//===----------------------------------------------------------------------===// - -CompileUnitDesc::CompileUnitDesc() -: AnchoredDesc(DW_TAG_compile_unit) -, Language(0) -, FileName("") -, Directory("") -, Producer("") -{} - -// Implement isa/cast/dyncast. -bool CompileUnitDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_compile_unit; -} - -/// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc. -/// -void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) { - AnchoredDesc::ApplyToFields(Visitor); - - // Handle cases out of sync with compiler. - if (getVersion() == 0) { - unsigned DebugVersion; - Visitor->Apply(DebugVersion); - } - - Visitor->Apply(Language); - Visitor->Apply(FileName); - Visitor->Apply(Directory); - Visitor->Apply(Producer); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *CompileUnitDesc::getDescString() const { - return "llvm.dbg.compile_unit"; -} - -/// getTypeString - Return a string used to label this descriptors type. -/// -const char *CompileUnitDesc::getTypeString() const { - return "llvm.dbg.compile_unit.type"; -} - -/// getAnchorString - Return a string used to label this descriptor's anchor. -/// -const char *const CompileUnitDesc::AnchorString = "llvm.dbg.compile_units"; -const char *CompileUnitDesc::getAnchorString() const { - return AnchorString; -} - -#ifndef NDEBUG -void CompileUnitDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Anchor(" << getAnchor() << "), " - << "Language(" << Language << "), " - << "FileName(\"" << FileName << "\"), " - << "Directory(\"" << Directory << "\"), " - << "Producer(\"" << Producer << "\")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -TypeDesc::TypeDesc(unsigned T) -: DebugInfoDesc(T) -, Context(NULL) -, Name("") -, File(NULL) -, Line(0) -, Size(0) -, Align(0) -, Offset(0) -, Flags(0) -{} - -/// ApplyToFields - Target the visitor to the fields of the TypeDesc. -/// -void TypeDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Context); - Visitor->Apply(Name); - Visitor->Apply(File); - Visitor->Apply(Line); - Visitor->Apply(Size); - Visitor->Apply(Align); - Visitor->Apply(Offset); - if (getVersion() > LLVMDebugVersion4) Visitor->Apply(Flags); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *TypeDesc::getDescString() const { - return "llvm.dbg.type"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *TypeDesc::getTypeString() const { - return "llvm.dbg.type.type"; -} - -#ifndef NDEBUG -void TypeDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Context(" << Context << "), " - << "Name(\"" << Name << "\"), " - << "File(" << File << "), " - << "Line(" << Line << "), " - << "Size(" << Size << "), " - << "Align(" << Align << "), " - << "Offset(" << Offset << "), " - << "Flags(" << Flags << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -BasicTypeDesc::BasicTypeDesc() -: TypeDesc(DW_TAG_base_type) -, Encoding(0) -{} - -// Implement isa/cast/dyncast. -bool BasicTypeDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_base_type; -} - -/// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc. -/// -void BasicTypeDesc::ApplyToFields(DIVisitor *Visitor) { - TypeDesc::ApplyToFields(Visitor); - - Visitor->Apply(Encoding); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *BasicTypeDesc::getDescString() const { - return "llvm.dbg.basictype"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *BasicTypeDesc::getTypeString() const { - return "llvm.dbg.basictype.type"; -} - -#ifndef NDEBUG -void BasicTypeDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Context(" << getContext() << "), " - << "Name(\"" << getName() << "\"), " - << "Size(" << getSize() << "), " - << "Encoding(" << Encoding << ")," - << "Flags(" << Flags << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -DerivedTypeDesc::DerivedTypeDesc(unsigned T) -: TypeDesc(T) -, FromType(NULL) -{} - -// Implement isa/cast/dyncast. -bool DerivedTypeDesc::classof(const DebugInfoDesc *D) { - unsigned T = D->getTag(); - switch (T) { - case DW_TAG_typedef: - case DW_TAG_pointer_type: - case DW_TAG_reference_type: - case DW_TAG_const_type: - case DW_TAG_volatile_type: - case DW_TAG_restrict_type: - case DW_TAG_member: - case DW_TAG_inheritance: - return true; - default: break; - } - return false; -} - -/// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc. -/// -void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) { - TypeDesc::ApplyToFields(Visitor); - - Visitor->Apply(FromType); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *DerivedTypeDesc::getDescString() const { - return "llvm.dbg.derivedtype"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *DerivedTypeDesc::getTypeString() const { - return "llvm.dbg.derivedtype.type"; -} - -#ifndef NDEBUG -void DerivedTypeDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Context(" << getContext() << "), " - << "Name(\"" << getName() << "\"), " - << "Size(" << getSize() << "), " - << "File(" << getFile() << "), " - << "Line(" << getLine() << "), " - << "FromType(" << FromType << ")," - << "Flags(" << Flags << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -CompositeTypeDesc::CompositeTypeDesc(unsigned T) -: DerivedTypeDesc(T) -, Elements() -{} - -// Implement isa/cast/dyncast. -bool CompositeTypeDesc::classof(const DebugInfoDesc *D) { - unsigned T = D->getTag(); - switch (T) { - case DW_TAG_array_type: - case DW_TAG_structure_type: - case DW_TAG_union_type: - case DW_TAG_enumeration_type: - case DW_TAG_vector_type: - case DW_TAG_subroutine_type: - return true; - default: break; - } - return false; -} - -/// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc. -/// -void CompositeTypeDesc::ApplyToFields(DIVisitor *Visitor) { - DerivedTypeDesc::ApplyToFields(Visitor); - - Visitor->Apply(Elements); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *CompositeTypeDesc::getDescString() const { - return "llvm.dbg.compositetype"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *CompositeTypeDesc::getTypeString() const { - return "llvm.dbg.compositetype.type"; -} - -#ifndef NDEBUG -void CompositeTypeDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Context(" << getContext() << "), " - << "Name(\"" << getName() << "\"), " - << "Size(" << getSize() << "), " - << "File(" << getFile() << "), " - << "Line(" << getLine() << "), " - << "FromType(" << getFromType() << "), " - << "Elements.size(" << Elements.size() << ")," - << "Flags(" << Flags << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -SubrangeDesc::SubrangeDesc() -: DebugInfoDesc(DW_TAG_subrange_type) -, Lo(0) -, Hi(0) -{} - -// Implement isa/cast/dyncast. -bool SubrangeDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_subrange_type; -} - -/// ApplyToFields - Target the visitor to the fields of the SubrangeDesc. -/// -void SubrangeDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Lo); - Visitor->Apply(Hi); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *SubrangeDesc::getDescString() const { - return "llvm.dbg.subrange"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *SubrangeDesc::getTypeString() const { - return "llvm.dbg.subrange.type"; -} - -#ifndef NDEBUG -void SubrangeDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Lo(" << Lo << "), " - << "Hi(" << Hi << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -EnumeratorDesc::EnumeratorDesc() -: DebugInfoDesc(DW_TAG_enumerator) -, Name("") -, Value(0) -{} - -// Implement isa/cast/dyncast. -bool EnumeratorDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_enumerator; -} - -/// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc. -/// -void EnumeratorDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Name); - Visitor->Apply(Value); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *EnumeratorDesc::getDescString() const { - return "llvm.dbg.enumerator"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *EnumeratorDesc::getTypeString() const { - return "llvm.dbg.enumerator.type"; -} - -#ifndef NDEBUG -void EnumeratorDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Name(" << Name << "), " - << "Value(" << Value << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -VariableDesc::VariableDesc(unsigned T) -: DebugInfoDesc(T) -, Context(NULL) -, Name("") -, File(NULL) -, Line(0) -, TyDesc(0) -{} - -// Implement isa/cast/dyncast. -bool VariableDesc::classof(const DebugInfoDesc *D) { - unsigned T = D->getTag(); - switch (T) { - case DW_TAG_auto_variable: - case DW_TAG_arg_variable: - case DW_TAG_return_variable: - return true; - default: break; - } - return false; -} - -/// ApplyToFields - Target the visitor to the fields of the VariableDesc. -/// -void VariableDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Context); - Visitor->Apply(Name); - Visitor->Apply(File); - Visitor->Apply(Line); - Visitor->Apply(TyDesc); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *VariableDesc::getDescString() const { - return "llvm.dbg.variable"; -} - -/// getTypeString - Return a string used to label this descriptor's type. -/// -const char *VariableDesc::getTypeString() const { - return "llvm.dbg.variable.type"; -} - -#ifndef NDEBUG -void VariableDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Context(" << Context << "), " - << "Name(\"" << Name << "\"), " - << "File(" << File << "), " - << "Line(" << Line << "), " - << "TyDesc(" << TyDesc << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -GlobalDesc::GlobalDesc(unsigned T) -: AnchoredDesc(T) -, Context(0) -, Name("") -, FullName("") -, LinkageName("") -, File(NULL) -, Line(0) -, TyDesc(NULL) -, IsStatic(false) -, IsDefinition(false) -{} - -/// ApplyToFields - Target the visitor to the fields of the global. -/// -void GlobalDesc::ApplyToFields(DIVisitor *Visitor) { - AnchoredDesc::ApplyToFields(Visitor); - - Visitor->Apply(Context); - Visitor->Apply(Name); - Visitor->Apply(FullName); - Visitor->Apply(LinkageName); - Visitor->Apply(File); - Visitor->Apply(Line); - Visitor->Apply(TyDesc); - Visitor->Apply(IsStatic); - Visitor->Apply(IsDefinition); -} - -//===----------------------------------------------------------------------===// - -GlobalVariableDesc::GlobalVariableDesc() -: GlobalDesc(DW_TAG_variable) -, Global(NULL) -{} - -// Implement isa/cast/dyncast. -bool GlobalVariableDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_variable; -} - -/// ApplyToFields - Target the visitor to the fields of the GlobalVariableDesc. -/// -void GlobalVariableDesc::ApplyToFields(DIVisitor *Visitor) { - GlobalDesc::ApplyToFields(Visitor); - - Visitor->Apply(Global); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *GlobalVariableDesc::getDescString() const { - return "llvm.dbg.global_variable"; -} - -/// getTypeString - Return a string used to label this descriptors type. -/// -const char *GlobalVariableDesc::getTypeString() const { - return "llvm.dbg.global_variable.type"; -} - -/// getAnchorString - Return a string used to label this descriptor's anchor. -/// -const char *const GlobalVariableDesc::AnchorString = "llvm.dbg.global_variables"; -const char *GlobalVariableDesc::getAnchorString() const { - return AnchorString; -} - -#ifndef NDEBUG -void GlobalVariableDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Anchor(" << getAnchor() << "), " - << "Name(\"" << getName() << "\"), " - << "FullName(\"" << getFullName() << "\"), " - << "LinkageName(\"" << getLinkageName() << "\"), " - << "File(" << getFile() << ")," - << "Line(" << getLine() << ")," - << "Type(" << getType() << "), " - << "IsStatic(" << (isStatic() ? "true" : "false") << "), " - << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), " - << "Global(" << Global << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -SubprogramDesc::SubprogramDesc() -: GlobalDesc(DW_TAG_subprogram) -{} - -// Implement isa/cast/dyncast. -bool SubprogramDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_subprogram; -} - -/// ApplyToFields - Target the visitor to the fields of the -/// SubprogramDesc. -void SubprogramDesc::ApplyToFields(DIVisitor *Visitor) { - GlobalDesc::ApplyToFields(Visitor); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *SubprogramDesc::getDescString() const { - return "llvm.dbg.subprogram"; -} - -/// getTypeString - Return a string used to label this descriptors type. -/// -const char *SubprogramDesc::getTypeString() const { - return "llvm.dbg.subprogram.type"; -} - -/// getAnchorString - Return a string used to label this descriptor's anchor. -/// -const char *const SubprogramDesc::AnchorString = "llvm.dbg.subprograms"; -const char *SubprogramDesc::getAnchorString() const { - return AnchorString; -} - -#ifndef NDEBUG -void SubprogramDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << "), " - << "Anchor(" << getAnchor() << "), " - << "Name(\"" << getName() << "\"), " - << "FullName(\"" << getFullName() << "\"), " - << "LinkageName(\"" << getLinkageName() << "\"), " - << "File(" << getFile() << ")," - << "Line(" << getLine() << ")," - << "Type(" << getType() << "), " - << "IsStatic(" << (isStatic() ? "true" : "false") << "), " - << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -BlockDesc::BlockDesc() -: DebugInfoDesc(DW_TAG_lexical_block) -, Context(NULL) -{} - -// Implement isa/cast/dyncast. -bool BlockDesc::classof(const DebugInfoDesc *D) { - return D->getTag() == DW_TAG_lexical_block; -} - -/// ApplyToFields - Target the visitor to the fields of the BlockDesc. -/// -void BlockDesc::ApplyToFields(DIVisitor *Visitor) { - DebugInfoDesc::ApplyToFields(Visitor); - - Visitor->Apply(Context); -} - -/// getDescString - Return a string used to compose global names and labels. -/// -const char *BlockDesc::getDescString() const { - return "llvm.dbg.block"; -} - -/// getTypeString - Return a string used to label this descriptors type. -/// -const char *BlockDesc::getTypeString() const { - return "llvm.dbg.block.type"; -} - -#ifndef NDEBUG -void BlockDesc::dump() { - cerr << getDescString() << " " - << "Version(" << getVersion() << "), " - << "Tag(" << getTag() << ")," - << "Context(" << Context << ")\n"; -} -#endif - -//===----------------------------------------------------------------------===// - -DebugInfoDesc *DIDeserializer::Deserialize(Value *V) { - return Deserialize(getGlobalVariable(V)); -} -DebugInfoDesc *DIDeserializer::Deserialize(GlobalVariable *GV) { - // Handle NULL. - if (!GV) return NULL; - - // Check to see if it has been already deserialized. - DebugInfoDesc *&Slot = GlobalDescs[GV]; - if (Slot) return Slot; - - // Get the Tag from the global. - unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); - - // Create an empty instance of the correct sort. - Slot = DebugInfoDesc::DescFactory(Tag); - - // If not a user defined descriptor. - if (Slot) { - // Deserialize the fields. - DIDeserializeVisitor DRAM(*this, GV); - DRAM.ApplyToFields(Slot); - } - - return Slot; -} - -//===----------------------------------------------------------------------===// - -/// getStrPtrType - Return a "sbyte *" type. -/// -const PointerType *DISerializer::getStrPtrType() { - // If not already defined. - if (!StrPtrTy) { - // Construct the pointer to signed bytes. - StrPtrTy = PointerType::getUnqual(Type::Int8Ty); - } - - return StrPtrTy; -} - -/// getEmptyStructPtrType - Return a "{ }*" type. -/// -const PointerType *DISerializer::getEmptyStructPtrType() { - // If not already defined. - if (EmptyStructPtrTy) return EmptyStructPtrTy; - - // Construct the pointer to empty structure type. - const StructType *EmptyStructTy = StructType::get(NULL, NULL); - - // Construct the pointer to empty structure type. - EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy); - return EmptyStructPtrTy; -} - -/// getTagType - Return the type describing the specified descriptor (via tag.) -/// -const StructType *DISerializer::getTagType(DebugInfoDesc *DD) { - // Attempt to get the previously defined type. - StructType *&Ty = TagTypes[DD->getTag()]; - - // If not already defined. - if (!Ty) { - // Set up fields vector. - std::vector Fields; - // Get types of fields. - DIGetTypesVisitor GTAM(*this, Fields); - GTAM.ApplyToFields(DD); - - // Construct structured type. - Ty = StructType::get(Fields); - - // Register type name with module. - M->addTypeName(DD->getTypeString(), Ty); - } - - return Ty; -} - -/// getString - Construct the string as constant string global. -/// -Constant *DISerializer::getString(const std::string &String) { - // Check string cache for previous edition. - Constant *&Slot = StringCache[String]; - - // Return Constant if previously defined. - if (Slot) return Slot; - - // If empty string then use a sbyte* null instead. - if (String.empty()) { - Slot = ConstantPointerNull::get(getStrPtrType()); - } else { - // Construct string as an llvm constant. - Constant *ConstStr = ConstantArray::get(String); - - // Otherwise create and return a new string global. - GlobalVariable *StrGV = new GlobalVariable(ConstStr->getType(), true, - GlobalVariable::InternalLinkage, - ConstStr, ".str", M); - StrGV->setSection("llvm.metadata"); - - // Convert to generic string pointer. - Slot = ConstantExpr::getBitCast(StrGV, getStrPtrType()); - } - - return Slot; - -} - -/// Serialize - Recursively cast the specified descriptor into a GlobalVariable -/// so that it can be serialized to a .bc or .ll file. -GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) { - // Check if the DebugInfoDesc is already in the map. - GlobalVariable *&Slot = DescGlobals[DD]; - - // See if DebugInfoDesc exists, if so return prior GlobalVariable. - if (Slot) return Slot; - - // Get the type associated with the Tag. - const StructType *Ty = getTagType(DD); - - // Create the GlobalVariable early to prevent infinite recursion. - GlobalVariable *GV = new GlobalVariable(Ty, true, DD->getLinkage(), - NULL, DD->getDescString(), M); - GV->setSection("llvm.metadata"); - - // Insert new GlobalVariable in DescGlobals map. - Slot = GV; - - // Set up elements vector - std::vector Elements; - // Add fields. - DISerializeVisitor SRAM(*this, Elements); - SRAM.ApplyToFields(DD); - - // Set the globals initializer. - GV->setInitializer(ConstantStruct::get(Ty, Elements)); - - return GV; -} - -/// addDescriptor - Directly connect DD with existing GV. -void DISerializer::addDescriptor(DebugInfoDesc *DD, - GlobalVariable *GV) { - DescGlobals[DD] = GV; -} - -//===----------------------------------------------------------------------===// - -/// Verify - Return true if the GlobalVariable appears to be a valid -/// serialization of a DebugInfoDesc. -bool DIVerifier::Verify(Value *V) { - return !V || Verify(getGlobalVariable(V)); -} -bool DIVerifier::Verify(GlobalVariable *GV) { - // NULLs are valid. - if (!GV) return true; - - // Check prior validity. - unsigned &ValiditySlot = Validity[GV]; - - // If visited before then use old state. - if (ValiditySlot) return ValiditySlot == Valid; - - // Assume validity for the time being (recursion.) - ValiditySlot = Valid; - - // Make sure the global is internal or link once (anchor.) - if (GV->getLinkage() != GlobalValue::InternalLinkage && - GV->getLinkage() != GlobalValue::LinkOnceLinkage) { - ValiditySlot = Invalid; - return false; - } - - // Get the Tag. - unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); - - // Check for user defined descriptors. - if (Tag == DW_TAG_invalid) { - ValiditySlot = Valid; - return true; - } - - // Get the Version. - unsigned Version = DebugInfoDesc::VersionFromGlobal(GV); - - // Check for version mismatch. - if (Version != LLVMDebugVersion) { - ValiditySlot = Invalid; - return false; - } - - // Construct an empty DebugInfoDesc. - DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag); - - // Allow for user defined descriptors. - if (!DD) return true; - - // Get the initializer constant. - ConstantStruct *CI = cast(GV->getInitializer()); - - // Get the operand count. - unsigned N = CI->getNumOperands(); - - // Get the field count. - unsigned &CountSlot = Counts[Tag]; - - if (!CountSlot) - // Check the operand count to the field count - CountSlot = CountFields(DD); - - // Field count must be at most equal operand count. - if (CountSlot > N) { - delete DD; - ValiditySlot = Invalid; - return false; - } - - // Check each field for valid type. - DIVerifyVisitor VRAM(*this, GV); - VRAM.ApplyToFields(DD); - - // Release empty DebugInfoDesc. - delete DD; - - // If fields are not valid. - if (!VRAM.isValid()) { - ValiditySlot = Invalid; - return false; - } - - return true; -} - -/// isVerified - Return true if the specified GV has already been -/// verified as a debug information descriptor. -bool DIVerifier::isVerified(GlobalVariable *GV) { - unsigned &ValiditySlot = Validity[GV]; - if (ValiditySlot) return ValiditySlot == Valid; - return false; -} - -//===----------------------------------------------------------------------===// - -DebugScope::~DebugScope() { - for (unsigned i = 0, N = Scopes.size(); i < N; ++i) delete Scopes[i]; - for (unsigned j = 0, M = Variables.size(); j < M; ++j) delete Variables[j]; -} - -//===----------------------------------------------------------------------===// - MachineModuleInfo::MachineModuleInfo() : ImmutablePass(&ID) -, DR() -, VR() -, CompileUnits() -, Directories() -, SourceFiles() , Lines() , LabelIDList() -, ScopeMap() -, RootScope(NULL) , FrameMoves() , LandingPads() , Personalities() @@ -1660,16 +73,6 @@ /// EndFunction - Discard function meta information. /// void MachineModuleInfo::EndFunction() { - // Clean up scope information. - if (RootScope) { - delete RootScope; - ScopeMap.clear(); - RootScope = NULL; - } - - // Clean up line info. - Lines.clear(); - // Clean up frame info. FrameMoves.clear(); @@ -1682,18 +85,9 @@ CallsUnwindInit = 0; } -/// getDescFor - Convert a Value to a debug information descriptor. -/// -// FIXME - use new Value type when available. -DebugInfoDesc *MachineModuleInfo::getDescFor(Value *V) { - return DR.Deserialize(V); -} - /// AnalyzeModule - Scan the module for global debug information. /// void MachineModuleInfo::AnalyzeModule(Module &M) { - SetupCompileUnits(M); - // Insert functions in the llvm.used array into UsedFunctions. GlobalVariable *GV = M.getGlobalVariable("llvm.used"); if (!GV || !GV->hasInitializer()) return; @@ -1710,111 +104,6 @@ } } -/// SetupCompileUnits - Set up the unique vector of compile units. -/// -void MachineModuleInfo::SetupCompileUnits(Module &M) { - std::vector CU; - getAnchoredDescriptors(M, CU); - - for (unsigned i = 0, N = CU.size(); i < N; i++) { - CompileUnits.insert(CU[i]); - } -} - -/// getCompileUnits - Return a vector of debug compile units. -/// -const UniqueVector MachineModuleInfo::getCompileUnits()const{ - return CompileUnits; -} - -/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the -/// named GlobalVariable. -void -MachineModuleInfo::getGlobalVariablesUsing(Module &M, - const std::string &RootName, - std::vector&Result){ - return ::getGlobalVariablesUsing(M, RootName, Result); -} - -/// RecordSourceLine - Records location information and associates it with a -/// debug label. Returns a unique label ID used to generate a label and -/// provide correspondence to the source line list. -unsigned MachineModuleInfo::RecordSourceLine(unsigned Line, unsigned Column, - unsigned Source) { - unsigned ID = NextLabelID(); - Lines.push_back(SourceLineInfo(Line, Column, Source, ID)); - return ID; -} - -/// RecordSource - Register a source file with debug info. Returns an source -/// ID. -unsigned MachineModuleInfo::RecordSource(const std::string &Directory, - const std::string &Source) { - unsigned DirectoryID = Directories.insert(Directory); - return SourceFiles.insert(SourceFileInfo(DirectoryID, Source)); -} -unsigned MachineModuleInfo::RecordSource(const CompileUnitDesc *CompileUnit) { - return RecordSource(CompileUnit->getDirectory(), - CompileUnit->getFileName()); -} - -/// RecordRegionStart - Indicate the start of a region. -/// -unsigned MachineModuleInfo::RecordRegionStart(Value *V) { - // FIXME - need to be able to handle split scopes because of bb cloning. - DebugInfoDesc *ScopeDesc = DR.Deserialize(V); - DebugScope *Scope = getOrCreateScope(ScopeDesc); - unsigned ID = NextLabelID(); - if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); - return ID; -} - -/// RecordRegionEnd - Indicate the end of a region. -/// -unsigned MachineModuleInfo::RecordRegionEnd(Value *V) { - // FIXME - need to be able to handle split scopes because of bb cloning. - DebugInfoDesc *ScopeDesc = DR.Deserialize(V); - DebugScope *Scope = getOrCreateScope(ScopeDesc); - unsigned ID = NextLabelID(); - Scope->setEndLabelID(ID); - return ID; -} - -/// RecordVariable - Indicate the declaration of a local variable. -/// -void MachineModuleInfo::RecordVariable(GlobalValue *GV, unsigned FrameIndex) { - VariableDesc *VD = cast(DR.Deserialize(GV)); - DebugScope *Scope = getOrCreateScope(VD->getContext()); - DebugVariable *DV = new DebugVariable(VD, FrameIndex); - Scope->AddVariable(DV); -} - -/// getOrCreateScope - Returns the scope associated with the given descriptor. -/// -DebugScope *MachineModuleInfo::getOrCreateScope(DebugInfoDesc *ScopeDesc) { - DebugScope *&Slot = ScopeMap[ScopeDesc]; - if (!Slot) { - // FIXME - breaks down when the context is an inlined function. - DebugInfoDesc *ParentDesc = NULL; - if (BlockDesc *Block = dyn_cast(ScopeDesc)) { - ParentDesc = Block->getContext(); - } - DebugScope *Parent = ParentDesc ? getOrCreateScope(ParentDesc) : NULL; - Slot = new DebugScope(Parent, ScopeDesc); - if (Parent) { - Parent->AddScope(Slot); - } else if (RootScope) { - // FIXME - Add inlined function scopes to the root so we can delete - // them later. Long term, handle inlined functions properly. - RootScope->AddScope(Slot); - } else { - // First function is top level function. - RootScope = Slot; - } - } - return Slot; -} - //===-EH-------------------------------------------------------------------===// /// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62199&r1=62198&r2=62199&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 13 17:54:55 2009 @@ -2041,7 +2041,7 @@ GlobalVariable *GV = dyn_cast(GA->getGlobal()); if (!GV) return false; MachineModuleInfo *MMI = getMachineModuleInfo(); - return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV); + return MMI && MMI->hasDebugInfo(); } From sabre at nondot.org Tue Jan 13 18:12:59 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Jan 2009 00:12:59 -0000 Subject: [llvm-commits] [llvm] r62201 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2009-01-13-phi-user.ll Message-ID: <200901140012.n0E0Cxg6016897@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 13 18:12:58 2009 New Revision: 62201 URL: http://llvm.org/viewvc/llvm-project?rev=62201&view=rev Log: rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporary vector and extraneous loop over it, 2) not delete globals used by phis/selects etc which could actually be useful. This fixes PR3321. Many thanks to Duncan for narrowing this down. Added: llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=62201&r1=62200&r2=62201&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 13 18:12:58 2009 @@ -733,44 +733,46 @@ /// if the loaded value is dynamically null, then we know that they cannot be /// reachable with a null optimize away the load. static bool OptimizeAwayTrappingUsesOfLoads(GlobalVariable *GV, Constant *LV) { - std::vector Loads; bool Changed = false; + // Keep track of whether we are able to remove all the uses of the global + // other than the store that defines it. + bool AllNonStoreUsesGone = true; + // Replace all uses of loads with uses of uses of the stored value. - for (Value::use_iterator GUI = GV->use_begin(), E = GV->use_end(); - GUI != E; ++GUI) - if (LoadInst *LI = dyn_cast(*GUI)) { - Loads.push_back(LI); + for (Value::use_iterator GUI = GV->use_begin(), E = GV->use_end(); GUI != E;){ + User *GlobalUser = *GUI++; + if (LoadInst *LI = dyn_cast(GlobalUser)) { Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV); + // If we were able to delete all uses of the loads + if (LI->use_empty()) { + LI->eraseFromParent(); + Changed = true; + } else { + AllNonStoreUsesGone = false; + } + } else if (isa(GlobalUser)) { + // Ignore the store that stores "LV" to the global. + assert(GlobalUser->getOperand(1) == GV && + "Must be storing *to* the global"); } else { - // If we get here we could have stores, selects, or phi nodes whose values - // are loaded. - assert((isa(*GUI) || isa(*GUI) || - isa(*GUI) || isa(*GUI)) && - "Only expect load and stores!"); + AllNonStoreUsesGone = false; + + // If we get here we could have other crazy uses that are transitively + // loaded. + assert((isa(GlobalUser) || isa(GlobalUser) || + isa(GlobalUser)) && "Only expect load and stores!"); } + } if (Changed) { DOUT << "OPTIMIZED LOADS FROM STORED ONCE POINTER: " << *GV; ++NumGlobUses; } - // Delete all of the loads we can, keeping track of whether we nuked them all! - bool AllLoadsGone = true; - while (!Loads.empty()) { - LoadInst *L = Loads.back(); - if (L->use_empty()) { - L->eraseFromParent(); - Changed = true; - } else { - AllLoadsGone = false; - } - Loads.pop_back(); - } - // If we nuked all of the loads, then none of the stores are needed either, // nor is the global. - if (AllLoadsGone) { + if (AllNonStoreUsesGone) { DOUT << " *** GLOBAL NOW DEAD!\n"; CleanupConstantGlobalUsers(GV, 0); if (GV->use_empty()) { Added: llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll?rev=62201&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/2009-01-13-phi-user.ll Tue Jan 13 18:12:58 2009 @@ -0,0 +1,35 @@ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {phi.*@head} +; PR3321 +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-unknown-linux-gnu" + %struct.node = type { %struct.node*, i32 } + at head = internal global %struct.node* null ; <%struct.node**> [#uses=2] + at node = internal global %struct.node { %struct.node* null, i32 42 }, align 16 ; <%struct.node*> [#uses=1] + +define i32 @f() nounwind { +entry: + store %struct.node* @node, %struct.node** @head, align 8 + br label %bb1 + +bb: ; preds = %bb1 + %0 = getelementptr %struct.node* %t.0, i64 0, i32 1 ; [#uses=1] + %1 = load i32* %0, align 4 ; [#uses=1] + %2 = getelementptr %struct.node* %t.0, i64 0, i32 0 ; <%struct.node**> [#uses=1] + br label %bb1 + +bb1: ; preds = %bb, %entry + %value.0 = phi i32 [ undef, %entry ], [ %1, %bb ] ; [#uses=1] + %t.0.in = phi %struct.node** [ @head, %entry ], [ %2, %bb ] ; <%struct.node**> [#uses=1] + %t.0 = load %struct.node** %t.0.in ; <%struct.node*> [#uses=3] + %3 = icmp eq %struct.node* %t.0, null ; [#uses=1] + br i1 %3, label %bb2, label %bb + +bb2: ; preds = %bb1 + ret i32 %value.0 +} + +define i32 @main() nounwind { +entry: + %0 = call i32 @f() nounwind ; [#uses=1] + ret i32 %0 +} From kremenek at apple.com Tue Jan 13 18:38:21 2009 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 14 Jan 2009 00:38:21 -0000 Subject: [llvm-commits] [llvm] r62202 - /llvm/trunk/include/llvm/Support/Allocator.h Message-ID: <200901140038.n0E0cLgW017668@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jan 13 18:38:21 2009 New Revision: 62202 URL: http://llvm.org/viewvc/llvm-project?rev=62202&view=rev Log: Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator). Modified: llvm/trunk/include/llvm/Support/Allocator.h Modified: llvm/trunk/include/llvm/Support/Allocator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=62202&r1=62201&r2=62202&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Allocator.h (original) +++ llvm/trunk/include/llvm/Support/Allocator.h Tue Jan 13 18:38:21 2009 @@ -31,6 +31,11 @@ template T *Allocate() { return static_cast(malloc(sizeof(T))); } + template + T *Allocate(size_t Num) { + return static_cast(malloc(sizeof(T)*Num)); + } + void Deallocate(void *Ptr) { free(Ptr); } void PrintStats() const {} From dpatel at apple.com Tue Jan 13 19:34:32 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 Jan 2009 01:34:32 -0000 Subject: [llvm-commits] [llvm] r62209 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901140134.n0E1YWJN019457@zion.cs.uiuc.edu> Author: dpatel Date: Tue Jan 13 19:34:32 2009 New Revision: 62209 URL: http://llvm.org/viewvc/llvm-project?rev=62209&view=rev Log: Do not construct debug scope if RootScope *is* null. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62209&r1=62208&r2=62209&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 19:34:32 2009 @@ -2091,7 +2091,7 @@ void ConstructRootDbgScope(DbgScope *RootScope) { // Exit if there is no root scope. if (!RootScope) return; - if (!RootScope->getDesc()->isNull()) return; + if (RootScope->getDesc()->isNull()) return; // Get the subprogram debug information entry. DISubprogram SPD(RootScope->getDesc()->getGV()); From foldr at codedgers.com Tue Jan 13 20:02:16 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Wed, 14 Jan 2009 02:02:16 -0000 Subject: [llvm-commits] [llvm] r62211 - /llvm/trunk/tools/llvmc/driver/llvmc.cpp Message-ID: <200901140202.n0E22GfY020285@zion.cs.uiuc.edu> Author: foldr Date: Tue Jan 13 20:02:16 2009 New Revision: 62211 URL: http://llvm.org/viewvc/llvm-project?rev=62211&view=rev Log: Make -o a prefix option. Both 'llvmc -o file' and 'llvmc -ofile' should work. Modified: llvm/trunk/tools/llvmc/driver/llvmc.cpp Modified: llvm/trunk/tools/llvmc/driver/llvmc.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/driver/llvmc.cpp?rev=62211&r1=62210&r2=62211&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/driver/llvmc.cpp (original) +++ llvm/trunk/tools/llvmc/driver/llvmc.cpp Tue Jan 13 20:02:16 2009 @@ -37,7 +37,7 @@ cl::list InputFilenames(cl::Positional, cl::desc(""), cl::ZeroOrMore); cl::opt OutputFilename("o", cl::desc("Output file name"), - cl::value_desc("file")); + cl::value_desc("file"), cl::Prefix); cl::list Languages("x", cl::desc("Specify the language of the following input files"), cl::ZeroOrMore); From dalej at apple.com Tue Jan 13 20:35:31 2009 From: dalej at apple.com (Dale Johannesen) Date: Wed, 14 Jan 2009 02:35:31 -0000 Subject: [llvm-commits] [llvm] r62212 - in /llvm/trunk: include/llvm/Analysis/LoopInfo.h lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll Message-ID: <200901140235.n0E2ZVah021778@zion.cs.uiuc.edu> Author: johannes Date: Tue Jan 13 20:35:31 2009 New Revision: 62212 URL: http://llvm.org/viewvc/llvm-project?rev=62212&view=rev Log: Fix the time regression I introduced in 464.h264ref with my earlier patch to this file. The issue there was that all uses of an IV inside a loop are actually references to Base[IV*2], and there was one use outside that was the same but LSR didn't see the base or the scaling because it didn't recurse into uses outside the loop; thus, it used base+IV*scale mode inside the loop instead of pulling base out of the loop. This was extra bad because register pressure later forced both base and IV into memory. Doing that recursion, at least enough to figure out addressing modes, is a good idea in general; the change in AddUsersIfInteresting does this. However, there were side effects.... It is also possible for recursing outside the loop to introduce another IV where there was only 1 before (if the refs inside are not scaled and the ref outside is). I don't think this is a common case, but it's in the testsuite. It is right to be very aggressive about getting rid of such introduced IVs (CheckForIVReuse and the handling of nonzero RewriteFactor in StrengthReduceStridedIVUsers). In the testcase in question the new IV produced this way has both a nonconstant stride and a nonzero base, neither of which was handled before. And when inserting new code that feeds into a PHI, it's right to put such code at the original location rather than in the PHI's immediate predecessor(s) when the original location is outside the loop (a case that couldn't happen before) (RewriteInstructionToUseNewBase); better to avoid making multiple copies of it in this case. Also, the mechanism for keeping SCEV's corresponding to GEP's no longer works, as the GEP might change after its SCEV is remembered, invalidating the SCEV, and we might get a bad SCEV value when looking up the GEP again for a later loop. This also couldn't happen before, as we weren't recursing into GEP's outside the loop. Also, when we build an expression that involves a (possibly non-affine) IV from a different loop as well as an IV from the one we're interested in (containsAddRecFromDifferentLoop), don't recurse into that. We can't do much with it and will get in trouble if we try to create new non-affine IVs or something. More testcases are coming. Added: llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=62212&r1=62211&r2=62212&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Jan 13 20:35:31 2009 @@ -731,8 +731,8 @@ // Internals - static bool isNotAlreadyContainedIn(LoopBase *SubLoop, - LoopBase *ParentLoop) { + static bool isNotAlreadyContainedIn(const LoopBase *SubLoop, + const LoopBase *ParentLoop) { if (SubLoop == 0) return true; if (SubLoop == ParentLoop) return false; return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop); Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=62212&r1=62211&r2=62212&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Jan 13 20:35:31 2009 @@ -130,6 +130,12 @@ /// dependent on random ordering of pointers in the process. SmallVector StrideOrder; + /// GEPlist - A list of the GEP's that have been remembered in the SCEV + /// data structures. SCEV does not know to update these when the operands + /// of the GEP are changed, which means we cannot leave them live across + /// loops. + SmallVector GEPlist; + /// CastedValues - As we need to cast values to uintptr_t, this keeps track /// of the casted version of each value. This is accessed by /// getCastedVersionOf. @@ -191,7 +197,7 @@ bool FindIVUserForCond(ICmpInst *Cond, IVStrideUse *&CondUse, const SCEVHandle *&CondStride); bool RequiresTypeConversion(const Type *Ty, const Type *NewTy); - int64_t CheckForIVReuse(bool, bool, bool, const SCEVHandle&, + SCEVHandle CheckForIVReuse(bool, bool, bool, const SCEVHandle&, IVExpr&, const Type*, const std::vector& UsersToProcess); bool ValidStride(bool, int64_t, @@ -340,13 +346,58 @@ } SE->setSCEV(GEP, GEPVal); + GEPlist.push_back(GEP); return GEPVal; } +/// containsAddRecFromDifferentLoop - Determine whether expression S involves a +/// subexpression that is an AddRec from a loop other than L. An outer loop +/// of L is OK, but not an inner loop nor a disjoint loop. +static bool containsAddRecFromDifferentLoop(SCEVHandle S, Loop *L) { + // This is very common, put it first. + if (isa(S)) + return false; + if (SCEVCommutativeExpr *AE = dyn_cast(S)) { + for (unsigned int i=0; i< AE->getNumOperands(); i++) + if (containsAddRecFromDifferentLoop(AE->getOperand(i), L)) + return true; + return false; + } + if (SCEVAddRecExpr *AE = dyn_cast(S)) { + if (const Loop *newLoop = AE->getLoop()) { + if (newLoop == L) + return false; + // if newLoop is an outer loop of L, this is OK. + if (!LoopInfoBase::isNotAlreadyContainedIn(L, newLoop)) + return false; + } + return true; + } + if (SCEVUDivExpr *DE = dyn_cast(S)) + return containsAddRecFromDifferentLoop(DE->getLHS(), L) || + containsAddRecFromDifferentLoop(DE->getRHS(), L); +#if 0 + // SCEVSDivExpr has been backed out temporarily, but will be back; we'll + // need this when it is. + if (SCEVSDivExpr *DE = dyn_cast(S)) + return containsAddRecFromDifferentLoop(DE->getLHS(), L) || + containsAddRecFromDifferentLoop(DE->getRHS(), L); +#endif + if (SCEVTruncateExpr *TE = dyn_cast(S)) + return containsAddRecFromDifferentLoop(TE->getOperand(), L); + if (SCEVZeroExtendExpr *ZE = dyn_cast(S)) + return containsAddRecFromDifferentLoop(ZE->getOperand(), L); + if (SCEVSignExtendExpr *SE = dyn_cast(S)) + return containsAddRecFromDifferentLoop(SE->getOperand(), L); + return false; +} + /// getSCEVStartAndStride - Compute the start and stride of this expression, /// returning false if the expression is not a start/stride pair, or true if it /// is. The stride must be a loop invariant expression, but the start may be -/// a mix of loop invariant and loop variant expressions. +/// a mix of loop invariant and loop variant expressions. The start cannot, +/// however, contain an AddRec from a different loop, unless that loop is an +/// outer loop of the current loop. static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L, SCEVHandle &Start, SCEVHandle &Stride, ScalarEvolution *SE) { @@ -378,6 +429,12 @@ // FIXME: Generalize to non-affine IV's. if (!AddRec->isAffine()) return false; + // If Start contains an SCEVAddRecExpr from a different loop, other than an + // outer loop of the current loop, reject it. SCEV has no concept of operating + // on one loop at a time so don't confuse it with such expressions. + if (containsAddRecFromDifferentLoop(Start, L)) + return false; + Start = SE->getAddExpr(Start, AddRec->getOperand(0)); if (!isa(AddRec->getOperand(1))) @@ -508,14 +565,22 @@ if (isa(User) && Processed.count(User)) continue; - // If this is an instruction defined in a nested loop, or outside this loop, - // don't recurse into it. + // Descend recursively, but not into PHI nodes outside the current loop. + // It's important to see the entire expression outside the loop to get + // choices that depend on addressing mode use right, although we won't + // consider references ouside the loop in all cases. + // If User is already in Processed, we don't want to recurse into it again, + // but do want to record a second reference in the same instruction. bool AddUserToIVUsers = false; if (LI->getLoopFor(User->getParent()) != L) { - DOUT << "FOUND USER in other loop: " << *User - << " OF SCEV: " << *ISE << "\n"; - AddUserToIVUsers = true; - } else if (!AddUsersIfInteresting(User, L, Processed)) { + if (isa(User) || Processed.count(User) || + !AddUsersIfInteresting(User, L, Processed)) { + DOUT << "FOUND USER in other loop: " << *User + << " OF SCEV: " << *ISE << "\n"; + AddUserToIVUsers = true; + } + } else if (Processed.count(User) || + !AddUsersIfInteresting(User, L, Processed)) { DOUT << "FOUND USER: " << *User << " OF SCEV: " << *ISE << "\n"; AddUserToIVUsers = true; @@ -704,34 +769,45 @@ PHINode *PN = cast(Inst); for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { if (PN->getIncomingValue(i) == OperandValToReplace) { - // If this is a critical edge, split the edge so that we do not insert the - // code on all predecessor/successor paths. We do this unless this is the - // canonical backedge for this loop, as this can make some inserted code - // be in an illegal position. - BasicBlock *PHIPred = PN->getIncomingBlock(i); - if (e != 1 && PHIPred->getTerminator()->getNumSuccessors() > 1 && - (PN->getParent() != L->getHeader() || !L->contains(PHIPred))) { - - // First step, split the critical edge. - SplitCriticalEdge(PHIPred, PN->getParent(), P, false); - - // Next step: move the basic block. In particular, if the PHI node - // is outside of the loop, and PredTI is in the loop, we want to - // move the block to be immediately before the PHI block, not - // immediately after PredTI. - if (L->contains(PHIPred) && !L->contains(PN->getParent())) { - BasicBlock *NewBB = PN->getIncomingBlock(i); - NewBB->moveBefore(PN->getParent()); + // If the original expression is outside the loop, put the replacement + // code in the same place as the original expression, + // which need not be an immediate predecessor of this PHI. This way we + // need only one copy of it even if it is referenced multiple times in + // the PHI. We don't do this when the original expression is inside the + // loop because multiple copies sometimes do useful sinking of code in that + // case(?). + Instruction *OldLoc = dyn_cast(OperandValToReplace); + if (L->contains(OldLoc->getParent())) { + // If this is a critical edge, split the edge so that we do not insert the + // code on all predecessor/successor paths. We do this unless this is the + // canonical backedge for this loop, as this can make some inserted code + // be in an illegal position. + BasicBlock *PHIPred = PN->getIncomingBlock(i); + if (e != 1 && PHIPred->getTerminator()->getNumSuccessors() > 1 && + (PN->getParent() != L->getHeader() || !L->contains(PHIPred))) { + + // First step, split the critical edge. + SplitCriticalEdge(PHIPred, PN->getParent(), P, false); + + // Next step: move the basic block. In particular, if the PHI node + // is outside of the loop, and PredTI is in the loop, we want to + // move the block to be immediately before the PHI block, not + // immediately after PredTI. + if (L->contains(PHIPred) && !L->contains(PN->getParent())) { + BasicBlock *NewBB = PN->getIncomingBlock(i); + NewBB->moveBefore(PN->getParent()); + } + + // Splitting the edge can reduce the number of PHI entries we have. + e = PN->getNumIncomingValues(); } - - // Splitting the edge can reduce the number of PHI entries we have. - e = PN->getNumIncomingValues(); } - Value *&Code = InsertedCode[PN->getIncomingBlock(i)]; if (!Code) { // Insert the code into the end of the predecessor block. - Instruction *InsertPt = PN->getIncomingBlock(i)->getTerminator(); + Instruction *InsertPt = (L->contains(OldLoc->getParent())) ? + PN->getIncomingBlock(i)->getTerminator() : + OldLoc->getParent()->getTerminator(); Code = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L); // Adjust the type back to match the PHI. Note that we can't use @@ -1168,7 +1244,12 @@ /// mode scale component and optional base reg. This allows the users of /// this stride to be rewritten as prev iv * factor. It returns 0 if no /// reuse is possible. Factors can be negative on same targets, e.g. ARM. -int64_t LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg, +/// +/// If all uses are outside the loop, we don't require that all multiplies +/// be folded into the addressing mode, nor even that the factor be constant; +/// a multiply (executed once) outside the loop is better than another IV +/// within. Well, usually. +SCEVHandle LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg, bool AllUsesAreAddresses, bool AllUsesAreOutsideLoop, const SCEVHandle &Stride, @@ -1180,7 +1261,7 @@ ++NewStride) { std::map::iterator SI = IVsByStride.find(StrideOrder[NewStride]); - if (SI == IVsByStride.end()) + if (SI == IVsByStride.end() || !isa(SI->first)) continue; int64_t SSInt = cast(SI->first)->getValue()->getSExtValue(); if (SI->first != Stride && @@ -1202,11 +1283,53 @@ if (II->Base->isZero() && !RequiresTypeConversion(II->Base->getType(), Ty)) { IV = *II; - return Scale; + return SE->getIntegerSCEV(Scale, Stride->getType()); } } + } else if (AllUsesAreOutsideLoop) { + // Accept nonconstant strides here; it is really really right to substitute + // an existing IV if we can. + for (unsigned NewStride = 0, e = StrideOrder.size(); NewStride != e; + ++NewStride) { + std::map::iterator SI = + IVsByStride.find(StrideOrder[NewStride]); + if (SI == IVsByStride.end() || !isa(SI->first)) + continue; + int64_t SSInt = cast(SI->first)->getValue()->getSExtValue(); + if (SI->first != Stride && SSInt != 1) + continue; + for (std::vector::iterator II = SI->second.IVs.begin(), + IE = SI->second.IVs.end(); II != IE; ++II) + // Accept nonzero base here. + // Only reuse previous IV if it would not require a type conversion. + if (!RequiresTypeConversion(II->Base->getType(), Ty)) { + IV = *II; + return Stride; + } + } + // Special case, old IV is -1*x and this one is x. Can treat this one as + // -1*old. + for (unsigned NewStride = 0, e = StrideOrder.size(); NewStride != e; + ++NewStride) { + std::map::iterator SI = + IVsByStride.find(StrideOrder[NewStride]); + if (SI == IVsByStride.end()) + continue; + if (SCEVMulExpr *ME = dyn_cast(SI->first)) + if (SCEVConstant *SC = dyn_cast(ME->getOperand(0))) + if (Stride == ME->getOperand(1) && + SC->getValue()->getSExtValue() == -1LL) + for (std::vector::iterator II = SI->second.IVs.begin(), + IE = SI->second.IVs.end(); II != IE; ++II) + // Accept nonzero base here. + // Only reuse previous IV if it would not require type conversion. + if (!RequiresTypeConversion(II->Base->getType(), Ty)) { + IV = *II; + return SE->getIntegerSCEV(-1LL, Stride->getType()); + } + } } - return 0; + return SE->getIntegerSCEV(0, Stride->getType()); } /// PartitionByIsUseOfPostIncrementedValue - Simple boolean predicate that @@ -1357,12 +1480,13 @@ IVExpr ReuseIV(SE->getIntegerSCEV(0, Type::Int32Ty), SE->getIntegerSCEV(0, Type::Int32Ty), 0, 0); - int64_t RewriteFactor = 0; - RewriteFactor = CheckForIVReuse(HaveCommonExprs, AllUsesAreAddresses, + SCEVHandle RewriteFactor = + CheckForIVReuse(HaveCommonExprs, AllUsesAreAddresses, AllUsesAreOutsideLoop, Stride, ReuseIV, CommonExprs->getType(), UsersToProcess); - if (RewriteFactor != 0) { + if (!isa(RewriteFactor) || + !cast(RewriteFactor)->isZero()) { DOUT << "BASED ON IV of STRIDE " << *ReuseIV.Stride << " and BASE " << *ReuseIV.Base << " :\n"; NewPHI = ReuseIV.PHI; @@ -1390,7 +1514,8 @@ Value *CommonBaseV = PreheaderRewriter.expandCodeFor(CommonExprs, PreInsertPt); - if (RewriteFactor == 0) { + if (isa(RewriteFactor) && + cast(RewriteFactor)->isZero()) { // Create a new Phi for this base, and stick it in the loop header. NewPHI = PHINode::Create(ReplacedTy, "iv.", PhiInsertBefore); ++NumInserted; @@ -1537,18 +1662,33 @@ // If we are reusing the iv, then it must be multiplied by a constant // factor take advantage of addressing mode scale component. - if (RewriteFactor != 0) { - RewriteExpr = SE->getMulExpr(SE->getIntegerSCEV(RewriteFactor, - RewriteExpr->getType()), + if (!isa(RewriteFactor) || + !cast(RewriteFactor)->isZero()) { + // If we're reusing an IV with a nonzero base (currently this happens + // only when all reuses are outside the loop) subtract that base here. + // The base has been used to initialize the PHI node but we don't want + // it here. + if (!ReuseIV.Base->isZero()) + RewriteExpr = SE->getMinusSCEV(RewriteExpr, ReuseIV.Base); + + // Multiply old variable, with base removed, by new scale factor. + RewriteExpr = SE->getMulExpr(RewriteFactor, RewriteExpr); // The common base is emitted in the loop preheader. But since we // are reusing an IV, it has not been used to initialize the PHI node. // Add it to the expression used to rewrite the uses. + // When this use is outside the loop, we earlier subtracted the + // common base, and are adding it back here. Use the same expression + // as before, rather than CommonBaseV, so DAGCombiner will zap it. if (!isa(CommonBaseV) || - !cast(CommonBaseV)->isZero()) - RewriteExpr = SE->getAddExpr(RewriteExpr, + !cast(CommonBaseV)->isZero()) { + if (L->contains(User.Inst->getParent())) + RewriteExpr = SE->getAddExpr(RewriteExpr, SE->getUnknown(CommonBaseV)); + else + RewriteExpr = SE->getAddExpr(RewriteExpr, CommonExprs); + } } // Now that we know what we need to do, insert code before User for the @@ -2174,6 +2314,9 @@ IVUsesByStride.clear(); IVsByStride.clear(); StrideOrder.clear(); + for (unsigned i=0; ideleteValueFromRecords(GEPlist[i]); + GEPlist.clear(); // Clean up after ourselves if (!DeadInsts.empty()) { Added: llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll?rev=62212&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll (added) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll Tue Jan 13 20:35:31 2009 @@ -0,0 +1,39 @@ +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep phi | count 1 +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep mul | count 1 +; ModuleID = '' +; Make sure examining a fuller expression outside the loop doesn't cause us to create a second +; IV of stride %3. +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.5" + %struct.anon = type { %struct.obj*, %struct.obj* } + %struct.obj = type { i16, i16, { %struct.anon } } + at heap_size = external global i32 ; [#uses=1] +@"\01LC85" = external constant [39 x i8] ; <[39 x i8]*> [#uses=1] + +declare i32 @sprintf(i8*, i8*, ...) nounwind + +define %struct.obj* @gc_status(%struct.obj* %args) nounwind { +entry: + br label %bb1.i + +bb.i2: ; preds = %bb2.i3 + %indvar.next24 = add i32 %m.0.i, 1 ; [#uses=1] + br label %bb1.i + +bb1.i: ; preds = %bb.i2, %entry + %m.0.i = phi i32 [ 0, %entry ], [ %indvar.next24, %bb.i2 ] ; [#uses=4] + %0 = icmp slt i32 %m.0.i, 0 ; [#uses=1] + br i1 %0, label %bb2.i3, label %nactive_heaps.exit + +bb2.i3: ; preds = %bb1.i + %1 = load %struct.obj** null, align 4 ; <%struct.obj*> [#uses=1] + %2 = icmp eq %struct.obj* %1, null ; [#uses=1] + br i1 %2, label %nactive_heaps.exit, label %bb.i2 + +nactive_heaps.exit: ; preds = %bb2.i3, %bb1.i + %3 = load i32* @heap_size, align 4 ; [#uses=1] + %4 = mul i32 %3, %m.0.i ; [#uses=1] + %5 = sub i32 %4, 0 ; [#uses=1] + %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; [#uses=0] + ret %struct.obj* null +} From baldrick at free.fr Wed Jan 14 02:45:29 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 09:45:29 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901131252.49945.baldrick@free.fr> Message-ID: <200901140945.29330.baldrick@free.fr> Hi Evan, > This gets translated into low level pointer arithmetics, right? Later > on llvm-convert casts it to i8*: > > ArrayAddr = BitCastToType(ArrayAddr, > PointerType::getUnqual(Type::Int8Ty)); > > Is there a reason why we can't just give it the alignment of i8? I'm not sure what you are saying. Consider &a[1]. This gets turned into pointer arithmetic or a GEP on &a. The alignment of the resulting lvalue should be the alignment of a[1], i.e. the original alignment of the array itself adjusted by the size of 1 array element. I will try to find time to cook up an example. Ciao, Duncan. From baldrick at free.fr Wed Jan 14 02:50:46 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 09:50:46 +0100 Subject: [llvm-commits] [llvm] r62107 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp test/Transforms/Inline/2009-01-12-RecursiveInline.ll In-Reply-To: <471AB860-D287-4456-B07A-06CDFA1AEA13@apple.com> References: <200901122211.n0CMBpwT014399@zion.cs.uiuc.edu> <200901130857.29043.baldrick@free.fr> <471AB860-D287-4456-B07A-06CDFA1AEA13@apple.com> Message-ID: <200901140950.47088.baldrick@free.fr> Hi Dale, > I don't agree, I think it was indented funny before. Let's get the > whole context: it still looks funny to me, but I don't care enough to argue. > > Also, it is > > probably OK to inline a function with weak linkage (mayBeOverridden) > > into > > itself. > > Maybe so. What happens if different compilations make different > inlining decisions? Is the linker allowed to require that all copies > of a weak function are the same? I think not. None of that matters. Consider a function f with weak linkage that calls itself: define weak void @f(...) { ... call void @f(...) ... } There are two cases: (1) this is the function that is finally used, i.e. the body isn't overridden by something else at link time. In this case it is fine to inline f into itself. (2) this is not the function that is finally used, i.e. the body is discarded at link time. Since the body is discarded, it is fine to inline f into itself because the result is discarded anyway! That said, this seems like a particularly unimportant optimization. Ciao, Duncan. From baldrick at free.fr Wed Jan 14 03:20:29 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 10:20:29 +0100 Subject: [llvm-commits] Link failing due to debug info In-Reply-To: <5833A76F-3C78-4FCE-B7C2-171860D672D6@apple.com> References: <200901131321.52282.baldrick@free.fr> <5833A76F-3C78-4FCE-B7C2-171860D672D6@apple.com> Message-ID: <200901141020.30084.baldrick@free.fr> > > Hi Devang, I'm seeing lots of failures like this in the Ada testsuite: > > > > gnatlink a87b59a.ali --GCC=gcc-4.2.llvm-objects-32/gcc/xgcc -B/home/ > > duncan/LLVM/gcc-4.2.llvm-objects-32/gcc/ > > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xa0): > > undefined reference to `llvm.dbg.global_variable643' > > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xb8): > > undefined reference to `llvm.dbg.global_variable641' > > gcc-4.2.llvm-objects-32/gcc/ada/rts/s-tasdeb.o:(.debug_info+0xd0): > > undefined reference to `llvm.dbg.global_variable639' > > ... > > > > Any idea what that's about? I can send you the corresponding LLVM IR > > if that would help. > > > Yes, please send me corresponding LLVM IR. Here you go (attached; produced yesterday, before your latest changes). If I compile this with llc, I see entries like this: .uleb128 2 .byte 0x0 .byte 0x8 .uleb128 3 .asciz "C.45.1170" .long 0x89 .byte 0x1 .short 0x11B .byte 0x5 .byte 0x3 .long llvm.dbg.global_variable643 .uleb128 3 .asciz "C.44.1168" .long 0x89 .byte 0x1 .short 0x11B .byte 0x5 .byte 0x3 .long llvm.dbg.global_variable641 ... Thanks for your help, Duncan. -------------- next part -------------- ; ModuleID = 's-tasdeb.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" %llvm.dbg.anchor.type = type { i32, i32 } %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i8*, i8* } %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, i8*, i8* } %llvm.dbg.enumerator.type = type { i32, i8*, i64 } %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }*, i8*, i8* } %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, i8*, i8* } %llvm.dbg.subrange.type = type { i32, i64, i64 } %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* } %struct.FRAME.system__tasking__debug__print_task_info = type { %llvm.dbg.anchor.type, %llvm.dbg.anchor.type, %llvm.dbg.anchor.type } %struct.FRAME.system__tasking__debug__put_line = type { %llvm.dbg.anchor.type } %struct.FRAME.system__tasking__debug__trace = type { %llvm.dbg.anchor.type } %struct.ada__exceptions__exception_occurrence = type { %struct.system__standard_library__exception_data*, i32, [200 x i8], i8, i8, i32, i32, [50 x i32], i32 } %struct.string___XUB = type { i32, i32 } %struct.string___XUP = type { i8*, %llvm.dbg.anchor.type* } %struct.system__os_interface__pthread_mutex_t = type { i32, i32, i32, i32, %llvm.dbg.anchor.type } %struct.system__os_interface__struct_pthread_fast_lock = type { i32, i32 } %struct.system__secondary_stack__mark_id = type { i32, i32 } %struct.system__soft_links__tsd = type { %struct.system__stack_checking__stack_info, i32, i32, %struct.ada__exceptions__exception_occurrence } %struct.system__stack_checking__stack_info = type { i32, i32, i32 } %struct.system__stack_usage__stack_analyzer = type { [32 x i8], i32, i32, i32, i32, i32, i32, i32, i8, i32 } %struct.system__standard_library__exception_data = type { i8, i8, i32, i32, %struct.system__standard_library__exception_data*, i32, void ()* } %struct.system__task_primitives__private_data = type { i32, i32, [48 x i8], %struct.system__os_interface__pthread_mutex_t } %struct.system__tasking__accept_alternative = type { i8, i32 } %struct.system__tasking__accept_list___XUB = type { i32, i32 } %struct.system__tasking__accept_list_access = type { %struct.system__tasking__accept_alternative*, %llvm.dbg.anchor.type* } %struct.system__tasking__ada_task_control_block = type { i32, %struct.system__tasking__common_atcb, [19 x %struct.system__tasking__entry_call_record], i32, %struct.system__tasking__accept_list_access, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i64, i32, i32, [4 x i32], i8, i32*, %struct.system__tasking__entry_queue } %struct.system__tasking__common_atcb = type { i8, %struct.system__tasking__ada_task_control_block*, i32, i32, i32, [32 x i8], i32, %struct.system__tasking__entry_call_record*, %struct.system__task_primitives__private_data, i32, void (i32)*, %struct.system__soft_links__tsd, %struct.system__tasking__ada_task_control_block*, %struct.system__tasking__ada_task_control_block*, %struct.system__tasking__ada_task_control_block*, i32, i8*, i8, i8, %struct.system__stack_usage__stack_analyzer, i32, %struct.system__tasking__termination_handler, %struct.system__tasking__termination_handler } %struct.system__tasking__debug__Ttrace_flag_setB___XUB = type { i8, i8 } %struct.system__tasking__debug__Ttrace_flag_setB___XUP = type { i8*, %struct.system__tasking__debug__Ttrace_flag_setB___XUB* } %struct.system__tasking__entry_call_record = type { %struct.system__tasking__ada_task_control_block*, i8, i8, i32, %struct.system__standard_library__exception_data*, %struct.system__tasking__entry_call_record*, %struct.system__tasking__entry_call_record*, i32, i32, i32, %struct.system__tasking__ada_task_control_block*, i32, %struct.system__tasking__entry_call_record*, i32, i8, i8, i8 } %struct.system__tasking__entry_queue = type { %struct.system__tasking__entry_call_record*, %struct.system__tasking__entry_call_record* } %struct.system__tasking__termination_handler = type { i32, void (i32, i8, %struct.system__tasking__ada_task_control_block*, %struct.ada__exceptions__exception_occurrence*)* } @llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] @.str = internal constant [13 x i8] c"s-tasdeb.adb\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @.str1 = internal constant [55 x i8] c"/home/duncan/LLVM/gcc-4.2.llvm-objects-32/gcc/ada/rts/\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] @.str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5628) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] @llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 13, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] @system__tasking__debug_E = global i8 0 ; [#uses=1] @.str3 = internal constant [6 x i8] c"false\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.enumerator = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([6 x i8]* @.str3, i32 0, i32 0), i64 0 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str4 = internal constant [5 x i8] c"true\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.enumerator5 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i64 1 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @llvm.dbg.array = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator5 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @.str6 = internal constant [8 x i8] c"boolean\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @.str7 = internal constant [11 x i8] c"system.ads\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458756, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str6, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i8* getelementptr ([11 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] @.str8 = internal constant [25 x i8] c"system__tasking__debug_E\00", section "llvm.metadata" ; <[25 x i8]*> [#uses=1] @.str9 = internal constant [13 x i8] c"s-tasdeb.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([25 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([25 x i8]* @.str8, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 40, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true, { }* bitcast (i8* @system__tasking__debug_E to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @system__tasking__debug__known_tasks = global [1000 x %struct.system__tasking__ada_task_control_block*] zeroinitializer, align 32 ; <[1000 x %struct.system__tasking__ada_task_control_block*]*> [#uses=1] @llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 999 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array10 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @.str11 = internal constant [40 x i8] c"system__tasking__ada_task_control_block\00", section "llvm.metadata" ; <[40 x i8]*> [#uses=1] @.str12 = internal constant [13 x i8] c"s-taskin.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @.str14 = internal constant [55 x i8] c"system__tasking__task_entry_index___XDLU_0__2147483647\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] @llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([55 x i8]* @.str14, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str15 = internal constant [10 x i8] c"entry_num\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str15, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 837, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str16 = internal constant [29 x i8] c"system__tasking__common_atcb\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @.str18 = internal constant [29 x i8] c"system__tasking__unactivated\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.enumerator19 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([29 x i8]* @.str18, i32 0, i32 0), i64 0 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str20 = internal constant [26 x i8] c"system__tasking__runnable\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] @llvm.dbg.enumerator21 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([26 x i8]* @.str20, i32 0, i32 0), i64 1 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str22 = internal constant [28 x i8] c"system__tasking__terminated\00", section "llvm.metadata" ; <[28 x i8]*> [#uses=1] @llvm.dbg.enumerator23 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([28 x i8]* @.str22, i32 0, i32 0), i64 2 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str24 = internal constant [33 x i8] c"system__tasking__activator_sleep\00", section "llvm.metadata" ; <[33 x i8]*> [#uses=1] @llvm.dbg.enumerator25 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([33 x i8]* @.str24, i32 0, i32 0), i64 3 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str26 = internal constant [32 x i8] c"system__tasking__acceptor_sleep\00", section "llvm.metadata" ; <[32 x i8]*> [#uses=1] @llvm.dbg.enumerator27 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([32 x i8]* @.str26, i32 0, i32 0), i64 4 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str28 = internal constant [36 x i8] c"system__tasking__entry_caller_sleep\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.enumerator29 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([36 x i8]* @.str28, i32 0, i32 0), i64 5 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str30 = internal constant [36 x i8] c"system__tasking__async_select_sleep\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.enumerator31 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([36 x i8]* @.str30, i32 0, i32 0), i64 6 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str32 = internal constant [29 x i8] c"system__tasking__delay_sleep\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.enumerator33 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([29 x i8]* @.str32, i32 0, i32 0), i64 7 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str34 = internal constant [41 x i8] c"system__tasking__master_completion_sleep\00", section "llvm.metadata" ; <[41 x i8]*> [#uses=1] @llvm.dbg.enumerator35 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([41 x i8]* @.str34, i32 0, i32 0), i64 8 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str36 = internal constant [38 x i8] c"system__tasking__master_phase_2_sleep\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] @llvm.dbg.enumerator37 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([38 x i8]* @.str36, i32 0, i32 0), i64 9 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str38 = internal constant [45 x i8] c"system__tasking__interrupt_server_idle_sleep\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1] @llvm.dbg.enumerator39 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([45 x i8]* @.str38, i32 0, i32 0), i64 10 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str40 = internal constant [58 x i8] c"system__tasking__interrupt_server_blocked_interrupt_sleep\00", section "llvm.metadata" ; <[58 x i8]*> [#uses=1] @llvm.dbg.enumerator41 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([58 x i8]* @.str40, i32 0, i32 0), i64 11 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str42 = internal constant [36 x i8] c"system__tasking__timer_server_sleep\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.enumerator43 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([36 x i8]* @.str42, i32 0, i32 0), i64 12 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str44 = internal constant [34 x i8] c"system__tasking__ast_server_sleep\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1] @llvm.dbg.enumerator45 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([34 x i8]* @.str44, i32 0, i32 0), i64 13 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str46 = internal constant [35 x i8] c"system__tasking__asynchronous_hold\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @llvm.dbg.enumerator47 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([35 x i8]* @.str46, i32 0, i32 0), i64 14 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str48 = internal constant [56 x i8] c"system__tasking__interrupt_server_blocked_on_event_flag\00", section "llvm.metadata" ; <[56 x i8]*> [#uses=1] @llvm.dbg.enumerator49 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([56 x i8]* @.str48, i32 0, i32 0), i64 15 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @llvm.dbg.array50 = internal constant [16 x { }*] [ { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator19 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator21 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator23 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator25 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator27 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator29 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator31 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator33 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator35 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator37 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator39 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator41 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator43 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator45 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator47 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator49 to { }*) ], section "llvm.metadata" ; <[16 x { }*]*> [#uses=1] @.str51 = internal constant [29 x i8] c"system__tasking__task_states\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.composite52 = internal constant %llvm.dbg.composite.type { i32 458756, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([29 x i8]* @.str51, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 138, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([16 x { }*]* @llvm.dbg.array50 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str53 = internal constant [6 x i8] c"state\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.derivedtype54 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([6 x i8]* @.str53, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 418, i64 8, i64 8, i64 0, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite52 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype55 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite488 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str56 = internal constant [7 x i8] c"parent\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @llvm.dbg.derivedtype57 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str56, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 426, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str58 = internal constant [34 x i8] c"system__any_priority___XDLU_0__31\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1] @llvm.dbg.basictype59 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([34 x i8]* @.str58, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str60 = internal constant [14 x i8] c"base_priority\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype61 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str60, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 430, i64 32, i64 32, i64 64, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype59 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str62 = internal constant [17 x i8] c"current_priority\00", section "llvm.metadata" ; <[17 x i8]*> [#uses=1] @llvm.dbg.derivedtype63 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([17 x i8]* @.str62, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 436, i64 32, i64 32, i64 96, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype59 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str64 = internal constant [29 x i8] c"natural___XDLU_0__2147483647\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.basictype65 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([29 x i8]* @.str64, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str66 = internal constant [25 x i8] c"protected_action_nesting\00", section "llvm.metadata" ; <[25 x i8]*> [#uses=1] @llvm.dbg.derivedtype67 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([25 x i8]* @.str66, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 461, i64 32, i64 32, i64 128, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange68 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 1, i64 32 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array69 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange68 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @.str70 = internal constant [10 x i8] c"character\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.basictype71 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str70, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @llvm.dbg.composite72 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 256, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array69 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str73 = internal constant [11 x i8] c"task_image\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype74 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str73, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 468, i64 256, i64 8, i64 160, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite72 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str75 = internal constant [15 x i8] c"task_image_len\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype76 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str75, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 472, i64 32, i64 32, i64 416, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str77 = internal constant [35 x i8] c"system__tasking__entry_call_record\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @.str79 = internal constant [5 x i8] c"self\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype80 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str79, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 713, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str81 = internal constant [29 x i8] c"system__tasking__simple_call\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.enumerator82 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([29 x i8]* @.str81, i32 0, i32 0), i64 0 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str83 = internal constant [34 x i8] c"system__tasking__conditional_call\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1] @llvm.dbg.enumerator84 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([34 x i8]* @.str83, i32 0, i32 0), i64 1 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str85 = internal constant [35 x i8] c"system__tasking__asynchronous_call\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @llvm.dbg.enumerator86 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([35 x i8]* @.str85, i32 0, i32 0), i64 2 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str87 = internal constant [28 x i8] c"system__tasking__timed_call\00", section "llvm.metadata" ; <[28 x i8]*> [#uses=1] @llvm.dbg.enumerator88 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([28 x i8]* @.str87, i32 0, i32 0), i64 3 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @llvm.dbg.array89 = internal constant [4 x { }*] [ { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator82 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator84 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator86 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator88 to { }*) ], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1] @.str90 = internal constant [28 x i8] c"system__tasking__call_modes\00", section "llvm.metadata" ; <[28 x i8]*> [#uses=1] @llvm.dbg.composite91 = internal constant %llvm.dbg.composite.type { i32 458756, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([28 x i8]* @.str90, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 207, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]* @llvm.dbg.array89 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str92 = internal constant [5 x i8] c"mode\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype93 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str92, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 716, i64 8, i64 8, i64 32, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite91 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str94 = internal constant [33 x i8] c"system__tasking__never_abortable\00", section "llvm.metadata" ; <[33 x i8]*> [#uses=1] @llvm.dbg.enumerator95 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([33 x i8]* @.str94, i32 0, i32 0), i64 0 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str96 = internal constant [35 x i8] c"system__tasking__not_yet_abortable\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @llvm.dbg.enumerator97 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([35 x i8]* @.str96, i32 0, i32 0), i64 1 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str98 = internal constant [31 x i8] c"system__tasking__was_abortable\00", section "llvm.metadata" ; <[31 x i8]*> [#uses=1] @llvm.dbg.enumerator99 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([31 x i8]* @.str98, i32 0, i32 0), i64 2 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str100 = internal constant [31 x i8] c"system__tasking__now_abortable\00", section "llvm.metadata" ; <[31 x i8]*> [#uses=1] @llvm.dbg.enumerator101 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([31 x i8]* @.str100, i32 0, i32 0), i64 3 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str102 = internal constant [22 x i8] c"system__tasking__done\00", section "llvm.metadata" ; <[22 x i8]*> [#uses=1] @llvm.dbg.enumerator103 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([22 x i8]* @.str102, i32 0, i32 0), i64 4 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str104 = internal constant [27 x i8] c"system__tasking__cancelled\00", section "llvm.metadata" ; <[27 x i8]*> [#uses=1] @llvm.dbg.enumerator105 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([27 x i8]* @.str104, i32 0, i32 0), i64 5 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @llvm.dbg.array106 = internal constant [6 x { }*] [ { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator95 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator97 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator99 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator101 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator103 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator105 to { }*) ], section "llvm.metadata" ; <[6 x { }*]*> [#uses=1] @.str107 = internal constant [34 x i8] c"system__tasking__entry_call_state\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1] @llvm.dbg.composite108 = internal constant %llvm.dbg.composite.type { i32 458756, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([34 x i8]* @.str107, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 251, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([6 x { }*]* @llvm.dbg.array106 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype109 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([6 x i8]* @.str53, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 718, i64 8, i64 8, i64 40, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite108 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str110 = internal constant [16 x i8] c"system__address\00", section "llvm.metadata" ; <[16 x i8]*> [#uses=1] @llvm.dbg.basictype111 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([16 x i8]* @.str110, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str112 = internal constant [19 x i8] c"uninterpreted_data\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype113 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str112, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 731, i64 32, i64 32, i64 64, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str114 = internal constant [41 x i8] c"system__standard_library__exception_data\00", section "llvm.metadata" ; <[41 x i8]*> [#uses=1] @.str115 = internal constant [13 x i8] c"s-stalib.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @.str117 = internal constant [22 x i8] c"not_handled_by_others\00", section "llvm.metadata" ; <[22 x i8]*> [#uses=1] @llvm.dbg.derivedtype118 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([22 x i8]* @.str117, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 123, i64 8, i64 8, i64 0, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str119 = internal constant [5 x i8] c"lang\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype120 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str119, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 130, i64 8, i64 8, i64 8, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str121 = internal constant [12 x i8] c"name_length\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype122 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str121, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 135, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str123 = internal constant [10 x i8] c"full_name\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype124 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str123, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 138, i64 32, i64 32, i64 64, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype125 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite138 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str126 = internal constant [11 x i8] c"htable_ptr\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype127 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str126, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 142, i64 32, i64 32, i64 96, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype125 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str128 = internal constant [41 x i8] c"system__standard_library__exception_code\00", section "llvm.metadata" ; <[41 x i8]*> [#uses=1] @llvm.dbg.basictype129 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([41 x i8]* @.str128, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str130 = internal constant [12 x i8] c"import_code\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype131 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str130, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 147, i64 32, i64 32, i64 128, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype129 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array132 = internal constant [1 x { }*] zeroinitializer, section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @llvm.dbg.composite133 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array132 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype134 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite133 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str135 = internal constant [11 x i8] c"raise_hook\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype136 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str135, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 153, i64 32, i64 32, i64 160, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype134 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array137 = internal constant [7 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype118 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype120 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype122 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype124 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype127 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype131 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype136 to { }*) ], section "llvm.metadata" ; <[7 x { }*]*> [#uses=1] @llvm.dbg.composite138 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([41 x i8]* @.str114, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 91, i64 192, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([7 x { }*]* @llvm.dbg.array137 to { }*), i8* getelementptr ([13 x i8]* @.str115, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype139 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite138 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str140 = internal constant [19 x i8] c"exception_to_raise\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype141 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str140, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 734, i64 32, i64 32, i64 96, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype139 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype142 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite174 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str143 = internal constant [5 x i8] c"prev\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype144 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str143, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 738, i64 32, i64 32, i64 128, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype142 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str145 = internal constant [5 x i8] c"next\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype146 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str145, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 740, i64 32, i64 32, i64 160, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype142 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str147 = internal constant [40 x i8] c"system__tasking__atc_level___XDLU_0__19\00", section "llvm.metadata" ; <[40 x i8]*> [#uses=1] @llvm.dbg.basictype148 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([40 x i8]* @.str147, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str149 = internal constant [6 x i8] c"level\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.derivedtype150 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([6 x i8]* @.str149, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 742, i64 32, i64 32, i64 192, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype148 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str151 = internal constant [51 x i8] c"system__tasking__entry_index___XDLU_2m__2147483647\00", section "llvm.metadata" ; <[51 x i8]*> [#uses=1] @llvm.dbg.basictype152 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([51 x i8]* @.str151, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str153 = internal constant [2 x i8] c"e\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.derivedtype154 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str153, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 749, i64 32, i64 32, i64 224, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype152 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str155 = internal constant [5 x i8] c"prio\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype156 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str155, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 751, i64 32, i64 32, i64 256, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype59 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str157 = internal constant [12 x i8] c"called_task\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype158 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str157, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 757, i64 32, i64 32, i64 288, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str159 = internal constant [10 x i8] c"called_po\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype160 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str159, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 765, i64 32, i64 32, i64 320, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str161 = internal constant [19 x i8] c"acceptor_prev_call\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype162 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str161, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 776, i64 32, i64 32, i64 352, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype142 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str163 = internal constant [51 x i8] c"system__tasking__rendezvous_priority___XDLU_1m__31\00", section "llvm.metadata" ; <[51 x i8]*> [#uses=1] @llvm.dbg.basictype164 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([51 x i8]* @.str163, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str165 = internal constant [23 x i8] c"acceptor_prev_priority\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] @llvm.dbg.derivedtype166 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([23 x i8]* @.str165, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 779, i64 32, i64 32, i64 384, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype164 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str167 = internal constant [23 x i8] c"cancellation_attempted\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] @llvm.dbg.derivedtype168 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([23 x i8]* @.str167, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 784, i64 8, i64 8, i64 416, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str169 = internal constant [19 x i8] c"requeue_with_abort\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype170 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str169, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 789, i64 8, i64 8, i64 424, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str171 = internal constant [14 x i8] c"needs_requeue\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype172 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str171, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 793, i64 8, i64 8, i64 432, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array173 = internal constant [17 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype80 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype93 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype109 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype113 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype141 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype144 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype146 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype150 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype154 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype156 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype158 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype160 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype162 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype166 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype168 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype170 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype172 to { }*) ], section "llvm.metadata" ; <[17 x { }*]*> [#uses=1] @llvm.dbg.composite174 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([35 x i8]* @.str77, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 667, i64 448, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([17 x { }*]* @llvm.dbg.array173 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype175 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite174 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str176 = internal constant [5 x i8] c"call\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype177 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str176, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 475, i64 32, i64 32, i64 448, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype175 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str178 = internal constant [38 x i8] c"system__task_primitives__private_data\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] @.str179 = internal constant [8 x i8] c"i-c.ads\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @.str181 = internal constant [32 x i8] c"system__os_interface__pthread_t\00", section "llvm.metadata" ; <[32 x i8]*> [#uses=1] @llvm.dbg.basictype182 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([32 x i8]* @.str181, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str183 = internal constant [7 x i8] c"thread\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @.str184 = internal constant [13 x i8] c"s-taspri.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype185 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str183, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 94, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype182 to { }*), i8* getelementptr ([13 x i8]* @.str184, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str186 = internal constant [4 x i8] c"lwp\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] @llvm.dbg.derivedtype187 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str186, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 102, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str184, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange188 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 47 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array189 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange188 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @.str190 = internal constant [36 x i8] c"system__os_interface__unsigned_char\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.basictype191 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str190, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @llvm.dbg.composite192 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 384, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype191 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array189 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str193 = internal constant [3 x i8] c"cv\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] @llvm.dbg.derivedtype194 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str193, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 107, i64 384, i64 8, i64 64, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite192 to { }*), i8* getelementptr ([13 x i8]* @.str184, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str195 = internal constant [38 x i8] c"system__os_interface__pthread_mutex_t\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] @.str197 = internal constant [26 x i8] c"system__os_interface__int\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] @llvm.dbg.basictype198 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([26 x i8]* @.str197, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str199 = internal constant [11 x i8] c"m_reserved\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @.str200 = internal constant [13 x i8] c"s-osinte.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype201 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str199, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 509, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype198 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str202 = internal constant [8 x i8] c"m_count\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.derivedtype203 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str202, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 510, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype198 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str204 = internal constant [8 x i8] c"m_owner\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.derivedtype205 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str204, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 511, i64 32, i64 32, i64 64, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str206 = internal constant [7 x i8] c"m_kind\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @llvm.dbg.derivedtype207 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str206, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 512, i64 32, i64 32, i64 96, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype198 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str208 = internal constant [47 x i8] c"system__os_interface__struct_pthread_fast_lock\00", section "llvm.metadata" ; <[47 x i8]*> [#uses=1] @.str210 = internal constant [27 x i8] c"system__os_interface__long\00", section "llvm.metadata" ; <[27 x i8]*> [#uses=1] @llvm.dbg.basictype211 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([27 x i8]* @.str210, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str212 = internal constant [7 x i8] c"status\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @llvm.dbg.derivedtype213 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str212, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 503, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype211 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str214 = internal constant [9 x i8] c"spinlock\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype215 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str214, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 504, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype198 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array216 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype213 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype215 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite217 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([47 x i8]* @.str208, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 38, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array216 to { }*), i8* getelementptr ([8 x i8]* @.str179, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str218 = internal constant [7 x i8] c"m_lock\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @llvm.dbg.derivedtype219 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str218, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 513, i64 64, i64 32, i64 128, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite217 to { }*), i8* getelementptr ([13 x i8]* @.str200, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array220 = internal constant [5 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype201 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype203 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype205 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype207 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype219 to { }*) ], section "llvm.metadata" ; <[5 x { }*]*> [#uses=1] @llvm.dbg.composite221 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([38 x i8]* @.str195, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 38, i64 192, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([5 x { }*]* @llvm.dbg.array220 to { }*), i8* getelementptr ([8 x i8]* @.str179, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str222 = internal constant [2 x i8] c"l\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.derivedtype223 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str222, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 110, i64 192, i64 32, i64 448, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite221 to { }*), i8* getelementptr ([13 x i8]* @.str184, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array224 = internal constant [4 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype185 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype187 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype194 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype223 to { }*) ], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1] @llvm.dbg.composite225 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([38 x i8]* @.str178, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 38, i64 640, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]* @llvm.dbg.array224 to { }*), i8* getelementptr ([8 x i8]* @.str179, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str226 = internal constant [3 x i8] c"ll\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] @llvm.dbg.derivedtype227 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str226, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 482, i64 640, i64 32, i64 480, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite225 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str228 = internal constant [9 x i8] c"task_arg\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype229 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str228, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 489, i64 32, i64 32, i64 1120, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype230 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array231 = internal constant [2 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype230 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite232 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array231 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype233 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite232 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str234 = internal constant [17 x i8] c"task_entry_point\00", section "llvm.metadata" ; <[17 x i8]*> [#uses=1] @llvm.dbg.derivedtype235 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([17 x i8]* @.str234, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 497, i64 32, i64 32, i64 1152, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype233 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str236 = internal constant [24 x i8] c"system__soft_links__tsd\00", section "llvm.metadata" ; <[24 x i8]*> [#uses=1] @.str238 = internal constant [35 x i8] c"system__stack_checking__stack_info\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @.str239 = internal constant [13 x i8] c"s-stoele.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @.str241 = internal constant [6 x i8] c"limit\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @.str242 = internal constant [13 x i8] c"s-stache.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype243 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([6 x i8]* @.str241, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 51, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str242, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str244 = internal constant [5 x i8] c"base\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype245 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str244, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 52, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str242, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str246 = internal constant [41 x i8] c"system__storage_elements__storage_offset\00", section "llvm.metadata" ; <[41 x i8]*> [#uses=1] @llvm.dbg.basictype247 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([41 x i8]* @.str246, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str248 = internal constant [5 x i8] c"size\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype249 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str248, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 53, i64 32, i64 32, i64 64, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype247 to { }*), i8* getelementptr ([13 x i8]* @.str242, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array250 = internal constant [3 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype243 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype245 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype249 to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] @llvm.dbg.composite251 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([35 x i8]* @.str238, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 56, i64 96, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array250 to { }*), i8* getelementptr ([13 x i8]* @.str239, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str252 = internal constant [15 x i8] c"pri_stack_info\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @.str253 = internal constant [13 x i8] c"s-soflin.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype254 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str252, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 301, i64 96, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite251 to { }*), i8* getelementptr ([13 x i8]* @.str253, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str255 = internal constant [15 x i8] c"jmpbuf_address\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype256 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str255, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 309, i64 32, i64 32, i64 96, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str253, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str257 = internal constant [15 x i8] c"sec_stack_addr\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype258 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str257, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 316, i64 32, i64 32, i64 128, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str253, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str259 = internal constant [38 x i8] c"ada__exceptions__exception_occurrence\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] @.str261 = internal constant [3 x i8] c"id\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] @.str262 = internal constant [13 x i8] c"a-except.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype263 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str261, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 270, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype139 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str264 = internal constant [11 x i8] c"msg_length\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype265 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str264, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 276, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange266 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 1, i64 200 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array267 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange266 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @llvm.dbg.composite268 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 1600, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array267 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str269 = internal constant [4 x i8] c"msg\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] @llvm.dbg.derivedtype270 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str269, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 279, i64 1600, i64 8, i64 64, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite268 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str271 = internal constant [13 x i8] c"cleanup_flag\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype272 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str271, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 282, i64 8, i64 8, i64 1664, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str273 = internal constant [17 x i8] c"exception_raised\00", section "llvm.metadata" ; <[17 x i8]*> [#uses=1] @llvm.dbg.derivedtype274 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([17 x i8]* @.str273, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 289, i64 8, i64 8, i64 1672, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str275 = internal constant [4 x i8] c"pid\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] @llvm.dbg.derivedtype276 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str275, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 298, i64 32, i64 32, i64 1696, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str277 = internal constant [57 x i8] c"ada__exceptions__exception_occurrence__T10s___XDLU_0__50\00", section "llvm.metadata" ; <[57 x i8]*> [#uses=1] @llvm.dbg.basictype278 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([57 x i8]* @.str277, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str279 = internal constant [15 x i8] c"num_tracebacks\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype280 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str279, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 301, i64 32, i64 32, i64 1728, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype278 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange281 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 1, i64 50 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array282 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange281 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @.str283 = internal constant [64 x i8] c"system__traceback_entries__traceback_entry___XDLU_0__4294967295\00", section "llvm.metadata" ; <[64 x i8]*> [#uses=1] @llvm.dbg.basictype284 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([64 x i8]* @.str283, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @llvm.dbg.composite285 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 1600, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype284 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array282 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str286 = internal constant [11 x i8] c"tracebacks\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype287 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str286, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 304, i64 1600, i64 32, i64 1760, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite285 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str288 = internal constant [13 x i8] c"private_data\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype289 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str288, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 307, i64 32, i64 32, i64 3360, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str262, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array290 = internal constant [9 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype263 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype265 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype270 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype272 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype274 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype276 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype280 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype287 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype289 to { }*) ], section "llvm.metadata" ; <[9 x { }*]*> [#uses=1] @llvm.dbg.composite291 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([38 x i8]* @.str259, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 105, i64 3392, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([9 x { }*]* @llvm.dbg.array290 to { }*), i8* getelementptr ([11 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str292 = internal constant [14 x i8] c"current_excep\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype293 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str292, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 320, i64 3392, i64 32, i64 160, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite291 to { }*), i8* getelementptr ([13 x i8]* @.str253, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array294 = internal constant [4 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype254 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype256 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype258 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype293 to { }*) ], section "llvm.metadata" ; <[4 x { }*]*> [#uses=1] @llvm.dbg.composite295 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([24 x i8]* @.str236, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 105, i64 3552, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([4 x { }*]* @llvm.dbg.array294 to { }*), i8* getelementptr ([11 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str296 = internal constant [14 x i8] c"compiler_data\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype297 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str296, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 505, i64 3552, i64 32, i64 1184, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite295 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str298 = internal constant [15 x i8] c"all_tasks_link\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype299 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str298, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 511, i64 32, i64 32, i64 4736, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str300 = internal constant [16 x i8] c"activation_link\00", section "llvm.metadata" ; <[16 x i8]*> [#uses=1] @llvm.dbg.derivedtype301 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([16 x i8]* @.str300, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 516, i64 32, i64 32, i64 4768, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str302 = internal constant [10 x i8] c"activator\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype303 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str302, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 521, i64 32, i64 32, i64 4800, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str304 = internal constant [8 x i8] c"integer\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.basictype305 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str304, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str306 = internal constant [11 x i8] c"wait_count\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype307 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str306, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 529, i64 32, i64 32, i64 4832, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype308 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str309 = internal constant [11 x i8] c"elaborated\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype310 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str309, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 556, i64 32, i64 32, i64 4864, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype308 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str311 = internal constant [18 x i8] c"activation_failed\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype312 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str311, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 565, i64 8, i64 8, i64 4896, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str313 = internal constant [46 x i8] c"system__task_info__task_info_type___XDLU_0__2\00", section "llvm.metadata" ; <[46 x i8]*> [#uses=1] @llvm.dbg.basictype314 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([46 x i8]* @.str313, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str315 = internal constant [10 x i8] c"task_info\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype316 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str315, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 569, i64 8, i64 8, i64 4904, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype314 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str317 = internal constant [36 x i8] c"system__stack_usage__stack_analyzer\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.composite319 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 256, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array69 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str320 = internal constant [10 x i8] c"task_name\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @.str321 = internal constant [13 x i8] c"s-stausa.ads\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype322 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str320, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 276, i64 256, i64 8, i64 0, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite319 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype323 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str248, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 279, i64 32, i64 32, i64 256, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str324 = internal constant [29 x i8] c"system__stack_usage__word_32\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @llvm.dbg.basictype325 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([29 x i8]* @.str324, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str326 = internal constant [8 x i8] c"pattern\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.derivedtype327 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str326, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 282, i64 32, i64 32, i64 288, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype325 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str328 = internal constant [35 x i8] c"system__stack_usage__stack_address\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @llvm.dbg.basictype329 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([35 x i8]* @.str328, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str330 = internal constant [19 x i8] c"inner_pattern_mark\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype331 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str330, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 285, i64 32, i64 32, i64 320, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype329 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str332 = internal constant [19 x i8] c"outer_pattern_mark\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype333 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str332, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 288, i64 32, i64 32, i64 352, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype329 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str334 = internal constant [23 x i8] c"outermost_touched_mark\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] @llvm.dbg.derivedtype335 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([23 x i8]* @.str334, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 291, i64 32, i64 32, i64 384, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype329 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str336 = internal constant [16 x i8] c"bottom_of_stack\00", section "llvm.metadata" ; <[16 x i8]*> [#uses=1] @llvm.dbg.derivedtype337 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([16 x i8]* @.str336, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 297, i64 32, i64 32, i64 416, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype329 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str338 = internal constant [14 x i8] c"array_address\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype339 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str338, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 301, i64 32, i64 32, i64 448, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str340 = internal constant [19 x i8] c"first_is_outermost\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype341 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str340, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 304, i64 8, i64 8, i64 480, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str342 = internal constant [30 x i8] c"positive___XDLU_1__2147483647\00", section "llvm.metadata" ; <[30 x i8]*> [#uses=1] @llvm.dbg.basictype343 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([30 x i8]* @.str342, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str344 = internal constant [10 x i8] c"result_id\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype345 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str344, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 309, i64 32, i64 32, i64 512, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype343 to { }*), i8* getelementptr ([13 x i8]* @.str321, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array346 = internal constant [10 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype322 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype323 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype327 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype331 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype333 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype335 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype337 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype339 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype341 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype345 to { }*) ], section "llvm.metadata" ; <[10 x { }*]*> [#uses=1] @llvm.dbg.composite347 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str317, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 98, i64 544, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([10 x { }*]* @llvm.dbg.array346 to { }*), i8* getelementptr ([13 x i8]* @.str239, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str348 = internal constant [9 x i8] c"analyzer\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype349 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str348, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 573, i64 544, i64 32, i64 4928, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite347 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str350 = internal constant [25 x i8] c"global_task_lock_nesting\00", section "llvm.metadata" ; <[25 x i8]*> [#uses=1] @llvm.dbg.derivedtype351 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([25 x i8]* @.str350, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 576, i64 32, i64 32, i64 5472, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str352 = internal constant [37 x i8] c"system__tasking__termination_handler\00", section "llvm.metadata" ; <[37 x i8]*> [#uses=1] @.str354 = internal constant [5 x i8] c"P10s\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype355 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str354, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 355, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str356 = internal constant [24 x i8] c"system__tasking__normal\00", section "llvm.metadata" ; <[24 x i8]*> [#uses=1] @llvm.dbg.enumerator357 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([24 x i8]* @.str356, i32 0, i32 0), i64 0 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str358 = internal constant [26 x i8] c"system__tasking__abnormal\00", section "llvm.metadata" ; <[26 x i8]*> [#uses=1] @llvm.dbg.enumerator359 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([26 x i8]* @.str358, i32 0, i32 0), i64 1 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @.str360 = internal constant [37 x i8] c"system__tasking__unhandled_exception\00", section "llvm.metadata" ; <[37 x i8]*> [#uses=1] @llvm.dbg.enumerator361 = internal constant %llvm.dbg.enumerator.type { i32 458792, i8* getelementptr ([37 x i8]* @.str360, i32 0, i32 0), i64 2 }, section "llvm.metadata" ; <%llvm.dbg.enumerator.type*> [#uses=1] @llvm.dbg.array362 = internal constant [3 x { }*] [ { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator357 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator359 to { }*), { }* bitcast (%llvm.dbg.enumerator.type* @llvm.dbg.enumerator361 to { }*) ], section "llvm.metadata" ; <[3 x { }*]*> [#uses=1] @.str363 = internal constant [38 x i8] c"system__tasking__cause_of_termination\00", section "llvm.metadata" ; <[38 x i8]*> [#uses=1] @llvm.dbg.composite364 = internal constant %llvm.dbg.composite.type { i32 458756, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([38 x i8]* @.str363, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 343, i64 8, i64 8, i64 0, i32 0, { }* null, { }* bitcast ([3 x { }*]* @llvm.dbg.array362 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype365 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite364 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype366 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype55 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype367 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 3392, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite291 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype368 = internal constant %llvm.dbg.derivedtype.type { i32 458768, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype367 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array369 = internal constant [5 x { }*] [ { }* null, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype230 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype365 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype366 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype368 to { }*) ], section "llvm.metadata" ; <[5 x { }*]*> [#uses=1] @llvm.dbg.composite370 = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([5 x { }*]* @llvm.dbg.array369 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype371 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite370 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str372 = internal constant [4 x i8] c"S9s\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] @llvm.dbg.derivedtype373 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str372, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 355, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype371 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array374 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype355 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype373 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite375 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([37 x i8]* @.str352, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 355, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array374 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str376 = internal constant [18 x i8] c"fall_back_handler\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype377 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str376, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 585, i64 64, i64 32, i64 5504, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite375 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str378 = internal constant [17 x i8] c"specific_handler\00", section "llvm.metadata" ; <[17 x i8]*> [#uses=1] @llvm.dbg.derivedtype379 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([17 x i8]* @.str378, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 591, i64 64, i64 32, i64 5568, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite375 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array380 = internal constant [23 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype54 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype57 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype61 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype63 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype67 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype74 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype76 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype177 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype227 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype229 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype235 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype297 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype299 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype301 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype303 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype307 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype310 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype312 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype316 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype349 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype351 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype377 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype379 to { }*) ], section "llvm.metadata" ; <[23 x { }*]*> [#uses=1] @llvm.dbg.composite381 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([29 x i8]* @.str16, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 355, i64 5632, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([23 x { }*]* @llvm.dbg.array380 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str382 = internal constant [7 x i8] c"common\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] @llvm.dbg.derivedtype383 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([7 x i8]* @.str382, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 838, i64 5632, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite381 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange384 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 1, i64 19 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array385 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange384 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @llvm.dbg.composite386 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8512, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite174 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array385 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str387 = internal constant [12 x i8] c"entry_calls\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype388 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str387, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 841, i64 8512, i64 32, i64 5664, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite386 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str389 = internal constant [18 x i8] c"new_base_priority\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype390 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str389, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 848, i64 32, i64 32, i64 14176, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype59 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str391 = internal constant [36 x i8] c"system__tasking__accept_list_access\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.array393 = internal constant [0 x { }*] zeroinitializer, section "llvm.metadata" ; <[0 x { }*]*> [#uses=1] @.str394 = internal constant [36 x i8] c"system__tasking__accept_alternative\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @.str396 = internal constant [10 x i8] c"null_body\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.derivedtype397 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str396, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 685, i64 8, i64 8, i64 0, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str398 = internal constant [2 x i8] c"s\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.derivedtype399 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str398, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 686, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array400 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype397 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype399 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite401 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str394, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 684, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array400 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.composite402 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite401 to { }*), { }* bitcast ([0 x { }*]* @llvm.dbg.array393 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype403 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite402 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str404 = internal constant [8 x i8] c"P_ARRAY\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.derivedtype405 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str404, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 692, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype403 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype406 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 64, i64 32, i64 0, i32 0, { }* null, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype407 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype406 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str408 = internal constant [9 x i8] c"P_BOUNDS\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype409 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str408, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 692, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype407 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array410 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype405 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype409 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite411 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str391, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 692, i64 64, i64 64, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array410 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str412 = internal constant [13 x i8] c"open_accepts\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype413 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str412, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 853, i64 64, i64 64, i64 14208, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite411 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str414 = internal constant [51 x i8] c"system__tasking__select_index___XDLU_0__2147483647\00", section "llvm.metadata" ; <[51 x i8]*> [#uses=1] @llvm.dbg.basictype415 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([51 x i8]* @.str414, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str416 = internal constant [13 x i8] c"chosen_index\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype417 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str416, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 860, i64 32, i64 32, i64 14272, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype415 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str418 = internal constant [30 x i8] c"system__tasking__master_level\00", section "llvm.metadata" ; <[30 x i8]*> [#uses=1] @llvm.dbg.basictype419 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([30 x i8]* @.str418, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str420 = internal constant [15 x i8] c"master_of_task\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype421 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str420, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 870, i64 32, i64 32, i64 14304, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype419 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str422 = internal constant [14 x i8] c"master_within\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype423 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str422, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 877, i64 32, i64 32, i64 14336, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype419 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str424 = internal constant [12 x i8] c"alive_count\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype425 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str424, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 886, i64 32, i64 32, i64 14368, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str426 = internal constant [12 x i8] c"awake_count\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.derivedtype427 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([12 x i8]* @.str426, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 892, i64 32, i64 32, i64 14400, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str428 = internal constant [9 x i8] c"aborting\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype429 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str428, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 903, i64 8, i64 8, i64 14432, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str430 = internal constant [9 x i8] c"atc_hack\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype431 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str430, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 917, i64 8, i64 8, i64 14440, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str432 = internal constant [9 x i8] c"callable\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.derivedtype433 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str432, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 925, i64 8, i64 8, i64 14448, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str434 = internal constant [19 x i8] c"dependents_aborted\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] @llvm.dbg.derivedtype435 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str434, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 928, i64 8, i64 8, i64 14456, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str436 = internal constant [16 x i8] c"interrupt_entry\00", section "llvm.metadata" ; <[16 x i8]*> [#uses=1] @llvm.dbg.derivedtype437 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([16 x i8]* @.str436, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 934, i64 8, i64 8, i64 14464, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str438 = internal constant [15 x i8] c"pending_action\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype439 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str438, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 938, i64 8, i64 8, i64 14472, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str440 = internal constant [24 x i8] c"pending_priority_change\00", section "llvm.metadata" ; <[24 x i8]*> [#uses=1] @llvm.dbg.derivedtype441 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([24 x i8]* @.str440, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 954, i64 8, i64 8, i64 14480, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str442 = internal constant [22 x i8] c"terminate_alternative\00", section "llvm.metadata" ; <[22 x i8]*> [#uses=1] @llvm.dbg.derivedtype443 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([22 x i8]* @.str442, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 961, i64 8, i64 8, i64 14488, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str444 = internal constant [18 x i8] c"atc_nesting_level\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype445 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str444, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 970, i64 32, i64 32, i64 14496, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype148 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str446 = internal constant [15 x i8] c"deferral_level\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1] @llvm.dbg.derivedtype447 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([15 x i8]* @.str446, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 982, i64 32, i64 32, i64 14528, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype65 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str448 = internal constant [45 x i8] c"system__tasking__atc_level_base___XDLU_0__20\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1] @llvm.dbg.basictype449 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([45 x i8]* @.str448, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str450 = internal constant [18 x i8] c"pending_atc_level\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype451 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str450, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 990, i64 32, i64 32, i64 14560, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype449 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str452 = internal constant [36 x i8] c"system__tasking__task_serial_number\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.basictype453 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str452, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 64, i64 64, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str454 = internal constant [14 x i8] c"serial_number\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1] @llvm.dbg.derivedtype455 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([14 x i8]* @.str454, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1000, i64 64, i64 64, i64 14592, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype453 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str456 = internal constant [18 x i8] c"known_tasks_index\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype457 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str456, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1003, i64 32, i64 32, i64 14656, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str458 = internal constant [13 x i8] c"long_integer\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.basictype459 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str458, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str460 = internal constant [11 x i8] c"user_state\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype461 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str460, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1006, i64 32, i64 32, i64 14688, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype459 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.subrange462 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 1, i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array463 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange462 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @llvm.dbg.basictype464 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @llvm.dbg.derivedtype465 = internal constant %llvm.dbg.derivedtype.type { i32 458805, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype464 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.composite466 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 128, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype465 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array463 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str467 = internal constant [18 x i8] c"direct_attributes\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] @llvm.dbg.derivedtype468 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str467, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1010, i64 128, i64 32, i64 14720, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite466 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str469 = internal constant [37 x i8] c"system__tasking__direct_index_vector\00", section "llvm.metadata" ; <[37 x i8]*> [#uses=1] @llvm.dbg.basictype470 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([37 x i8]* @.str469, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str471 = internal constant [11 x i8] c"is_defined\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.derivedtype472 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([11 x i8]* @.str471, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1013, i64 8, i64 8, i64 14848, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype470 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype473 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype111 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str474 = internal constant [20 x i8] c"indirect_attributes\00", section "llvm.metadata" ; <[20 x i8]*> [#uses=1] @llvm.dbg.derivedtype475 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([20 x i8]* @.str474, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1016, i64 32, i64 32, i64 14880, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype473 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str476 = internal constant [29 x i8] c"system__tasking__entry_queue\00", section "llvm.metadata" ; <[29 x i8]*> [#uses=1] @.str478 = internal constant [5 x i8] c"head\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype479 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str478, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 240, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype175 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str480 = internal constant [5 x i8] c"tail\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.derivedtype481 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str480, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 241, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype175 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array482 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype479 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype481 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite483 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([29 x i8]* @.str476, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 239, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array482 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.composite484 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite483 to { }*), { }* bitcast ([0 x { }*]* @llvm.dbg.array393 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str485 = internal constant [13 x i8] c"entry_queues\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.derivedtype486 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str485, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1020, i64 32, i64 32, i64 14912, i32 1, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite484 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array487 = internal constant [28 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype383 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype388 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype390 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype413 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype417 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype421 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype423 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype425 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype427 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype429 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype431 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype433 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype435 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype437 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype439 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype441 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype443 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype445 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype447 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype451 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype455 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype457 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype461 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype468 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype472 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype475 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype486 to { }*) ], section "llvm.metadata" ; <[28 x { }*]*> [#uses=1] @llvm.dbg.composite488 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([40 x i8]* @.str11, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 1020, i64 32, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([28 x { }*]* @llvm.dbg.array487 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype489 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite488 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.composite490 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32000, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype489 to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array10 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str491 = internal constant [36 x i8] c"system__tasking__debug__known_tasks\00", section "llvm.metadata" ; <[36 x i8]*> [#uses=1] @llvm.dbg.global_variable492 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([36 x i8]* @.str491, i32 0, i32 0), i8* getelementptr ([36 x i8]* @.str491, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 70, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite490 to { }*), i1 false, i1 true, { }* bitcast ([1000 x %struct.system__tasking__ada_task_control_block*]* @system__tasking__debug__known_tasks to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @system__tasking__debug__trace_on = internal global [256 x i8] c"\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01", align 32 ; <[256 x i8]*> [#uses=3] @llvm.dbg.subrange493 = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 255 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] @llvm.dbg.array494 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange493 to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1] @llvm.dbg.composite495 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 2048, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array494 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str496 = internal constant [33 x i8] c"system__tasking__debug__trace_on\00", section "llvm.metadata" ; <[33 x i8]*> [#uses=1] @llvm.dbg.global_variable497 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([33 x i8]* @.str496, i32 0, i32 0), i8* getelementptr ([33 x i8]* @.str496, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite495 to { }*), i1 true, i1 true, { }* bitcast ([256 x i8]* @system__tasking__debug__trace_on to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] @.str498 = internal constant [43 x i8] c"system__tasking__debug__Ttrace_flag_setBIP\00", section "llvm.metadata" ; <[43 x i8]*> [#uses=1] @llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([43 x i8]* @.str498, i32 0, i32 0), i8* getelementptr ([43 x i8]* @.str498, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str499 = internal constant [47 x i8] c"system__tasking__debug__Ttrace_flag_setB___XUP\00", section "llvm.metadata" ; <[47 x i8]*> [#uses=1] @llvm.dbg.composite501 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), { }* bitcast ([0 x { }*]* @llvm.dbg.array393 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype502 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite501 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype503 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str404, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 53, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype502 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype504 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 16, i64 8, i64 0, i32 0, { }* null, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype505 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype504 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype506 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str408, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 53, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype505 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array507 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype503 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype506 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite508 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([47 x i8]* @.str499, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 53, i64 64, i64 64, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array507 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @.str509 = internal constant [6 x i8] c"_init\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([6 x i8]* @.str509, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 53, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite508 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str510 = internal constant [39 x i8] c"system__tasking__debug__get_user_state\00", section "llvm.metadata" ; <[39 x i8]*> [#uses=1] @llvm.dbg.subprogram511 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([39 x i8]* @.str510, i32 0, i32 0), i8* getelementptr ([39 x i8]* @.str510, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 73, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype459 to { }*), i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str512 = internal constant [35 x i8] c"system__tasking__debug__list_tasks\00", section "llvm.metadata" ; <[35 x i8]*> [#uses=1] @llvm.dbg.subprogram513 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([35 x i8]* @.str512, i32 0, i32 0), i8* getelementptr ([35 x i8]* @.str512, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 82, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str514 = internal constant [2 x i8] c"c\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.variable515 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram513 to { }*), i8* getelementptr ([2 x i8]* @.str514, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 83, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype489 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @system__tasking__all_tasks_list = external global %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=3] @.str516 = internal constant [43 x i8] c"system__tasking__debug__print_current_task\00", section "llvm.metadata" ; <[43 x i8]*> [#uses=1] @llvm.dbg.subprogram517 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([43 x i8]* @.str516, i32 0, i32 0), i8* getelementptr ([43 x i8]* @.str516, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 97, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str518 = internal constant [40 x i8] c"system__tasking__debug__print_task_info\00", section "llvm.metadata" ; <[40 x i8]*> [#uses=1] @llvm.dbg.subprogram519 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([40 x i8]* @.str518, i32 0, i32 0), i8* getelementptr ([40 x i8]* @.str518, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 106, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str520 = internal constant [2 x i8] c"t\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.variable521 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([2 x i8]* @.str520, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype366 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.basictype522 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str304, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @.str523 = internal constant [2 x i8] c"j\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] @llvm.dbg.variable524 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([2 x i8]* @.str523, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 155, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype522 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str525 = internal constant [55 x i8] c"system__tasking__debug__print_task_info__L_3__T29b___U\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] @llvm.dbg.variable526 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([55 x i8]* @.str525, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 155, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype522 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str527 = internal constant [55 x i8] c"system__tasking__debug__print_task_info__L_3__T29b___L\00", section "llvm.metadata" ; <[55 x i8]*> [#uses=1] @llvm.dbg.variable528 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([55 x i8]* @.str527, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 155, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype522 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable529 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([7 x i8]* @.str56, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 108, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype489 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str530 = internal constant [11 x i8] c"entry_call\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1] @llvm.dbg.variable531 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*), i8* getelementptr ([11 x i8]* @.str530, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 107, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype175 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str532 = internal constant [9 x i8] c"null task" ; <[9 x i8]*> [#uses=1] @C.0.798 = internal constant %llvm.dbg.anchor.type { i32 1, i32 9 } ; <%llvm.dbg.anchor.type*> [#uses=2] @llvm.dbg.derivedtype533 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 64, i64 32, i64 0, i32 0, { }* null, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str534 = internal constant [8 x i8] c"C.0.798\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.global_variable535 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str534, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str534, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 112, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.0.798 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @system__tasking__task_statesN = external constant [17 x i16] ; <[17 x i16]*> [#uses=1] @system__tasking__task_statesS = external constant [304 x i8] ; <[304 x i8]*> [#uses=1] @C.3.814 = internal constant %llvm.dbg.anchor.type { i32 1, i32 304 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str536 = internal constant [8 x i8] c"C.3.814\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.global_variable537 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str536, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str536, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 116, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.3.814 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str538 = internal constant [2 x i8] c": " ; <[2 x i8]*> [#uses=1] @C.5.820 = internal constant %llvm.dbg.anchor.type { i32 1, i32 2 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str539 = internal constant [8 x i8] c"C.5.820\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.global_variable540 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str539, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str539, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 116, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.5.820 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str541 = internal constant [16 x i8] c", parent: " ; <[16 x i8]*> [#uses=1] @C.7.830 = internal constant %llvm.dbg.anchor.type { i32 1, i32 16 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str542 = internal constant [8 x i8] c"C.7.830\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.global_variable543 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str542, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str542, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 122, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.7.830 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str544 = internal constant [10 x i8] c", parent: " ; <[10 x i8]*> [#uses=1] @C.14.848 = internal constant %llvm.dbg.anchor.type { i32 1, i32 10 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str545 = internal constant [9 x i8] c"C.14.848\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable546 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str545, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str545, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 124, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.14.848 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str547 = internal constant [7 x i8] c", prio:" ; <[7 x i8]*> [#uses=1] @C.15.855 = internal constant %llvm.dbg.anchor.type { i32 1, i32 7 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str548 = internal constant [9 x i8] c"C.15.855\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable549 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str548, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str548, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 128, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.15.855 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str550 = internal constant [14 x i8] c", not callable" ; <[14 x i8]*> [#uses=1] @C.16.860 = internal constant %llvm.dbg.anchor.type { i32 1, i32 14 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str551 = internal constant [9 x i8] c"C.16.860\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable552 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str551, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str551, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 131, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.16.860 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str553 = internal constant [10 x i8] c", aborting" ; <[10 x i8]*> [#uses=1] @C.17.865 = internal constant %llvm.dbg.anchor.type { i32 1, i32 10 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str554 = internal constant [9 x i8] c"C.17.865\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable555 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str554, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str554, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 135, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.17.865 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str556 = internal constant [16 x i8] c", abort deferred" ; <[16 x i8]*> [#uses=1] @C.18.869 = internal constant %llvm.dbg.anchor.type { i32 1, i32 16 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str557 = internal constant [9 x i8] c"C.18.869\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable558 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str557, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str557, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 139, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.18.869 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str559 = internal constant [10 x i8] c", serving:" ; <[10 x i8]*> [#uses=1] @C.19.874 = internal constant %llvm.dbg.anchor.type { i32 1, i32 10 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str560 = internal constant [9 x i8] c"C.19.874\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable561 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str560, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str560, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 144, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.19.874 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str562 = internal constant [12 x i8] c", accepting:" ; <[12 x i8]*> [#uses=1] @C.20.884 = internal constant %llvm.dbg.anchor.type { i32 1, i32 12 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str563 = internal constant [9 x i8] c"C.20.884\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable564 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str563, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str563, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 153, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.20.884 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str565 = internal constant [13 x i8] c" or terminate" ; <[13 x i8]*> [#uses=1] @C.22.907 = internal constant %llvm.dbg.anchor.type { i32 1, i32 13 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str566 = internal constant [9 x i8] c"C.22.907\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable567 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str566, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str566, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 160, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.22.907 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str568 = internal constant [8 x i8] c", state:" ; <[8 x i8]*> [#uses=1] @C.23.913 = internal constant %llvm.dbg.anchor.type { i32 1, i32 8 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str569 = internal constant [9 x i8] c"C.23.913\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable570 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str569, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str569, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 165, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.23.913 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str571 = internal constant [0 x i8] zeroinitializer ; <[0 x i8]*> [#uses=1] @C.24.917 = internal constant %llvm.dbg.anchor.type { i32 1, i32 0 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str572 = internal constant [9 x i8] c"C.24.917\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.global_variable573 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str572, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str572, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 168, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.24.917 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @__gnat_all_others_value = external constant i32 ; [#uses=5] @.str574 = internal constant [63 x i8] c"system__tasking__debug__print_task_info__L_3__B30b___clean.789\00", section "llvm.metadata" ; <[63 x i8]*> [#uses=1] @llvm.dbg.subprogram575 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([63 x i8]* @.str574, i32 0, i32 0), i8* getelementptr ([63 x i8]* @.str574, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str576 = internal constant [63 x i8] c"system__tasking__debug__print_task_info__L_2__B26b___clean.775\00", section "llvm.metadata" ; <[63 x i8]*> [#uses=1] @llvm.dbg.subprogram577 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([63 x i8]* @.str576, i32 0, i32 0), i8* getelementptr ([63 x i8]* @.str576, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str578 = internal constant [52 x i8] c"system__tasking__debug__print_task_info___clean.697\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] @llvm.dbg.subprogram579 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([52 x i8]* @.str578, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str578, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 55, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str580 = internal constant [28 x i8] c"system__tasking__debug__put\00", section "llvm.metadata" ; <[28 x i8]*> [#uses=1] @llvm.dbg.subprogram581 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([28 x i8]* @.str580, i32 0, i32 0), i8* getelementptr ([28 x i8]* @.str580, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 175, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str582 = internal constant [13 x i8] c"string___XUP\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] @llvm.dbg.composite584 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), { }* bitcast ([0 x { }*]* @llvm.dbg.array393 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.derivedtype585 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite584 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype586 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str404, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 468, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype585 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype587 = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.derivedtype588 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str408, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 468, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype587 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.array589 = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype586 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype588 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] @llvm.dbg.composite590 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str582, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 468, i64 64, i64 64, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array589 to { }*), i8* getelementptr ([13 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] @llvm.dbg.variable591 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram581 to { }*), i8* getelementptr ([2 x i8]* @.str398, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 63, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite590 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str592 = internal constant [33 x i8] c"system__tasking__debug__put_line\00", section "llvm.metadata" ; <[33 x i8]*> [#uses=1] @llvm.dbg.subprogram593 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([33 x i8]* @.str592, i32 0, i32 0), i8* getelementptr ([33 x i8]* @.str592, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 184, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.variable594 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram593 to { }*), i8* getelementptr ([2 x i8]* @.str398, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 66, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite590 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str595 = internal constant [46 x i8] c"system__tasking__debug__put_line___clean.1009\00", section "llvm.metadata" ; <[46 x i8]*> [#uses=1] @llvm.dbg.subprogram596 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([46 x i8]* @.str595, i32 0, i32 0), i8* getelementptr ([46 x i8]* @.str595, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 66, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str597 = internal constant [41 x i8] c"system__tasking__debug__resume_all_tasks\00", section "llvm.metadata" ; <[41 x i8]*> [#uses=1] @llvm.dbg.subprogram598 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([41 x i8]* @.str597, i32 0, i32 0), i8* getelementptr ([41 x i8]* @.str597, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 193, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str599 = internal constant [32 x i8] c"system__os_interface__thread_id\00", section "llvm.metadata" ; <[32 x i8]*> [#uses=1] @llvm.dbg.basictype600 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([32 x i8]* @.str599, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] @llvm.dbg.derivedtype601 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype600 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str602 = internal constant [12 x i8] c"thread_self\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1] @llvm.dbg.variable603 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram598 to { }*), i8* getelementptr ([12 x i8]* @.str602, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 93, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype601 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str604 = internal constant [6 x i8] c"dummy\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.variable605 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram598 to { }*), i8* getelementptr ([6 x i8]* @.str604, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 195, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable606 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram598 to { }*), i8* getelementptr ([2 x i8]* @.str514, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 194, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype489 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str607 = internal constant [34 x i8] c"system__tasking__debug__set_trace\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1] @llvm.dbg.subprogram608 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([34 x i8]* @.str607, i32 0, i32 0), i8* getelementptr ([34 x i8]* @.str607, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 214, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.derivedtype609 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype71 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str610 = internal constant [5 x i8] c"flag\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] @llvm.dbg.variable611 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram608 to { }*), i8* getelementptr ([5 x i8]* @.str610, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 112, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype609 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.derivedtype612 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 8, i64 8, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str613 = internal constant [6 x i8] c"value\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.variable614 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram608 to { }*), i8* getelementptr ([6 x i8]* @.str613, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 113, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype612 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str615 = internal constant [39 x i8] c"system__tasking__debug__set_user_state\00", section "llvm.metadata" ; <[39 x i8]*> [#uses=1] @llvm.dbg.subprogram616 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([39 x i8]* @.str615, i32 0, i32 0), i8* getelementptr ([39 x i8]* @.str615, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 223, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.derivedtype617 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype459 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @llvm.dbg.variable618 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram616 to { }*), i8* getelementptr ([6 x i8]* @.str613, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 58, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype617 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str619 = internal constant [42 x i8] c"system__tasking__debug__suspend_all_tasks\00", section "llvm.metadata" ; <[42 x i8]*> [#uses=1] @llvm.dbg.subprogram620 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([42 x i8]* @.str619, i32 0, i32 0), i8* getelementptr ([42 x i8]* @.str619, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 232, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.variable621 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram620 to { }*), i8* getelementptr ([12 x i8]* @.str602, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 88, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype601 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable622 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram620 to { }*), i8* getelementptr ([6 x i8]* @.str604, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 234, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable623 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram620 to { }*), i8* getelementptr ([2 x i8]* @.str514, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 233, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype489 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str624 = internal constant [43 x i8] c"system__tasking__debug__task_creation_hook\00", section "llvm.metadata" ; <[43 x i8]*> [#uses=1] @llvm.dbg.subprogram625 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([43 x i8]* @.str624, i32 0, i32 0), i8* getelementptr ([43 x i8]* @.str624, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 253, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.variable626 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram625 to { }*), i8* getelementptr ([7 x i8]* @.str183, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 81, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype601 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str627 = internal constant [46 x i8] c"system__tasking__debug__task_termination_hook\00", section "llvm.metadata" ; <[46 x i8]*> [#uses=1] @llvm.dbg.subprogram628 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([46 x i8]* @.str627, i32 0, i32 0), i8* getelementptr ([46 x i8]* @.str627, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 266, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str629 = internal constant [30 x i8] c"system__tasking__debug__trace\00", section "llvm.metadata" ; <[30 x i8]*> [#uses=1] @llvm.dbg.subprogram630 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([30 x i8]* @.str629, i32 0, i32 0), i8* getelementptr ([30 x i8]* @.str629, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 275, { }* null, i1 false, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str631 = internal constant [8 x i8] c"self_id\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.variable632 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*), i8* getelementptr ([8 x i8]* @.str631, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 103, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype366 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable633 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*), i8* getelementptr ([4 x i8]* @.str269, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 104, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite590 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable634 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*), i8* getelementptr ([5 x i8]* @.str610, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 105, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype609 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str635 = internal constant [9 x i8] c"other_id\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] @llvm.dbg.variable636 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*), i8* getelementptr ([9 x i8]* @.str635, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 106, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype366 to { }*), i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str637 = internal constant [1 x i8] c":" ; <[1 x i8]*> [#uses=1] @C.41.1163 = internal constant %llvm.dbg.anchor.type { i32 1, i32 1 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str638 = internal constant [10 x i8] c"C.41.1163\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.global_variable639 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str638, i32 0, i32 0), i8* getelementptr ([10 x i8]* @.str638, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 283, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.41.1163 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @C.44.1168 = internal constant %llvm.dbg.anchor.type { i32 1, i32 1 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str640 = internal constant [10 x i8] c"C.44.1168\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.global_variable641 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str640, i32 0, i32 0), i8* getelementptr ([10 x i8]* @.str640, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 283, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.44.1168 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @C.45.1170 = internal constant %llvm.dbg.anchor.type { i32 1, i32 1 } ; <%llvm.dbg.anchor.type*> [#uses=2] @.str642 = internal constant [10 x i8] c"C.45.1170\00", section "llvm.metadata" ; <[10 x i8]*> [#uses=1] @llvm.dbg.global_variable643 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([10 x i8]* @.str642, i32 0, i32 0), i8* getelementptr ([10 x i8]* @.str642, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 283, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype533 to { }*), i1 true, i1 true, { }* bitcast (%llvm.dbg.anchor.type* @C.45.1170 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] @.str644 = internal constant [43 x i8] c"system__tasking__debug__trace___clean.1098\00", section "llvm.metadata" ; <[43 x i8]*> [#uses=1] @llvm.dbg.subprogram645 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([43 x i8]* @.str644, i32 0, i32 0), i8* getelementptr ([43 x i8]* @.str644, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 102, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str9, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @.str646 = internal constant [30 x i8] c"system__tasking__debug__write\00", section "llvm.metadata" ; <[30 x i8]*> [#uses=1] @llvm.dbg.subprogram647 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([30 x i8]* @.str646, i32 0, i32 0), i8* getelementptr ([30 x i8]* @.str646, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 300, { }* null, i1 true, i1 true, i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] @llvm.dbg.derivedtype648 = internal constant %llvm.dbg.derivedtype.type { i32 458790, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] @.str649 = internal constant [3 x i8] c"fd\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] @llvm.dbg.variable650 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*), i8* getelementptr ([3 x i8]* @.str649, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 61, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype648 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @llvm.dbg.variable651 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*), i8* getelementptr ([2 x i8]* @.str398, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 61, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite590 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str652 = internal constant [6 x i8] c"count\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] @llvm.dbg.variable653 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*), i8* getelementptr ([6 x i8]* @.str652, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 61, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype648 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] @.str654 = internal constant [8 x i8] c"discard\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] @llvm.dbg.variable655 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*), i8* getelementptr ([8 x i8]* @.str654, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 301, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype305 to { }*), i8* getelementptr ([13 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([55 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] define void @system__tasking__debug__Ttrace_flag_setBIP(i8* %_init.0, %struct.system__tasking__debug__Ttrace_flag_setB___XUB* %_init.1) { entry: %_init_addr = alloca %struct.system__tasking__debug__Ttrace_flag_setB___XUP ; <%struct.system__tasking__debug__Ttrace_flag_setB___XUP*> [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) %0 = bitcast %struct.system__tasking__debug__Ttrace_flag_setB___XUP* %_init_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) %1 = getelementptr %struct.system__tasking__debug__Ttrace_flag_setB___XUP* %_init_addr, i32 0, i32 0 ; [#uses=1] store i8* %_init.0, i8** %1 %2 = getelementptr %struct.system__tasking__debug__Ttrace_flag_setB___XUP* %_init_addr, i32 0, i32 1 ; <%struct.system__tasking__debug__Ttrace_flag_setB___XUB**> [#uses=1] store %struct.system__tasking__debug__Ttrace_flag_setB___XUB* %_init.1, %struct.system__tasking__debug__Ttrace_flag_setB___XUB** %2 call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) ret void } declare void @llvm.dbg.func.start({ }*) nounwind declare void @llvm.dbg.declare({ }*, { }*) nounwind declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind declare void @llvm.dbg.region.end({ }*) nounwind define i32 @system__tasking__debug__get_user_state() { entry: %retval = alloca i32 ; [#uses=2] %0 = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=2] %1 = alloca i32 ; [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram511 to { }*)) call void @llvm.dbg.stoppoint(i32 75, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %2 = call %struct.system__tasking__ada_task_control_block* @system__task_primitives__operations__self() ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %2, %struct.system__tasking__ada_task_control_block** %0, align 4 %3 = load %struct.system__tasking__ada_task_control_block** %0, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %4 = getelementptr %struct.system__tasking__ada_task_control_block* %3, i32 0, i32 23 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %1, align 4 %6 = load i32* %1, align 4 ; [#uses=1] store i32 %6, i32* %retval, align 4 br label %return return: ; preds = %entry %retval1 = load i32* %retval ; [#uses=1] call void @llvm.dbg.stoppoint(i32 75, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram511 to { }*)) ret i32 %retval1 } declare %struct.system__tasking__ada_task_control_block* @system__task_primitives__operations__self() define void @system__tasking__debug__list_tasks() { entry: %c = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=7] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram513 to { }*)) %0 = bitcast %struct.system__tasking__ada_task_control_block** %c to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable515 to { }*)) call void @llvm.dbg.stoppoint(i32 83, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) store %struct.system__tasking__ada_task_control_block* null, %struct.system__tasking__ada_task_control_block** %c, align 4 call void @llvm.dbg.stoppoint(i32 85, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.system__tasking__ada_task_control_block** @system__tasking__all_tasks_list, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %1, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb bb: ; preds = %bb1, %entry call void @llvm.dbg.stoppoint(i32 87, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %2 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %3 = icmp eq %struct.system__tasking__ada_task_control_block* %2, null ; [#uses=1] br i1 %3, label %bb2, label %bb1 ; No predecessors! call void @llvm.dbg.stoppoint(i32 87, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb1 bb1: ; preds = %4, %bb call void @llvm.dbg.stoppoint(i32 88, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %5 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] call void @system__tasking__debug__print_task_info(%struct.system__tasking__ada_task_control_block* %5) call void @llvm.dbg.stoppoint(i32 89, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %6 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %7 = getelementptr %struct.system__tasking__ada_task_control_block* %6, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %8 = getelementptr %struct.system__tasking__common_atcb* %7, i32 0, i32 12 ; <%struct.system__tasking__ada_task_control_block**> [#uses=1] %9 = load %struct.system__tasking__ada_task_control_block** %8, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %9, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb ; No predecessors! call void @llvm.dbg.stoppoint(i32 89, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb2 bb2: ; preds = %10, %bb call void @llvm.dbg.stoppoint(i32 89, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %return return: ; preds = %bb2 call void @llvm.dbg.stoppoint(i32 89, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram513 to { }*)) ret void } define void @system__tasking__debug__print_task_info(%struct.system__tasking__ada_task_control_block* %t) { entry: %t_addr = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=23] %save_filt.34 = alloca i32 ; [#uses=2] %save_eptr.33 = alloca i8* ; [#uses=2] %save_filt.32 = alloca i32 ; [#uses=2] %save_eptr.31 = alloca i8* ; [#uses=2] %save_filt.30 = alloca i32 ; [#uses=2] %save_eptr.29 = alloca i8* ; [#uses=2] %M31b = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=0] %j = alloca i32 ; [#uses=6] %M27b = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=0] %system__tasking__debug__print_task_info__L_3__T29b___U = alloca i32 ; [#uses=2] %system__tasking__debug__print_task_info__L_3__T29b___L = alloca i32 ; [#uses=2] %R15b = alloca i32 ; [#uses=6] %parent = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=6] %entry_call = alloca %struct.system__tasking__entry_call_record* ; <%struct.system__tasking__entry_call_record**> [#uses=7] %M35b = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=0] %0 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %1 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %2 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %3 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %4 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %5 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %6 = alloca i32 ; [#uses=3] %7 = alloca i32 ; [#uses=3] %8 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %9 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %10 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %11 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %12 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %13 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %14 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %15 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %16 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %17 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %18 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %A.12 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=3] %19 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %20 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %21 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %A.6 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=3] %22 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %23 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %24 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %25 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %26 = alloca i32 ; [#uses=6] %27 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %FRAME.25 = alloca %struct.FRAME.system__tasking__debug__print_task_info ; <%struct.FRAME.system__tasking__debug__print_task_info*> [#uses=9] %eh_exception = alloca i8* ; [#uses=13] %eh_selector = alloca i32 ; [#uses=9] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*)) %28 = bitcast %struct.system__tasking__ada_task_control_block** %t_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %28, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable521 to { }*)) store %struct.system__tasking__ada_task_control_block* %t, %struct.system__tasking__ada_task_control_block** %t_addr %29 = bitcast i32* %j to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %29, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable524 to { }*)) %30 = bitcast i32* %system__tasking__debug__print_task_info__L_3__T29b___U to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %30, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable526 to { }*)) %31 = bitcast i32* %system__tasking__debug__print_task_info__L_3__T29b___L to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %31, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable528 to { }*)) %32 = bitcast %struct.system__tasking__ada_task_control_block** %parent to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %32, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable529 to { }*)) %33 = bitcast %struct.system__tasking__entry_call_record** %entry_call to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %33, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable531 to { }*)) call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %34 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %FRAME.25, i32 0, i32 2 ; <%llvm.dbg.anchor.type*> [#uses=1] call void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret %34) call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) store %struct.system__tasking__entry_call_record* null, %struct.system__tasking__entry_call_record** %entry_call, align 4 call void @llvm.dbg.stoppoint(i32 108, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) store %struct.system__tasking__ada_task_control_block* null, %struct.system__tasking__ada_task_control_block** %parent, align 4 call void @llvm.dbg.stoppoint(i32 111, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %35 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %36 = icmp eq %struct.system__tasking__ada_task_control_block* %35, null ; [#uses=1] br i1 %36, label %bb, label %bb3 ; No predecessors! call void @llvm.dbg.stoppoint(i32 111, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb bb: ; preds = %37, %entry call void @llvm.dbg.stoppoint(i32 112, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %38 = getelementptr %struct.string___XUP* %27, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([9 x i8]* @.str532, i32 0, i32 0), i8** %38, align 4 %39 = getelementptr %struct.string___XUP* %27, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.0.798, %llvm.dbg.anchor.type** %39, align 4 %elt = getelementptr %struct.string___XUP* %27, i32 0, i32 0 ; [#uses=1] %val = load i8** %elt ; [#uses=1] %elt1 = getelementptr %struct.string___XUP* %27, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val2 = load %llvm.dbg.anchor.type** %elt1 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put_line(i8* %val, %llvm.dbg.anchor.type* %val2) to label %invcont unwind label %lpad invcont: ; preds = %bb br label %bb196 ; No predecessors! call void @llvm.dbg.stoppoint(i32 112, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb3 bb3: ; preds = %40, %entry call void @llvm.dbg.stoppoint(i32 116, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %41 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %42 = getelementptr %struct.system__tasking__ada_task_control_block* %41, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %43 = getelementptr %struct.system__tasking__common_atcb* %42, i32 0, i32 6 ; [#uses=1] %44 = load i32* %43, align 4 ; [#uses=1] store i32 %44, i32* %26, align 4 %45 = load i32* %26, align 4 ; [#uses=0] %46 = load i32* %26, align 4 ; [#uses=2] %47 = icmp sge i32 %46, 0 ; [#uses=1] %max = select i1 %47, i32 %46, i32 0 ; [#uses=0] %48 = load i32* %26, align 4 ; [#uses=2] %49 = icmp sge i32 %48, 0 ; [#uses=1] %max5 = select i1 %49, i32 %48, i32 0 ; [#uses=1] %max567 = sext i32 %max5 to i64 ; [#uses=1] %sextl = shl i64 %max567, 28 ; [#uses=1] %sextr = ashr i64 %sextl, 28 ; [#uses=2] %sextl9 = shl i64 %sextr, 28 ; [#uses=1] %sextr10 = ashr i64 %sextl9, 28 ; [#uses=0] %sextl11 = shl i64 %sextr, 28 ; [#uses=1] %sextr12 = ashr i64 %sextl11, 28 ; [#uses=1] %50 = mul i64 %sextr12, 8 ; [#uses=1] %sextl13 = shl i64 %50, 28 ; [#uses=1] %sextr14 = ashr i64 %sextl13, 28 ; [#uses=1] %sextl16 = shl i64 %sextr14, 28 ; [#uses=1] %sextr17 = ashr i64 %sextl16, 28 ; [#uses=0] %51 = load i32* %26, align 4 ; [#uses=2] %52 = icmp sge i32 %51, 0 ; [#uses=1] %max18 = select i1 %52, i32 %51, i32 0 ; [#uses=0] %53 = getelementptr %struct.string___XUP* %25, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([304 x i8]* @system__tasking__task_statesS, i32 0, i32 0), i8** %53, align 4 %54 = getelementptr %struct.string___XUP* %25, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.3.814, %llvm.dbg.anchor.type** %54, align 4 call void @llvm.dbg.stoppoint(i32 117, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %55 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %56 = getelementptr %struct.system__tasking__ada_task_control_block* %55, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %57 = getelementptr %struct.system__tasking__common_atcb* %56, i32 0, i32 0 ; [#uses=1] %58 = volatile load i8* %57, align 1 ; [#uses=1] call void @llvm.dbg.stoppoint(i32 116, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %59 = zext i8 %58 to i32 ; [#uses=1] %elt20 = getelementptr %struct.string___XUP* %25, i32 0, i32 0 ; [#uses=1] %val21 = load i8** %elt20 ; [#uses=1] %elt22 = getelementptr %struct.string___XUP* %25, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val23 = load %llvm.dbg.anchor.type** %elt22 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__img_enum__image_enumeration_16(%struct.string___XUP* noalias sret %24, i32 %59, i8* %val21, %llvm.dbg.anchor.type* %val23, i32 ptrtoint ([17 x i16]* @system__tasking__task_statesN to i32)) to label %invcont24 unwind label %lpad invcont24: ; preds = %bb3 call void @llvm.dbg.stoppoint(i32 116, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %60 = getelementptr %struct.string___XUP* %23, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([2 x i8]* @.str538, i32 0, i32 0), i8** %60, align 4 %61 = getelementptr %struct.string___XUP* %23, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.5.820, %llvm.dbg.anchor.type** %61, align 4 %62 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %63 = getelementptr %struct.system__tasking__ada_task_control_block* %62, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %64 = getelementptr %struct.system__tasking__common_atcb* %63, i32 0, i32 5 ; <[32 x i8]*> [#uses=1] %65 = getelementptr [32 x i8]* %64, i32 0, i32 0 ; [#uses=1] %66 = load i32* %26, align 4 ; [#uses=1] %67 = getelementptr %llvm.dbg.anchor.type* %A.6, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %67, align 4 %68 = getelementptr %llvm.dbg.anchor.type* %A.6, i32 0, i32 1 ; [#uses=1] store i32 %66, i32* %68, align 4 %69 = getelementptr %struct.string___XUP* %22, i32 0, i32 0 ; [#uses=1] store i8* %65, i8** %69, align 4 %70 = getelementptr %struct.string___XUP* %22, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %A.6, %llvm.dbg.anchor.type** %70, align 4 %elt25 = getelementptr %struct.string___XUP* %22, i32 0, i32 0 ; [#uses=1] %val26 = load i8** %elt25 ; [#uses=1] %elt27 = getelementptr %struct.string___XUP* %22, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val28 = load %llvm.dbg.anchor.type** %elt27 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt29 = getelementptr %struct.string___XUP* %23, i32 0, i32 0 ; [#uses=1] %val30 = load i8** %elt29 ; [#uses=1] %elt31 = getelementptr %struct.string___XUP* %23, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val32 = load %llvm.dbg.anchor.type** %elt31 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt33 = getelementptr %struct.string___XUP* %24, i32 0, i32 0 ; [#uses=1] %val34 = load i8** %elt33 ; [#uses=1] %elt35 = getelementptr %struct.string___XUP* %24, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val36 = load %llvm.dbg.anchor.type** %elt35 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops_concat_3__str_concat_3(%struct.string___XUP* noalias sret %21, i8* %val26, %llvm.dbg.anchor.type* %val28, i8* %val30, %llvm.dbg.anchor.type* %val32, i8* %val34, %llvm.dbg.anchor.type* %val36) to label %invcont37 unwind label %lpad invcont37: ; preds = %invcont24 call void @llvm.dbg.stoppoint(i32 116, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt38 = getelementptr %struct.string___XUP* %21, i32 0, i32 0 ; [#uses=1] %val39 = load i8** %elt38 ; [#uses=1] %elt40 = getelementptr %struct.string___XUP* %21, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val41 = load %llvm.dbg.anchor.type** %elt40 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val39, %llvm.dbg.anchor.type* %val41) to label %invcont42 unwind label %lpad invcont42: ; preds = %invcont37 call void @llvm.dbg.stoppoint(i32 119, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %71 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %72 = getelementptr %struct.system__tasking__ada_task_control_block* %71, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %73 = getelementptr %struct.system__tasking__common_atcb* %72, i32 0, i32 1 ; <%struct.system__tasking__ada_task_control_block**> [#uses=1] %74 = load %struct.system__tasking__ada_task_control_block** %73, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %74, %struct.system__tasking__ada_task_control_block** %parent, align 4 call void @llvm.dbg.stoppoint(i32 121, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %75 = load %struct.system__tasking__ada_task_control_block** %parent, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %76 = icmp eq %struct.system__tasking__ada_task_control_block* %75, null ; [#uses=1] br i1 %76, label %bb43, label %bb49 ; No predecessors! call void @llvm.dbg.stoppoint(i32 121, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb43 bb43: ; preds = %77, %invcont42 call void @llvm.dbg.stoppoint(i32 122, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %78 = getelementptr %struct.string___XUP* %20, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([16 x i8]* @.str541, i32 0, i32 0), i8** %78, align 4 %79 = getelementptr %struct.string___XUP* %20, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.7.830, %llvm.dbg.anchor.type** %79, align 4 %elt44 = getelementptr %struct.string___XUP* %20, i32 0, i32 0 ; [#uses=1] %val45 = load i8** %elt44 ; [#uses=1] %elt46 = getelementptr %struct.string___XUP* %20, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val47 = load %llvm.dbg.anchor.type** %elt46 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val45, %llvm.dbg.anchor.type* %val47) to label %invcont48 unwind label %lpad invcont48: ; preds = %bb43 br label %bb83 ; No predecessors! call void @llvm.dbg.stoppoint(i32 122, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb49 bb49: ; preds = %80, %invcont42 call void @llvm.dbg.stoppoint(i32 125, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %81 = load %struct.system__tasking__ada_task_control_block** %parent, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %82 = getelementptr %struct.system__tasking__ada_task_control_block* %81, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %83 = getelementptr %struct.system__tasking__common_atcb* %82, i32 0, i32 6 ; [#uses=1] %84 = load i32* %83, align 4 ; [#uses=1] store i32 %84, i32* %R15b, align 4 %85 = load i32* %R15b, align 4 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 124, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %86 = load i32* %R15b, align 4 ; [#uses=2] %87 = icmp sge i32 %86, 0 ; [#uses=1] %max50 = select i1 %87, i32 %86, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 125, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %88 = load i32* %R15b, align 4 ; [#uses=2] %89 = icmp sge i32 %88, 0 ; [#uses=1] %max52 = select i1 %89, i32 %88, i32 0 ; [#uses=1] %max525354 = sext i32 %max52 to i64 ; [#uses=1] %sextl55 = shl i64 %max525354, 28 ; [#uses=1] %sextr56 = ashr i64 %sextl55, 28 ; [#uses=2] %sextl58 = shl i64 %sextr56, 28 ; [#uses=1] %sextr59 = ashr i64 %sextl58, 28 ; [#uses=0] %sextl60 = shl i64 %sextr56, 28 ; [#uses=1] %sextr61 = ashr i64 %sextl60, 28 ; [#uses=1] %90 = mul i64 %sextr61, 8 ; [#uses=1] %sextl62 = shl i64 %90, 28 ; [#uses=1] %sextr63 = ashr i64 %sextl62, 28 ; [#uses=1] %sextl65 = shl i64 %sextr63, 28 ; [#uses=1] %sextr66 = ashr i64 %sextl65, 28 ; [#uses=0] %91 = load i32* %R15b, align 4 ; [#uses=2] %92 = icmp sge i32 %91, 0 ; [#uses=1] %max67 = select i1 %92, i32 %91, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 124, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %93 = load %struct.system__tasking__ada_task_control_block** %parent, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %94 = getelementptr %struct.system__tasking__ada_task_control_block* %93, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %95 = getelementptr %struct.system__tasking__common_atcb* %94, i32 0, i32 5 ; <[32 x i8]*> [#uses=1] %96 = getelementptr [32 x i8]* %95, i32 0, i32 0 ; [#uses=1] %97 = load i32* %R15b, align 4 ; [#uses=1] %98 = getelementptr %llvm.dbg.anchor.type* %A.12, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %98, align 4 %99 = getelementptr %llvm.dbg.anchor.type* %A.12, i32 0, i32 1 ; [#uses=1] store i32 %97, i32* %99, align 4 %100 = getelementptr %struct.string___XUP* %19, i32 0, i32 0 ; [#uses=1] store i8* %96, i8** %100, align 4 %101 = getelementptr %struct.string___XUP* %19, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %A.12, %llvm.dbg.anchor.type** %101, align 4 %102 = getelementptr %struct.string___XUP* %18, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([10 x i8]* @.str544, i32 0, i32 0), i8** %102, align 4 %103 = getelementptr %struct.string___XUP* %18, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.14.848, %llvm.dbg.anchor.type** %103, align 4 %elt69 = getelementptr %struct.string___XUP* %18, i32 0, i32 0 ; [#uses=1] %val70 = load i8** %elt69 ; [#uses=1] %elt71 = getelementptr %struct.string___XUP* %18, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val72 = load %llvm.dbg.anchor.type** %elt71 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt73 = getelementptr %struct.string___XUP* %19, i32 0, i32 0 ; [#uses=1] %val74 = load i8** %elt73 ; [#uses=1] %elt75 = getelementptr %struct.string___XUP* %19, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val76 = load %llvm.dbg.anchor.type** %elt75 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat(%struct.string___XUP* noalias sret %17, i8* %val70, %llvm.dbg.anchor.type* %val72, i8* %val74, %llvm.dbg.anchor.type* %val76) to label %invcont77 unwind label %lpad invcont77: ; preds = %bb49 call void @llvm.dbg.stoppoint(i32 124, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt78 = getelementptr %struct.string___XUP* %17, i32 0, i32 0 ; [#uses=1] %val79 = load i8** %elt78 ; [#uses=1] %elt80 = getelementptr %struct.string___XUP* %17, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val81 = load %llvm.dbg.anchor.type** %elt80 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val79, %llvm.dbg.anchor.type* %val81) to label %invcont82 unwind label %lpad invcont82: ; preds = %invcont77 call void @llvm.dbg.stoppoint(i32 124, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb83 bb83: ; preds = %invcont82, %invcont48 call void @llvm.dbg.stoppoint(i32 128, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %104 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %105 = getelementptr %struct.system__tasking__ada_task_control_block* %104, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %106 = getelementptr %struct.system__tasking__common_atcb* %105, i32 0, i32 3 ; [#uses=1] %107 = load i32* %106, align 4 ; [#uses=1] invoke void @system__img_int__image_integer(%struct.string___XUP* noalias sret %16, i32 %107) to label %invcont84 unwind label %lpad invcont84: ; preds = %bb83 call void @llvm.dbg.stoppoint(i32 128, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %108 = getelementptr %struct.string___XUP* %15, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([7 x i8]* @.str547, i32 0, i32 0), i8** %108, align 4 %109 = getelementptr %struct.string___XUP* %15, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.15.855, %llvm.dbg.anchor.type** %109, align 4 %elt85 = getelementptr %struct.string___XUP* %15, i32 0, i32 0 ; [#uses=1] %val86 = load i8** %elt85 ; [#uses=1] %elt87 = getelementptr %struct.string___XUP* %15, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val88 = load %llvm.dbg.anchor.type** %elt87 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt89 = getelementptr %struct.string___XUP* %16, i32 0, i32 0 ; [#uses=1] %val90 = load i8** %elt89 ; [#uses=1] %elt91 = getelementptr %struct.string___XUP* %16, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val92 = load %llvm.dbg.anchor.type** %elt91 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat(%struct.string___XUP* noalias sret %14, i8* %val86, %llvm.dbg.anchor.type* %val88, i8* %val90, %llvm.dbg.anchor.type* %val92) to label %invcont93 unwind label %lpad invcont93: ; preds = %invcont84 call void @llvm.dbg.stoppoint(i32 128, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt94 = getelementptr %struct.string___XUP* %14, i32 0, i32 0 ; [#uses=1] %val95 = load i8** %elt94 ; [#uses=1] %elt96 = getelementptr %struct.string___XUP* %14, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val97 = load %llvm.dbg.anchor.type** %elt96 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val95, %llvm.dbg.anchor.type* %val97) to label %invcont98 unwind label %lpad invcont98: ; preds = %invcont93 call void @llvm.dbg.stoppoint(i32 130, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %110 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %111 = getelementptr %struct.system__tasking__ada_task_control_block* %110, i32 0, i32 12 ; [#uses=1] %112 = load i8* %111, align 1 ; [#uses=1] %113 = icmp eq i8 %112, 0 ; [#uses=1] br i1 %113, label %bb99, label %bb105 ; No predecessors! call void @llvm.dbg.stoppoint(i32 130, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb99 bb99: ; preds = %114, %invcont98 call void @llvm.dbg.stoppoint(i32 131, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %115 = getelementptr %struct.string___XUP* %13, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([14 x i8]* @.str550, i32 0, i32 0), i8** %115, align 4 %116 = getelementptr %struct.string___XUP* %13, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.16.860, %llvm.dbg.anchor.type** %116, align 4 %elt100 = getelementptr %struct.string___XUP* %13, i32 0, i32 0 ; [#uses=1] %val101 = load i8** %elt100 ; [#uses=1] %elt102 = getelementptr %struct.string___XUP* %13, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val103 = load %llvm.dbg.anchor.type** %elt102 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val101, %llvm.dbg.anchor.type* %val103) to label %invcont104 unwind label %lpad invcont104: ; preds = %bb99 call void @llvm.dbg.stoppoint(i32 131, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb105 bb105: ; preds = %invcont104, %invcont98 call void @llvm.dbg.stoppoint(i32 134, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %117 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %118 = getelementptr %struct.system__tasking__ada_task_control_block* %117, i32 0, i32 10 ; [#uses=1] %119 = volatile load i8* %118, align 1 ; [#uses=1] %toBool = icmp ne i8 %119, 0 ; [#uses=1] br i1 %toBool, label %bb106, label %bb112 ; No predecessors! call void @llvm.dbg.stoppoint(i32 134, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb106 bb106: ; preds = %120, %bb105 call void @llvm.dbg.stoppoint(i32 135, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %121 = getelementptr %struct.string___XUP* %12, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([10 x i8]* @.str553, i32 0, i32 0), i8** %121, align 4 %122 = getelementptr %struct.string___XUP* %12, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.17.865, %llvm.dbg.anchor.type** %122, align 4 %elt107 = getelementptr %struct.string___XUP* %12, i32 0, i32 0 ; [#uses=1] %val108 = load i8** %elt107 ; [#uses=1] %elt109 = getelementptr %struct.string___XUP* %12, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val110 = load %llvm.dbg.anchor.type** %elt109 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val108, %llvm.dbg.anchor.type* %val110) to label %invcont111 unwind label %lpad invcont111: ; preds = %bb106 call void @llvm.dbg.stoppoint(i32 135, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb112 bb112: ; preds = %invcont111, %bb105 call void @llvm.dbg.stoppoint(i32 138, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %123 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %124 = getelementptr %struct.system__tasking__ada_task_control_block* %123, i32 0, i32 19 ; [#uses=1] %125 = load i32* %124, align 4 ; [#uses=1] %126 = icmp ne i32 %125, 0 ; [#uses=1] br i1 %126, label %bb113, label %bb119 ; No predecessors! call void @llvm.dbg.stoppoint(i32 138, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb113 bb113: ; preds = %127, %bb112 call void @llvm.dbg.stoppoint(i32 139, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %128 = getelementptr %struct.string___XUP* %11, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([16 x i8]* @.str556, i32 0, i32 0), i8** %128, align 4 %129 = getelementptr %struct.string___XUP* %11, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.18.869, %llvm.dbg.anchor.type** %129, align 4 %elt114 = getelementptr %struct.string___XUP* %11, i32 0, i32 0 ; [#uses=1] %val115 = load i8** %elt114 ; [#uses=1] %elt116 = getelementptr %struct.string___XUP* %11, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val117 = load %llvm.dbg.anchor.type** %elt116 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val115, %llvm.dbg.anchor.type* %val117) to label %invcont118 unwind label %lpad invcont118: ; preds = %bb113 call void @llvm.dbg.stoppoint(i32 139, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb119 bb119: ; preds = %invcont118, %bb112 call void @llvm.dbg.stoppoint(i32 142, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %130 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %131 = getelementptr %struct.system__tasking__ada_task_control_block* %130, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %132 = getelementptr %struct.system__tasking__common_atcb* %131, i32 0, i32 7 ; <%struct.system__tasking__entry_call_record**> [#uses=1] %133 = load %struct.system__tasking__entry_call_record** %132, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] %134 = icmp ne %struct.system__tasking__entry_call_record* %133, null ; [#uses=1] br i1 %134, label %bb120, label %bb139 ; No predecessors! call void @llvm.dbg.stoppoint(i32 142, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb120 bb120: ; preds = %135, %bb119 call void @llvm.dbg.stoppoint(i32 143, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %136 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %137 = getelementptr %struct.system__tasking__ada_task_control_block* %136, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %138 = getelementptr %struct.system__tasking__common_atcb* %137, i32 0, i32 7 ; <%struct.system__tasking__entry_call_record**> [#uses=1] %139 = load %struct.system__tasking__entry_call_record** %138, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] store %struct.system__tasking__entry_call_record* %139, %struct.system__tasking__entry_call_record** %entry_call, align 4 call void @llvm.dbg.stoppoint(i32 144, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %140 = getelementptr %struct.string___XUP* %10, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([10 x i8]* @.str559, i32 0, i32 0), i8** %140, align 4 %141 = getelementptr %struct.string___XUP* %10, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.19.874, %llvm.dbg.anchor.type** %141, align 4 %elt121 = getelementptr %struct.string___XUP* %10, i32 0, i32 0 ; [#uses=1] %val122 = load i8** %elt121 ; [#uses=1] %elt123 = getelementptr %struct.string___XUP* %10, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val124 = load %llvm.dbg.anchor.type** %elt123 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val122, %llvm.dbg.anchor.type* %val124) to label %invcont125 unwind label %lpad invcont125: ; preds = %bb120 call void @llvm.dbg.stoppoint(i32 144, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb126 bb126: ; preds = %bb138, %invcont125 call void @llvm.dbg.stoppoint(i32 146, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %142 = load %struct.system__tasking__entry_call_record** %entry_call, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] %143 = icmp eq %struct.system__tasking__entry_call_record* %142, null ; [#uses=1] br i1 %143, label %bb139, label %bb127 ; No predecessors! call void @llvm.dbg.stoppoint(i32 146, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb127 bb127: ; preds = %144, %bb126 call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %145 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %FRAME.25, i32 0, i32 1 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret %145) to label %invcont128 unwind label %lpad invcont128: ; preds = %bb127 call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %146 = load %struct.system__tasking__entry_call_record** %entry_call, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] %147 = getelementptr %struct.system__tasking__entry_call_record* %146, i32 0, i32 0 ; <%struct.system__tasking__ada_task_control_block**> [#uses=1] %148 = load %struct.system__tasking__ada_task_control_block** %147, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %149 = ptrtoint %struct.system__tasking__ada_task_control_block* %148 to i32 ; [#uses=1] invoke void @system__img_uns__image_unsigned(%struct.string___XUP* noalias sret %9, i32 %149) to label %invcont129 unwind label %lpad199 invcont129: ; preds = %invcont128 call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt130 = getelementptr %struct.string___XUP* %9, i32 0, i32 0 ; [#uses=1] %val131 = load i8** %elt130 ; [#uses=1] %elt132 = getelementptr %struct.string___XUP* %9, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val133 = load %llvm.dbg.anchor.type** %elt132 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val131, %llvm.dbg.anchor.type* %val133) to label %invcont134 unwind label %lpad199 invcont134: ; preds = %invcont129 call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) invoke void @system__tasking__debug__print_task_info__L_2__B26b___clean.775(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) to label %invcont135 unwind label %lpad invcont135: ; preds = %invcont134 br label %bb138 ; No predecessors! call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb136 bb136: ; preds = %ppad207, %150 call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select = load i32* %eh_selector ; [#uses=1] store i32 %eh_select, i32* %save_filt.30, align 4 %eh_value = load i8** %eh_exception ; [#uses=1] store i8* %eh_value, i8** %save_eptr.29, align 4 invoke void @system__tasking__debug__print_task_info__L_2__B26b___clean.775(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) to label %invcont137 unwind label %lpad invcont137: ; preds = %bb136 call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %151 = load i8** %save_eptr.29, align 4 ; [#uses=1] store i8* %151, i8** %eh_exception, align 4 %152 = load i32* %save_filt.30, align 4 ; [#uses=1] store i32 %152, i32* %eh_selector, align 4 br label %ppad ; No predecessors! call void @llvm.dbg.stoppoint(i32 147, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb138 bb138: ; preds = %153, %invcont135 call void @llvm.dbg.stoppoint(i32 148, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %154 = load %struct.system__tasking__entry_call_record** %entry_call, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] %155 = getelementptr %struct.system__tasking__entry_call_record* %154, i32 0, i32 12 ; <%struct.system__tasking__entry_call_record**> [#uses=1] %156 = load %struct.system__tasking__entry_call_record** %155, align 4 ; <%struct.system__tasking__entry_call_record*> [#uses=1] store %struct.system__tasking__entry_call_record* %156, %struct.system__tasking__entry_call_record** %entry_call, align 4 br label %bb126 ; No predecessors! call void @llvm.dbg.stoppoint(i32 148, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb139 bb139: ; preds = %157, %bb126, %bb119 call void @llvm.dbg.stoppoint(i32 152, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %158 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %159 = getelementptr %struct.system__tasking__ada_task_control_block* %158, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %160 = getelementptr %struct.system__tasking__accept_list_access* %159, i32 0, i32 0 ; <%struct.system__tasking__accept_alternative**> [#uses=1] %161 = load %struct.system__tasking__accept_alternative** %160, align 4 ; <%struct.system__tasking__accept_alternative*> [#uses=1] %162 = icmp ne %struct.system__tasking__accept_alternative* %161, null ; [#uses=1] br i1 %162, label %bb140, label %bb170 ; No predecessors! call void @llvm.dbg.stoppoint(i32 152, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb140 bb140: ; preds = %163, %bb139 call void @llvm.dbg.stoppoint(i32 153, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %164 = getelementptr %struct.string___XUP* %8, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([12 x i8]* @.str562, i32 0, i32 0), i8** %164, align 4 %165 = getelementptr %struct.string___XUP* %8, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.20.884, %llvm.dbg.anchor.type** %165, align 4 %elt141 = getelementptr %struct.string___XUP* %8, i32 0, i32 0 ; [#uses=1] %val142 = load i8** %elt141 ; [#uses=1] %elt143 = getelementptr %struct.string___XUP* %8, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val144 = load %llvm.dbg.anchor.type** %elt143 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val142, %llvm.dbg.anchor.type* %val144) to label %invcont145 unwind label %lpad invcont145: ; preds = %bb140 call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %166 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %167 = getelementptr %struct.system__tasking__ada_task_control_block* %166, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %168 = getelementptr %struct.system__tasking__accept_list_access* %167, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %169 = load %llvm.dbg.anchor.type** %168, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %170 = getelementptr %llvm.dbg.anchor.type* %169, i32 0, i32 0 ; [#uses=1] %171 = load i32* %170, align 4 ; [#uses=1] store i32 %171, i32* %system__tasking__debug__print_task_info__L_3__T29b___L, align 4 %172 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %173 = getelementptr %struct.system__tasking__ada_task_control_block* %172, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %174 = getelementptr %struct.system__tasking__accept_list_access* %173, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %175 = load %llvm.dbg.anchor.type** %174, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %176 = getelementptr %llvm.dbg.anchor.type* %175, i32 0, i32 1 ; [#uses=1] %177 = load i32* %176, align 4 ; [#uses=1] store i32 %177, i32* %system__tasking__debug__print_task_info__L_3__T29b___U, align 4 %178 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %179 = getelementptr %struct.system__tasking__ada_task_control_block* %178, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %180 = getelementptr %struct.system__tasking__accept_list_access* %179, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %181 = load %llvm.dbg.anchor.type** %180, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %182 = getelementptr %llvm.dbg.anchor.type* %181, i32 0, i32 0 ; [#uses=1] %183 = load i32* %182, align 4 ; [#uses=1] store i32 %183, i32* %7, align 4 %184 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %185 = getelementptr %struct.system__tasking__ada_task_control_block* %184, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %186 = getelementptr %struct.system__tasking__accept_list_access* %185, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %187 = load %llvm.dbg.anchor.type** %186, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %188 = getelementptr %llvm.dbg.anchor.type* %187, i32 0, i32 1 ; [#uses=1] %189 = load i32* %188, align 4 ; [#uses=1] store i32 %189, i32* %6, align 4 %190 = load i32* %7, align 4 ; [#uses=1] %191 = load i32* %6, align 4 ; [#uses=1] %192 = icmp sle i32 %190, %191 ; [#uses=1] br i1 %192, label %bb146, label %bb162 ; No predecessors! call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb146 bb146: ; preds = %193, %invcont145 call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %194 = load i32* %7, align 4 ; [#uses=1] store i32 %194, i32* %j, align 4 br label %bb147 bb147: ; preds = %bb161, %bb146 call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %195 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %FRAME.25, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret %195) to label %invcont148 unwind label %lpad invcont148: ; preds = %bb147 call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %196 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %197 = getelementptr %struct.system__tasking__ada_task_control_block* %196, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %198 = getelementptr %struct.system__tasking__accept_list_access* %197, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %199 = load %llvm.dbg.anchor.type** %198, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %200 = getelementptr %llvm.dbg.anchor.type* %199, i32 0, i32 0 ; [#uses=1] %201 = load i32* %200, align 4 ; [#uses=1] %202 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %203 = getelementptr %struct.system__tasking__ada_task_control_block* %202, i32 0, i32 4 ; <%struct.system__tasking__accept_list_access*> [#uses=1] %204 = getelementptr %struct.system__tasking__accept_list_access* %203, i32 0, i32 0 ; <%struct.system__tasking__accept_alternative**> [#uses=1] %205 = load %struct.system__tasking__accept_alternative** %204, align 4 ; <%struct.system__tasking__accept_alternative*> [#uses=1] %206 = load i32* %j, align 4 ; [#uses=1] %207 = sub i32 %206, %201 ; [#uses=1] %208 = getelementptr %struct.system__tasking__accept_alternative* %205, i32 %207 ; <%struct.system__tasking__accept_alternative*> [#uses=1] %209 = getelementptr %struct.system__tasking__accept_alternative* %208, i32 0, i32 1 ; [#uses=1] %210 = load i32* %209, align 4 ; [#uses=1] invoke void @system__img_int__image_integer(%struct.string___XUP* noalias sret %5, i32 %210) to label %invcont149 unwind label %lpad203 invcont149: ; preds = %invcont148 call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt150 = getelementptr %struct.string___XUP* %5, i32 0, i32 0 ; [#uses=1] %val151 = load i8** %elt150 ; [#uses=1] %elt152 = getelementptr %struct.string___XUP* %5, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val153 = load %llvm.dbg.anchor.type** %elt152 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val151, %llvm.dbg.anchor.type* %val153) to label %invcont154 unwind label %lpad203 invcont154: ; preds = %invcont149 call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) invoke void @system__tasking__debug__print_task_info__L_3__B30b___clean.789(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) to label %invcont155 unwind label %lpad invcont155: ; preds = %invcont154 br label %bb160 ; No predecessors! call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb156 bb156: ; preds = %ppad208, %211 call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select157 = load i32* %eh_selector ; [#uses=1] store i32 %eh_select157, i32* %save_filt.32, align 4 %eh_value158 = load i8** %eh_exception ; [#uses=1] store i8* %eh_value158, i8** %save_eptr.31, align 4 invoke void @system__tasking__debug__print_task_info__L_3__B30b___clean.789(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) to label %invcont159 unwind label %lpad invcont159: ; preds = %bb156 call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %212 = load i8** %save_eptr.31, align 4 ; [#uses=1] store i8* %212, i8** %eh_exception, align 4 %213 = load i32* %save_filt.32, align 4 ; [#uses=1] store i32 %213, i32* %eh_selector, align 4 br label %ppad ; No predecessors! call void @llvm.dbg.stoppoint(i32 156, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb160 bb160: ; preds = %214, %invcont155 call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %215 = load i32* %6, align 4 ; [#uses=1] %216 = load i32* %j, align 4 ; [#uses=1] %217 = icmp eq i32 %215, %216 ; [#uses=1] br i1 %217, label %bb162, label %bb161 ; No predecessors! call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb161 bb161: ; preds = %218, %bb160 call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %219 = load i32* %j, align 4 ; [#uses=1] %220 = add i32 %219, 1 ; [#uses=1] store i32 %220, i32* %j, align 4 br label %bb147 ; No predecessors! call void @llvm.dbg.stoppoint(i32 155, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb162 bb162: ; preds = %221, %bb160, %invcont145 call void @llvm.dbg.stoppoint(i32 159, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %222 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %223 = getelementptr %struct.system__tasking__ada_task_control_block* %222, i32 0, i32 17 ; [#uses=1] %224 = load i8* %223, align 1 ; [#uses=1] %toBool163 = icmp ne i8 %224, 0 ; [#uses=1] br i1 %toBool163, label %bb164, label %bb170 ; No predecessors! call void @llvm.dbg.stoppoint(i32 159, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb164 bb164: ; preds = %225, %bb162 call void @llvm.dbg.stoppoint(i32 160, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %226 = getelementptr %struct.string___XUP* %4, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([13 x i8]* @.str565, i32 0, i32 0), i8** %226, align 4 %227 = getelementptr %struct.string___XUP* %4, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.22.907, %llvm.dbg.anchor.type** %227, align 4 %elt165 = getelementptr %struct.string___XUP* %4, i32 0, i32 0 ; [#uses=1] %val166 = load i8** %elt165 ; [#uses=1] %elt167 = getelementptr %struct.string___XUP* %4, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val168 = load %llvm.dbg.anchor.type** %elt167 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val166, %llvm.dbg.anchor.type* %val168) to label %invcont169 unwind label %lpad invcont169: ; preds = %bb164 call void @llvm.dbg.stoppoint(i32 160, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb170 bb170: ; preds = %invcont169, %bb162, %bb139 call void @llvm.dbg.stoppoint(i32 164, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %228 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %229 = getelementptr %struct.system__tasking__ada_task_control_block* %228, i32 0, i32 23 ; [#uses=1] %230 = load i32* %229, align 4 ; [#uses=1] %231 = icmp ne i32 %230, 0 ; [#uses=1] br i1 %231, label %bb171, label %bb187 ; No predecessors! call void @llvm.dbg.stoppoint(i32 164, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb171 bb171: ; preds = %232, %bb170 call void @llvm.dbg.stoppoint(i32 165, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %233 = load %struct.system__tasking__ada_task_control_block** %t_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %234 = getelementptr %struct.system__tasking__ada_task_control_block* %233, i32 0, i32 23 ; [#uses=1] %235 = load i32* %234, align 4 ; [#uses=1] invoke void @system__img_int__image_integer(%struct.string___XUP* noalias sret %3, i32 %235) to label %invcont172 unwind label %lpad invcont172: ; preds = %bb171 call void @llvm.dbg.stoppoint(i32 165, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %236 = getelementptr %struct.string___XUP* %2, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([8 x i8]* @.str568, i32 0, i32 0), i8** %236, align 4 %237 = getelementptr %struct.string___XUP* %2, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.23.913, %llvm.dbg.anchor.type** %237, align 4 %elt173 = getelementptr %struct.string___XUP* %2, i32 0, i32 0 ; [#uses=1] %val174 = load i8** %elt173 ; [#uses=1] %elt175 = getelementptr %struct.string___XUP* %2, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val176 = load %llvm.dbg.anchor.type** %elt175 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt177 = getelementptr %struct.string___XUP* %3, i32 0, i32 0 ; [#uses=1] %val178 = load i8** %elt177 ; [#uses=1] %elt179 = getelementptr %struct.string___XUP* %3, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val180 = load %llvm.dbg.anchor.type** %elt179 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat(%struct.string___XUP* noalias sret %1, i8* %val174, %llvm.dbg.anchor.type* %val176, i8* %val178, %llvm.dbg.anchor.type* %val180) to label %invcont181 unwind label %lpad invcont181: ; preds = %invcont172 call void @llvm.dbg.stoppoint(i32 165, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt182 = getelementptr %struct.string___XUP* %1, i32 0, i32 0 ; [#uses=1] %val183 = load i8** %elt182 ; [#uses=1] %elt184 = getelementptr %struct.string___XUP* %1, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val185 = load %llvm.dbg.anchor.type** %elt184 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val183, %llvm.dbg.anchor.type* %val185) to label %invcont186 unwind label %lpad invcont186: ; preds = %invcont181 call void @llvm.dbg.stoppoint(i32 165, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb187 bb187: ; preds = %invcont186, %bb170 call void @llvm.dbg.stoppoint(i32 168, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %238 = getelementptr %struct.string___XUP* %0, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([0 x i8]* @.str571, i32 0, i32 0), i8** %238, align 4 %239 = getelementptr %struct.string___XUP* %0, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.24.917, %llvm.dbg.anchor.type** %239, align 4 %elt188 = getelementptr %struct.string___XUP* %0, i32 0, i32 0 ; [#uses=1] %val189 = load i8** %elt188 ; [#uses=1] %elt190 = getelementptr %struct.string___XUP* %0, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val191 = load %llvm.dbg.anchor.type** %elt190 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put_line(i8* %val189, %llvm.dbg.anchor.type* %val191) to label %invcont192 unwind label %lpad invcont192: ; preds = %bb187 br label %bb196 ; No predecessors! call void @llvm.dbg.stoppoint(i32 168, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb193 bb193: ; preds = %ppad, %240 call void @llvm.dbg.stoppoint(i32 168, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select194 = load i32* %eh_selector ; [#uses=1] store i32 %eh_select194, i32* %save_filt.34, align 4 %eh_value195 = load i8** %eh_exception ; [#uses=1] store i8* %eh_value195, i8** %save_eptr.33, align 4 call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__tasking__debug__print_task_info___clean.697(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) %241 = load i8** %save_eptr.33, align 4 ; [#uses=1] store i8* %241, i8** %eh_exception, align 4 %242 = load i32* %save_filt.34, align 4 ; [#uses=1] store i32 %242, i32* %eh_selector, align 4 br label %Unwind ; No predecessors! call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb196 bb196: ; preds = %243, %invcont192, %invcont call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__tasking__debug__print_task_info___clean.697(%struct.FRAME.system__tasking__debug__print_task_info* nest %FRAME.25) br label %return return: ; preds = %bb196 call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram519 to { }*)) ret void lpad: ; preds = %bb187, %invcont181, %invcont172, %bb171, %bb164, %bb156, %invcont154, %bb147, %bb140, %bb136, %invcont134, %bb127, %bb120, %bb113, %bb106, %bb99, %invcont93, %invcont84, %bb83, %invcont77, %bb49, %bb43, %invcont37, %invcont24, %bb3, %bb %eh_ptr = call i8* @llvm.eh.exception() ; [#uses=1] store i8* %eh_ptr, i8** %eh_exception %eh_ptr197 = load i8** %eh_exception ; [#uses=1] call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select198 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr197, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value) ; [#uses=1] store i32 %eh_select198, i32* %eh_selector br label %ppad lpad199: ; preds = %invcont129, %invcont128 %eh_ptr200 = call i8* @llvm.eh.exception() ; [#uses=1] store i8* %eh_ptr200, i8** %eh_exception %eh_ptr201 = load i8** %eh_exception ; [#uses=1] call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select202 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr201, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value) ; [#uses=1] store i32 %eh_select202, i32* %eh_selector br label %ppad207 lpad203: ; preds = %invcont149, %invcont148 %eh_ptr204 = call i8* @llvm.eh.exception() ; [#uses=1] store i8* %eh_ptr204, i8** %eh_exception %eh_ptr205 = load i8** %eh_exception ; [#uses=1] call void @llvm.dbg.stoppoint(i32 107, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select206 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr205, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value) ; [#uses=1] store i32 %eh_select206, i32* %eh_selector br label %ppad208 ppad: ; preds = %lpad, %invcont159, %invcont137 br label %bb193 ppad207: ; preds = %lpad199 br label %bb136 ppad208: ; preds = %lpad203 br label %bb156 Unwind: ; preds = %bb193 %eh_ptr209 = load i8** %eh_exception ; [#uses=1] call void (i8*, ...)* @_Unwind_Resume(i8* %eh_ptr209) unreachable } define void @system__tasking__debug__print_current_task() { entry: call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram517 to { }*)) call void @llvm.dbg.stoppoint(i32 99, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %0 = call %struct.system__tasking__ada_task_control_block* @system__task_primitives__operations__self() ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] call void @system__tasking__debug__print_task_info(%struct.system__tasking__ada_task_control_block* %0) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 99, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram517 to { }*)) ret void } declare void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret) define internal void @system__tasking__debug__put_line(i8* %s.0, %llvm.dbg.anchor.type* %s.1) { entry: %s_addr = alloca %struct.string___XUP ; <%struct.string___XUP*> [#uses=6] %save_filt.39 = alloca i32 ; [#uses=2] %save_eptr.38 = alloca i8* ; [#uses=2] %M41b = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=0] %0 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %A.35 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=3] %1 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %2 = alloca i32 ; [#uses=1] %3 = alloca i32 ; [#uses=6] %4 = alloca i32 ; [#uses=9] %FRAME.36 = alloca %struct.FRAME.system__tasking__debug__put_line ; <%struct.FRAME.system__tasking__debug__put_line*> [#uses=3] %eh_exception = alloca i8* ; [#uses=5] %eh_selector = alloca i32 ; [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram593 to { }*)) %5 = bitcast %struct.string___XUP* %s_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %5, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable594 to { }*)) %6 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] store i8* %s.0, i8** %6 %7 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %s.1, %llvm.dbg.anchor.type** %7 call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %8 = getelementptr %struct.FRAME.system__tasking__debug__put_line* %FRAME.36, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=1] call void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret %8) %9 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %10 = load %llvm.dbg.anchor.type** %9, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %11 = getelementptr %llvm.dbg.anchor.type* %10, i32 0, i32 0 ; [#uses=1] %12 = load i32* %11, align 4 ; [#uses=1] store i32 %12, i32* %4, align 4 %13 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %14 = load %llvm.dbg.anchor.type** %13, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %15 = getelementptr %llvm.dbg.anchor.type* %14, i32 0, i32 1 ; [#uses=1] %16 = load i32* %15, align 4 ; [#uses=1] store i32 %16, i32* %3, align 4 %17 = load i32* %4, align 4 ; [#uses=1] store i32 %17, i32* %2, align 4 %18 = load i32* %4, align 4 ; [#uses=1] %19 = sub i32 %18, 1 ; [#uses=2] %20 = load i32* %3, align 4 ; [#uses=2] %21 = icmp sge i32 %20, %19 ; [#uses=1] %max = select i1 %21, i32 %20, i32 %19 ; [#uses=0] %22 = load i32* %4, align 4 ; [#uses=1] %23 = sub i32 %22, 1 ; [#uses=2] %24 = load i32* %3, align 4 ; [#uses=2] %25 = icmp sge i32 %24, %23 ; [#uses=1] %max2 = select i1 %25, i32 %24, i32 %23 ; [#uses=1] %26 = load i32* %4, align 4 ; [#uses=1] %27 = sub i32 %max2, %26 ; [#uses=1] %28 = sext i32 %27 to i64 ; [#uses=1] %sextl = shl i64 %28, 28 ; [#uses=1] %sextr = ashr i64 %sextl, 28 ; [#uses=2] %sextl5 = shl i64 %sextr, 28 ; [#uses=1] %sextr6 = ashr i64 %sextl5, 28 ; [#uses=0] %sextl7 = shl i64 %sextr, 28 ; [#uses=1] %sextr8 = ashr i64 %sextl7, 28 ; [#uses=1] %29 = add i64 %sextr8, 1 ; [#uses=1] %sextl9 = shl i64 %29, 28 ; [#uses=1] %sextr10 = ashr i64 %sextl9, 28 ; [#uses=2] %sextl12 = shl i64 %sextr10, 28 ; [#uses=1] %sextr13 = ashr i64 %sextl12, 28 ; [#uses=0] %sextl14 = shl i64 %sextr10, 28 ; [#uses=1] %sextr15 = ashr i64 %sextl14, 28 ; [#uses=1] %30 = mul i64 %sextr15, 8 ; [#uses=1] %sextl16 = shl i64 %30, 28 ; [#uses=1] %sextr17 = ashr i64 %sextl16, 28 ; [#uses=2] %sextl19 = shl i64 %sextr17, 28 ; [#uses=1] %sextr20 = ashr i64 %sextl19, 28 ; [#uses=0] %sextl21 = shl i64 %sextr17, 28 ; [#uses=1] %sextr22 = ashr i64 %sextl21, 28 ; [#uses=2] %31 = icmp sge i64 %sextr22, 0 ; [#uses=1] %max24 = select i1 %31, i64 %sextr22, i64 0 ; [#uses=1] %sextl25 = shl i64 %max24, 28 ; [#uses=1] %sextr26 = ashr i64 %sextl25, 28 ; [#uses=2] %sextl28 = shl i64 %sextr26, 28 ; [#uses=1] %sextr29 = ashr i64 %sextl28, 28 ; [#uses=0] %sextl30 = shl i64 %sextr26, 28 ; [#uses=1] %sextr31 = ashr i64 %sextl30, 28 ; [#uses=1] %32 = add i64 %sextr31, 7 ; [#uses=1] %sextl32 = shl i64 %32, 28 ; [#uses=1] %sextr33 = ashr i64 %sextl32, 28 ; [#uses=2] %sextl35 = shl i64 %sextr33, 28 ; [#uses=1] %sextr36 = ashr i64 %sextl35, 28 ; [#uses=0] %sextl37 = shl i64 %sextr33, 28 ; [#uses=1] %sextr38 = ashr i64 %sextl37, 28 ; [#uses=1] %33 = and i64 %sextr38, -8 ; [#uses=1] %sextl39 = shl i64 %33, 28 ; [#uses=1] %sextr40 = ashr i64 %sextl39, 28 ; [#uses=1] %sextl42 = shl i64 %sextr40, 28 ; [#uses=1] %sextr43 = ashr i64 %sextl42, 28 ; [#uses=0] %34 = load i32* %4, align 4 ; [#uses=1] %35 = sub i32 %34, 1 ; [#uses=2] %36 = load i32* %3, align 4 ; [#uses=2] %37 = icmp sge i32 %36, %35 ; [#uses=1] %max44 = select i1 %37, i32 %36, i32 %35 ; [#uses=1] %38 = load i32* %4, align 4 ; [#uses=1] %39 = sub i32 %max44, %38 ; [#uses=1] %40 = add i32 %39, 1 ; [#uses=2] %41 = icmp sge i32 %40, 0 ; [#uses=1] %max46 = select i1 %41, i32 %40, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 186, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %42 = load i32* %3, align 4 ; [#uses=1] %43 = load i32* %4, align 4 ; [#uses=1] %44 = sub i32 %42, %43 ; [#uses=1] %45 = add i32 %44, 1 ; [#uses=2] %46 = icmp sge i32 %45, 0 ; [#uses=1] %max48 = select i1 %46, i32 %45, i32 0 ; [#uses=1] %47 = add i32 %max48, 1 ; [#uses=1] %48 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] %49 = load i8** %48, align 4 ; [#uses=1] %50 = getelementptr %llvm.dbg.anchor.type* %A.35, i32 0, i32 0 ; [#uses=1] %51 = load i32* %4, align 4 ; [#uses=1] store i32 %51, i32* %50, align 4 %52 = getelementptr %llvm.dbg.anchor.type* %A.35, i32 0, i32 1 ; [#uses=1] %53 = load i32* %3, align 4 ; [#uses=1] store i32 %53, i32* %52, align 4 %54 = getelementptr %struct.string___XUP* %1, i32 0, i32 0 ; [#uses=1] store i8* %49, i8** %54, align 4 %55 = getelementptr %struct.string___XUP* %1, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %A.35, %llvm.dbg.anchor.type** %55, align 4 %elt = getelementptr %struct.string___XUP* %1, i32 0, i32 0 ; [#uses=1] %val = load i8** %elt ; [#uses=1] %elt50 = getelementptr %struct.string___XUP* %1, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val51 = load %llvm.dbg.anchor.type** %elt50 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat_sc(%struct.string___XUP* noalias sret %0, i8* %val, %llvm.dbg.anchor.type* %val51, i8 zeroext 10) to label %invcont unwind label %lpad invcont: ; preds = %entry call void @llvm.dbg.stoppoint(i32 186, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt52 = getelementptr %struct.string___XUP* %0, i32 0, i32 0 ; [#uses=1] %val53 = load i8** %elt52 ; [#uses=1] %elt54 = getelementptr %struct.string___XUP* %0, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val55 = load %llvm.dbg.anchor.type** %elt54 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__write(i32 2, i8* %val53, %llvm.dbg.anchor.type* %val55, i32 %47) to label %invcont56 unwind label %lpad invcont56: ; preds = %invcont call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__tasking__debug__put_line___clean.1009(%struct.FRAME.system__tasking__debug__put_line* nest %FRAME.36) br label %return ; No predecessors! call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb bb: ; preds = %ppad, %56 call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select = load i32* %eh_selector ; [#uses=1] store i32 %eh_select, i32* %save_filt.39, align 4 %eh_value = load i8** %eh_exception ; [#uses=1] store i8* %eh_value, i8** %save_eptr.38, align 4 call void @system__tasking__debug__put_line___clean.1009(%struct.FRAME.system__tasking__debug__put_line* nest %FRAME.36) %57 = load i8** %save_eptr.38, align 4 ; [#uses=1] store i8* %57, i8** %eh_exception, align 4 %58 = load i32* %save_filt.39, align 4 ; [#uses=1] store i32 %58, i32* %eh_selector, align 4 br label %Unwind return: ; preds = %invcont56 call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram593 to { }*)) ret void lpad: ; preds = %invcont, %entry %eh_ptr = call i8* @llvm.eh.exception() ; [#uses=1] store i8* %eh_ptr, i8** %eh_exception %eh_ptr57 = load i8** %eh_exception ; [#uses=1] call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select58 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr57, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value) ; [#uses=1] store i32 %eh_select58, i32* %eh_selector br label %ppad ppad: ; preds = %lpad br label %bb Unwind: ; preds = %bb %eh_ptr59 = load i8** %eh_exception ; [#uses=1] call void (i8*, ...)* @_Unwind_Resume(i8* %eh_ptr59) unreachable } declare void @system__img_enum__image_enumeration_16(%struct.string___XUP* noalias sret, i32, i8*, %llvm.dbg.anchor.type*, i32) declare void @system__string_ops_concat_3__str_concat_3(%struct.string___XUP* noalias sret, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*) define internal void @system__tasking__debug__put(i8* %s.0, %llvm.dbg.anchor.type* %s.1) { entry: %s_addr = alloca %struct.string___XUP ; <%struct.string___XUP*> [#uses=7] %0 = alloca i32 ; [#uses=1] %1 = alloca i32 ; [#uses=5] %2 = alloca i32 ; [#uses=8] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram581 to { }*)) %3 = bitcast %struct.string___XUP* %s_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %3, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable591 to { }*)) %4 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] store i8* %s.0, i8** %4 %5 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %s.1, %llvm.dbg.anchor.type** %5 call void @llvm.dbg.stoppoint(i32 63, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %6 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %7 = load %llvm.dbg.anchor.type** %6, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %8 = getelementptr %llvm.dbg.anchor.type* %7, i32 0, i32 0 ; [#uses=1] %9 = load i32* %8, align 4 ; [#uses=1] store i32 %9, i32* %2, align 4 %10 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %11 = load %llvm.dbg.anchor.type** %10, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %12 = getelementptr %llvm.dbg.anchor.type* %11, i32 0, i32 1 ; [#uses=1] %13 = load i32* %12, align 4 ; [#uses=1] store i32 %13, i32* %1, align 4 call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %14 = load i32* %2, align 4 ; [#uses=1] store i32 %14, i32* %0, align 4 %15 = load i32* %2, align 4 ; [#uses=1] %16 = sub i32 %15, 1 ; [#uses=2] %17 = load i32* %1, align 4 ; [#uses=2] %18 = icmp sge i32 %17, %16 ; [#uses=1] %max = select i1 %18, i32 %17, i32 %16 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 63, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %19 = load i32* %2, align 4 ; [#uses=1] %20 = sub i32 %19, 1 ; [#uses=2] %21 = load i32* %1, align 4 ; [#uses=2] %22 = icmp sge i32 %21, %20 ; [#uses=1] %max2 = select i1 %22, i32 %21, i32 %20 ; [#uses=1] %23 = load i32* %2, align 4 ; [#uses=1] %24 = sub i32 %max2, %23 ; [#uses=1] %25 = sext i32 %24 to i64 ; [#uses=1] %sextl = shl i64 %25, 28 ; [#uses=1] %sextr = ashr i64 %sextl, 28 ; [#uses=2] %sextl5 = shl i64 %sextr, 28 ; [#uses=1] %sextr6 = ashr i64 %sextl5, 28 ; [#uses=0] %sextl7 = shl i64 %sextr, 28 ; [#uses=1] %sextr8 = ashr i64 %sextl7, 28 ; [#uses=1] %26 = add i64 %sextr8, 1 ; [#uses=1] %sextl9 = shl i64 %26, 28 ; [#uses=1] %sextr10 = ashr i64 %sextl9, 28 ; [#uses=2] %sextl12 = shl i64 %sextr10, 28 ; [#uses=1] %sextr13 = ashr i64 %sextl12, 28 ; [#uses=0] %sextl14 = shl i64 %sextr10, 28 ; [#uses=1] %sextr15 = ashr i64 %sextl14, 28 ; [#uses=1] %27 = mul i64 %sextr15, 8 ; [#uses=1] %sextl16 = shl i64 %27, 28 ; [#uses=1] %sextr17 = ashr i64 %sextl16, 28 ; [#uses=2] %sextl19 = shl i64 %sextr17, 28 ; [#uses=1] %sextr20 = ashr i64 %sextl19, 28 ; [#uses=0] %sextl21 = shl i64 %sextr17, 28 ; [#uses=1] %sextr22 = ashr i64 %sextl21, 28 ; [#uses=2] %28 = icmp sge i64 %sextr22, 0 ; [#uses=1] %max24 = select i1 %28, i64 %sextr22, i64 0 ; [#uses=1] %sextl25 = shl i64 %max24, 28 ; [#uses=1] %sextr26 = ashr i64 %sextl25, 28 ; [#uses=2] %sextl28 = shl i64 %sextr26, 28 ; [#uses=1] %sextr29 = ashr i64 %sextl28, 28 ; [#uses=0] %sextl30 = shl i64 %sextr26, 28 ; [#uses=1] %sextr31 = ashr i64 %sextl30, 28 ; [#uses=1] %29 = add i64 %sextr31, 7 ; [#uses=1] %sextl32 = shl i64 %29, 28 ; [#uses=1] %sextr33 = ashr i64 %sextl32, 28 ; [#uses=2] %sextl35 = shl i64 %sextr33, 28 ; [#uses=1] %sextr36 = ashr i64 %sextl35, 28 ; [#uses=0] %sextl37 = shl i64 %sextr33, 28 ; [#uses=1] %sextr38 = ashr i64 %sextl37, 28 ; [#uses=1] %30 = and i64 %sextr38, -8 ; [#uses=1] %sextl39 = shl i64 %30, 28 ; [#uses=1] %sextr40 = ashr i64 %sextl39, 28 ; [#uses=1] %sextl42 = shl i64 %sextr40, 28 ; [#uses=1] %sextr43 = ashr i64 %sextl42, 28 ; [#uses=0] %31 = load i32* %2, align 4 ; [#uses=1] %32 = sub i32 %31, 1 ; [#uses=2] %33 = load i32* %1, align 4 ; [#uses=2] %34 = icmp sge i32 %33, %32 ; [#uses=1] %max44 = select i1 %34, i32 %33, i32 %32 ; [#uses=1] %35 = load i32* %2, align 4 ; [#uses=1] %36 = sub i32 %max44, %35 ; [#uses=1] %37 = add i32 %36, 1 ; [#uses=2] %38 = icmp sge i32 %37, 0 ; [#uses=1] %max46 = select i1 %38, i32 %37, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 177, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %39 = load i32* %1, align 4 ; [#uses=1] %40 = load i32* %2, align 4 ; [#uses=1] %41 = sub i32 %39, %40 ; [#uses=1] %42 = add i32 %41, 1 ; [#uses=2] %43 = icmp sge i32 %42, 0 ; [#uses=1] %max48 = select i1 %43, i32 %42, i32 0 ; [#uses=1] %elt = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] %val = load i8** %elt ; [#uses=1] %elt50 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val51 = load %llvm.dbg.anchor.type** %elt50 ; <%llvm.dbg.anchor.type*> [#uses=1] call void @system__tasking__debug__write(i32 2, i8* %val, %llvm.dbg.anchor.type* %val51, i32 %max48) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 177, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram581 to { }*)) ret void } declare void @system__string_ops__str_concat(%struct.string___XUP* noalias sret, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*) declare void @system__img_int__image_integer(%struct.string___XUP* noalias sret, i32) declare void @system__img_uns__image_unsigned(%struct.string___XUP* noalias sret, i32) declare i8* @llvm.eh.exception() nounwind declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind declare i32 @llvm.eh.typeid.for.i32(i8*) nounwind declare i32 @__gnat_eh_personality(...) declare void @_Unwind_Resume(i8*, ...) define internal void @system__tasking__debug__print_task_info__L_3__B30b___clean.789(%struct.FRAME.system__tasking__debug__print_task_info* nest %CHAIN.28) { entry: %CHAIN.28_addr = alloca %struct.FRAME.system__tasking__debug__print_task_info* ; <%struct.FRAME.system__tasking__debug__print_task_info**> [#uses=2] %0 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=4] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram575 to { }*)) store %struct.FRAME.system__tasking__debug__print_task_info* %CHAIN.28, %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.28_addr call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.28_addr, align 4 ; <%struct.FRAME.system__tasking__debug__print_task_info*> [#uses=1] %2 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %1, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=2] %3 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %4 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 0 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %3, align 4 %6 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %7 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 1 ; [#uses=1] %8 = load i32* %7, align 4 ; [#uses=1] store i32 %8, i32* %6, align 4 %elt = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %val = load i32* %elt ; [#uses=1] %elt1 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %val2 = load i32* %elt1 ; [#uses=1] call void @system__secondary_stack__ss_release(i32 %val, i32 %val2) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram575 to { }*)) ret void } declare void @system__secondary_stack__ss_release(i32, i32) define internal void @system__tasking__debug__print_task_info__L_2__B26b___clean.775(%struct.FRAME.system__tasking__debug__print_task_info* nest %CHAIN.27) { entry: %CHAIN.27_addr = alloca %struct.FRAME.system__tasking__debug__print_task_info* ; <%struct.FRAME.system__tasking__debug__print_task_info**> [#uses=2] %0 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=4] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram577 to { }*)) store %struct.FRAME.system__tasking__debug__print_task_info* %CHAIN.27, %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.27_addr call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.27_addr, align 4 ; <%struct.FRAME.system__tasking__debug__print_task_info*> [#uses=1] %2 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %1, i32 0, i32 1 ; <%llvm.dbg.anchor.type*> [#uses=2] %3 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %4 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 0 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %3, align 4 %6 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %7 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 1 ; [#uses=1] %8 = load i32* %7, align 4 ; [#uses=1] store i32 %8, i32* %6, align 4 %elt = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %val = load i32* %elt ; [#uses=1] %elt1 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %val2 = load i32* %elt1 ; [#uses=1] call void @system__secondary_stack__ss_release(i32 %val, i32 %val2) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram577 to { }*)) ret void } define internal void @system__tasking__debug__print_task_info___clean.697(%struct.FRAME.system__tasking__debug__print_task_info* nest %CHAIN.26) { entry: %CHAIN.26_addr = alloca %struct.FRAME.system__tasking__debug__print_task_info* ; <%struct.FRAME.system__tasking__debug__print_task_info**> [#uses=2] %0 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=4] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram579 to { }*)) store %struct.FRAME.system__tasking__debug__print_task_info* %CHAIN.26, %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.26_addr call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.FRAME.system__tasking__debug__print_task_info** %CHAIN.26_addr, align 4 ; <%struct.FRAME.system__tasking__debug__print_task_info*> [#uses=1] %2 = getelementptr %struct.FRAME.system__tasking__debug__print_task_info* %1, i32 0, i32 2 ; <%llvm.dbg.anchor.type*> [#uses=2] %3 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %4 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 0 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %3, align 4 %6 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %7 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 1 ; [#uses=1] %8 = load i32* %7, align 4 ; [#uses=1] store i32 %8, i32* %6, align 4 %elt = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %val = load i32* %elt ; [#uses=1] %elt1 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %val2 = load i32* %elt1 ; [#uses=1] call void @system__secondary_stack__ss_release(i32 %val, i32 %val2) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 55, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram579 to { }*)) ret void } define internal void @system__tasking__debug__write(i32 %fd, i8* %s.0, %llvm.dbg.anchor.type* %s.1, i32 %count) { entry: %fd_addr = alloca i32 ; [#uses=3] %s_addr = alloca %struct.string___XUP ; <%struct.string___XUP*> [#uses=6] %count_addr = alloca i32 ; [#uses=3] %discard = alloca i32 ; [#uses=2] %0 = alloca i32 ; [#uses=1] %1 = alloca i32 ; [#uses=4] %2 = alloca i32 ; [#uses=7] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*)) %3 = bitcast i32* %fd_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %3, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable650 to { }*)) store i32 %fd, i32* %fd_addr %4 = bitcast %struct.string___XUP* %s_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %4, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable651 to { }*)) %5 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] store i8* %s.0, i8** %5 %6 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %s.1, %llvm.dbg.anchor.type** %6 %7 = bitcast i32* %count_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %7, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable653 to { }*)) store i32 %count, i32* %count_addr %8 = bitcast i32* %discard to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %8, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable655 to { }*)) call void @llvm.dbg.stoppoint(i32 61, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %9 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %10 = load %llvm.dbg.anchor.type** %9, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %11 = getelementptr %llvm.dbg.anchor.type* %10, i32 0, i32 0 ; [#uses=1] %12 = load i32* %11, align 4 ; [#uses=1] store i32 %12, i32* %2, align 4 %13 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %14 = load %llvm.dbg.anchor.type** %13, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %15 = getelementptr %llvm.dbg.anchor.type* %14, i32 0, i32 1 ; [#uses=1] %16 = load i32* %15, align 4 ; [#uses=1] store i32 %16, i32* %1, align 4 call void @llvm.dbg.stoppoint(i32 300, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %17 = load i32* %2, align 4 ; [#uses=1] store i32 %17, i32* %0, align 4 %18 = load i32* %2, align 4 ; [#uses=1] %19 = sub i32 %18, 1 ; [#uses=2] %20 = load i32* %1, align 4 ; [#uses=2] %21 = icmp sge i32 %20, %19 ; [#uses=1] %max = select i1 %21, i32 %20, i32 %19 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 61, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %22 = load i32* %2, align 4 ; [#uses=1] %23 = sub i32 %22, 1 ; [#uses=2] %24 = load i32* %1, align 4 ; [#uses=2] %25 = icmp sge i32 %24, %23 ; [#uses=1] %max2 = select i1 %25, i32 %24, i32 %23 ; [#uses=1] %26 = load i32* %2, align 4 ; [#uses=1] %27 = sub i32 %max2, %26 ; [#uses=1] %28 = sext i32 %27 to i64 ; [#uses=1] %sextl = shl i64 %28, 28 ; [#uses=1] %sextr = ashr i64 %sextl, 28 ; [#uses=2] %sextl5 = shl i64 %sextr, 28 ; [#uses=1] %sextr6 = ashr i64 %sextl5, 28 ; [#uses=0] %sextl7 = shl i64 %sextr, 28 ; [#uses=1] %sextr8 = ashr i64 %sextl7, 28 ; [#uses=1] %29 = add i64 %sextr8, 1 ; [#uses=1] %sextl9 = shl i64 %29, 28 ; [#uses=1] %sextr10 = ashr i64 %sextl9, 28 ; [#uses=2] %sextl12 = shl i64 %sextr10, 28 ; [#uses=1] %sextr13 = ashr i64 %sextl12, 28 ; [#uses=0] %sextl14 = shl i64 %sextr10, 28 ; [#uses=1] %sextr15 = ashr i64 %sextl14, 28 ; [#uses=1] %30 = mul i64 %sextr15, 8 ; [#uses=1] %sextl16 = shl i64 %30, 28 ; [#uses=1] %sextr17 = ashr i64 %sextl16, 28 ; [#uses=2] %sextl19 = shl i64 %sextr17, 28 ; [#uses=1] %sextr20 = ashr i64 %sextl19, 28 ; [#uses=0] %sextl21 = shl i64 %sextr17, 28 ; [#uses=1] %sextr22 = ashr i64 %sextl21, 28 ; [#uses=2] %31 = icmp sge i64 %sextr22, 0 ; [#uses=1] %max24 = select i1 %31, i64 %sextr22, i64 0 ; [#uses=1] %sextl25 = shl i64 %max24, 28 ; [#uses=1] %sextr26 = ashr i64 %sextl25, 28 ; [#uses=2] %sextl28 = shl i64 %sextr26, 28 ; [#uses=1] %sextr29 = ashr i64 %sextl28, 28 ; [#uses=0] %sextl30 = shl i64 %sextr26, 28 ; [#uses=1] %sextr31 = ashr i64 %sextl30, 28 ; [#uses=1] %32 = add i64 %sextr31, 7 ; [#uses=1] %sextl32 = shl i64 %32, 28 ; [#uses=1] %sextr33 = ashr i64 %sextl32, 28 ; [#uses=2] %sextl35 = shl i64 %sextr33, 28 ; [#uses=1] %sextr36 = ashr i64 %sextl35, 28 ; [#uses=0] %sextl37 = shl i64 %sextr33, 28 ; [#uses=1] %sextr38 = ashr i64 %sextl37, 28 ; [#uses=1] %33 = and i64 %sextr38, -8 ; [#uses=1] %sextl39 = shl i64 %33, 28 ; [#uses=1] %sextr40 = ashr i64 %sextl39, 28 ; [#uses=1] %sextl42 = shl i64 %sextr40, 28 ; [#uses=1] %sextr43 = ashr i64 %sextl42, 28 ; [#uses=0] %34 = load i32* %2, align 4 ; [#uses=1] %35 = sub i32 %34, 1 ; [#uses=2] %36 = load i32* %1, align 4 ; [#uses=2] %37 = icmp sge i32 %36, %35 ; [#uses=1] %max44 = select i1 %37, i32 %36, i32 %35 ; [#uses=1] %38 = load i32* %2, align 4 ; [#uses=1] %39 = sub i32 %max44, %38 ; [#uses=1] %40 = add i32 %39, 1 ; [#uses=2] %41 = icmp sge i32 %40, 0 ; [#uses=1] %max46 = select i1 %41, i32 %40, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 304, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %42 = getelementptr %struct.string___XUP* %s_addr, i32 0, i32 0 ; [#uses=1] %43 = load i8** %42, align 4 ; [#uses=1] %44 = ptrtoint i8* %43 to i32 ; [#uses=1] %45 = load i32* %fd_addr, align 4 ; [#uses=1] %46 = load i32* %count_addr, align 4 ; [#uses=1] %47 = call i32 @write(i32 %45, i32 %44, i32 %46) ; [#uses=1] store i32 %47, i32* %discard, align 4 br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 304, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram647 to { }*)) ret void } declare void @system__string_ops__str_concat_sc(%struct.string___XUP* noalias sret, i8*, %llvm.dbg.anchor.type*, i8 zeroext) define internal void @system__tasking__debug__put_line___clean.1009(%struct.FRAME.system__tasking__debug__put_line* nest %CHAIN.37) { entry: %CHAIN.37_addr = alloca %struct.FRAME.system__tasking__debug__put_line* ; <%struct.FRAME.system__tasking__debug__put_line**> [#uses=2] %0 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=4] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram596 to { }*)) store %struct.FRAME.system__tasking__debug__put_line* %CHAIN.37, %struct.FRAME.system__tasking__debug__put_line** %CHAIN.37_addr call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.FRAME.system__tasking__debug__put_line** %CHAIN.37_addr, align 4 ; <%struct.FRAME.system__tasking__debug__put_line*> [#uses=1] %2 = getelementptr %struct.FRAME.system__tasking__debug__put_line* %1, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=2] %3 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %4 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 0 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %3, align 4 %6 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %7 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 1 ; [#uses=1] %8 = load i32* %7, align 4 ; [#uses=1] store i32 %8, i32* %6, align 4 %elt = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %val = load i32* %elt ; [#uses=1] %elt1 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %val2 = load i32* %elt1 ; [#uses=1] call void @system__secondary_stack__ss_release(i32 %val, i32 %val2) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 66, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram596 to { }*)) ret void } define void @system__tasking__debug__resume_all_tasks(i32 %thread_self) { entry: %thread_self_addr = alloca i32 ; [#uses=3] %dummy = alloca i8 ; [#uses=2] %c = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=7] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram598 to { }*)) %0 = bitcast i32* %thread_self_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable603 to { }*)) store i32 %thread_self, i32* %thread_self_addr %1 = bitcast i8* %dummy to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable605 to { }*)) %2 = bitcast %struct.system__tasking__ada_task_control_block** %c to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable606 to { }*)) call void @llvm.dbg.stoppoint(i32 194, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) store %struct.system__tasking__ada_task_control_block* null, %struct.system__tasking__ada_task_control_block** %c, align 4 call void @llvm.dbg.stoppoint(i32 199, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__task_primitives__operations__lock_rts() call void @llvm.dbg.stoppoint(i32 200, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %3 = load %struct.system__tasking__ada_task_control_block** @system__tasking__all_tasks_list, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %3, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb bb: ; preds = %bb1, %entry call void @llvm.dbg.stoppoint(i32 202, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %4 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %5 = icmp eq %struct.system__tasking__ada_task_control_block* %4, null ; [#uses=1] br i1 %5, label %bb2, label %bb1 ; No predecessors! call void @llvm.dbg.stoppoint(i32 202, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb1 bb1: ; preds = %6, %bb call void @llvm.dbg.stoppoint(i32 203, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %7 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %8 = load i32* %thread_self_addr, align 4 ; [#uses=1] %9 = call i8 @system__task_primitives__operations__resume_task(%struct.system__tasking__ada_task_control_block* %7, i32 %8) ; [#uses=1] store i8 %9, i8* %dummy, align 1 call void @llvm.dbg.stoppoint(i32 204, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %10 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %11 = getelementptr %struct.system__tasking__ada_task_control_block* %10, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %12 = getelementptr %struct.system__tasking__common_atcb* %11, i32 0, i32 12 ; <%struct.system__tasking__ada_task_control_block**> [#uses=1] %13 = load %struct.system__tasking__ada_task_control_block** %12, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %13, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb ; No predecessors! call void @llvm.dbg.stoppoint(i32 204, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb2 bb2: ; preds = %14, %bb call void @llvm.dbg.stoppoint(i32 207, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__task_primitives__operations__unlock_rts() br label %return return: ; preds = %bb2 call void @llvm.dbg.stoppoint(i32 207, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram598 to { }*)) ret void } declare void @system__task_primitives__operations__lock_rts() declare i8 @system__task_primitives__operations__resume_task(%struct.system__tasking__ada_task_control_block*, i32) declare void @system__task_primitives__operations__unlock_rts() define void @system__tasking__debug__set_trace(i8 zeroext %flag, i8 %value) { entry: %flag_addr = alloca i8 ; [#uses=3] %value_addr = alloca i8 ; [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram608 to { }*)) %0 = bitcast i8* %flag_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable611 to { }*)) store i8 %flag, i8* %flag_addr %1 = bitcast i8* %value_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable614 to { }*)) store i8 %value, i8* %value_addr call void @llvm.dbg.stoppoint(i32 216, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %2 = load i8* %flag_addr, align 1 ; [#uses=1] %3 = zext i8 %2 to i32 ; [#uses=1] %4 = getelementptr [256 x i8]* @system__tasking__debug__trace_on, i32 0, i32 %3 ; [#uses=1] %5 = load i8* %value_addr, align 1 ; [#uses=1] store i8 %5, i8* %4, align 1 br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 216, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram608 to { }*)) ret void } define void @system__tasking__debug__set_user_state(i32 %value) { entry: %value_addr = alloca i32 ; [#uses=3] %0 = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram616 to { }*)) %1 = bitcast i32* %value_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable618 to { }*)) store i32 %value, i32* %value_addr call void @llvm.dbg.stoppoint(i32 225, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %2 = call %struct.system__tasking__ada_task_control_block* @system__task_primitives__operations__self() ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %2, %struct.system__tasking__ada_task_control_block** %0, align 4 %3 = load %struct.system__tasking__ada_task_control_block** %0, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %4 = getelementptr %struct.system__tasking__ada_task_control_block* %3, i32 0, i32 23 ; [#uses=1] %5 = load i32* %value_addr, align 4 ; [#uses=1] store i32 %5, i32* %4, align 4 br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 225, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram616 to { }*)) ret void } define void @system__tasking__debug__suspend_all_tasks(i32 %thread_self) { entry: %thread_self_addr = alloca i32 ; [#uses=3] %dummy = alloca i8 ; [#uses=2] %c = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=7] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram620 to { }*)) %0 = bitcast i32* %thread_self_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable621 to { }*)) store i32 %thread_self, i32* %thread_self_addr %1 = bitcast i8* %dummy to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable622 to { }*)) %2 = bitcast %struct.system__tasking__ada_task_control_block** %c to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable623 to { }*)) call void @llvm.dbg.stoppoint(i32 233, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) store %struct.system__tasking__ada_task_control_block* null, %struct.system__tasking__ada_task_control_block** %c, align 4 call void @llvm.dbg.stoppoint(i32 238, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__task_primitives__operations__lock_rts() call void @llvm.dbg.stoppoint(i32 239, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %3 = load %struct.system__tasking__ada_task_control_block** @system__tasking__all_tasks_list, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %3, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb bb: ; preds = %bb1, %entry call void @llvm.dbg.stoppoint(i32 241, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %4 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %5 = icmp eq %struct.system__tasking__ada_task_control_block* %4, null ; [#uses=1] br i1 %5, label %bb2, label %bb1 ; No predecessors! call void @llvm.dbg.stoppoint(i32 241, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb1 bb1: ; preds = %6, %bb call void @llvm.dbg.stoppoint(i32 242, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %7 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %8 = load i32* %thread_self_addr, align 4 ; [#uses=1] %9 = call i8 @system__task_primitives__operations__suspend_task(%struct.system__tasking__ada_task_control_block* %7, i32 %8) ; [#uses=1] store i8 %9, i8* %dummy, align 1 call void @llvm.dbg.stoppoint(i32 243, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %10 = load %struct.system__tasking__ada_task_control_block** %c, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %11 = getelementptr %struct.system__tasking__ada_task_control_block* %10, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %12 = getelementptr %struct.system__tasking__common_atcb* %11, i32 0, i32 12 ; <%struct.system__tasking__ada_task_control_block**> [#uses=1] %13 = load %struct.system__tasking__ada_task_control_block** %12, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] store %struct.system__tasking__ada_task_control_block* %13, %struct.system__tasking__ada_task_control_block** %c, align 4 br label %bb ; No predecessors! call void @llvm.dbg.stoppoint(i32 243, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb2 bb2: ; preds = %14, %bb call void @llvm.dbg.stoppoint(i32 246, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__task_primitives__operations__unlock_rts() br label %return return: ; preds = %bb2 call void @llvm.dbg.stoppoint(i32 246, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram620 to { }*)) ret void } declare i8 @system__task_primitives__operations__suspend_task(%struct.system__tasking__ada_task_control_block*, i32) define void @system__tasking__debug__task_creation_hook(i32 %thread) { entry: %thread_addr = alloca i32 ; [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram625 to { }*)) %0 = bitcast i32* %thread_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable626 to { }*)) store i32 %thread, i32* %thread_addr call void @llvm.dbg.stoppoint(i32 253, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 253, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram625 to { }*)) ret void } define void @system__tasking__debug__task_termination_hook() { entry: call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram628 to { }*)) call void @llvm.dbg.stoppoint(i32 266, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 266, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram628 to { }*)) ret void } define void @system__tasking__debug__trace(%struct.system__tasking__ada_task_control_block* %self_id, i8* %msg.0, %llvm.dbg.anchor.type* %msg.1, i8 zeroext %flag, %struct.system__tasking__ada_task_control_block* %other_id) { entry: %self_id_addr = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=5] %msg_addr = alloca %struct.string___XUP ; <%struct.string___XUP*> [#uses=7] %flag_addr = alloca i8 ; [#uses=4] %other_id_addr = alloca %struct.system__tasking__ada_task_control_block* ; <%struct.system__tasking__ada_task_control_block**> [#uses=4] %save_filt.53 = alloca i32 ; [#uses=2] %save_eptr.52 = alloca i8* ; [#uses=2] %M51b = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=0] %0 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %1 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %2 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %3 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %4 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=3] %5 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %A.42 = alloca [1 x i8] ; <[1 x i8]*> [#uses=2] %6 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %7 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %A.40 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=3] %8 = alloca %struct.string___XUP, align 8 ; <%struct.string___XUP*> [#uses=4] %9 = alloca i32 ; [#uses=6] %10 = alloca i32 ; [#uses=1] %11 = alloca i32 ; [#uses=4] %12 = alloca i32 ; [#uses=7] %FRAME.50 = alloca %struct.FRAME.system__tasking__debug__put_line ; <%struct.FRAME.system__tasking__debug__put_line*> [#uses=3] %eh_exception = alloca i8* ; [#uses=5] %eh_selector = alloca i32 ; [#uses=3] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*)) %13 = bitcast %struct.system__tasking__ada_task_control_block** %self_id_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %13, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable632 to { }*)) store %struct.system__tasking__ada_task_control_block* %self_id, %struct.system__tasking__ada_task_control_block** %self_id_addr %14 = bitcast %struct.string___XUP* %msg_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %14, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable633 to { }*)) %15 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 0 ; [#uses=1] store i8* %msg.0, i8** %15 %16 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %msg.1, %llvm.dbg.anchor.type** %16 %17 = bitcast i8* %flag_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %17, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable634 to { }*)) store i8 %flag, i8* %flag_addr %18 = bitcast %struct.system__tasking__ada_task_control_block** %other_id_addr to { }* ; <{ }*> [#uses=1] call void @llvm.dbg.declare({ }* %18, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable636 to { }*)) store %struct.system__tasking__ada_task_control_block* %other_id, %struct.system__tasking__ada_task_control_block** %other_id_addr call void @llvm.dbg.stoppoint(i32 102, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %19 = getelementptr %struct.FRAME.system__tasking__debug__put_line* %FRAME.50, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=1] call void @system__secondary_stack__ss_mark(%llvm.dbg.anchor.type* noalias sret %19) call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %20 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %21 = load %llvm.dbg.anchor.type** %20, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %22 = getelementptr %llvm.dbg.anchor.type* %21, i32 0, i32 0 ; [#uses=1] %23 = load i32* %22, align 4 ; [#uses=1] store i32 %23, i32* %12, align 4 %24 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %25 = load %llvm.dbg.anchor.type** %24, align 4 ; <%llvm.dbg.anchor.type*> [#uses=1] %26 = getelementptr %llvm.dbg.anchor.type* %25, i32 0, i32 1 ; [#uses=1] %27 = load i32* %26, align 4 ; [#uses=1] store i32 %27, i32* %11, align 4 %28 = load i32* %12, align 4 ; [#uses=1] store i32 %28, i32* %10, align 4 %29 = load i32* %12, align 4 ; [#uses=1] %30 = sub i32 %29, 1 ; [#uses=2] %31 = load i32* %11, align 4 ; [#uses=2] %32 = icmp sge i32 %31, %30 ; [#uses=1] %max = select i1 %32, i32 %31, i32 %30 ; [#uses=0] %33 = load i32* %12, align 4 ; [#uses=1] %34 = sub i32 %33, 1 ; [#uses=2] %35 = load i32* %11, align 4 ; [#uses=2] %36 = icmp sge i32 %35, %34 ; [#uses=1] %max2 = select i1 %36, i32 %35, i32 %34 ; [#uses=1] %37 = load i32* %12, align 4 ; [#uses=1] %38 = sub i32 %max2, %37 ; [#uses=1] %39 = sext i32 %38 to i64 ; [#uses=1] %sextl = shl i64 %39, 28 ; [#uses=1] %sextr = ashr i64 %sextl, 28 ; [#uses=2] %sextl5 = shl i64 %sextr, 28 ; [#uses=1] %sextr6 = ashr i64 %sextl5, 28 ; [#uses=0] %sextl7 = shl i64 %sextr, 28 ; [#uses=1] %sextr8 = ashr i64 %sextl7, 28 ; [#uses=1] %40 = add i64 %sextr8, 1 ; [#uses=1] %sextl9 = shl i64 %40, 28 ; [#uses=1] %sextr10 = ashr i64 %sextl9, 28 ; [#uses=2] %sextl12 = shl i64 %sextr10, 28 ; [#uses=1] %sextr13 = ashr i64 %sextl12, 28 ; [#uses=0] %sextl14 = shl i64 %sextr10, 28 ; [#uses=1] %sextr15 = ashr i64 %sextl14, 28 ; [#uses=1] %41 = mul i64 %sextr15, 8 ; [#uses=1] %sextl16 = shl i64 %41, 28 ; [#uses=1] %sextr17 = ashr i64 %sextl16, 28 ; [#uses=2] %sextl19 = shl i64 %sextr17, 28 ; [#uses=1] %sextr20 = ashr i64 %sextl19, 28 ; [#uses=0] %sextl21 = shl i64 %sextr17, 28 ; [#uses=1] %sextr22 = ashr i64 %sextl21, 28 ; [#uses=2] %42 = icmp sge i64 %sextr22, 0 ; [#uses=1] %max24 = select i1 %42, i64 %sextr22, i64 0 ; [#uses=1] %sextl25 = shl i64 %max24, 28 ; [#uses=1] %sextr26 = ashr i64 %sextl25, 28 ; [#uses=2] %sextl28 = shl i64 %sextr26, 28 ; [#uses=1] %sextr29 = ashr i64 %sextl28, 28 ; [#uses=0] %sextl30 = shl i64 %sextr26, 28 ; [#uses=1] %sextr31 = ashr i64 %sextl30, 28 ; [#uses=1] %43 = add i64 %sextr31, 7 ; [#uses=1] %sextl32 = shl i64 %43, 28 ; [#uses=1] %sextr33 = ashr i64 %sextl32, 28 ; [#uses=2] %sextl35 = shl i64 %sextr33, 28 ; [#uses=1] %sextr36 = ashr i64 %sextl35, 28 ; [#uses=0] %sextl37 = shl i64 %sextr33, 28 ; [#uses=1] %sextr38 = ashr i64 %sextl37, 28 ; [#uses=1] %44 = and i64 %sextr38, -8 ; [#uses=1] %sextl39 = shl i64 %44, 28 ; [#uses=1] %sextr40 = ashr i64 %sextl39, 28 ; [#uses=1] %sextl42 = shl i64 %sextr40, 28 ; [#uses=1] %sextr43 = ashr i64 %sextl42, 28 ; [#uses=0] %45 = load i32* %12, align 4 ; [#uses=1] %46 = sub i32 %45, 1 ; [#uses=2] %47 = load i32* %11, align 4 ; [#uses=2] %48 = icmp sge i32 %47, %46 ; [#uses=1] %max44 = select i1 %48, i32 %47, i32 %46 ; [#uses=1] %49 = load i32* %12, align 4 ; [#uses=1] %50 = sub i32 %max44, %49 ; [#uses=1] %51 = add i32 %50, 1 ; [#uses=2] %52 = icmp sge i32 %51, 0 ; [#uses=1] %max46 = select i1 %52, i32 %51, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 282, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %53 = load i8* %flag_addr, align 1 ; [#uses=1] %54 = zext i8 %53 to i32 ; [#uses=1] %55 = getelementptr [256 x i8]* @system__tasking__debug__trace_on, i32 0, i32 %54 ; [#uses=1] %56 = load i8* %55, align 1 ; [#uses=1] %toBool = icmp ne i8 %56, 0 ; [#uses=1] br i1 %toBool, label %bb, label %bb116 ; No predecessors! call void @llvm.dbg.stoppoint(i32 282, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb bb: ; preds = %57, %entry call void @llvm.dbg.stoppoint(i32 285, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %58 = load %struct.system__tasking__ada_task_control_block** %self_id_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %59 = getelementptr %struct.system__tasking__ada_task_control_block* %58, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %60 = getelementptr %struct.system__tasking__common_atcb* %59, i32 0, i32 6 ; [#uses=1] %61 = load i32* %60, align 4 ; [#uses=1] store i32 %61, i32* %9, align 4 %62 = load i32* %9, align 4 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 283, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %63 = load i32* %9, align 4 ; [#uses=2] %64 = icmp sge i32 %63, 0 ; [#uses=1] %max48 = select i1 %64, i32 %63, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 285, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %65 = load i32* %9, align 4 ; [#uses=2] %66 = icmp sge i32 %65, 0 ; [#uses=1] %max50 = select i1 %66, i32 %65, i32 0 ; [#uses=1] %max505152 = sext i32 %max50 to i64 ; [#uses=1] %sextl53 = shl i64 %max505152, 28 ; [#uses=1] %sextr54 = ashr i64 %sextl53, 28 ; [#uses=2] %sextl56 = shl i64 %sextr54, 28 ; [#uses=1] %sextr57 = ashr i64 %sextl56, 28 ; [#uses=0] %sextl58 = shl i64 %sextr54, 28 ; [#uses=1] %sextr59 = ashr i64 %sextl58, 28 ; [#uses=1] %67 = mul i64 %sextr59, 8 ; [#uses=1] %sextl60 = shl i64 %67, 28 ; [#uses=1] %sextr61 = ashr i64 %sextl60, 28 ; [#uses=1] %sextl63 = shl i64 %sextr61, 28 ; [#uses=1] %sextr64 = ashr i64 %sextl63, 28 ; [#uses=0] %68 = load i32* %9, align 4 ; [#uses=2] %69 = icmp sge i32 %68, 0 ; [#uses=1] %max65 = select i1 %69, i32 %68, i32 0 ; [#uses=0] call void @llvm.dbg.stoppoint(i32 283, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %70 = load %struct.system__tasking__ada_task_control_block** %self_id_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %71 = getelementptr %struct.system__tasking__ada_task_control_block* %70, i32 0, i32 1 ; <%struct.system__tasking__common_atcb*> [#uses=1] %72 = getelementptr %struct.system__tasking__common_atcb* %71, i32 0, i32 5 ; <[32 x i8]*> [#uses=1] %73 = getelementptr [32 x i8]* %72, i32 0, i32 0 ; [#uses=1] %74 = load i32* %9, align 4 ; [#uses=1] %75 = getelementptr %llvm.dbg.anchor.type* %A.40, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %75, align 4 %76 = getelementptr %llvm.dbg.anchor.type* %A.40, i32 0, i32 1 ; [#uses=1] store i32 %74, i32* %76, align 4 %77 = getelementptr %struct.string___XUP* %8, i32 0, i32 0 ; [#uses=1] store i8* %73, i8** %77, align 4 %78 = getelementptr %struct.string___XUP* %8, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* %A.40, %llvm.dbg.anchor.type** %78, align 4 %79 = getelementptr %struct.string___XUP* %7, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([1 x i8]* @.str637, i32 0, i32 0), i8** %79, align 4 %80 = getelementptr %struct.string___XUP* %7, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.41.1163, %llvm.dbg.anchor.type** %80, align 4 %81 = getelementptr [1 x i8]* %A.42, i32 0, i32 0 ; [#uses=1] %82 = load i8* %flag_addr, align 1 ; [#uses=1] store i8 %82, i8* %81, align 1 %A.4267 = bitcast [1 x i8]* %A.42 to i8* ; [#uses=1] %83 = getelementptr %struct.string___XUP* %6, i32 0, i32 0 ; [#uses=1] store i8* %A.4267, i8** %83, align 4 %84 = getelementptr %struct.string___XUP* %6, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.44.1168, %llvm.dbg.anchor.type** %84, align 4 %85 = getelementptr %struct.string___XUP* %5, i32 0, i32 0 ; [#uses=1] store i8* getelementptr ([1 x i8]* @.str637, i32 0, i32 0), i8** %85, align 4 %86 = getelementptr %struct.string___XUP* %5, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] store %llvm.dbg.anchor.type* @C.45.1170, %llvm.dbg.anchor.type** %86, align 4 %87 = load %struct.system__tasking__ada_task_control_block** %self_id_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %88 = ptrtoint %struct.system__tasking__ada_task_control_block* %87 to i32 ; [#uses=1] invoke void @system__img_uns__image_unsigned(%struct.string___XUP* noalias sret %4, i32 %88) to label %invcont unwind label %lpad invcont: ; preds = %bb call void @llvm.dbg.stoppoint(i32 283, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt = getelementptr %struct.string___XUP* %4, i32 0, i32 0 ; [#uses=1] %val = load i8** %elt ; [#uses=1] %elt69 = getelementptr %struct.string___XUP* %4, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val70 = load %llvm.dbg.anchor.type** %elt69 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt71 = getelementptr %struct.string___XUP* %5, i32 0, i32 0 ; [#uses=1] %val72 = load i8** %elt71 ; [#uses=1] %elt73 = getelementptr %struct.string___XUP* %5, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val74 = load %llvm.dbg.anchor.type** %elt73 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt75 = getelementptr %struct.string___XUP* %6, i32 0, i32 0 ; [#uses=1] %val76 = load i8** %elt75 ; [#uses=1] %elt77 = getelementptr %struct.string___XUP* %6, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val78 = load %llvm.dbg.anchor.type** %elt77 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt79 = getelementptr %struct.string___XUP* %7, i32 0, i32 0 ; [#uses=1] %val80 = load i8** %elt79 ; [#uses=1] %elt81 = getelementptr %struct.string___XUP* %7, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val82 = load %llvm.dbg.anchor.type** %elt81 ; <%llvm.dbg.anchor.type*> [#uses=1] %elt83 = getelementptr %struct.string___XUP* %8, i32 0, i32 0 ; [#uses=1] %val84 = load i8** %elt83 ; [#uses=1] %elt85 = getelementptr %struct.string___XUP* %8, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val86 = load %llvm.dbg.anchor.type** %elt85 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops_concat_5__str_concat_5(%struct.string___XUP* noalias sret %3, i8* %val, %llvm.dbg.anchor.type* %val70, i8* %val72, %llvm.dbg.anchor.type* %val74, i8* %val76, %llvm.dbg.anchor.type* %val78, i8* %val80, %llvm.dbg.anchor.type* %val82, i8* %val84, %llvm.dbg.anchor.type* %val86) to label %invcont87 unwind label %lpad invcont87: ; preds = %invcont call void @llvm.dbg.stoppoint(i32 283, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt88 = getelementptr %struct.string___XUP* %3, i32 0, i32 0 ; [#uses=1] %val89 = load i8** %elt88 ; [#uses=1] %elt90 = getelementptr %struct.string___XUP* %3, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val91 = load %llvm.dbg.anchor.type** %elt90 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat_sc(%struct.string___XUP* noalias sret %2, i8* %val89, %llvm.dbg.anchor.type* %val91, i8 zeroext 58) to label %invcont92 unwind label %lpad invcont92: ; preds = %invcont87 call void @llvm.dbg.stoppoint(i32 283, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt93 = getelementptr %struct.string___XUP* %2, i32 0, i32 0 ; [#uses=1] %val94 = load i8** %elt93 ; [#uses=1] %elt95 = getelementptr %struct.string___XUP* %2, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val96 = load %llvm.dbg.anchor.type** %elt95 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val94, %llvm.dbg.anchor.type* %val96) to label %invcont97 unwind label %lpad invcont97: ; preds = %invcont92 call void @llvm.dbg.stoppoint(i32 288, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %89 = load %struct.system__tasking__ada_task_control_block** %other_id_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %90 = icmp ne %struct.system__tasking__ada_task_control_block* %89, null ; [#uses=1] br i1 %90, label %bb98, label %bb110 ; No predecessors! call void @llvm.dbg.stoppoint(i32 288, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb98 bb98: ; preds = %91, %invcont97 call void @llvm.dbg.stoppoint(i32 289, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %92 = load %struct.system__tasking__ada_task_control_block** %other_id_addr, align 4 ; <%struct.system__tasking__ada_task_control_block*> [#uses=1] %93 = ptrtoint %struct.system__tasking__ada_task_control_block* %92 to i32 ; [#uses=1] invoke void @system__img_uns__image_unsigned(%struct.string___XUP* noalias sret %1, i32 %93) to label %invcont99 unwind label %lpad invcont99: ; preds = %bb98 call void @llvm.dbg.stoppoint(i32 289, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt100 = getelementptr %struct.string___XUP* %1, i32 0, i32 0 ; [#uses=1] %val101 = load i8** %elt100 ; [#uses=1] %elt102 = getelementptr %struct.string___XUP* %1, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val103 = load %llvm.dbg.anchor.type** %elt102 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__string_ops__str_concat_sc(%struct.string___XUP* noalias sret %0, i8* %val101, %llvm.dbg.anchor.type* %val103, i8 zeroext 58) to label %invcont104 unwind label %lpad invcont104: ; preds = %invcont99 call void @llvm.dbg.stoppoint(i32 289, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt105 = getelementptr %struct.string___XUP* %0, i32 0, i32 0 ; [#uses=1] %val106 = load i8** %elt105 ; [#uses=1] %elt107 = getelementptr %struct.string___XUP* %0, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val108 = load %llvm.dbg.anchor.type** %elt107 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put(i8* %val106, %llvm.dbg.anchor.type* %val108) to label %invcont109 unwind label %lpad invcont109: ; preds = %invcont104 call void @llvm.dbg.stoppoint(i32 289, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb110 bb110: ; preds = %invcont109, %invcont97 call void @llvm.dbg.stoppoint(i32 292, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %elt111 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 0 ; [#uses=1] %val112 = load i8** %elt111 ; [#uses=1] %elt113 = getelementptr %struct.string___XUP* %msg_addr, i32 0, i32 1 ; <%llvm.dbg.anchor.type**> [#uses=1] %val114 = load %llvm.dbg.anchor.type** %elt113 ; <%llvm.dbg.anchor.type*> [#uses=1] invoke void @system__tasking__debug__put_line(i8* %val112, %llvm.dbg.anchor.type* %val114) to label %invcont115 unwind label %lpad invcont115: ; preds = %bb110 call void @llvm.dbg.stoppoint(i32 292, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb116 bb116: ; preds = %invcont115, %entry call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @system__tasking__debug__trace___clean.1098(%struct.FRAME.system__tasking__debug__put_line* nest %FRAME.50) br label %return ; No predecessors! call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) br label %bb117 bb117: ; preds = %ppad, %94 call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select = load i32* %eh_selector ; [#uses=1] store i32 %eh_select, i32* %save_filt.53, align 4 %eh_value = load i8** %eh_exception ; [#uses=1] store i8* %eh_value, i8** %save_eptr.52, align 4 call void @system__tasking__debug__trace___clean.1098(%struct.FRAME.system__tasking__debug__put_line* nest %FRAME.50) %95 = load i8** %save_eptr.52, align 4 ; [#uses=1] store i8* %95, i8** %eh_exception, align 4 %96 = load i32* %save_filt.53, align 4 ; [#uses=1] store i32 %96, i32* %eh_selector, align 4 br label %Unwind return: ; preds = %bb116 call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram630 to { }*)) ret void lpad: ; preds = %bb110, %invcont104, %invcont99, %bb98, %invcont92, %invcont87, %invcont, %bb %eh_ptr = call i8* @llvm.eh.exception() ; [#uses=1] store i8* %eh_ptr, i8** %eh_exception %eh_ptr118 = load i8** %eh_exception ; [#uses=1] call void @llvm.dbg.stoppoint(i32 104, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %eh_select119 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr118, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i32* @__gnat_all_others_value) ; [#uses=1] store i32 %eh_select119, i32* %eh_selector br label %ppad ppad: ; preds = %lpad br label %bb117 Unwind: ; preds = %bb117 %eh_ptr120 = load i8** %eh_exception ; [#uses=1] call void (i8*, ...)* @_Unwind_Resume(i8* %eh_ptr120) unreachable } declare void @system__string_ops_concat_5__str_concat_5(%struct.string___XUP* noalias sret, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*, i8*, %llvm.dbg.anchor.type*) define internal void @system__tasking__debug__trace___clean.1098(%struct.FRAME.system__tasking__debug__put_line* nest %CHAIN.51) { entry: %CHAIN.51_addr = alloca %struct.FRAME.system__tasking__debug__put_line* ; <%struct.FRAME.system__tasking__debug__put_line**> [#uses=2] %0 = alloca %llvm.dbg.anchor.type ; <%llvm.dbg.anchor.type*> [#uses=4] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram645 to { }*)) store %struct.FRAME.system__tasking__debug__put_line* %CHAIN.51, %struct.FRAME.system__tasking__debug__put_line** %CHAIN.51_addr call void @llvm.dbg.stoppoint(i32 102, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) %1 = load %struct.FRAME.system__tasking__debug__put_line** %CHAIN.51_addr, align 4 ; <%struct.FRAME.system__tasking__debug__put_line*> [#uses=1] %2 = getelementptr %struct.FRAME.system__tasking__debug__put_line* %1, i32 0, i32 0 ; <%llvm.dbg.anchor.type*> [#uses=2] %3 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %4 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 0 ; [#uses=1] %5 = load i32* %4, align 4 ; [#uses=1] store i32 %5, i32* %3, align 4 %6 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %7 = getelementptr %llvm.dbg.anchor.type* %2, i32 0, i32 1 ; [#uses=1] %8 = load i32* %7, align 4 ; [#uses=1] store i32 %8, i32* %6, align 4 %elt = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 0 ; [#uses=1] %val = load i32* %elt ; [#uses=1] %elt1 = getelementptr %llvm.dbg.anchor.type* %0, i32 0, i32 1 ; [#uses=1] %val2 = load i32* %elt1 ; [#uses=1] call void @system__secondary_stack__ss_release(i32 %val, i32 %val2) br label %return return: ; preds = %entry call void @llvm.dbg.stoppoint(i32 102, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram645 to { }*)) ret void } declare i32 @write(i32, i32, i32) From baldrick at free.fr Wed Jan 14 05:46:56 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 12:46:56 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901131252.49945.baldrick@free.fr> Message-ID: <200901141246.56489.baldrick@free.fr> Hi Evan, > This gets translated into low level pointer arithmetics, right? Later > on llvm-convert casts it to i8*: > > ArrayAddr = BitCastToType(ArrayAddr, > PointerType::getUnqual(Type::Int8Ty)); > > Is there a reason why we can't just give it the alignment of i8? I just had some coffee and woke up. It is of course always safe to give an alignment of 1. Ciao, Duncan. From baldrick at free.fr Wed Jan 14 08:27:22 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 14:27:22 -0000 Subject: [llvm-commits] [llvm-top] r62222 - in /llvm-top/trunk: ./ README.txt Message-ID: <200901141427.n0EERMqM023616@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jan 14 08:27:20 2009 New Revision: 62222 URL: http://llvm.org/viewvc/llvm-project?rev=62222&view=rev Log: Support for llvm-gcc-4.2. Modified: llvm-top/trunk/ (props changed) llvm-top/trunk/README.txt Propchange: llvm-top/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Jan 14 08:27:20 2009 @@ -3,8 +3,10 @@ .options sample build.llvm-gcc-4.0 +build.llvm-gcc-4.2 website llvm-gcc-4.0 +llvm-gcc-4.2 test-suite build.llvm llvm Modified: llvm-top/trunk/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/README.txt?rev=62222&r1=62221&r2=62222&view=diff ============================================================================== --- llvm-top/trunk/README.txt (original) +++ llvm-top/trunk/README.txt Wed Jan 14 08:27:20 2009 @@ -17,13 +17,13 @@ Once you've checked out llvm-top, you can then check out a module (and all its dependencies) with the "get" script located here. For example: - ./get llvm-gcc-4-0 + ./get llvm-gcc-4.2 -which will check out both llvm and llvm-gcc-4-0 because the latter depends on +which will check out both llvm and llvm-gcc-4.2 because the latter depends on the former. You can check out any number of modules using the "get" script, for example, like this: - ./get llvm-gcc-4.0 test-suite stacker + ./get llvm-gcc-4.2 test-suite stacker In addition to checking out software, there are several more scripts in @@ -119,17 +119,17 @@ So, for example, consider: - ./build llvm-gcc-4.0 ENABLE_OPTIMIZED=1 PREFIX=/my/install/dir VERBOSE=1 + ./build llvm-gcc-4.2 ENABLE_OPTIMIZED=1 PREFIX=/my/install/dir VERBOSE=1 As you might guess, this will do the following: - 1. Check out the llvm-gcc-4.0 module - 2. Check out the core module because llvm-gcc-4.0 depends on core + 1. Check out the llvm-gcc-4.2 module + 2. Check out the core module because llvm-gcc-4.2 depends on core 3. Check out the support module because core depends on support 4. Build the support module in optimized mode and configure it to install into /my/install/dir 5. Build the core module the same way. - 6. Build the llvm-gcc-4.0 module the same way. + 6. Build the llvm-gcc-4.2 module the same way. 7. Do all of the above with some simple progress messages. The modules available are: @@ -138,7 +138,7 @@ sample - A sample module you can use as a template for your own support - The support libraries, makefile system, etc. core - The core llvm software (currently "llvm") - llvm-gcc-4.0 - The C/C++/Obj-C front end for llvm, based on GCC 4.0 + llvm-gcc-4.2 - The C/C++/Obj-C front end for llvm, based on GCC 4.2 llvm-gcc-4.2 - The C/C++/Obj-C front end for llvm, based on GCC 4.2 cfe - The new C/C++/Obj-C front end for llvm test-suite - The llvm test suite From baldrick at free.fr Wed Jan 14 08:33:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 14:33:50 -0000 Subject: [llvm-commits] [llvm-top] r62224 - /llvm-top/trunk/README.txt Message-ID: <200901141433.n0EEXpWF023921@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jan 14 08:33:50 2009 New Revision: 62224 URL: http://llvm.org/viewvc/llvm-project?rev=62224&view=rev Log: Fix comment. Modified: llvm-top/trunk/README.txt Modified: llvm-top/trunk/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm-top/trunk/README.txt?rev=62224&r1=62223&r2=62224&view=diff ============================================================================== --- llvm-top/trunk/README.txt (original) +++ llvm-top/trunk/README.txt Wed Jan 14 08:33:50 2009 @@ -138,7 +138,7 @@ sample - A sample module you can use as a template for your own support - The support libraries, makefile system, etc. core - The core llvm software (currently "llvm") - llvm-gcc-4.2 - The C/C++/Obj-C front end for llvm, based on GCC 4.2 + llvm-gcc-4.0 - The C/C++/Obj-C front end for llvm, based on GCC 4.0 llvm-gcc-4.2 - The C/C++/Obj-C front end for llvm, based on GCC 4.2 cfe - The new C/C++/Obj-C front end for llvm test-suite - The llvm test suite From baldrick at free.fr Wed Jan 14 08:39:48 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 14:39:48 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62225 - /llvm-gcc-4.2/trunk/build-for-llvm-top.sh Message-ID: <200901141439.n0EEdm6E024107@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jan 14 08:39:47 2009 New Revision: 62225 URL: http://llvm.org/viewvc/llvm-project?rev=62225&view=rev Log: Build script for use from llvm-top. Modified: llvm-gcc-4.2/trunk/build-for-llvm-top.sh Modified: llvm-gcc-4.2/trunk/build-for-llvm-top.sh URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build-for-llvm-top.sh?rev=62225&r1=62224&r2=62225&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build-for-llvm-top.sh (original) +++ llvm-gcc-4.2/trunk/build-for-llvm-top.sh Wed Jan 14 08:39:47 2009 @@ -1,5 +1,5 @@ #!/bin/sh -# build script for llvm-gcc-4.2 +# build script for llvm-gcc-4.2 # # This file was developed by Reid Spencer and is distributed under the # University of Illinois Open Source License. See LICENSE.TXT for details. @@ -27,10 +27,8 @@ config_options="--prefix=$PREFIX --enable-llvm=$LLVM_TOP/llvm " config_options="$config_options --program-prefix=llvm-" config_options="$config_options --enable-languages=c,c++" - config_options="$config_options --disable-bootstrap" - config_options="$config_options --with-gxx-include-dir=/proj/install/include/c++/4.2.1" if test "$OPTIMIZED" -eq 0 ; then - config_options="$config_options --enable-checking" + config_options="$config_options --enable-checking --enable-libstdcxx-debug" fi host=`./config.guess` if test ! -z `echo "$host" | grep 'linux'` ; then From baldrick at free.fr Wed Jan 14 08:42:50 2009 From: baldrick at free.fr (Duncan Sands) Date: Wed, 14 Jan 2009 14:42:50 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62226 - /llvm-gcc-4.2/trunk/build-for-llvm-top.sh Message-ID: <200901141442.n0EEgoNf024254@zion.cs.uiuc.edu> Author: baldrick Date: Wed Jan 14 08:42:49 2009 New Revision: 62226 URL: http://llvm.org/viewvc/llvm-project?rev=62226&view=rev Log: I'm having a bad day - undo some changes that shouldn't have been made. Modified: llvm-gcc-4.2/trunk/build-for-llvm-top.sh Modified: llvm-gcc-4.2/trunk/build-for-llvm-top.sh URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/build-for-llvm-top.sh?rev=62226&r1=62225&r2=62226&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/build-for-llvm-top.sh (original) +++ llvm-gcc-4.2/trunk/build-for-llvm-top.sh Wed Jan 14 08:42:49 2009 @@ -1,5 +1,5 @@ #!/bin/sh -# build script for llvm-gcc-4.2 +# build script for llvm-gcc-4.2 # # This file was developed by Reid Spencer and is distributed under the # University of Illinois Open Source License. See LICENSE.TXT for details. @@ -27,8 +27,9 @@ config_options="--prefix=$PREFIX --enable-llvm=$LLVM_TOP/llvm " config_options="$config_options --program-prefix=llvm-" config_options="$config_options --enable-languages=c,c++" + config_options="$config_options --disable-bootstrap" if test "$OPTIMIZED" -eq 0 ; then - config_options="$config_options --enable-checking --enable-libstdcxx-debug" + config_options="$config_options --enable-checking" fi host=`./config.guess` if test ! -z `echo "$host" | grep 'linux'` ; then From nicolas.geoffray at lip6.fr Wed Jan 14 10:01:44 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jan 2009 17:01:44 +0100 Subject: [llvm-commits] [llvm] r62045 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp In-Reply-To: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> References: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> Message-ID: <496E0C68.1070209@lip6.fr> Hi Chris, Quick question folllowing this patch. Getting the size of a type is platform dependent, and since InstCombine makes lots of uses of getTypeSize, InstCombine is therefore platform dependent. Is this OK? I know this patch did not introduce the platform-dependency, but I was just curious if that's OK, and if LLVM considers transformation passes strongly platform dependent. Thanks! Nicolas Chris Lattner wrote: > Author: lattner > Date: Sun Jan 11 14:15:20 2009 > New Revision: 62045 > > URL: http://llvm.org/viewvc/llvm-project?rev=62045&view=rev > Log: > Make a couple of cleanups to the instcombine bitcast/gep > canonicalization transform based on duncan's comments: > > 1) improve the comment about %. > 2) within our index loop make sure the offset stays > within the *type size*, instead of within the *abi size*. > This allows us to reason explicitly about landing in tail > padding and means that issues like non-zero offsets into > [0 x foo] types don't occur anymore. > > > Modified: > llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > > Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62045&r1=62044&r2=62045&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun Jan 11 14:15:20 2009 > @@ -7712,7 +7712,7 @@ > FirstIdx = Offset/TySize; > Offset %= TySize; > > - // Handle silly modulus not returning values [0..TySize). > + // Handle hosts where % returns negative instead of values [0..TySize). > if (Offset < 0) { > --FirstIdx; > Offset += TySize; > @@ -7725,12 +7725,15 @@ > > // Index into the types. If we fail, set OrigBase to null. > while (Offset) { > + // Indexing into tail padding between struct/array elements. > + if (uint64_t(Offset*8) >= TD->getTypeSizeInBits(Ty)) > + return false; > + > if (const StructType *STy = dyn_cast(Ty)) { > const StructLayout *SL = TD->getStructLayout(STy); > - if (Offset >= (int64_t)SL->getSizeInBytes()) { > - // We can't index into this, bail out. > - return false; > - } > + assert(Offset < (int64_t)SL->getSizeInBytes() && > + "Offset must stay within the indexed type"); > + > unsigned Elt = SL->getElementContainingOffset(Offset); > NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt)); > > @@ -7738,15 +7741,13 @@ > Ty = STy->getElementType(Elt); > } else if (isa(Ty) || isa(Ty)) { > const SequentialType *STy = cast(Ty); > - if (uint64_t EltSize = TD->getABITypeSize(STy->getElementType())) { > - NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize)); > - Offset %= EltSize; > - } else { > - NewIndices.push_back(ConstantInt::get(IntPtrTy, 0)); > - } > + uint64_t EltSize = TD->getABITypeSize(STy->getElementType()); > + assert(EltSize && "Cannot index into a zero-sized array"); > + NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize)); > + Offset %= EltSize; > Ty = STy->getElementType(); > } else { > - // Otherwise, we can't index into this, bail out. > + // Otherwise, we can't index into the middle of this atomic type, bail. > return false; > } > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From ggreif at gmail.com Wed Jan 14 11:09:10 2009 From: ggreif at gmail.com (Gabor Greif) Date: Wed, 14 Jan 2009 17:09:10 -0000 Subject: [llvm-commits] [llvm] r62232 - /llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Message-ID: <200901141709.n0EH9AZH029101@zion.cs.uiuc.edu> Author: ggreif Date: Wed Jan 14 11:09:04 2009 New Revision: 62232 URL: http://llvm.org/viewvc/llvm-project?rev=62232&view=rev Log: minor simplification Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=62232&r1=62231&r2=62232&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Wed Jan 14 11:09:04 2009 @@ -247,8 +247,8 @@ OS << "Call graph node <>:\n"; for (const_iterator I = begin(), E = end(); I != E; ++I) - if (I->second->getFunction()) - OS << " Calls function '" << I->second->getFunction()->getName() <<"'\n"; + if (Function *FI = I->second->getFunction()) + OS << " Calls function '" << FI->getName() <<"'\n"; else OS << " Calls external node\n"; OS << "\n"; From criswell at uiuc.edu Wed Jan 14 11:29:16 2009 From: criswell at uiuc.edu (John Criswell) Date: Wed, 14 Jan 2009 17:29:16 -0000 Subject: [llvm-commits] [poolalloc] r62234 - in /poolalloc/trunk/lib: DSA/DataStructure.cpp DSA/Local.cpp PoolAllocate/Heuristic.cpp PoolAllocate/PASimple.cpp PoolAllocate/PointerCompress.cpp PoolAllocate/TransformFunctionBody.cpp Message-ID: <200901141729.n0EHTG0l029772@zion.cs.uiuc.edu> Author: criswell Date: Wed Jan 14 11:29:15 2009 New Revision: 62234 URL: http://llvm.org/viewvc/llvm-project?rev=62234&view=rev Log: Updated to new LLVM API. This API replaced getABITypeSize() with getTypePaddedSize(). Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp poolalloc/trunk/lib/DSA/Local.cpp poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp poolalloc/trunk/lib/PoolAllocate/PASimple.cpp poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructure.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructure.cpp Wed Jan 14 11:29:15 2009 @@ -399,7 +399,7 @@ const ArrayType *AT = cast(SS.Ty); ++SS.Idx; if (SS.Idx != AT->getNumElements()) { - SS.Offset += unsigned(TD.getABITypeSize(AT->getElementType())); + SS.Offset += unsigned(TD.getTypePaddedSize(AT->getElementType())); return; } Stack.pop_back(); // At the end of the array @@ -434,7 +434,7 @@ assert(SS.Idx < AT->getNumElements()); Stack.push_back(StackState(AT->getElementType(), SS.Offset+SS.Idx* - unsigned(TD.getABITypeSize(AT->getElementType())))); + unsigned(TD.getTypePaddedSize(AT->getElementType())))); } } } @@ -491,7 +491,7 @@ (Size == 0 && !Ty->isSized() && !isArray()) || (Size == 1 && Ty == Type::VoidTy && isArray()) || (Size == 0 && !Ty->isSized() && !isArray()) || - (TD.getABITypeSize(Ty) == Size)) && + (TD.getTypePaddedSize(Ty) == Size)) && "Size member of DSNode doesn't match the type structure!"); assert(NewTy != Type::VoidTy && "Cannot merge void type into DSNode!"); @@ -514,7 +514,7 @@ } // Figure out how big the new type we're merging in is... - unsigned NewTySize = NewTy->isSized() ? (unsigned)TD.getABITypeSize(NewTy) : 0; + unsigned NewTySize = NewTy->isSized() ? (unsigned)TD.getTypePaddedSize(NewTy) : 0; // Otherwise check to see if we can fold this type into the current node. If // we can't, we fold the node completely, if we can, we potentially update our @@ -654,7 +654,7 @@ unsigned O = 0; const Type *SubType = Ty; while (O < Offset) { - assert(Offset-O < TD.getABITypeSize(SubType) && "Offset out of range!"); + assert(Offset-O < TD.getTypePaddedSize(SubType) && "Offset out of range!"); switch (SubType->getTypeID()) { case Type::StructTyID: { @@ -669,7 +669,7 @@ } case Type::ArrayTyID: { SubType = cast(SubType)->getElementType(); - unsigned ElSize = (unsigned)TD.getABITypeSize(SubType); + unsigned ElSize = (unsigned)TD.getTypePaddedSize(SubType); unsigned Remainder = (Offset-O) % ElSize; O = Offset-Remainder; break; @@ -691,7 +691,7 @@ isa(NewTy)) return false; unsigned SubTypeSize = SubType->isSized() ? - (unsigned)TD.getABITypeSize(SubType) : 0; + (unsigned)TD.getTypePaddedSize(SubType) : 0; // Ok, we are getting desperate now. Check for physical subtyping, where we // just require each element in the node to be compatible. @@ -719,12 +719,12 @@ else NextPadSize = SubTypeSize; NextSubType = STy->getElementType(0); - NextSubTypeSize = (unsigned)TD.getABITypeSize(NextSubType); + NextSubTypeSize = (unsigned)TD.getTypePaddedSize(NextSubType); break; } case Type::ArrayTyID: NextSubType = cast(SubType)->getElementType(); - NextSubTypeSize = (unsigned)TD.getABITypeSize(NextSubType); + NextSubTypeSize = (unsigned)TD.getTypePaddedSize(NextSubType); NextPadSize = NextSubTypeSize; break; default: ; Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Wed Jan 14 11:29:15 2009 @@ -447,7 +447,7 @@ if (ConstantInt *CS = dyn_cast(GEP.getOperand(i))) { Offset += (CS->getType()->isSigned() ? CS->getSExtValue() : CS->getZExtValue()) - * TD.getABITypeSize(CurTy); + * TD.getTypePaddedSize(CurTy); } else { // Variable index into a node. We must merge all of the elements of the // sequential type here. @@ -455,7 +455,7 @@ cerr << "Pointer indexing not handled yet!\n"; else { const ArrayType *ATy = cast(STy); - unsigned ElSize = TD.getABITypeSize(CurTy); + unsigned ElSize = TD.getTypePaddedSize(CurTy); DSNode *N = Value.getNode(); assert(N && "Value must have a node!"); unsigned RawOffset = Offset+Value.getOffset(); Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Wed Jan 14 11:29:15 2009 @@ -57,7 +57,7 @@ unsigned Heuristic::getRecommendedSize(const DSNode *N) { unsigned PoolSize = 0; if (!N->isArray() && N->getType()->isSized()) { - PoolSize = N->getParentGraph()->getTargetData().getABITypeSize(N->getType()); + PoolSize = N->getParentGraph()->getTargetData().getTypePaddedSize(N->getType()); } if (PoolSize == 1) PoolSize = 0; return PoolSize; Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Wed Jan 14 11:29:15 2009 @@ -178,7 +178,7 @@ if (MI->isArrayAllocation()) { Value * NumElements = MI->getArraySize(); Value * ElementSize = ConstantInt::get (Type::Int32Ty, - TD.getABITypeSize(MI->getAllocatedType())); + TD.getTypePaddedSize(MI->getAllocatedType())); AllocSize = BinaryOperator::Create (Instruction::Mul, ElementSize, NumElements, @@ -186,7 +186,7 @@ MI); } else { AllocSize = ConstantInt::get (Type::Int32Ty, - TD.getABITypeSize(MI->getAllocatedType())); + TD.getTypePaddedSize(MI->getAllocatedType())); } Value* args[] = {TheGlobalPool, AllocSize}; Modified: poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp Wed Jan 14 11:29:15 2009 @@ -226,7 +226,7 @@ NewTy = ComputeCompressedType(Pool->getType(), 0, Nodes); // Get the compressed type size. - NewSize = NewTy->isSized() ? TD.getABITypeSize(NewTy) : 0; + NewSize = NewTy->isSized() ? TD.getTypePaddedSize(NewTy) : 0; } @@ -318,9 +318,9 @@ const TargetData &TD = getNode()->getParentGraph()->getTargetData(); std::cerr << " From size: " << (getNode()->getType()->isSized() ? - TD.getABITypeSize(getNode()->getType()) : 0) + TD.getTypePaddedSize(getNode()->getType()) : 0) << " To size: " - << (NewTy->isSized() ? TD.getABITypeSize(NewTy) : 0) << "\n"; + << (NewTy->isSized() ? TD.getTypePaddedSize(NewTy) : 0) << "\n"; std::cerr << "Node: "; getNode()->dump(); std::cerr << "New Type: " << *NewTy << "\n"; } @@ -733,7 +733,7 @@ Idx = CastInst::CreateSExtOrBitCast(Idx, SCALARUINTTYPE, Idx->getName(), &GEPI); Constant *Scale = ConstantInt::get(SCALARUINTTYPE, - TD.getABITypeSize(ElTy)); + TD.getTypePaddedSize(ElTy)); Idx = BinaryOperator::CreateMul(Idx, Scale, "fieldidx", &GEPI); Val = BinaryOperator::CreateAdd(Val, Idx, GEPI.getName(), &GEPI); } Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=62234&r1=62233&r2=62234&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Jan 14 11:29:15 2009 @@ -216,7 +216,7 @@ TargetData &TD = PAInfo.getAnalysis(); Value *AllocSize = - ConstantInt::get(Type::Int32Ty, TD.getABITypeSize(MI.getAllocatedType())); + ConstantInt::get(Type::Int32Ty, TD.getTypePaddedSize(MI.getAllocatedType())); if (MI.isArrayAllocation()) AllocSize = BinaryOperator::Create(Instruction::Mul, AllocSize, @@ -274,7 +274,7 @@ if (PH == 0 || isa(PH)) return; TargetData &TD = PAInfo.getAnalysis(); Value *AllocSize = - ConstantInt::get(Type::Int32Ty, TD.getABITypeSize(MI.getAllocatedType())); + ConstantInt::get(Type::Int32Ty, TD.getTypePaddedSize(MI.getAllocatedType())); if (MI.isArrayAllocation()) AllocSize = BinaryOperator::Create(Instruction::Mul, AllocSize, @@ -335,7 +335,7 @@ void FuncTransform::visitCallocCall(CallSite CS) { TargetData& TD = PAInfo.getAnalysis(); - bool useLong = TD.getABITypeSize(PointerType::getUnqual(Type::Int8Ty)) != 4; + bool useLong = TD.getTypePaddedSize(PointerType::getUnqual(Type::Int8Ty)) != 4; Module *M = CS.getInstruction()->getParent()->getParent()->getParent(); assert(CS.arg_end()-CS.arg_begin() == 2 && "calloc takes two arguments!"); From nunoplopes at sapo.pt Wed Jan 14 11:51:42 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Wed, 14 Jan 2009 17:51:42 -0000 Subject: [llvm-commits] [llvm] r62236 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> Author: nlopes Date: Wed Jan 14 11:51:41 2009 New Revision: 62236 URL: http://llvm.org/viewvc/llvm-project?rev=62236&view=rev Log: fix crash in the case when some arg is null Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62236&r1=62235&r2=62236&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Jan 14 11:51:41 2009 @@ -1671,7 +1671,7 @@ } else { for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) { Operand = I.getOperand(i); - if (Operand->getType() != TheType) { + if (Operand && Operand->getType() != TheType) { PrintAllTypes = true; // We have differing types! Print them all! break; } From richard at xmos.com Wed Jan 14 12:26:48 2009 From: richard at xmos.com (Richard Osborne) Date: Wed, 14 Jan 2009 18:26:48 -0000 Subject: [llvm-commits] [llvm] r62238 - in /llvm/trunk: lib/Target/XCore/XCoreInstrInfo.cpp lib/Target/XCore/XCoreInstrInfo.td lib/Target/XCore/XCoreRegisterInfo.cpp test/CodeGen/XCore/2009-01-14-Remat-Crash.ll Message-ID: <200901141826.n0EIQm5d032038@zion.cs.uiuc.edu> Author: friedgold Date: Wed Jan 14 12:26:46 2009 New Revision: 62238 URL: http://llvm.org/viewvc/llvm-project?rev=62238&view=rev Log: Add pseudo instructions to the XCore for (load|store|load address) of a frame index. eliminateFrameIndex will replace these instructions with (LDWSP|STWSP|LDAWSP) or (LDW|STW|LDAWF) if a frame pointer is in use. This fixes PR 3324. Previously we used LDWSP, STWSP, LDAWSP before frame pointer elimination. However since they were marked as implicitly using SP they could not be rematerialised. Added: llvm/trunk/test/CodeGen/XCore/2009-01-14-Remat-Crash.ll Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp?rev=62238&r1=62237&r2=62238&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp Wed Jan 14 12:26:46 2009 @@ -77,7 +77,7 @@ unsigned XCoreInstrInfo::isLoadFromStackSlot(const MachineInstr *MI, int &FrameIndex) const{ int Opcode = MI->getOpcode(); - if (Opcode == XCore::LDWSP_ru6 || Opcode == XCore::LDWSP_lru6) + if (Opcode == XCore::LDWFI) { if ((MI->getOperand(1).isFI()) && // is a stack slot (MI->getOperand(2).isImm()) && // the imm is zero @@ -99,19 +99,11 @@ XCoreInstrInfo::isStoreToStackSlot(const MachineInstr *MI, int &FrameIndex) const { int Opcode = MI->getOpcode(); - if (Opcode == XCore::STWSP_ru6 || Opcode == XCore::STWSP_lru6) + if (Opcode == XCore::STWFI) { if ((MI->getOperand(1).isFI()) && // is a stack slot (MI->getOperand(2).isImm()) && // the imm is zero - (isZeroImm(MI->getOperand(2)))) - { - FrameIndex = MI->getOperand(1).getIndex(); - return MI->getOperand(0).getReg(); - } - } - else if (Opcode == XCore::STWSP_ru6_2 || Opcode == XCore::STWSP_lru6_2) - { - if (MI->getOperand(1).isFI()) + (isZeroImm(MI->getOperand(2)))) { FrameIndex = MI->getOperand(1).getIndex(); return MI->getOperand(0).getReg(); @@ -387,8 +379,8 @@ unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC) const { - BuildMI(MBB, I, get(XCore::STWSP_lru6)).addReg(SrcReg, false, false, isKill) - .addFrameIndex(FrameIndex).addImm(0); + BuildMI(MBB, I, get(XCore::STWFI)).addReg(SrcReg, false, false, isKill) + .addFrameIndex(FrameIndex).addImm(0); } void XCoreInstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg, @@ -404,8 +396,8 @@ unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC) const { - BuildMI(MBB, I, get(XCore::LDWSP_lru6), DestReg).addFrameIndex(FrameIndex) - .addImm(0); + BuildMI(MBB, I, get(XCore::LDWFI), DestReg).addFrameIndex(FrameIndex) + .addImm(0); } void XCoreInstrInfo::loadRegFromAddr(MachineFunction &MF, unsigned DestReg, Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td?rev=62238&r1=62237&r2=62238&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td (original) +++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.td Wed Jan 14 12:26:46 2009 @@ -349,6 +349,18 @@ [(callseq_end timm:$amt1, timm:$amt2)]>; } +def LDWFI : PseudoInstXCore<(outs GRRegs:$dst), (ins MEMii:$addr), + "${:comment} LDWFI $dst, $addr", + [(set GRRegs:$dst, (load ADDRspii:$addr))]>; + +def LDAWFI : PseudoInstXCore<(outs GRRegs:$dst), (ins MEMii:$addr), + "${:comment} LDAWFI $dst, $addr", + [(set GRRegs:$dst, ADDRspii:$addr)]>; + +def STWFI : PseudoInstXCore<(outs), (ins GRRegs:$src, MEMii:$addr), + "${:comment} STWFI $src, $addr", + [(store GRRegs:$src, ADDRspii:$addr)]>; + // SELECT_CC_* - Used to implement the SELECT_CC DAG operation. Expanded by the // scheduler into a branch sequence. let usesCustomDAGSchedInserter = 1 in { @@ -543,51 +555,41 @@ defm LDWCP : FRU6_LRU6_cp<"ldw">; let Uses = [SP] in { -let mayStore=1 in +let mayStore=1 in { def STWSP_ru6 : _FRU6< - (outs), (ins GRRegs:$dst, MEMii:$b), - "stw $dst, sp[$b]", - []>; + (outs), (ins GRRegs:$val, i32imm:$index), + "stw $val, sp[$index]", + [(XCoreStwsp GRRegs:$val, immU6:$index)]>; def STWSP_lru6 : _FLRU6< - (outs), (ins GRRegs:$dst, MEMii:$b), - "stw $dst, sp[$b]", - [(store GRRegs:$dst, ADDRspii:$b)]>; - -let mayStore=1 in -def STWSP_ru6_2 : _FRU6< - (outs), (ins GRRegs:$dst, i32imm:$b), - "stw $dst, sp[$b]", - []>; - -def STWSP_lru6_2 : _FLRU6< - (outs), (ins GRRegs:$dst, i32imm:$b), - "stw $dst, sp[$b]", - [(store GRRegs:$dst, ADDRspii:$b)]>; + (outs), (ins GRRegs:$val, i32imm:$index), + "stw $val, sp[$index]", + [(XCoreStwsp GRRegs:$val, immU16:$index)]>; +} -let mayLoad=1 in +let mayLoad=1 in { def LDWSP_ru6 : _FRU6< - (outs GRRegs:$dst), (ins MEMii:$b), + (outs GRRegs:$dst), (ins i32imm:$b), "ldw $dst, sp[$b]", []>; def LDWSP_lru6 : _FLRU6< - (outs GRRegs:$dst), (ins MEMii:$b), + (outs GRRegs:$dst), (ins i32imm:$b), "ldw $dst, sp[$b]", - [(set GRRegs:$dst, (load ADDRspii:$b))]>; + []>; +} -let neverHasSideEffects = 1 in +let neverHasSideEffects = 1 in { def LDAWSP_ru6 : _FRU6< - (outs GRRegs:$dst), (ins MEMii:$b), + (outs GRRegs:$dst), (ins i32imm:$b), "ldaw $dst, sp[$b]", []>; def LDAWSP_lru6 : _FLRU6< - (outs GRRegs:$dst), (ins MEMii:$b), + (outs GRRegs:$dst), (ins i32imm:$b), "ldaw $dst, sp[$b]", - [(set GRRegs: $dst, ADDRspii:$b)]>; + []>; -let neverHasSideEffects = 1 in { def LDAWSP_ru6_RRegs : _FRU6< (outs RRegs:$dst), (ins i32imm:$b), "ldaw $dst, sp[$b]", @@ -808,10 +810,6 @@ def : Pat<(XCoreBranchLink tglobaladdr:$addr), (BL_lu10 tglobaladdr:$addr)>; def : Pat<(XCoreBranchLink texternalsym:$addr), (BL_lu10 texternalsym:$addr)>; -def : Pat<(XCoreStwsp GRRegs:$val, immU6:$index), - (STWSP_ru6_2 GRRegs:$val, immU6:$index)>; -def : Pat<(XCoreStwsp GRRegs:$val, immU16:$index), - (STWSP_lru6_2 GRRegs:$val, immU16:$index)>; /// sext_inreg def : Pat<(sext_inreg GRRegs:$b, i1), (SEXT_rus GRRegs:$b, 1)>; Modified: llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp?rev=62238&r1=62237&r2=62238&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp Wed Jan 14 12:26:46 2009 @@ -211,19 +211,18 @@ bool FP = hasFP(MF); + unsigned Reg = MI.getOperand(0).getReg(); + bool isKill = MI.getOpcode() == XCore::STWFI && MI.getOperand(0).isKill(); + + assert(XCore::GRRegsRegisterClass->contains(Reg) && + "Unexpected register operand"); + + MachineBasicBlock &MBB = *MI.getParent(); + if (FP) { bool isUs = isImmUs(Offset); - MachineBasicBlock &MBB = *MI.getParent(); unsigned FramePtr = XCore::R10; - unsigned Reg = MI.getOperand(0).getReg(); - bool isKill = MI.getOperand(0).isKill(); - if (Reg == XCore::LR) { - // The LR should have been save in the prologue. - cerr << "saving LR to FP unimplemented\n"; - abort(); - } - MachineInstr *New = 0; if (!isUs) { if (!RS) { @@ -234,18 +233,18 @@ SPAdj); loadConstant(MBB, II, ScratchReg, Offset); switch (MI.getOpcode()) { - case XCore::LDWSP_lru6: + case XCore::LDWFI: New = BuildMI(MBB, II, TII.get(XCore::LDW_3r), Reg) .addReg(FramePtr) .addReg(ScratchReg, false, false, true); break; - case XCore::STWSP_lru6: + case XCore::STWFI: New = BuildMI(MBB, II, TII.get(XCore::STW_3r)) .addReg(Reg, false, false, isKill) .addReg(FramePtr) .addReg(ScratchReg, false, false, true); break; - case XCore::LDAWSP_lru6: + case XCore::LDAWFI: New = BuildMI(MBB, II, TII.get(XCore::LDAWF_l3r), Reg) .addReg(FramePtr) .addReg(ScratchReg, false, false, true); @@ -255,18 +254,18 @@ } } else { switch (MI.getOpcode()) { - case XCore::LDWSP_lru6: + case XCore::LDWFI: New = BuildMI(MBB, II, TII.get(XCore::LDW_2rus), Reg) .addReg(FramePtr) .addImm(Offset); break; - case XCore::STWSP_lru6: + case XCore::STWFI: New = BuildMI(MBB, II, TII.get(XCore::STW_2rus)) .addReg(Reg, false, false, isKill) .addReg(FramePtr) .addImm(Offset); break; - case XCore::LDAWSP_lru6: + case XCore::LDAWFI: New = BuildMI(MBB, II, TII.get(XCore::LDAWF_l2rus), Reg) .addReg(FramePtr) .addImm(Offset); @@ -275,9 +274,6 @@ assert(0 && "Unexpected Opcode\n"); } } - - // Erase old instruction. - MBB.erase(II); } else { bool isU6 = isImmU6(Offset); if (!isU6 && !isImmU16(Offset)) { @@ -286,25 +282,30 @@ abort(); } - int NewOpcode = MI.getOpcode(); - - switch (NewOpcode) { - case XCore::LDWSP_lru6: + switch (MI.getOpcode()) { + int NewOpcode; + case XCore::LDWFI: NewOpcode = (isU6) ? XCore::LDWSP_ru6 : XCore::LDWSP_lru6; + BuildMI(MBB, II, TII.get(NewOpcode), Reg) + .addImm(Offset); break; - case XCore::STWSP_lru6: + case XCore::STWFI: NewOpcode = (isU6) ? XCore::STWSP_ru6 : XCore::STWSP_lru6; + BuildMI(MBB, II, TII.get(NewOpcode)) + .addReg(Reg, false, false, isKill) + .addImm(Offset); break; - case XCore::LDAWSP_lru6: + case XCore::LDAWFI: NewOpcode = (isU6) ? XCore::LDAWSP_ru6 : XCore::LDAWSP_lru6; + BuildMI(MBB, II, TII.get(NewOpcode), Reg) + .addImm(Offset); break; default: assert(0 && "Unexpected Opcode\n"); } - - MI.setDesc(TII.get(NewOpcode)); - FrameOp.ChangeToImmediate(Offset); } + // Erase old instruction. + MBB.erase(II); } void @@ -372,8 +373,7 @@ int Opcode = isU6 ? XCore::STWSP_ru6 : XCore::STWSP_lru6; BuildMI(MBB, I, TII.get(Opcode)) .addReg(SrcReg) - .addImm(Offset) - .addImm(0); + .addImm(Offset); } void XCoreRegisterInfo:: @@ -388,8 +388,7 @@ } int Opcode = isU6 ? XCore::LDWSP_ru6 : XCore::LDWSP_lru6; BuildMI(MBB, I, TII.get(Opcode), DstReg) - .addImm(Offset) - .addImm(0); + .addImm(Offset); } void XCoreRegisterInfo::emitPrologue(MachineFunction &MF) const { Added: llvm/trunk/test/CodeGen/XCore/2009-01-14-Remat-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/2009-01-14-Remat-Crash.ll?rev=62238&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/XCore/2009-01-14-Remat-Crash.ll (added) +++ llvm/trunk/test/CodeGen/XCore/2009-01-14-Remat-Crash.ll Wed Jan 14 12:26:46 2009 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +; PR3324 +define double @f1(double %a, double %b, double %c, double %d, double %e, double %f, double %g) nounwind { +entry: + br i1 false, label %bb113, label %bb129 + +bb113: ; preds = %entry + ret double 0.000000e+00 + +bb129: ; preds = %entry + %tmp134 = sub double %b, %a ; [#uses=1] + %tmp136 = sub double %tmp134, %c ; [#uses=1] + %tmp138 = add double %tmp136, %d ; [#uses=1] + %tmp140 = sub double %tmp138, %e ; [#uses=1] + %tmp142 = add double %tmp140, %f ; [#uses=1] + %tmp.0 = mul double %tmp142, 0.000000e+00 ; [#uses=1] + ret double %tmp.0 +} From echeng at apple.com Wed Jan 14 13:01:03 2009 From: echeng at apple.com (Evan Cheng) Date: Wed, 14 Jan 2009 11:01:03 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200901141246.56489.baldrick@free.fr> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901131252.49945.baldrick@free.fr> <200901141246.56489.baldrick@free.fr> Message-ID: <0F92559C-EC5B-48AF-97D3-AFA8CBB0E795@apple.com> On Jan 14, 2009, at 3:46 AM, Duncan Sands wrote: > Hi Evan, > >> This gets translated into low level pointer arithmetics, right? Later >> on llvm-convert casts it to i8*: >> >> ArrayAddr = BitCastToType(ArrayAddr, >> PointerType::getUnqual(Type::Int8Ty)); >> >> Is there a reason why we can't just give it the alignment of i8? > > I just had some coffee and woke up. It is of course always safe to > give an alignment of 1. Right. I am saying for array_ref that is turned into pointer arithmetics + load / store i8, just return lvalue with alignment 1. It is always correct. The down size I see if theoretically this could prevent some optimization that combine multiple loads / stores into a larger one. I think we can eliminate most of these potential cases by calling getPointerAlignment() when the type is POINTER_TYPE. The main issue is I'd like to fix the bug where we emit memory instructions with artificially high alignment. But I am willing to invest a significant effort to change Emit. I'll cook up with another patch with those x86-64 linux (which obviously hates me) failures fixed. Evan > > > Ciao, > > Duncan. From criswell at cs.uiuc.edu Wed Jan 14 13:10:49 2009 From: criswell at cs.uiuc.edu (John Criswell) Date: Wed, 14 Jan 2009 13:10:49 -0600 Subject: [llvm-commits] [llvm] r62199 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/MachineModuleInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp In-Reply-To: <200901132354.n0DNsuWr016259@zion.cs.uiuc.edu> References: <200901132354.n0DNsuWr016259@zion.cs.uiuc.edu> Message-ID: <496E38B9.8060002@cs.uiuc.edu> Dear Devang, Have these classes been moved or replaced? If replaced, what has replaced them? I have some code from Edwin Torok that I'm using which currently relies upon these Debug Info classes. -- John T. Devang Patel wrote: > Author: dpatel > Date: Tue Jan 13 17:54:55 2009 > New Revision: 62199 > > URL: http://llvm.org/viewvc/llvm-project?rev=62199&view=rev > Log: > Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info. > > Modified: > llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h > llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > > Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=62199&r1=62198&r2=62199&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original) > +++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Tue Jan 13 17:54:55 2009 > @@ -47,7 +47,6 @@ > //===----------------------------------------------------------------------===// > // Forward declarations. > class Constant; > -class DebugInfoDesc; > class GlobalVariable; > class MachineBasicBlock; > class MachineFunction; > @@ -67,787 +66,6 @@ > }; > > //===----------------------------------------------------------------------===// > -/// DIVisitor - Subclasses of this class apply steps to each of the fields in > -/// the supplied DebugInfoDesc. > -class DIVisitor { > -public: > - DIVisitor() {} > - virtual ~DIVisitor() {} > - > - /// ApplyToFields - Target the visitor to each field of the debug information > - /// descriptor. > - void ApplyToFields(DebugInfoDesc *DD); > - > - /// Apply - Subclasses override each of these methods to perform the > - /// appropriate action for the type of field. > - virtual void Apply(int &Field) = 0; > - virtual void Apply(unsigned &Field) = 0; > - virtual void Apply(int64_t &Field) = 0; > - virtual void Apply(uint64_t &Field) = 0; > - virtual void Apply(bool &Field) = 0; > - virtual void Apply(std::string &Field) = 0; > - virtual void Apply(DebugInfoDesc *&Field) = 0; > - virtual void Apply(GlobalVariable *&Field) = 0; > - virtual void Apply(std::vector &Field) = 0; > -}; > - > -//===----------------------------------------------------------------------===// > -/// DebugInfoDesc - This class is the base class for debug info descriptors. > -/// > -class DebugInfoDesc { > -private: > - unsigned Tag; // Content indicator. Dwarf values are > - // used but that does not limit use to > - // Dwarf writers. > - > -protected: > - explicit DebugInfoDesc(unsigned T) : Tag(T | LLVMDebugVersion) {} > - > -public: > - virtual ~DebugInfoDesc() {} > - > - // Accessors > - 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. > - static unsigned TagFromGlobal(GlobalVariable *GV); > - > - /// VersionFromGlobal - Returns the version number from a debug info > - /// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned > - /// int. > - static unsigned VersionFromGlobal(GlobalVariable *GV); > - > - /// DescFactory - Create an instance of debug info descriptor based on Tag. > - /// Return NULL if not a recognized Tag. > - static DebugInfoDesc *DescFactory(unsigned Tag); > - > - /// getLinkage - get linkage appropriate for this type of descriptor. > - /// > - virtual GlobalValue::LinkageTypes getLinkage() const; > - > - //===--------------------------------------------------------------------===// > - // Subclasses should supply the following static methods. > - > - // Implement isa/cast/dyncast. > - static bool classof(const DebugInfoDesc *) { return true; } > - > - //===--------------------------------------------------------------------===// > - // Subclasses should supply the following virtual methods. > - > - /// ApplyToFields - Target the vistor to the fields of the descriptor. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const = 0; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const = 0; > - > -#ifndef NDEBUG > - virtual void dump() = 0; > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// AnchorDesc - Descriptors of this class act as markers for identifying > -/// descriptors of certain groups. > -class AnchoredDesc; > -class AnchorDesc : public DebugInfoDesc { > -private: > - unsigned AnchorTag; // Tag number of descriptors anchored > - // by this object. > - > -public: > - AnchorDesc(); > - explicit AnchorDesc(AnchoredDesc *D); > - > - // Accessors > - unsigned getAnchorTag() const { return AnchorTag; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const AnchorDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// getLinkage - get linkage appropriate for this type of descriptor. > - /// > - virtual GlobalValue::LinkageTypes getLinkage() const; > - > - /// ApplyToFields - Target the visitor to the fields of the AnchorDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// AnchoredDesc - This class manages anchors for a variety of top level > -/// descriptors. > -class AnchoredDesc : public DebugInfoDesc { > -private: > - DebugInfoDesc *Anchor; // Anchor for all descriptors of the > - // same type. > - > -protected: > - > - explicit AnchoredDesc(unsigned T); > - > -public: > - // Accessors. > - AnchorDesc *getAnchor() const { return static_cast(Anchor); } > - void setAnchor(AnchorDesc *A) { Anchor = static_cast(A); } > - > - //===--------------------------------------------------------------------===// > - // Subclasses should supply the following virtual methods. > - > - /// getAnchorString - Return a string used to label descriptor's anchor. > - /// > - virtual const char *getAnchorString() const = 0; > - > - /// ApplyToFields - Target the visitor to the fields of the AnchoredDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > -}; > - > -//===----------------------------------------------------------------------===// > -/// CompileUnitDesc - This class packages debug information associated with a > -/// source/header file. > -class CompileUnitDesc : public AnchoredDesc { > -private: > - unsigned Language; // Language number (ex. DW_LANG_C89.) > - std::string FileName; // Source file name. > - std::string Directory; // Source file directory. > - std::string Producer; // Compiler string. > - > -public: > - CompileUnitDesc(); > - > - > - // Accessors > - unsigned getLanguage() const { return Language; } > - const std::string &getFileName() const { return FileName; } > - const std::string &getDirectory() const { return Directory; } > - const std::string &getProducer() const { return Producer; } > - void setLanguage(unsigned L) { Language = L; } > - void setFileName(const std::string &FN) { FileName = FN; } > - void setDirectory(const std::string &D) { Directory = D; } > - void setProducer(const std::string &P) { Producer = P; } > - > - // FIXME - Need translation unit getter/setter. > - > - // Implement isa/cast/dyncast. > - static bool classof(const CompileUnitDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > - /// getAnchorString - Return a string used to label this descriptor's anchor. > - /// > - static const char *const AnchorString; > - virtual const char *getAnchorString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// TypeDesc - This class packages debug information associated with a type. > -/// > -class TypeDesc : public DebugInfoDesc { > -private: > - enum { > - FlagPrivate = 1 << 0, > - FlagProtected = 1 << 1, > - FlagFwdDecl = 1 << 2 > - }; > - DebugInfoDesc *Context; // Context debug descriptor. > - std::string Name; // Type name (may be empty.) > - 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.) > - uint64_t Offset; // Type bit offset (may be zero.) > - > -protected: > - unsigned Flags; // Miscellaneous flags. > - > -public: > - explicit TypeDesc(unsigned T); > - > - // Accessors > - DebugInfoDesc *getContext() const { return Context; } > - const std::string &getName() const { return Name; } > - 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; } > - bool isPrivate() const { > - return (Flags & FlagPrivate) != 0; > - } > - bool isProtected() const { > - return (Flags & FlagProtected) != 0; > - } > - bool isForwardDecl() const { > - return (Flags & FlagFwdDecl) != 0; > - } > - void setContext(DebugInfoDesc *C) { Context = C; } > - void setName(const std::string &N) { Name = N; } > - 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; } > - void setOffset(uint64_t O) { Offset = O; } > - void setIsPrivate() { Flags |= FlagPrivate; } > - void setIsProtected() { Flags |= FlagProtected; } > - void setIsForwardDecl() { Flags |= FlagFwdDecl; } > - > - /// ApplyToFields - Target the visitor to the fields of the TypeDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// BasicTypeDesc - This class packages debug information associated with a > -/// basic type (eg. int, bool, double.) > -class BasicTypeDesc : public TypeDesc { > -private: > - unsigned Encoding; // Type encoding. > - > -public: > - BasicTypeDesc(); > - > - // Accessors > - unsigned getEncoding() const { return Encoding; } > - void setEncoding(unsigned E) { Encoding = E; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const BasicTypeDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > - > -//===----------------------------------------------------------------------===// > -/// DerivedTypeDesc - This class packages debug information associated with a > -/// derived types (eg., typedef, pointer, reference.) > -class DerivedTypeDesc : public TypeDesc { > -private: > - DebugInfoDesc *FromType; // Type derived from. > - > -public: > - explicit DerivedTypeDesc(unsigned T); > - > - // Accessors > - TypeDesc *getFromType() const { > - return static_cast(FromType); > - } > - void setFromType(TypeDesc *F) { > - FromType = static_cast(F); > - } > - > - // Implement isa/cast/dyncast. > - static bool classof(const DerivedTypeDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// CompositeTypeDesc - This class packages debug information associated with a > -/// array/struct types (eg., arrays, struct, union, enums.) > -class CompositeTypeDesc : public DerivedTypeDesc { > -private: > - std::vector Elements;// Information used to compose type. > - > -public: > - explicit CompositeTypeDesc(unsigned T); > - > - // Accessors > - std::vector &getElements() { return Elements; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const CompositeTypeDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// SubrangeDesc - This class packages debug information associated with integer > -/// value ranges. > -class SubrangeDesc : public DebugInfoDesc { > -private: > - int64_t Lo; // Low value of range. > - int64_t Hi; // High value of range. > - > -public: > - SubrangeDesc(); > - > - // Accessors > - int64_t getLo() const { return Lo; } > - int64_t getHi() const { return Hi; } > - void setLo(int64_t L) { Lo = L; } > - void setHi(int64_t H) { Hi = H; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const SubrangeDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the SubrangeDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// EnumeratorDesc - This class packages debug information associated with > -/// named integer constants. > -class EnumeratorDesc : public DebugInfoDesc { > -private: > - std::string Name; // Enumerator name. > - int64_t Value; // Enumerator value. > - > -public: > - EnumeratorDesc(); > - > - // Accessors > - const std::string &getName() const { return Name; } > - int64_t getValue() const { return Value; } > - void setName(const std::string &N) { Name = N; } > - void setValue(int64_t V) { Value = V; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const EnumeratorDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// VariableDesc - This class packages debug information associated with a > -/// subprogram variable. > -/// > -class VariableDesc : public DebugInfoDesc { > -private: > - DebugInfoDesc *Context; // Context debug descriptor. > - std::string Name; // Type name (may be empty.) > - DebugInfoDesc *File; // Defined compile unit (may be NULL.) > - unsigned Line; // Defined line# (may be zero.) > - DebugInfoDesc *TyDesc; // Type of variable. > - > -public: > - explicit VariableDesc(unsigned T); > - > - // Accessors > - DebugInfoDesc *getContext() const { return Context; } > - const std::string &getName() const { return Name; } > - CompileUnitDesc *getFile() const { > - return static_cast(File); > - } > - unsigned getLine() const { return Line; } > - TypeDesc *getType() const { > - return static_cast(TyDesc); > - } > - void setContext(DebugInfoDesc *C) { Context = C; } > - void setName(const std::string &N) { Name = N; } > - void setFile(CompileUnitDesc *U) { > - File = static_cast(U); > - } > - void setLine(unsigned L) { Line = L; } > - void setType(TypeDesc *T) { > - TyDesc = static_cast(T); > - } > - > - // Implement isa/cast/dyncast. > - static bool classof(const VariableDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the VariableDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// GlobalDesc - This class is the base descriptor for global functions and > -/// variables. > -class GlobalDesc : public AnchoredDesc { > -private: > - DebugInfoDesc *Context; // Context debug descriptor. > - std::string Name; // Global name. > - std::string FullName; // Fully qualified name. > - std::string LinkageName; // Name for binding to MIPS linkage. > - DebugInfoDesc *File; // Defined compile unit (may be NULL.) > - unsigned Line; // Defined line# (may be zero.) > - DebugInfoDesc *TyDesc; // Type debug descriptor. > - bool IsStatic; // Is the global a static. > - bool IsDefinition; // Is the global defined in context. > - > -protected: > - explicit GlobalDesc(unsigned T); > - > -public: > - // Accessors > - DebugInfoDesc *getContext() const { return Context; } > - const std::string &getName() const { return Name; } > - const std::string &getFullName() const { return FullName; } > - const std::string &getLinkageName() const { return LinkageName; } > - CompileUnitDesc *getFile() const { > - return static_cast(File); > - } > - unsigned getLine() const { return Line; } > - TypeDesc *getType() const { > - return static_cast(TyDesc); > - } > - bool isStatic() const { return IsStatic; } > - bool isDefinition() const { return IsDefinition; } > - void setContext(DebugInfoDesc *C) { Context = C; } > - void setName(const std::string &N) { Name = N; } > - void setFullName(const std::string &N) { FullName = N; } > - void setLinkageName(const std::string &N) { LinkageName = N; } > - void setFile(CompileUnitDesc *U) { > - File = static_cast(U); > - } > - void setLine(unsigned L) { Line = L; } > - void setType(TypeDesc *T) { > - TyDesc = static_cast(T); > - } > - void setIsStatic(bool IS) { IsStatic = IS; } > - void setIsDefinition(bool ID) { IsDefinition = ID; } > - > - /// ApplyToFields - Target the visitor to the fields of the GlobalDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > -}; > - > -//===----------------------------------------------------------------------===// > -/// GlobalVariableDesc - This class packages debug information associated with a > -/// GlobalVariable. > -class GlobalVariableDesc : public GlobalDesc { > -private: > - GlobalVariable *Global; // llvm global. > - > -public: > - GlobalVariableDesc(); > - > - // Accessors. > - GlobalVariable *getGlobalVariable() const { return Global; } > - void setGlobalVariable(GlobalVariable *GV) { Global = GV; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const GlobalVariableDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the > - /// GlobalVariableDesc. > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > - /// getAnchorString - Return a string used to label this descriptor's anchor. > - /// > - static const char *const AnchorString; > - virtual const char *getAnchorString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// SubprogramDesc - This class packages debug information associated with a > -/// subprogram/function. > -class SubprogramDesc : public GlobalDesc { > -private: > - > -public: > - SubprogramDesc(); > - > - // Accessors > - > - // Implement isa/cast/dyncast. > - static bool classof(const SubprogramDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the SubprogramDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > - /// getAnchorString - Return a string used to label this descriptor's anchor. > - /// > - static const char *const AnchorString; > - virtual const char *getAnchorString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// BlockDesc - This descriptor groups variables and blocks nested in a block. > -/// > -class BlockDesc : public DebugInfoDesc { > -private: > - DebugInfoDesc *Context; // Context debug descriptor. > - > -public: > - BlockDesc(); > - > - // Accessors > - DebugInfoDesc *getContext() const { return Context; } > - void setContext(DebugInfoDesc *C) { Context = C; } > - > - // Implement isa/cast/dyncast. > - static bool classof(const BlockDesc *) { return true; } > - static bool classof(const DebugInfoDesc *D); > - > - /// ApplyToFields - Target the visitor to the fields of the BlockDesc. > - /// > - virtual void ApplyToFields(DIVisitor *Visitor); > - > - /// getDescString - Return a string used to compose global names and labels. > - /// > - virtual const char *getDescString() const; > - > - /// getTypeString - Return a string used to label this descriptor's type. > - /// > - virtual const char *getTypeString() const; > - > -#ifndef NDEBUG > - virtual void dump(); > -#endif > -}; > - > -//===----------------------------------------------------------------------===// > -/// DIDeserializer - This class is responsible for casting GlobalVariables > -/// into DebugInfoDesc objects. > -class DIDeserializer { > - // Previously defined gloabls. > - std::map GlobalDescs; > -public: > - const std::map &getGlobalDescs() const { > - return GlobalDescs; > - } > - > - /// Deserialize - Reconstitute a GlobalVariable into it's component > - /// DebugInfoDesc objects. > - DebugInfoDesc *Deserialize(Value *V); > - DebugInfoDesc *Deserialize(GlobalVariable *GV); > -}; > - > -//===----------------------------------------------------------------------===// > -/// DISerializer - This class is responsible for casting DebugInfoDesc objects > -/// into GlobalVariables. > -class DISerializer { > - Module *M; // Definition space module. > - PointerType *StrPtrTy; // A "i8*" type. Created lazily. > - PointerType *EmptyStructPtrTy; // A "{ }*" type. Created lazily. > - > - // Types per Tag. Created lazily. > - std::map TagTypes; > - > - // Previously defined descriptors. > - DenseMap DescGlobals; > - > - // Previously defined strings. > - StringMap StringCache; > -public: > - DISerializer() > - : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(), > - DescGlobals(), StringCache() > - {} > - > - // Accessors > - Module *getModule() const { return M; }; > - void setModule(Module *module) { M = module; } > - > - /// getStrPtrType - Return a "i8*" type. > - /// > - const PointerType *getStrPtrType(); > - > - /// getEmptyStructPtrType - Return a "{ }*" type. > - /// > - const PointerType *getEmptyStructPtrType(); > - > - /// getTagType - Return the type describing the specified descriptor (via > - /// tag.) > - const StructType *getTagType(DebugInfoDesc *DD); > - > - /// getString - Construct the string as constant string global. > - /// > - Constant *getString(const std::string &String); > - > - /// Serialize - Recursively cast the specified descriptor into a > - /// GlobalVariable so that it can be serialized to a .bc or .ll file. > - GlobalVariable *Serialize(DebugInfoDesc *DD); > - > - /// addDescriptor - Directly connect DD with existing GV. > - void addDescriptor(DebugInfoDesc *DD, GlobalVariable *GV); > -}; > - > -//===----------------------------------------------------------------------===// > -/// DIVerifier - This class is responsible for verifying the given network of > -/// GlobalVariables are valid as DebugInfoDesc objects. > -class DIVerifier { > - enum { > - Unknown = 0, > - Invalid, > - Valid > - }; > - DenseMap Validity; // Tracks prior results. > - std::map Counts; // Count of fields per Tag type. > -public: > - DIVerifier() > - : Validity(), Counts() > - {} > - > - /// Verify - Return true if the GlobalVariable appears to be a valid > - /// serialization of a DebugInfoDesc. > - bool Verify(Value *V); > - bool Verify(GlobalVariable *GV); > - > - /// isVerified - Return true if the specified GV has already been > - /// verified as a debug information descriptor. > - bool isVerified(GlobalVariable *GV); > -}; > - > -//===----------------------------------------------------------------------===// > /// SourceLineInfo - This class is used to record source line correspondence. > /// > class SourceLineInfo { > @@ -867,95 +85,6 @@ > }; > > //===----------------------------------------------------------------------===// > -/// SourceFileInfo - This class is used to track source information. > -/// > -class SourceFileInfo { > - unsigned DirectoryID; // Directory ID number. > - std::string Name; // File name (not including directory.) > -public: > - SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {} > - > - // Accessors > - unsigned getDirectoryID() const { return DirectoryID; } > - const std::string &getName() const { return Name; } > - > - /// operator== - Used by UniqueVector to locate entry. > - /// > - bool operator==(const SourceFileInfo &SI) const { > - return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName(); > - } > - > - /// operator< - Used by UniqueVector to locate entry. > - /// > - bool operator<(const SourceFileInfo &SI) const { > - return getDirectoryID() < SI.getDirectoryID() || > - (getDirectoryID() == SI.getDirectoryID() && getName() < SI.getName()); > - } > -}; > - > -//===----------------------------------------------------------------------===// > -/// DebugVariable - This class is used to track local variable information. > -/// > -class DebugVariable { > -private: > - VariableDesc *Desc; // Variable Descriptor. > - unsigned FrameIndex; // Variable frame index. > - > -public: > - DebugVariable(VariableDesc *D, unsigned I) > - : Desc(D) > - , FrameIndex(I) > - {} > - > - // Accessors. > - VariableDesc *getDesc() const { return Desc; } > - unsigned getFrameIndex() const { return FrameIndex; } > -}; > - > -//===----------------------------------------------------------------------===// > -/// DebugScope - This class is used to track scope information. > -/// > -class DebugScope { > -private: > - DebugScope *Parent; // Parent to this scope. > - DebugInfoDesc *Desc; // Debug info descriptor for scope. > - // Either subprogram or block. > - unsigned StartLabelID; // Label ID of the beginning of scope. > - unsigned EndLabelID; // Label ID of the end of scope. > - std::vector Scopes; // Scopes defined in scope. > - std::vector Variables;// Variables declared in scope. > - > -public: > - DebugScope(DebugScope *P, DebugInfoDesc *D) > - : Parent(P) > - , Desc(D) > - , StartLabelID(0) > - , EndLabelID(0) > - , Scopes() > - , Variables() > - {} > - ~DebugScope(); > - > - // Accessors. > - DebugScope *getParent() const { return Parent; } > - DebugInfoDesc *getDesc() const { return Desc; } > - unsigned getStartLabelID() const { return StartLabelID; } > - unsigned getEndLabelID() const { return EndLabelID; } > - std::vector &getScopes() { return Scopes; } > - std::vector &getVariables() { return Variables; } > - void setStartLabelID(unsigned S) { StartLabelID = S; } > - void setEndLabelID(unsigned E) { EndLabelID = E; } > - > - /// AddScope - Add a scope to the scope. > - /// > - void AddScope(DebugScope *S) { Scopes.push_back(S); } > - > - /// AddVariable - Add a variable to the scope. > - /// > - void AddVariable(DebugVariable *V) { Variables.push_back(V); } > -}; > - > -//===----------------------------------------------------------------------===// > /// LandingPadInfo - This structure is used to retain landing pad info for > /// the current function. > /// > @@ -981,19 +110,6 @@ > /// > class MachineModuleInfo : public ImmutablePass { > private: > - // Use the same deserializer/verifier for the module. > - DIDeserializer DR; > - DIVerifier VR; > - > - // CompileUnits - Uniquing vector for compile units. > - UniqueVector CompileUnits; > - > - // Directories - Uniquing vector for directories. > - UniqueVector Directories; > - > - // SourceFiles - Uniquing vector for source files. > - UniqueVector SourceFiles; > - > // Lines - List of of source line correspondence. > std::vector Lines; > > @@ -1003,13 +119,6 @@ > // another label. > std::vector LabelIDList; > > - // ScopeMap - Tracks the scopes in the current function. > - std::map ScopeMap; > - > - // RootScope - Top level scope for the current function. > - // > - DebugScope *RootScope; > - > // FrameMoves - List of moves done by a function's prolog. Used to construct > // frame maps by debug and exception handling consumers. > std::vector FrameMoves; > @@ -1067,19 +176,6 @@ > /// > void EndFunction(); > > - /// getDescFor - Convert a Value to a debug information descriptor. > - /// > - // FIXME - use new Value type when available. > - DebugInfoDesc *getDescFor(Value *V); > - > - /// Verify - Verify that a Value is debug information descriptor. > - /// > - bool Verify(Value *V) { return VR.Verify(V); } > - > - /// isVerified - Return true if the specified GV has already been > - /// verified as a debug information descriptor. > - bool isVerified(GlobalVariable *GV) { return VR.isVerified(GV); } > - > /// AnalyzeModule - Scan the module for global debug information. > /// > void AnalyzeModule(Module &M); > @@ -1132,82 +228,12 @@ > return LabelID ? LabelIDList[LabelID - 1] : 0; > } > > - /// RecordSource - Register a source file with debug info. Returns an source > - /// ID. > - unsigned RecordSource(const std::string &Directory, > - const std::string &Source); > - unsigned RecordSource(const CompileUnitDesc *CompileUnit); > - > - /// getDirectories - Return the UniqueVector of std::string representing > - /// directories. > - const UniqueVector &getDirectories() const { > - return Directories; > - } > - > - /// getSourceFiles - Return the UniqueVector of source files. > - /// > - const UniqueVector &getSourceFiles() const { > - return SourceFiles; > - } > - > /// getSourceLines - Return a vector of source lines. > /// > const std::vector &getSourceLines() const { > return Lines; > } > > - /// SetupCompileUnits - Set up the unique vector of compile units. > - /// > - void SetupCompileUnits(Module &M); > - > - /// getCompileUnits - Return a vector of debug compile units. > - /// > - const UniqueVector getCompileUnits() const; > - > - /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the > - /// named GlobalVariable. > - void getGlobalVariablesUsing(Module &M, const std::string &RootName, > - std::vector &Result); > - > - /// getAnchoredDescriptors - Return a vector of anchored debug descriptors. > - /// > - template > - void getAnchoredDescriptors(Module &M, std::vector &AnchoredDescs) { > - T Desc; > - std::vector Globals; > - getGlobalVariablesUsing(M, Desc.getAnchorString(), Globals); > - > - for (unsigned i = 0, N = Globals.size(); i < N; ++i) { > - GlobalVariable *GV = Globals[i]; > - > - // FIXME - In the short term, changes are too drastic to continue. > - if (DebugInfoDesc::TagFromGlobal(GV) == Desc.getTag() && > - DebugInfoDesc::VersionFromGlobal(GV) == LLVMDebugVersion) { > - AnchoredDescs.push_back(cast(DR.Deserialize(GV))); > - } > - } > - } > - > - /// RecordRegionStart - Indicate the start of a region. > - /// > - unsigned RecordRegionStart(Value *V); > - > - /// RecordRegionEnd - Indicate the end of a region. > - /// > - unsigned RecordRegionEnd(Value *V); > - > - /// RecordVariable - Indicate the declaration of a local variable. > - /// > - void RecordVariable(GlobalValue *GV, unsigned FrameIndex); > - > - /// getRootScope - Return current functions root scope. > - /// > - DebugScope *getRootScope() { return RootScope; } > - > - /// getOrCreateScope - Returns the scope associated with the given descriptor. > - /// > - DebugScope *getOrCreateScope(DebugInfoDesc *ScopeDesc); > - > /// getFrameMoves - Returns a reference to a list of moves done in the current > /// function's prologue. Used to construct frame maps for debug and exception > /// handling comsumers. > @@ -1294,7 +320,6 @@ > /// of one is required to emit exception handling info. > Function *getPersonality() const; > > - DIDeserializer *getDIDeserializer() { return &DR; } > }; // End class MachineModuleInfo > > } // End llvm namespace > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62199&r1=62198&r2=62199&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Tue Jan 13 17:54:55 2009 > @@ -749,10 +749,6 @@ > /// with a source file. > class CompileUnit { > private: > - /// Desc - Compile unit debug descriptor. > - /// > - CompileUnitDesc *Desc; > - > /// ID - File identifier for source. > /// > unsigned ID; > @@ -761,14 +757,12 @@ > /// > DIE *Die; > > - /// DescToDieMap - Tracks the mapping of unit level debug informaton > - /// descriptors to debug information entries. > - std::map DescToDieMap; > + /// GVToDieMap - Tracks the mapping of unit level debug informaton > + /// variables to debug information entries. > DenseMap GVToDieMap; > > - /// DescToDIEntryMap - Tracks the mapping of unit level debug informaton > + /// GVToDIEntryMap - Tracks the mapping of unit level debug informaton > /// descriptors to debug information entries using a DIEntry proxy. > - std::map DescToDIEntryMap; > DenseMap GVToDIEntryMap; > > /// Globals - A map of globally visible named entities for this unit. > @@ -785,23 +779,10 @@ > > public: > CompileUnit(unsigned I, DIE *D) > - : ID(I), Die(D), DescToDieMap(), GVToDieMap(), DescToDIEntryMap(), > + : ID(I), Die(D), GVToDieMap(), > GVToDIEntryMap(), Globals(), DiesSet(InitDiesSetSize), Dies() > {} > > - CompileUnit(CompileUnitDesc *CUD, unsigned I, DIE *D) > - : Desc(CUD) > - , ID(I) > - , Die(D) > - , DescToDieMap() > - , GVToDieMap() > - , DescToDIEntryMap() > - , GVToDIEntryMap() > - , Globals() > - , DiesSet(InitDiesSetSize) > - , Dies() > - {} > - > ~CompileUnit() { > delete Die; > > @@ -810,7 +791,6 @@ > } > > // Accessors. > - CompileUnitDesc *getDesc() const { return Desc; } > unsigned getID() const { return ID; } > DIE* getDie() const { return Die; } > std::map &getGlobals() { return Globals; } > @@ -828,19 +808,13 @@ > } > > /// getDieMapSlotFor - Returns the debug information entry map slot for the > - /// specified debug descriptor. > - DIE *&getDieMapSlotFor(DebugInfoDesc *DID) { > - return DescToDieMap[DID]; > - } > + /// specified debug variable. > DIE *&getDieMapSlotFor(GlobalVariable *GV) { > return GVToDieMap[GV]; > } > > /// getDIEntrySlotFor - Returns the debug information entry proxy slot for the > - /// specified debug descriptor. > - DIEntry *&getDIEntrySlotFor(DebugInfoDesc *DID) { > - return DescToDIEntryMap[DID]; > - } > + /// specified debug variable. > DIEntry *&getDIEntrySlotFor(GlobalVariable *GV) { > return GVToDIEntryMap[GV]; > } > @@ -1204,7 +1178,7 @@ > > /// operator== - Used by UniqueVector to locate entry. > /// > - bool operator==(const SourceFileInfo &SI) const { > + bool operator==(const SrcFileInfo &SI) const { > return getDirectoryID() == SI.getDirectoryID() && getName() == SI.getName(); > } > > @@ -1317,10 +1291,6 @@ > /// > UniqueVector StringPool; > > - /// UnitMap - Map debug information descriptor to compile unit. > - /// > - std::map DescToUnitMap; > - > /// SectionMap - Provides a unique id per text section. > /// > UniqueVector SectionMap; > @@ -1574,17 +1544,6 @@ > > /// AddSourceLine - Add location information to specified debug information > /// entry. > - void AddSourceLine(DIE *Die, CompileUnitDesc *File, unsigned Line) { > - if (File && Line) { > - CompileUnit *FileUnit = FindCompileUnit(File); > - unsigned FileID = FileUnit->getID(); > - AddUInt(Die, DW_AT_decl_file, 0, FileID); > - AddUInt(Die, DW_AT_decl_line, 0, Line); > - } > - } > - > - /// AddSourceLine - Add location information to specified debug information > - /// entry. > void AddSourceLine(DIE *Die, DIVariable *V) { > unsigned FileID = 0; > unsigned Line = V->getLineNumber(); > @@ -1690,46 +1649,6 @@ > } > > /// AddType - Add a new type attribute to the specified entity. > - /// > - void AddType(DIE *Entity, TypeDesc *TyDesc, CompileUnit *Unit) { > - if (!TyDesc) { > - AddBasicType(Entity, Unit, "", DW_ATE_signed, sizeof(int32_t)); > - } else { > - // Check for pre-existence. > - DIEntry *&Slot = Unit->getDIEntrySlotFor(TyDesc); > - > - // If it exists then use the existing value. > - if (Slot) { > - Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot); > - return; > - } > - > - if (SubprogramDesc *SubprogramTy = dyn_cast(TyDesc)) { > - // FIXME - Not sure why programs and variables are coming through here. > - // Short cut for handling subprogram types (not really a TyDesc.) > - AddPointerType(Entity, Unit, SubprogramTy->getName()); > - } else if (GlobalVariableDesc *GlobalTy = > - dyn_cast(TyDesc)) { > - // FIXME - Not sure why programs and variables are coming through here. > - // Short cut for handling global variable types (not really a TyDesc.) > - AddPointerType(Entity, Unit, GlobalTy->getName()); > - } else { > - // Set up proxy. > - Slot = NewDIEntry(); > - > - // Construct type. > - DIE Buffer(DW_TAG_base_type); > - ConstructType(Buffer, TyDesc, Unit); > - > - // Add debug information entry to entity and unit. > - DIE *Die = Unit->AddDie(Buffer); > - SetDIEntry(Slot, Die); > - Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot); > - } > - } > - } > - > - /// AddType - Add a new type attribute to the specified entity. > void AddType(CompileUnit *DW_Unit, DIE *Entity, DIType Ty) { > if (Ty.isNull()) { > AddBasicType(Entity, DW_Unit, "", DW_ATE_signed, sizeof(int32_t)); > @@ -2040,332 +1959,6 @@ > Buffer.AddChild(MemberDie); > } > > - /// ConstructType - Adds all the required attributes to the type. > - /// > - void ConstructType(DIE &Buffer, TypeDesc *TyDesc, CompileUnit *Unit) { > - // Get core information. > - const std::string &Name = TyDesc->getName(); > - uint64_t Size = TyDesc->getSize() >> 3; > - > - if (BasicTypeDesc *BasicTy = dyn_cast(TyDesc)) { > - // Fundamental types like int, float, bool > - Buffer.setTag(DW_TAG_base_type); > - AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BasicTy->getEncoding()); > - } else if (DerivedTypeDesc *DerivedTy = dyn_cast(TyDesc)) { > - // Fetch tag. > - unsigned Tag = DerivedTy->getTag(); > - // FIXME - Workaround for templates. > - if (Tag == DW_TAG_inheritance) Tag = DW_TAG_reference_type; > - // Pointers, typedefs et al. > - Buffer.setTag(Tag); > - // Map to main type, void will not have a type. > - if (TypeDesc *FromTy = DerivedTy->getFromType()) > - AddType(&Buffer, FromTy, Unit); > - } else if (CompositeTypeDesc *CompTy = dyn_cast(TyDesc)){ > - // Fetch tag. > - unsigned Tag = CompTy->getTag(); > - > - // Set tag accordingly. > - if (Tag == DW_TAG_vector_type) > - Buffer.setTag(DW_TAG_array_type); > - else > - Buffer.setTag(Tag); > - > - std::vector &Elements = CompTy->getElements(); > - > - switch (Tag) { > - case DW_TAG_vector_type: > - AddUInt(&Buffer, DW_AT_GNU_vector, DW_FORM_flag, 1); > - // Fall thru > - case DW_TAG_array_type: { > - // Add element type. > - if (TypeDesc *FromTy = CompTy->getFromType()) > - AddType(&Buffer, FromTy, Unit); > - > - // Don't emit size attribute. > - Size = 0; > - > - // Construct an anonymous type for index type. > - DIE Buffer(DW_TAG_base_type); > - AddUInt(&Buffer, DW_AT_byte_size, 0, sizeof(int32_t)); > - AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, DW_ATE_signed); > - DIE *IndexTy = Unit->AddDie(Buffer); > - > - // Add subranges to array type. > - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { > - SubrangeDesc *SRD = cast(Elements[i]); > - int64_t Lo = SRD->getLo(); > - int64_t Hi = SRD->getHi(); > - DIE *Subrange = new DIE(DW_TAG_subrange_type); > - > - // If a range is available. > - if (Lo != Hi) { > - AddDIEntry(Subrange, DW_AT_type, DW_FORM_ref4, IndexTy); > - // Only add low if non-zero. > - if (Lo) AddSInt(Subrange, DW_AT_lower_bound, 0, Lo); > - AddSInt(Subrange, DW_AT_upper_bound, 0, Hi); > - } > - > - Buffer.AddChild(Subrange); > - } > - break; > - } > - case DW_TAG_structure_type: > - case DW_TAG_union_type: { > - // Add elements to structure type. > - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { > - DebugInfoDesc *Element = Elements[i]; > - > - if (DerivedTypeDesc *MemberDesc = dyn_cast(Element)){ > - // Add field or base class. > - unsigned Tag = MemberDesc->getTag(); > - > - // Extract the basic information. > - const std::string &Name = MemberDesc->getName(); > - uint64_t Size = MemberDesc->getSize(); > - uint64_t Align = MemberDesc->getAlign(); > - uint64_t Offset = MemberDesc->getOffset(); > - > - // Construct member debug information entry. > - DIE *Member = new DIE(Tag); > - > - // Add name if not "". > - if (!Name.empty()) > - AddString(Member, DW_AT_name, DW_FORM_string, Name); > - > - // Add location if available. > - AddSourceLine(Member, MemberDesc->getFile(), MemberDesc->getLine()); > - > - // Most of the time the field info is the same as the members. > - uint64_t FieldSize = Size; > - uint64_t FieldAlign = Align; > - uint64_t FieldOffset = Offset; > - > - // Set the member type. > - TypeDesc *FromTy = MemberDesc->getFromType(); > - AddType(Member, FromTy, Unit); > - > - // Walk up typedefs until a real size is found. > - while (FromTy) { > - if (FromTy->getTag() != DW_TAG_typedef) { > - FieldSize = FromTy->getSize(); > - FieldAlign = FromTy->getAlign(); > - break; > - } > - > - FromTy = cast(FromTy)->getFromType(); > - } > - > - // Unless we have a bit field. > - if (Tag == DW_TAG_member && FieldSize != Size) { > - // Construct the alignment mask. > - uint64_t AlignMask = ~(FieldAlign - 1); > - // Determine the high bit + 1 of the declared size. > - uint64_t HiMark = (Offset + FieldSize) & AlignMask; > - // Work backwards to determine the base offset of the field. > - FieldOffset = HiMark - FieldSize; > - // Now normalize offset to the field. > - Offset -= FieldOffset; > - > - // Maybe we need to work from the other end. > - if (TD->isLittleEndian()) Offset = FieldSize - (Offset + Size); > - > - // Add size and offset. > - AddUInt(Member, DW_AT_byte_size, 0, FieldSize >> 3); > - AddUInt(Member, DW_AT_bit_size, 0, Size); > - AddUInt(Member, DW_AT_bit_offset, 0, Offset); > - } > - > - // Add computation for offset. > - DIEBlock *Block = new DIEBlock(); > - AddUInt(Block, 0, DW_FORM_data1, DW_OP_plus_uconst); > - AddUInt(Block, 0, DW_FORM_udata, FieldOffset >> 3); > - AddBlock(Member, DW_AT_data_member_location, 0, Block); > - > - // Add accessibility (public default unless is base class. > - if (MemberDesc->isProtected()) { > - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_protected); > - } else if (MemberDesc->isPrivate()) { > - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_private); > - } else if (Tag == DW_TAG_inheritance) { > - AddUInt(Member, DW_AT_accessibility, 0, DW_ACCESS_public); > - } > - > - Buffer.AddChild(Member); > - } else if (GlobalVariableDesc *StaticDesc = > - dyn_cast(Element)) { > - // Add static member. > - > - // Construct member debug information entry. > - DIE *Static = new DIE(DW_TAG_variable); > - > - // Add name and mangled name. > - const std::string &Name = StaticDesc->getName(); > - const std::string &LinkageName = StaticDesc->getLinkageName(); > - AddString(Static, DW_AT_name, DW_FORM_string, Name); > - if (!LinkageName.empty()) { > - AddString(Static, DW_AT_MIPS_linkage_name, DW_FORM_string, > - LinkageName); > - } > - > - // Add location. > - AddSourceLine(Static, StaticDesc->getFile(), StaticDesc->getLine()); > - > - // Add type. > - if (TypeDesc *StaticTy = StaticDesc->getType()) > - AddType(Static, StaticTy, Unit); > - > - // Add flags. > - if (!StaticDesc->isStatic()) > - AddUInt(Static, DW_AT_external, DW_FORM_flag, 1); > - AddUInt(Static, DW_AT_declaration, DW_FORM_flag, 1); > - > - Buffer.AddChild(Static); > - } else if (SubprogramDesc *MethodDesc = > - dyn_cast(Element)) { > - // Add member function. > - > - // Construct member debug information entry. > - DIE *Method = new DIE(DW_TAG_subprogram); > - > - // Add name and mangled name. > - const std::string &Name = MethodDesc->getName(); > - const std::string &LinkageName = MethodDesc->getLinkageName(); > - > - AddString(Method, DW_AT_name, DW_FORM_string, Name); > - bool IsCTor = TyDesc->getName() == Name; > - > - if (!LinkageName.empty()) { > - AddString(Method, DW_AT_MIPS_linkage_name, DW_FORM_string, > - LinkageName); > - } > - > - // Add location. > - AddSourceLine(Method, MethodDesc->getFile(), MethodDesc->getLine()); > - > - // Add type. > - if (CompositeTypeDesc *MethodTy = > - dyn_cast_or_null(MethodDesc->getType())) { > - // Get argument information. > - std::vector &Args = MethodTy->getElements(); > - > - // If not a ctor. > - if (!IsCTor) { > - // Add return type. > - AddType(Method, dyn_cast(Args[0]), Unit); > - } > - > - // Add arguments. > - for (unsigned i = 1, N = Args.size(); i < N; ++i) { > - DIE *Arg = new DIE(DW_TAG_formal_parameter); > - AddType(Arg, cast(Args[i]), Unit); > - AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1); > - Method->AddChild(Arg); > - } > - } > - > - // Add flags. > - if (!MethodDesc->isStatic()) > - AddUInt(Method, DW_AT_external, DW_FORM_flag, 1); > - AddUInt(Method, DW_AT_declaration, DW_FORM_flag, 1); > - > - Buffer.AddChild(Method); > - } > - } > - break; > - } > - case DW_TAG_enumeration_type: { > - // Add enumerators to enumeration type. > - for (unsigned i = 0, N = Elements.size(); i < N; ++i) { > - EnumeratorDesc *ED = cast(Elements[i]); > - const std::string &Name = ED->getName(); > - int64_t Value = ED->getValue(); > - DIE *Enumerator = new DIE(DW_TAG_enumerator); > - AddString(Enumerator, DW_AT_name, DW_FORM_string, Name); > - AddSInt(Enumerator, DW_AT_const_value, DW_FORM_sdata, Value); > - Buffer.AddChild(Enumerator); > - } > - > - break; > - } > - case DW_TAG_subroutine_type: { > - // Add prototype flag. > - AddUInt(&Buffer, DW_AT_prototyped, DW_FORM_flag, 1); > - // Add return type. > - AddType(&Buffer, dyn_cast(Elements[0]), Unit); > - > - // Add arguments. > - for (unsigned i = 1, N = Elements.size(); i < N; ++i) { > - DIE *Arg = new DIE(DW_TAG_formal_parameter); > - AddType(Arg, cast(Elements[i]), Unit); > - Buffer.AddChild(Arg); > - } > - > - break; > - } > - default: break; > - } > - } > - > - // Add name if not anonymous or intermediate type. > - if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name); > - > - // Add size if non-zero (derived types might be zero-sized.) > - if (Size) > - AddUInt(&Buffer, DW_AT_byte_size, 0, Size); > - else if (isa(TyDesc)) { > - // If TyDesc is a composite type, then add size even if it's zero unless > - // it's a forward declaration. > - if (TyDesc->isForwardDecl()) > - AddUInt(&Buffer, DW_AT_declaration, DW_FORM_flag, 1); > - else > - AddUInt(&Buffer, DW_AT_byte_size, 0, 0); > - } > - > - // Add source line info if available and TyDesc is not a forward > - // declaration. > - if (!TyDesc->isForwardDecl()) > - AddSourceLine(&Buffer, TyDesc->getFile(), TyDesc->getLine()); > - } > - > - /// NewCompileUnit - Create new compile unit and it's debug information entry. > - /// > - CompileUnit *NewCompileUnit(CompileUnitDesc *UnitDesc, unsigned ID) { > - // Construct debug information entry. > - DIE *Die = new DIE(DW_TAG_compile_unit); > - AddSectionOffset(Die, DW_AT_stmt_list, DW_FORM_data4, > - DWLabel("section_line", 0), DWLabel("section_line", 0), false); > - AddString(Die, DW_AT_producer, DW_FORM_string, UnitDesc->getProducer()); > - AddUInt (Die, DW_AT_language, DW_FORM_data1, UnitDesc->getLanguage()); > - AddString(Die, DW_AT_name, DW_FORM_string, UnitDesc->getFileName()); > - if (!UnitDesc->getDirectory().empty()) > - AddString(Die, DW_AT_comp_dir, DW_FORM_string, UnitDesc->getDirectory()); > - > - // Construct compile unit. > - CompileUnit *Unit = new CompileUnit(UnitDesc, ID, Die); > - > - // Add Unit to compile unit map. > - DescToUnitMap[UnitDesc] = Unit; > - > - return Unit; > - } > - > - /// GetBaseCompileUnit - Get the main compile unit. > - /// > - CompileUnit *GetBaseCompileUnit() const { > - CompileUnit *Unit = CompileUnits[0]; > - assert(Unit && "Missing compile unit."); > - return Unit; > - } > - > - /// FindCompileUnit - Get the compile unit for the given descriptor. > - /// > - CompileUnit *FindCompileUnit(CompileUnitDesc *UnitDesc) { > - CompileUnit *Unit = DescToUnitMap[UnitDesc]; > - assert(Unit && "Missing compile unit."); > - return Unit; > - } > - > /// FindCompileUnit - Get the compile unit for the given descriptor. > /// > CompileUnit *FindCompileUnit(DICompileUnit Unit) { > @@ -2374,136 +1967,7 @@ > return DW_Unit; > } > > - /// NewGlobalVariable - Add a new global variable DIE. > - /// > - DIE *NewGlobalVariable(GlobalVariableDesc *GVD) { > - // Get the compile unit context. > - CompileUnitDesc *UnitDesc = > - static_cast(GVD->getContext()); > - CompileUnit *Unit = GetBaseCompileUnit(); > - > - // Check for pre-existence. > - DIE *&Slot = Unit->getDieMapSlotFor(GVD); > - if (Slot) return Slot; > - > - // Get the global variable itself. > - GlobalVariable *GV = GVD->getGlobalVariable(); > - > - const std::string &Name = GVD->getName(); > - const std::string &FullName = GVD->getFullName(); > - const std::string &LinkageName = GVD->getLinkageName(); > - // Create the global's variable DIE. > - DIE *VariableDie = new DIE(DW_TAG_variable); > - AddString(VariableDie, DW_AT_name, DW_FORM_string, Name); > - if (!LinkageName.empty()) { > - AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string, > - LinkageName); > - } > - AddType(VariableDie, GVD->getType(), Unit); > - if (!GVD->isStatic()) > - AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1); > - > - // Add source line info if available. > - AddSourceLine(VariableDie, UnitDesc, GVD->getLine()); > - > - // Add address. > - DIEBlock *Block = new DIEBlock(); > - AddUInt(Block, 0, DW_FORM_data1, DW_OP_addr); > - AddObjectLabel(Block, 0, DW_FORM_udata, Asm->getGlobalLinkName(GV)); > - AddBlock(VariableDie, DW_AT_location, 0, Block); > - > - // Add to map. > - Slot = VariableDie; > - > - // Add to context owner. > - Unit->getDie()->AddChild(VariableDie); > - > - // Expose as global. > - // FIXME - need to check external flag. > - Unit->AddGlobal(FullName, VariableDie); > - > - return VariableDie; > - } > - > - /// NewSubprogram - Add a new subprogram DIE. > - /// > - DIE *NewSubprogram(SubprogramDesc *SPD) { > - // Get the compile unit context. > - CompileUnitDesc *UnitDesc = > - static_cast(SPD->getContext()); > - CompileUnit *Unit = GetBaseCompileUnit(); > - > - // Check for pre-existence. > - DIE *&Slot = Unit->getDieMapSlotFor(SPD); > - if (Slot) return Slot; > - > - // Gather the details (simplify add attribute code.) > - const std::string &Name = SPD->getName(); > - const std::string &FullName = SPD->getFullName(); > - const std::string &LinkageName = SPD->getLinkageName(); > - > - DIE *SubprogramDie = new DIE(DW_TAG_subprogram); > - AddString(SubprogramDie, DW_AT_name, DW_FORM_string, Name); > - if (!LinkageName.empty()) { > - AddString(SubprogramDie, DW_AT_MIPS_linkage_name, DW_FORM_string, > - LinkageName); > - } > - if (SPD->getType()) AddType(SubprogramDie, SPD->getType(), Unit); > - if (!SPD->isStatic()) > - AddUInt(SubprogramDie, DW_AT_external, DW_FORM_flag, 1); > - AddUInt(SubprogramDie, DW_AT_prototyped, DW_FORM_flag, 1); > - > - // Add source line info if available. > - AddSourceLine(SubprogramDie, UnitDesc, SPD->getLine()); > - > - // Add to map. > - Slot = SubprogramDie; > - > - // Add to context owner. > - Unit->getDie()->AddChild(SubprogramDie); > - > - // Expose as global. > - Unit->AddGlobal(FullName, SubprogramDie); > - > - return SubprogramDie; > - } > - > - /// NewScopeVariable - Create a new scope variable. > - /// > - DIE *NewScopeVariable(DebugVariable *DV, CompileUnit *Unit) { > - // Get the descriptor. > - VariableDesc *VD = DV->getDesc(); > - > - // Translate tag to proper Dwarf tag. The result variable is dropped for > - // now. > - unsigned Tag; > - switch (VD->getTag()) { > - case DW_TAG_return_variable: return NULL; > - case DW_TAG_arg_variable: Tag = DW_TAG_formal_parameter; break; > - case DW_TAG_auto_variable: // fall thru > - default: Tag = DW_TAG_variable; break; > - } > - > - // Define variable debug information entry. > - DIE *VariableDie = new DIE(Tag); > - AddString(VariableDie, DW_AT_name, DW_FORM_string, VD->getName()); > - > - // Add source line info if available. > - AddSourceLine(VariableDie, VD->getFile(), VD->getLine()); > - > - // Add variable type. > - AddType(VariableDie, VD->getType(), Unit); > - > - // Add variable address. > - MachineLocation Location; > - Location.set(RI->getFrameRegister(*MF), > - RI->getFrameIndexOffset(*MF, DV->getFrameIndex())); > - AddAddress(VariableDie, DW_AT_location, Location); > - > - return VariableDie; > - } > - > - /// NewScopeVariable - Create a new scope variable. > + /// NewDbgScopeVariable - Create a new scope variable. > /// > DIE *NewDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit) { > // Get the descriptor. > @@ -2688,125 +2152,6 @@ > #endif > } > > - /// ConstructScope - Construct the components of a scope. > - /// > - void ConstructScope(DebugScope *ParentScope, > - unsigned ParentStartID, unsigned ParentEndID, > - DIE *ParentDie, CompileUnit *Unit) { > - // Add variables to scope. > - std::vector &Variables = ParentScope->getVariables(); > - for (unsigned i = 0, N = Variables.size(); i < N; ++i) { > - DIE *VariableDie = NewScopeVariable(Variables[i], Unit); > - if (VariableDie) ParentDie->AddChild(VariableDie); > - } > - > - // Add nested scopes. > - std::vector &Scopes = ParentScope->getScopes(); > - for (unsigned j = 0, M = Scopes.size(); j < M; ++j) { > - // Define the Scope debug information entry. > - DebugScope *Scope = Scopes[j]; > - // FIXME - Ignore inlined functions for the time being. > - if (!Scope->getParent()) continue; > - > - unsigned StartID = MMI->MappedLabel(Scope->getStartLabelID()); > - unsigned EndID = MMI->MappedLabel(Scope->getEndLabelID()); > - > - // Ignore empty scopes. > - if (StartID == EndID && StartID != 0) continue; > - if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue; > - > - if (StartID == ParentStartID && EndID == ParentEndID) { > - // Just add stuff to the parent scope. > - ConstructScope(Scope, ParentStartID, ParentEndID, ParentDie, Unit); > - } else { > - DIE *ScopeDie = new DIE(DW_TAG_lexical_block); > - > - // Add the scope bounds. > - if (StartID) { > - AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, > - DWLabel("label", StartID)); > - } else { > - AddLabel(ScopeDie, DW_AT_low_pc, DW_FORM_addr, > - DWLabel("func_begin", SubprogramCount)); > - } > - if (EndID) { > - AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, > - DWLabel("label", EndID)); > - } else { > - AddLabel(ScopeDie, DW_AT_high_pc, DW_FORM_addr, > - DWLabel("func_end", SubprogramCount)); > - } > - > - // Add the scope contents. > - ConstructScope(Scope, StartID, EndID, ScopeDie, Unit); > - ParentDie->AddChild(ScopeDie); > - } > - } > - } > - > - /// ConstructRootScope - Construct the scope for the subprogram. > - /// > - void ConstructRootScope(DebugScope *RootScope) { > - // Exit if there is no root scope. > - if (!RootScope) return; > - > - // Get the subprogram debug information entry. > - SubprogramDesc *SPD = cast(RootScope->getDesc()); > - > - // Get the compile unit context. > - CompileUnit *Unit = GetBaseCompileUnit(); > - > - // Get the subprogram die. > - DIE *SPDie = Unit->getDieMapSlotFor(SPD); > - assert(SPDie && "Missing subprogram descriptor"); > - > - // Add the function bounds. > - AddLabel(SPDie, DW_AT_low_pc, DW_FORM_addr, > - DWLabel("func_begin", SubprogramCount)); > - AddLabel(SPDie, DW_AT_high_pc, DW_FORM_addr, > - DWLabel("func_end", SubprogramCount)); > - MachineLocation Location(RI->getFrameRegister(*MF)); > - AddAddress(SPDie, DW_AT_frame_base, Location); > - > - ConstructScope(RootScope, 0, 0, SPDie, Unit); > - } > - > - /// ConstructDefaultScope - Construct a default scope for the subprogram. > - /// > - void ConstructDefaultScope(MachineFunction *MF) { > - // Find the correct subprogram descriptor. > - std::vector Subprograms; > - MMI->getAnchoredDescriptors(*M, Subprograms); > - > - for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) { > - SubprogramDesc *SPD = Subprograms[i]; > - > - if (SPD->getName() == MF->getFunction()->getName()) { > - // Get the compile unit context. > - CompileUnit *Unit = GetBaseCompileUnit(); > - > - // Get the subprogram die. > - DIE *SPDie = Unit->getDieMapSlotFor(SPD); > - assert(SPDie && "Missing subprogram descriptor"); > - > - // Add the function bounds. > - AddLabel(SPDie, DW_AT_low_pc, DW_FORM_addr, > - DWLabel("func_begin", SubprogramCount)); > - AddLabel(SPDie, DW_AT_high_pc, DW_FORM_addr, > - DWLabel("func_end", SubprogramCount)); > - > - MachineLocation Location(RI->getFrameRegister(*MF)); > - AddAddress(SPDie, DW_AT_frame_base, Location); > - return; > - } > - } > -#if 0 > - // FIXME: This is causing an abort because C++ mangled names are compared > - // with their unmangled counterparts. See PR2885. Don't do this assert. > - assert(0 && "Couldn't find DIE for machine function!"); > -#endif > - } > - > /// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc > /// tools to recognize the object file contains Dwarf information. > void EmitInitial() { > @@ -3443,18 +2788,6 @@ > } > } > > - /// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and > - /// header file. > - void ConstructCompileUnitDIEs() { > - const UniqueVector CUW = MMI->getCompileUnits(); > - > - for (unsigned i = 1, N = CUW.size(); i <= N; ++i) { > - unsigned ID = MMI->RecordSource(CUW[i]); > - CompileUnit *Unit = NewCompileUnit(CUW[i], ID); > - CompileUnits.push_back(Unit); > - } > - } > - > /// ConstructGlobalVariableDIEs - Create DIEs for each of the externally > /// visible global variables. > void ConstructGlobalVariableDIEs() { > @@ -3502,18 +2835,6 @@ > } > } > > - /// ConstructGlobalDIEs - Create DIEs for each of the externally visible > - /// global variables. > - void ConstructGlobalDIEs() { > - std::vector GlobalVariables; > - MMI->getAnchoredDescriptors(*M, GlobalVariables); > - > - for (unsigned i = 0, N = GlobalVariables.size(); i < N; ++i) { > - GlobalVariableDesc *GVD = GlobalVariables[i]; > - NewGlobalVariable(GVD); > - } > - } > - > /// ConstructSubprograms - Create DIEs for each of the externally visible > /// subprograms. > void ConstructSubprograms() { > @@ -3553,18 +2874,6 @@ > } > } > > - /// ConstructSubprogramDIEs - Create DIEs for each of the externally visible > - /// subprograms. > - void ConstructSubprogramDIEs() { > - std::vector Subprograms; > - MMI->getAnchoredDescriptors(*M, Subprograms); > - > - for (unsigned i = 0, N = Subprograms.size(); i < N; ++i) { > - SubprogramDesc *SPD = Subprograms[i]; > - NewSubprogram(SPD); > - } > - } > - > public: > //===--------------------------------------------------------------------===// > // Main entry points. > @@ -3577,7 +2886,6 @@ > , ValuesSet(InitValuesSetSize) > , Values() > , StringPool() > - , DescToUnitMap() > , SectionMap() > , SectionSourceLines() > , didInitial(false) > @@ -3632,47 +2940,6 @@ > EmitInitial(); > } > > - /// SetModuleInfo - Set machine module information when it's known that pass > - /// manager has created it. Set by the target AsmPrinter. > - void SetModuleInfo(MachineModuleInfo *mmi) { > - assert (0 && "Who is this?"); > - // Make sure initial declarations are made. > - if (!MMI && mmi->hasDebugInfo()) { > - MMI = mmi; > - shouldEmit = true; > - > - // Create all the compile unit DIEs. > - ConstructCompileUnitDIEs(); > - > - // Create DIEs for each of the externally visible global variables. > - ConstructGlobalDIEs(); > - > - // Create DIEs for each of the externally visible subprograms. > - ConstructSubprogramDIEs(); > - > - // Prime section data. > - SectionMap.insert(TAI->getTextSection()); > - > - // Print out .file directives to specify files for .loc directives. These > - // are printed out early so that they precede any .loc directives. > - if (TAI->hasDotLocAndDotFile()) { > - const UniqueVector &SourceFiles = MMI->getSourceFiles(); > - const UniqueVector &Directories = MMI->getDirectories(); > - for (unsigned i = 1, e = SourceFiles.size(); i <= e; ++i) { > - sys::Path FullPath(Directories[SourceFiles[i].getDirectoryID()]); > - bool AppendOk = FullPath.appendComponent(SourceFiles[i].getName()); > - assert(AppendOk && "Could not append filename to directory!"); > - AppendOk = false; > - Asm->EmitFile(i, FullPath.toString()); > - Asm->EOL(); > - } > - } > - > - // Emit initial sections > - EmitInitial(); > - } > - } > - > /// BeginModule - Emit all Dwarf sections that should come prior to the > /// content. > void BeginModule(Module *M) { > @@ -4991,3 +4258,4 @@ > void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { > DD->RecordVariable(GV, FrameIndex); > } > + > > Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=62199&r1=62198&r2=62199&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Jan 13 17:54:55 2009 > @@ -33,1598 +33,11 @@ > char MachineModuleInfo::ID = 0; > > //===----------------------------------------------------------------------===// > - > -/// getGlobalVariablesUsing - Return all of the GlobalVariables which have the > -/// specified value in their initializer somewhere. > -static void > -getGlobalVariablesUsing(Value *V, std::vector &Result) { > - // Scan though value users. > - for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) { > - if (GlobalVariable *GV = dyn_cast(*I)) { > - // If the user is a GlobalVariable then add to result. > - Result.push_back(GV); > - } else if (Constant *C = dyn_cast(*I)) { > - // If the user is a constant variable then scan its users > - getGlobalVariablesUsing(C, Result); > - } > - } > -} > - > -/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the > -/// named GlobalVariable. > -static void > -getGlobalVariablesUsing(Module &M, const std::string &RootName, > - std::vector &Result) { > - std::vector FieldTypes; > - FieldTypes.push_back(Type::Int32Ty); > - FieldTypes.push_back(Type::Int32Ty); > - > - // Get the GlobalVariable root. > - GlobalVariable *UseRoot = M.getGlobalVariable(RootName, > - StructType::get(FieldTypes)); > - > - // If present and linkonce then scan for users. > - if (UseRoot && UseRoot->hasLinkOnceLinkage()) > - getGlobalVariablesUsing(UseRoot, Result); > -} > - > -/// isStringValue - Return true if the given value can be coerced to a string. > -/// > -static bool isStringValue(Value *V) { > - if (GlobalVariable *GV = dyn_cast(V)) { > - if (GV->hasInitializer() && isa(GV->getInitializer())) { > - ConstantArray *Init = cast(GV->getInitializer()); > - return Init->isString(); > - } > - } else if (Constant *C = dyn_cast(V)) { > - if (GlobalValue *GV = dyn_cast(C)) > - return isStringValue(GV); > - else if (ConstantExpr *CE = dyn_cast(C)) { > - if (CE->getOpcode() == Instruction::GetElementPtr) { > - if (CE->getNumOperands() == 3 && > - cast(CE->getOperand(1))->isNullValue() && > - isa(CE->getOperand(2))) { > - return isStringValue(CE->getOperand(0)); > - } > - } > - } > - } > - return false; > -} > - > -/// getGlobalVariable - Return either a direct or cast Global value. > -/// > -static GlobalVariable *getGlobalVariable(Value *V) { > - if (GlobalVariable *GV = dyn_cast(V)) { > - return GV; > - } else if (ConstantExpr *CE = dyn_cast(V)) { > - if (CE->getOpcode() == Instruction::BitCast) { > - return dyn_cast(CE->getOperand(0)); > - } else if (CE->getOpcode() == Instruction::GetElementPtr) { > - for (unsigned int i=1; igetNumOperands(); i++) { > - if (!CE->getOperand(i)->isNullValue()) > - return NULL; > - } > - return dyn_cast(CE->getOperand(0)); > - } > - } > - return NULL; > -} > - > -/// isGlobalVariable - Return true if the given value can be coerced to a > -/// GlobalVariable. > -static bool isGlobalVariable(Value *V) { > - if (isa(V) || isa(V)) { > - return true; > - } else if (ConstantExpr *CE = dyn_cast(V)) { > - if (CE->getOpcode() == Instruction::BitCast) { > - return isa(CE->getOperand(0)); > - } else if (CE->getOpcode() == Instruction::GetElementPtr) { > - for (unsigned int i=1; igetNumOperands(); i++) { > - if (!CE->getOperand(i)->isNullValue()) > - return false; > - } > - return isa(CE->getOperand(0)); > - } > - } > - return false; > -} > - > -/// getUIntOperand - Return ith operand if it is an unsigned integer. > -/// > -static ConstantInt *getUIntOperand(GlobalVariable *GV, unsigned i) { > - // Make sure the GlobalVariable has an initializer. > - if (!GV->hasInitializer()) return NULL; > - > - // Get the initializer constant. > - ConstantStruct *CI = dyn_cast(GV->getInitializer()); > - if (!CI) return NULL; > - > - // Check if there is at least i + 1 operands. > - unsigned N = CI->getNumOperands(); > - if (i >= N) return NULL; > - > - // Check constant. > - return dyn_cast(CI->getOperand(i)); > -} > - > -//===----------------------------------------------------------------------===// > - > -static unsigned CountFields(DebugInfoDesc *DD) { > - unsigned Count = 0; > - > - switch (DD->getTag()) { > - case DW_TAG_anchor: // AnchorDesc > - // Tag > - // AnchorTag > - Count = 2; > - break; > - case DW_TAG_compile_unit: // CompileUnitDesc > - // [DW_TAG_anchor] > - // if (Version == 0) DebugVersion > - // Language > - // FileName > - // Directory > - // Producer > - Count = 6; > - > - // Handle cases out of sync with compiler. > - if (DD->getVersion() == 0) > - ++Count; > - > - break; > - case DW_TAG_variable: // GlobalVariableDesc > - // [DW_TAG_anchor] > - // Context > - // Name > - // FullName > - // LinkageName > - // File > - // Line > - // TyDesc > - // IsStatic > - // IsDefinition > - // Global > - Count = 12; > - break; > - case DW_TAG_subprogram: // SubprogramDesc > - // [DW_TAG_anchor] > - // Context > - // Name > - // FullName > - // LinkageName > - // File > - // Line > - // TyDesc > - // IsStatic > - // IsDefinition > - Count = 11; > - break; > - case DW_TAG_lexical_block: // BlockDesc > - // Tag > - // Context > - Count = 2; > - break; > - case DW_TAG_base_type: // BasicTypeDesc > - // Tag > - // Context > - // Name > - // File > - // Line > - // Size > - // Align > - // Offset > - // if (Version > LLVMDebugVersion4) Flags > - // Encoding > - Count = 9; > - > - if (DD->getVersion() > LLVMDebugVersion4) > - ++Count; > - > - break; > - case DW_TAG_typedef: > - case DW_TAG_pointer_type: > - case DW_TAG_reference_type: > - case DW_TAG_const_type: > - case DW_TAG_volatile_type: > - case DW_TAG_restrict_type: > - case DW_TAG_member: > - case DW_TAG_inheritance: // DerivedTypeDesc > - // Tag > - // Context > - // Name > - // File > - // Line > - // Size > - // Align > - // Offset > - // if (Version > LLVMDebugVersion4) Flags > - // FromType > - Count = 9; > - > - if (DD->getVersion() > LLVMDebugVersion4) > - ++Count; > - > - break; > - case DW_TAG_array_type: > - case DW_TAG_structure_type: > - case DW_TAG_union_type: > - case DW_TAG_enumeration_type: > - case DW_TAG_vector_type: > - case DW_TAG_subroutine_type: // CompositeTypeDesc > - // Tag > - // Context > - // Name > - // File > - // Line > - // Size > - // Align > - // Offset > - // if (Version > LLVMDebugVersion4) Flags > - // FromType > - // Elements > - Count = 10; > - > - if (DD->getVersion() > LLVMDebugVersion4) > - ++Count; > - > - break; > - case DW_TAG_subrange_type: // SubrangeDesc > - // Tag > - // Lo > - // Hi > - Count = 3; > - break; > - case DW_TAG_enumerator: // EnumeratorDesc > - // Tag > - // Name > - // Value > - Count = 3; > - break; > - case DW_TAG_return_variable: > - case DW_TAG_arg_variable: > - case DW_TAG_auto_variable: // VariableDesc > - // Tag > - // Context > - // Name > - // File > - // Line > - // TyDesc > - Count = 6; > - break; > - default: > - break; > - } > - > - return Count; > -} > - > -//===----------------------------------------------------------------------===// > - > -/// ApplyToFields - Target the visitor to each field of the debug information > -/// descriptor. > -void DIVisitor::ApplyToFields(DebugInfoDesc *DD) { > - DD->ApplyToFields(this); > -} > - > -namespace { > - > -//===----------------------------------------------------------------------===// > -/// DIDeserializeVisitor - This DIVisitor deserializes all the fields in the > -/// supplied DebugInfoDesc. > -class DIDeserializeVisitor : public DIVisitor { > -private: > - DIDeserializer &DR; // Active deserializer. > - unsigned I; // Current operand index. > - ConstantStruct *CI; // GlobalVariable constant initializer. > - > -public: > - DIDeserializeVisitor(DIDeserializer &D, GlobalVariable *GV) > - : DIVisitor(), DR(D), I(0), CI(cast(GV->getInitializer())) > - {} > - > - /// Apply - Set the value of each of the fields. > - /// > - virtual void Apply(int &Field) { > - Constant *C = CI->getOperand(I++); > - Field = cast(C)->getSExtValue(); > - } > - virtual void Apply(unsigned &Field) { > - Constant *C = CI->getOperand(I++); > - Field = cast(C)->getZExtValue(); > - } > - virtual void Apply(int64_t &Field) { > - Constant *C = CI->getOperand(I++); > - Field = cast(C)->getSExtValue(); > - } > - virtual void Apply(uint64_t &Field) { > - Constant *C = CI->getOperand(I++); > - Field = cast(C)->getZExtValue(); > - } > - virtual void Apply(bool &Field) { > - Constant *C = CI->getOperand(I++); > - Field = cast(C)->getZExtValue(); > - } > - virtual void Apply(std::string &Field) { > - Constant *C = CI->getOperand(I++); > - // Fills in the string if it succeeds > - if (!GetConstantStringInfo(C, Field)) > - Field.clear(); > - } > - virtual void Apply(DebugInfoDesc *&Field) { > - Constant *C = CI->getOperand(I++); > - Field = DR.Deserialize(C); > - } > - virtual void Apply(GlobalVariable *&Field) { > - Constant *C = CI->getOperand(I++); > - Field = getGlobalVariable(C); > - } > - virtual void Apply(std::vector &Field) { > - Field.resize(0); > - Constant *C = CI->getOperand(I++); > - GlobalVariable *GV = getGlobalVariable(C); > - if (GV && GV->hasInitializer()) { > - if (ConstantArray *CA = dyn_cast(GV->getInitializer())) { > - for (unsigned i = 0, N = CA->getNumOperands(); i < N; ++i) { > - GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i)); > - DebugInfoDesc *DE = DR.Deserialize(GVE); > - Field.push_back(DE); > - } > - } else if (GV->getInitializer()->isNullValue()) { > - if (const ArrayType *T = > - dyn_cast(GV->getType()->getElementType())) { > - Field.resize(T->getNumElements()); > - } > - } > - } > - } > -}; > - > -//===----------------------------------------------------------------------===// > -/// DISerializeVisitor - This DIVisitor serializes all the fields in > -/// the supplied DebugInfoDesc. > -class DISerializeVisitor : public DIVisitor { > -private: > - DISerializer &SR; // Active serializer. > - std::vector &Elements; // Element accumulator. > - > -public: > - DISerializeVisitor(DISerializer &S, std::vector &E) > - : DIVisitor() > - , SR(S) > - , Elements(E) > - {} > - > - /// Apply - Set the value of each of the fields. > - /// > - virtual void Apply(int &Field) { > - Elements.push_back(ConstantInt::get(Type::Int32Ty, int32_t(Field))); > - } > - virtual void Apply(unsigned &Field) { > - Elements.push_back(ConstantInt::get(Type::Int32Ty, uint32_t(Field))); > - } > - virtual void Apply(int64_t &Field) { > - Elements.push_back(ConstantInt::get(Type::Int64Ty, int64_t(Field))); > - } > - virtual void Apply(uint64_t &Field) { > - Elements.push_back(ConstantInt::get(Type::Int64Ty, uint64_t(Field))); > - } > - virtual void Apply(bool &Field) { > - Elements.push_back(ConstantInt::get(Type::Int1Ty, Field)); > - } > - virtual void Apply(std::string &Field) { > - Elements.push_back(SR.getString(Field)); > - } > - virtual void Apply(DebugInfoDesc *&Field) { > - GlobalVariable *GV = NULL; > - > - // If non-NULL then convert to global. > - if (Field) GV = SR.Serialize(Field); > - > - // FIXME - At some point should use specific type. > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - > - if (GV) { > - // Set to pointer to global. > - Elements.push_back(ConstantExpr::getBitCast(GV, EmptyTy)); > - } else { > - // Use NULL. > - Elements.push_back(ConstantPointerNull::get(EmptyTy)); > - } > - } > - virtual void Apply(GlobalVariable *&Field) { > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - if (Field) { > - Elements.push_back(ConstantExpr::getBitCast(Field, EmptyTy)); > - } else { > - Elements.push_back(ConstantPointerNull::get(EmptyTy)); > - } > - } > - virtual void Apply(std::vector &Field) { > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - unsigned N = Field.size(); > - ArrayType *AT = ArrayType::get(EmptyTy, N); > - std::vector ArrayElements; > - > - for (unsigned i = 0, N = Field.size(); i < N; ++i) { > - if (DebugInfoDesc *Element = Field[i]) { > - GlobalVariable *GVE = SR.Serialize(Element); > - Constant *CE = ConstantExpr::getBitCast(GVE, EmptyTy); > - ArrayElements.push_back(cast(CE)); > - } else { > - ArrayElements.push_back(ConstantPointerNull::get(EmptyTy)); > - } > - } > - > - Constant *CA = ConstantArray::get(AT, ArrayElements); > - GlobalVariable *CAGV = new GlobalVariable(AT, true, > - GlobalValue::InternalLinkage, > - CA, "llvm.dbg.array", > - SR.getModule()); > - CAGV->setSection("llvm.metadata"); > - Constant *CAE = ConstantExpr::getBitCast(CAGV, EmptyTy); > - Elements.push_back(CAE); > - } > -}; > - > -//===----------------------------------------------------------------------===// > -/// DIGetTypesVisitor - This DIVisitor gathers all the field types in > -/// the supplied DebugInfoDesc. > -class DIGetTypesVisitor : public DIVisitor { > -private: > - DISerializer &SR; // Active serializer. > - std::vector &Fields; // Type accumulator. > - > -public: > - DIGetTypesVisitor(DISerializer &S, std::vector &F) > - : DIVisitor() > - , SR(S) > - , Fields(F) > - {} > - > - /// Apply - Set the value of each of the fields. > - /// > - virtual void Apply(int &Field) { > - Fields.push_back(Type::Int32Ty); > - } > - virtual void Apply(unsigned &Field) { > - Fields.push_back(Type::Int32Ty); > - } > - virtual void Apply(int64_t &Field) { > - Fields.push_back(Type::Int64Ty); > - } > - virtual void Apply(uint64_t &Field) { > - Fields.push_back(Type::Int64Ty); > - } > - virtual void Apply(bool &Field) { > - Fields.push_back(Type::Int1Ty); > - } > - virtual void Apply(std::string &Field) { > - Fields.push_back(SR.getStrPtrType()); > - } > - virtual void Apply(DebugInfoDesc *&Field) { > - // FIXME - At some point should use specific type. > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - Fields.push_back(EmptyTy); > - } > - virtual void Apply(GlobalVariable *&Field) { > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - Fields.push_back(EmptyTy); > - } > - virtual void Apply(std::vector &Field) { > - const PointerType *EmptyTy = SR.getEmptyStructPtrType(); > - Fields.push_back(EmptyTy); > - } > -}; > - > -//===----------------------------------------------------------------------===// > -/// DIVerifyVisitor - This DIVisitor verifies all the field types against > -/// a constant initializer. > -class DIVerifyVisitor : public DIVisitor { > -private: > - DIVerifier &VR; // Active verifier. > - bool IsValid; // Validity status. > - unsigned I; // Current operand index. > - ConstantStruct *CI; // GlobalVariable constant initializer. > - > -public: > - DIVerifyVisitor(DIVerifier &V, GlobalVariable *GV) > - : DIVisitor() > - , VR(V) > - , IsValid(true) > - , I(0) > - , CI(cast(GV->getInitializer())) > - { > - } > > - // Accessors. > - bool isValid() const { return IsValid; } > - > - /// Apply - Set the value of each of the fields. > - /// > - virtual void Apply(int &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isa(C); > - } > - virtual void Apply(unsigned &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isa(C); > - } > - virtual void Apply(int64_t &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isa(C); > - } > - virtual void Apply(uint64_t &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isa(C); > - } > - virtual void Apply(bool &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isa(C) && C->getType() == Type::Int1Ty; > - } > - virtual void Apply(std::string &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && > - (!C || isStringValue(C) || C->isNullValue()); > - } > - virtual void Apply(DebugInfoDesc *&Field) { > - // FIXME - Prepare the correct descriptor. > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isGlobalVariable(C); > - } > - virtual void Apply(GlobalVariable *&Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isGlobalVariable(C); > - } > - virtual void Apply(std::vector &Field) { > - Constant *C = CI->getOperand(I++); > - IsValid = IsValid && isGlobalVariable(C); > - if (!IsValid) return; > - > - GlobalVariable *GV = getGlobalVariable(C); > - IsValid = IsValid && GV && GV->hasInitializer(); > - if (!IsValid) return; > - > - ConstantArray *CA = dyn_cast(GV->getInitializer()); > - IsValid = IsValid && CA; > - if (!IsValid) return; > - > - for (unsigned i = 0, N = CA->getNumOperands(); IsValid && i < N; ++i) { > - IsValid = IsValid && isGlobalVariable(CA->getOperand(i)); > - if (!IsValid) return; > - > - GlobalVariable *GVE = getGlobalVariable(CA->getOperand(i)); > - VR.Verify(GVE); > - } > - } > -}; > - > -} > - > -//===----------------------------------------------------------------------===// > - > -/// TagFromGlobal - Returns the tag number from a debug info descriptor > -/// GlobalVariable. Return DIIValid if operand is not an unsigned int. > -unsigned DebugInfoDesc::TagFromGlobal(GlobalVariable *GV) { > - ConstantInt *C = getUIntOperand(GV, 0); > - return C ? ((unsigned)C->getZExtValue() & ~LLVMDebugVersionMask) : > - (unsigned)DW_TAG_invalid; > -} > - > -/// VersionFromGlobal - Returns the version number from a debug info > -/// descriptor GlobalVariable. Return DIIValid if operand is not an unsigned > -/// int. > -unsigned DebugInfoDesc::VersionFromGlobal(GlobalVariable *GV) { > - ConstantInt *C = getUIntOperand(GV, 0); > - return C ? ((unsigned)C->getZExtValue() & LLVMDebugVersionMask) : > - (unsigned)DW_TAG_invalid; > -} > - > -/// DescFactory - Create an instance of debug info descriptor based on Tag. > -/// Return NULL if not a recognized Tag. > -DebugInfoDesc *DebugInfoDesc::DescFactory(unsigned Tag) { > - switch (Tag) { > - case DW_TAG_anchor: return new AnchorDesc(); > - case DW_TAG_compile_unit: return new CompileUnitDesc(); > - case DW_TAG_variable: return new GlobalVariableDesc(); > - case DW_TAG_subprogram: return new SubprogramDesc(); > - case DW_TAG_lexical_block: return new BlockDesc(); > - case DW_TAG_base_type: return new BasicTypeDesc(); > - case DW_TAG_typedef: > - case DW_TAG_pointer_type: > - case DW_TAG_reference_type: > - case DW_TAG_const_type: > - case DW_TAG_volatile_type: > - case DW_TAG_restrict_type: > - case DW_TAG_member: > - case DW_TAG_inheritance: return new DerivedTypeDesc(Tag); > - case DW_TAG_array_type: > - case DW_TAG_structure_type: > - case DW_TAG_union_type: > - case DW_TAG_enumeration_type: > - case DW_TAG_vector_type: > - case DW_TAG_subroutine_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: > - case DW_TAG_arg_variable: > - case DW_TAG_auto_variable: return new VariableDesc(Tag); > - default: break; > - } > - return NULL; > -} > - > -/// getLinkage - get linkage appropriate for this type of descriptor. > -/// > -GlobalValue::LinkageTypes DebugInfoDesc::getLinkage() const { > - return GlobalValue::InternalLinkage; > -} > - > -/// ApplyToFields - Target the vistor to the fields of the descriptor. > -/// > -void DebugInfoDesc::ApplyToFields(DIVisitor *Visitor) { > - Visitor->Apply(Tag); > -} > - > -//===----------------------------------------------------------------------===// > - > -AnchorDesc::AnchorDesc() > -: DebugInfoDesc(DW_TAG_anchor) > -, AnchorTag(0) > -{} > -AnchorDesc::AnchorDesc(AnchoredDesc *D) > -: DebugInfoDesc(DW_TAG_anchor) > -, AnchorTag(D->getTag()) > -{} > - > -// Implement isa/cast/dyncast. > -bool AnchorDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_anchor; > -} > - > -/// getLinkage - get linkage appropriate for this type of descriptor. > -/// > -GlobalValue::LinkageTypes AnchorDesc::getLinkage() const { > - return GlobalValue::LinkOnceLinkage; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the TransUnitDesc. > -/// > -void AnchorDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(AnchorTag); > -} > - > -/// getDescString - Return a string used to compose global names and labels. A > -/// A global variable name needs to be defined for each debug descriptor that is > -/// anchored. NOTE: that each global variable named here also needs to be added > -/// to the list of names left external in the internalizer. > -/// ExternalNames.insert("llvm.dbg.compile_units"); > -/// ExternalNames.insert("llvm.dbg.global_variables"); > -/// ExternalNames.insert("llvm.dbg.subprograms"); > -const char *AnchorDesc::getDescString() const { > - switch (AnchorTag) { > - case DW_TAG_compile_unit: return CompileUnitDesc::AnchorString; > - case DW_TAG_variable: return GlobalVariableDesc::AnchorString; > - case DW_TAG_subprogram: return SubprogramDesc::AnchorString; > - default: break; > - } > - > - assert(0 && "Tag does not have a case for anchor string"); > - return ""; > -} > - > -/// getTypeString - Return a string used to label this descriptors type. > -/// > -const char *AnchorDesc::getTypeString() const { > - return "llvm.dbg.anchor.type"; > -} > - > -#ifndef NDEBUG > -void AnchorDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "AnchorTag(" << AnchorTag << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -AnchoredDesc::AnchoredDesc(unsigned T) > -: DebugInfoDesc(T) > -, Anchor(NULL) > -{} > - > -/// ApplyToFields - Target the visitor to the fields of the AnchoredDesc. > -/// > -void AnchoredDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Anchor); > -} > - > -//===----------------------------------------------------------------------===// > - > -CompileUnitDesc::CompileUnitDesc() > -: AnchoredDesc(DW_TAG_compile_unit) > -, Language(0) > -, FileName("") > -, Directory("") > -, Producer("") > -{} > - > -// Implement isa/cast/dyncast. > -bool CompileUnitDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_compile_unit; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the CompileUnitDesc. > -/// > -void CompileUnitDesc::ApplyToFields(DIVisitor *Visitor) { > - AnchoredDesc::ApplyToFields(Visitor); > - > - // Handle cases out of sync with compiler. > - if (getVersion() == 0) { > - unsigned DebugVersion; > - Visitor->Apply(DebugVersion); > - } > - > - Visitor->Apply(Language); > - Visitor->Apply(FileName); > - Visitor->Apply(Directory); > - Visitor->Apply(Producer); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *CompileUnitDesc::getDescString() const { > - return "llvm.dbg.compile_unit"; > -} > - > -/// getTypeString - Return a string used to label this descriptors type. > -/// > -const char *CompileUnitDesc::getTypeString() const { > - return "llvm.dbg.compile_unit.type"; > -} > - > -/// getAnchorString - Return a string used to label this descriptor's anchor. > -/// > -const char *const CompileUnitDesc::AnchorString = "llvm.dbg.compile_units"; > -const char *CompileUnitDesc::getAnchorString() const { > - return AnchorString; > -} > - > -#ifndef NDEBUG > -void CompileUnitDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Anchor(" << getAnchor() << "), " > - << "Language(" << Language << "), " > - << "FileName(\"" << FileName << "\"), " > - << "Directory(\"" << Directory << "\"), " > - << "Producer(\"" << Producer << "\")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -TypeDesc::TypeDesc(unsigned T) > -: DebugInfoDesc(T) > -, Context(NULL) > -, Name("") > -, File(NULL) > -, Line(0) > -, Size(0) > -, Align(0) > -, Offset(0) > -, Flags(0) > -{} > - > -/// ApplyToFields - Target the visitor to the fields of the TypeDesc. > -/// > -void TypeDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Context); > - Visitor->Apply(Name); > - Visitor->Apply(File); > - Visitor->Apply(Line); > - Visitor->Apply(Size); > - Visitor->Apply(Align); > - Visitor->Apply(Offset); > - if (getVersion() > LLVMDebugVersion4) Visitor->Apply(Flags); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *TypeDesc::getDescString() const { > - return "llvm.dbg.type"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *TypeDesc::getTypeString() const { > - return "llvm.dbg.type.type"; > -} > - > -#ifndef NDEBUG > -void TypeDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Context(" << Context << "), " > - << "Name(\"" << Name << "\"), " > - << "File(" << File << "), " > - << "Line(" << Line << "), " > - << "Size(" << Size << "), " > - << "Align(" << Align << "), " > - << "Offset(" << Offset << "), " > - << "Flags(" << Flags << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -BasicTypeDesc::BasicTypeDesc() > -: TypeDesc(DW_TAG_base_type) > -, Encoding(0) > -{} > - > -// Implement isa/cast/dyncast. > -bool BasicTypeDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_base_type; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the BasicTypeDesc. > -/// > -void BasicTypeDesc::ApplyToFields(DIVisitor *Visitor) { > - TypeDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Encoding); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *BasicTypeDesc::getDescString() const { > - return "llvm.dbg.basictype"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *BasicTypeDesc::getTypeString() const { > - return "llvm.dbg.basictype.type"; > -} > - > -#ifndef NDEBUG > -void BasicTypeDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Context(" << getContext() << "), " > - << "Name(\"" << getName() << "\"), " > - << "Size(" << getSize() << "), " > - << "Encoding(" << Encoding << ")," > - << "Flags(" << Flags << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -DerivedTypeDesc::DerivedTypeDesc(unsigned T) > -: TypeDesc(T) > -, FromType(NULL) > -{} > - > -// Implement isa/cast/dyncast. > -bool DerivedTypeDesc::classof(const DebugInfoDesc *D) { > - unsigned T = D->getTag(); > - switch (T) { > - case DW_TAG_typedef: > - case DW_TAG_pointer_type: > - case DW_TAG_reference_type: > - case DW_TAG_const_type: > - case DW_TAG_volatile_type: > - case DW_TAG_restrict_type: > - case DW_TAG_member: > - case DW_TAG_inheritance: > - return true; > - default: break; > - } > - return false; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the DerivedTypeDesc. > -/// > -void DerivedTypeDesc::ApplyToFields(DIVisitor *Visitor) { > - TypeDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(FromType); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *DerivedTypeDesc::getDescString() const { > - return "llvm.dbg.derivedtype"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *DerivedTypeDesc::getTypeString() const { > - return "llvm.dbg.derivedtype.type"; > -} > - > -#ifndef NDEBUG > -void DerivedTypeDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Context(" << getContext() << "), " > - << "Name(\"" << getName() << "\"), " > - << "Size(" << getSize() << "), " > - << "File(" << getFile() << "), " > - << "Line(" << getLine() << "), " > - << "FromType(" << FromType << ")," > - << "Flags(" << Flags << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -CompositeTypeDesc::CompositeTypeDesc(unsigned T) > -: DerivedTypeDesc(T) > -, Elements() > -{} > - > -// Implement isa/cast/dyncast. > -bool CompositeTypeDesc::classof(const DebugInfoDesc *D) { > - unsigned T = D->getTag(); > - switch (T) { > - case DW_TAG_array_type: > - case DW_TAG_structure_type: > - case DW_TAG_union_type: > - case DW_TAG_enumeration_type: > - case DW_TAG_vector_type: > - case DW_TAG_subroutine_type: > - return true; > - default: break; > - } > - return false; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the CompositeTypeDesc. > -/// > -void CompositeTypeDesc::ApplyToFields(DIVisitor *Visitor) { > - DerivedTypeDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Elements); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *CompositeTypeDesc::getDescString() const { > - return "llvm.dbg.compositetype"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *CompositeTypeDesc::getTypeString() const { > - return "llvm.dbg.compositetype.type"; > -} > - > -#ifndef NDEBUG > -void CompositeTypeDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Context(" << getContext() << "), " > - << "Name(\"" << getName() << "\"), " > - << "Size(" << getSize() << "), " > - << "File(" << getFile() << "), " > - << "Line(" << getLine() << "), " > - << "FromType(" << getFromType() << "), " > - << "Elements.size(" << Elements.size() << ")," > - << "Flags(" << Flags << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -SubrangeDesc::SubrangeDesc() > -: DebugInfoDesc(DW_TAG_subrange_type) > -, Lo(0) > -, Hi(0) > -{} > - > -// Implement isa/cast/dyncast. > -bool SubrangeDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_subrange_type; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the SubrangeDesc. > -/// > -void SubrangeDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Lo); > - Visitor->Apply(Hi); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *SubrangeDesc::getDescString() const { > - return "llvm.dbg.subrange"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *SubrangeDesc::getTypeString() const { > - return "llvm.dbg.subrange.type"; > -} > - > -#ifndef NDEBUG > -void SubrangeDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Lo(" << Lo << "), " > - << "Hi(" << Hi << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -EnumeratorDesc::EnumeratorDesc() > -: DebugInfoDesc(DW_TAG_enumerator) > -, Name("") > -, Value(0) > -{} > - > -// Implement isa/cast/dyncast. > -bool EnumeratorDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_enumerator; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the EnumeratorDesc. > -/// > -void EnumeratorDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Name); > - Visitor->Apply(Value); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *EnumeratorDesc::getDescString() const { > - return "llvm.dbg.enumerator"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *EnumeratorDesc::getTypeString() const { > - return "llvm.dbg.enumerator.type"; > -} > - > -#ifndef NDEBUG > -void EnumeratorDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Name(" << Name << "), " > - << "Value(" << Value << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -VariableDesc::VariableDesc(unsigned T) > -: DebugInfoDesc(T) > -, Context(NULL) > -, Name("") > -, File(NULL) > -, Line(0) > -, TyDesc(0) > -{} > - > -// Implement isa/cast/dyncast. > -bool VariableDesc::classof(const DebugInfoDesc *D) { > - unsigned T = D->getTag(); > - switch (T) { > - case DW_TAG_auto_variable: > - case DW_TAG_arg_variable: > - case DW_TAG_return_variable: > - return true; > - default: break; > - } > - return false; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the VariableDesc. > -/// > -void VariableDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Context); > - Visitor->Apply(Name); > - Visitor->Apply(File); > - Visitor->Apply(Line); > - Visitor->Apply(TyDesc); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *VariableDesc::getDescString() const { > - return "llvm.dbg.variable"; > -} > - > -/// getTypeString - Return a string used to label this descriptor's type. > -/// > -const char *VariableDesc::getTypeString() const { > - return "llvm.dbg.variable.type"; > -} > - > -#ifndef NDEBUG > -void VariableDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Context(" << Context << "), " > - << "Name(\"" << Name << "\"), " > - << "File(" << File << "), " > - << "Line(" << Line << "), " > - << "TyDesc(" << TyDesc << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -GlobalDesc::GlobalDesc(unsigned T) > -: AnchoredDesc(T) > -, Context(0) > -, Name("") > -, FullName("") > -, LinkageName("") > -, File(NULL) > -, Line(0) > -, TyDesc(NULL) > -, IsStatic(false) > -, IsDefinition(false) > -{} > - > -/// ApplyToFields - Target the visitor to the fields of the global. > -/// > -void GlobalDesc::ApplyToFields(DIVisitor *Visitor) { > - AnchoredDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Context); > - Visitor->Apply(Name); > - Visitor->Apply(FullName); > - Visitor->Apply(LinkageName); > - Visitor->Apply(File); > - Visitor->Apply(Line); > - Visitor->Apply(TyDesc); > - Visitor->Apply(IsStatic); > - Visitor->Apply(IsDefinition); > -} > - > -//===----------------------------------------------------------------------===// > - > -GlobalVariableDesc::GlobalVariableDesc() > -: GlobalDesc(DW_TAG_variable) > -, Global(NULL) > -{} > - > -// Implement isa/cast/dyncast. > -bool GlobalVariableDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_variable; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the GlobalVariableDesc. > -/// > -void GlobalVariableDesc::ApplyToFields(DIVisitor *Visitor) { > - GlobalDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Global); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *GlobalVariableDesc::getDescString() const { > - return "llvm.dbg.global_variable"; > -} > - > -/// getTypeString - Return a string used to label this descriptors type. > -/// > -const char *GlobalVariableDesc::getTypeString() const { > - return "llvm.dbg.global_variable.type"; > -} > - > -/// getAnchorString - Return a string used to label this descriptor's anchor. > -/// > -const char *const GlobalVariableDesc::AnchorString = "llvm.dbg.global_variables"; > -const char *GlobalVariableDesc::getAnchorString() const { > - return AnchorString; > -} > - > -#ifndef NDEBUG > -void GlobalVariableDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Anchor(" << getAnchor() << "), " > - << "Name(\"" << getName() << "\"), " > - << "FullName(\"" << getFullName() << "\"), " > - << "LinkageName(\"" << getLinkageName() << "\"), " > - << "File(" << getFile() << ")," > - << "Line(" << getLine() << ")," > - << "Type(" << getType() << "), " > - << "IsStatic(" << (isStatic() ? "true" : "false") << "), " > - << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), " > - << "Global(" << Global << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -SubprogramDesc::SubprogramDesc() > -: GlobalDesc(DW_TAG_subprogram) > -{} > - > -// Implement isa/cast/dyncast. > -bool SubprogramDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_subprogram; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the > -/// SubprogramDesc. > -void SubprogramDesc::ApplyToFields(DIVisitor *Visitor) { > - GlobalDesc::ApplyToFields(Visitor); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *SubprogramDesc::getDescString() const { > - return "llvm.dbg.subprogram"; > -} > - > -/// getTypeString - Return a string used to label this descriptors type. > -/// > -const char *SubprogramDesc::getTypeString() const { > - return "llvm.dbg.subprogram.type"; > -} > - > -/// getAnchorString - Return a string used to label this descriptor's anchor. > -/// > -const char *const SubprogramDesc::AnchorString = "llvm.dbg.subprograms"; > -const char *SubprogramDesc::getAnchorString() const { > - return AnchorString; > -} > - > -#ifndef NDEBUG > -void SubprogramDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << "), " > - << "Anchor(" << getAnchor() << "), " > - << "Name(\"" << getName() << "\"), " > - << "FullName(\"" << getFullName() << "\"), " > - << "LinkageName(\"" << getLinkageName() << "\"), " > - << "File(" << getFile() << ")," > - << "Line(" << getLine() << ")," > - << "Type(" << getType() << "), " > - << "IsStatic(" << (isStatic() ? "true" : "false") << "), " > - << "IsDefinition(" << (isDefinition() ? "true" : "false") << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -BlockDesc::BlockDesc() > -: DebugInfoDesc(DW_TAG_lexical_block) > -, Context(NULL) > -{} > - > -// Implement isa/cast/dyncast. > -bool BlockDesc::classof(const DebugInfoDesc *D) { > - return D->getTag() == DW_TAG_lexical_block; > -} > - > -/// ApplyToFields - Target the visitor to the fields of the BlockDesc. > -/// > -void BlockDesc::ApplyToFields(DIVisitor *Visitor) { > - DebugInfoDesc::ApplyToFields(Visitor); > - > - Visitor->Apply(Context); > -} > - > -/// getDescString - Return a string used to compose global names and labels. > -/// > -const char *BlockDesc::getDescString() const { > - return "llvm.dbg.block"; > -} > - > -/// getTypeString - Return a string used to label this descriptors type. > -/// > -const char *BlockDesc::getTypeString() const { > - return "llvm.dbg.block.type"; > -} > - > -#ifndef NDEBUG > -void BlockDesc::dump() { > - cerr << getDescString() << " " > - << "Version(" << getVersion() << "), " > - << "Tag(" << getTag() << ")," > - << "Context(" << Context << ")\n"; > -} > -#endif > - > -//===----------------------------------------------------------------------===// > - > -DebugInfoDesc *DIDeserializer::Deserialize(Value *V) { > - return Deserialize(getGlobalVariable(V)); > -} > -DebugInfoDesc *DIDeserializer::Deserialize(GlobalVariable *GV) { > - // Handle NULL. > - if (!GV) return NULL; > - > - // Check to see if it has been already deserialized. > - DebugInfoDesc *&Slot = GlobalDescs[GV]; > - if (Slot) return Slot; > - > - // Get the Tag from the global. > - unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); > - > - // Create an empty instance of the correct sort. > - Slot = DebugInfoDesc::DescFactory(Tag); > - > - // If not a user defined descriptor. > - if (Slot) { > - // Deserialize the fields. > - DIDeserializeVisitor DRAM(*this, GV); > - DRAM.ApplyToFields(Slot); > - } > - > - return Slot; > -} > - > -//===----------------------------------------------------------------------===// > - > -/// getStrPtrType - Return a "sbyte *" type. > -/// > -const PointerType *DISerializer::getStrPtrType() { > - // If not already defined. > - if (!StrPtrTy) { > - // Construct the pointer to signed bytes. > - StrPtrTy = PointerType::getUnqual(Type::Int8Ty); > - } > - > - return StrPtrTy; > -} > - > -/// getEmptyStructPtrType - Return a "{ }*" type. > -/// > -const PointerType *DISerializer::getEmptyStructPtrType() { > - // If not already defined. > - if (EmptyStructPtrTy) return EmptyStructPtrTy; > - > - // Construct the pointer to empty structure type. > - const StructType *EmptyStructTy = StructType::get(NULL, NULL); > - > - // Construct the pointer to empty structure type. > - EmptyStructPtrTy = PointerType::getUnqual(EmptyStructTy); > - return EmptyStructPtrTy; > -} > - > -/// getTagType - Return the type describing the specified descriptor (via tag.) > -/// > -const StructType *DISerializer::getTagType(DebugInfoDesc *DD) { > - // Attempt to get the previously defined type. > - StructType *&Ty = TagTypes[DD->getTag()]; > - > - // If not already defined. > - if (!Ty) { > - // Set up fields vector. > - std::vector Fields; > - // Get types of fields. > - DIGetTypesVisitor GTAM(*this, Fields); > - GTAM.ApplyToFields(DD); > - > - // Construct structured type. > - Ty = StructType::get(Fields); > - > - // Register type name with module. > - M->addTypeName(DD->getTypeString(), Ty); > - } > - > - return Ty; > -} > - > -/// getString - Construct the string as constant string global. > -/// > -Constant *DISerializer::getString(const std::string &String) { > - // Check string cache for previous edition. > - Constant *&Slot = StringCache[String]; > - > - // Return Constant if previously defined. > - if (Slot) return Slot; > - > - // If empty string then use a sbyte* null instead. > - if (String.empty()) { > - Slot = ConstantPointerNull::get(getStrPtrType()); > - } else { > - // Construct string as an llvm constant. > - Constant *ConstStr = ConstantArray::get(String); > - > - // Otherwise create and return a new string global. > - GlobalVariable *StrGV = new GlobalVariable(ConstStr->getType(), true, > - GlobalVariable::InternalLinkage, > - ConstStr, ".str", M); > - StrGV->setSection("llvm.metadata"); > - > - // Convert to generic string pointer. > - Slot = ConstantExpr::getBitCast(StrGV, getStrPtrType()); > - } > - > - return Slot; > - > -} > - > -/// Serialize - Recursively cast the specified descriptor into a GlobalVariable > -/// so that it can be serialized to a .bc or .ll file. > -GlobalVariable *DISerializer::Serialize(DebugInfoDesc *DD) { > - // Check if the DebugInfoDesc is already in the map. > - GlobalVariable *&Slot = DescGlobals[DD]; > - > - // See if DebugInfoDesc exists, if so return prior GlobalVariable. > - if (Slot) return Slot; > - > - // Get the type associated with the Tag. > - const StructType *Ty = getTagType(DD); > - > - // Create the GlobalVariable early to prevent infinite recursion. > - GlobalVariable *GV = new GlobalVariable(Ty, true, DD->getLinkage(), > - NULL, DD->getDescString(), M); > - GV->setSection("llvm.metadata"); > - > - // Insert new GlobalVariable in DescGlobals map. > - Slot = GV; > - > - // Set up elements vector > - std::vector Elements; > - // Add fields. > - DISerializeVisitor SRAM(*this, Elements); > - SRAM.ApplyToFields(DD); > - > - // Set the globals initializer. > - GV->setInitializer(ConstantStruct::get(Ty, Elements)); > - > - return GV; > -} > - > -/// addDescriptor - Directly connect DD with existing GV. > -void DISerializer::addDescriptor(DebugInfoDesc *DD, > - GlobalVariable *GV) { > - DescGlobals[DD] = GV; > -} > - > -//===----------------------------------------------------------------------===// > - > -/// Verify - Return true if the GlobalVariable appears to be a valid > -/// serialization of a DebugInfoDesc. > -bool DIVerifier::Verify(Value *V) { > - return !V || Verify(getGlobalVariable(V)); > -} > -bool DIVerifier::Verify(GlobalVariable *GV) { > - // NULLs are valid. > - if (!GV) return true; > - > - // Check prior validity. > - unsigned &ValiditySlot = Validity[GV]; > - > - // If visited before then use old state. > - if (ValiditySlot) return ValiditySlot == Valid; > - > - // Assume validity for the time being (recursion.) > - ValiditySlot = Valid; > - > - // Make sure the global is internal or link once (anchor.) > - if (GV->getLinkage() != GlobalValue::InternalLinkage && > - GV->getLinkage() != GlobalValue::LinkOnceLinkage) { > - ValiditySlot = Invalid; > - return false; > - } > - > - // Get the Tag. > - unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); > - > - // Check for user defined descriptors. > - if (Tag == DW_TAG_invalid) { > - ValiditySlot = Valid; > - return true; > - } > - > - // Get the Version. > - unsigned Version = DebugInfoDesc::VersionFromGlobal(GV); > - > - // Check for version mismatch. > - if (Version != LLVMDebugVersion) { > - ValiditySlot = Invalid; > - return false; > - } > - > - // Construct an empty DebugInfoDesc. > - DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag); > - > - // Allow for user defined descriptors. > - if (!DD) return true; > - > - // Get the initializer constant. > - ConstantStruct *CI = cast(GV->getInitializer()); > - > - // Get the operand count. > - unsigned N = CI->getNumOperands(); > - > - // Get the field count. > - unsigned &CountSlot = Counts[Tag]; > - > - if (!CountSlot) > - // Check the operand count to the field count > - CountSlot = CountFields(DD); > - > - // Field count must be at most equal operand count. > - if (CountSlot > N) { > - delete DD; > - ValiditySlot = Invalid; > - return false; > - } > - > - // Check each field for valid type. > - DIVerifyVisitor VRAM(*this, GV); > - VRAM.ApplyToFields(DD); > - > - // Release empty DebugInfoDesc. > - delete DD; > - > - // If fields are not valid. > - if (!VRAM.isValid()) { > - ValiditySlot = Invalid; > - return false; > - } > - > - return true; > -} > - > -/// isVerified - Return true if the specified GV has already been > -/// verified as a debug information descriptor. > -bool DIVerifier::isVerified(GlobalVariable *GV) { > - unsigned &ValiditySlot = Validity[GV]; > - if (ValiditySlot) return ValiditySlot == Valid; > - return false; > -} > - > -//===----------------------------------------------------------------------===// > - > -DebugScope::~DebugScope() { > - for (unsigned i = 0, N = Scopes.size(); i < N; ++i) delete Scopes[i]; > - for (unsigned j = 0, M = Variables.size(); j < M; ++j) delete Variables[j]; > -} > - > -//===----------------------------------------------------------------------===// > - > MachineModuleInfo::MachineModuleInfo() > : ImmutablePass(&ID) > -, DR() > -, VR() > -, CompileUnits() > -, Directories() > -, SourceFiles() > , Lines() > , LabelIDList() > -, ScopeMap() > -, RootScope(NULL) > , FrameMoves() > , LandingPads() > , Personalities() > @@ -1660,16 +73,6 @@ > /// EndFunction - Discard function meta information. > /// > void MachineModuleInfo::EndFunction() { > - // Clean up scope information. > - if (RootScope) { > - delete RootScope; > - ScopeMap.clear(); > - RootScope = NULL; > - } > - > - // Clean up line info. > - Lines.clear(); > - > // Clean up frame info. > FrameMoves.clear(); > > @@ -1682,18 +85,9 @@ > CallsUnwindInit = 0; > } > > -/// getDescFor - Convert a Value to a debug information descriptor. > -/// > -// FIXME - use new Value type when available. > -DebugInfoDesc *MachineModuleInfo::getDescFor(Value *V) { > - return DR.Deserialize(V); > -} > - > /// AnalyzeModule - Scan the module for global debug information. > /// > void MachineModuleInfo::AnalyzeModule(Module &M) { > - SetupCompileUnits(M); > - > // Insert functions in the llvm.used array into UsedFunctions. > GlobalVariable *GV = M.getGlobalVariable("llvm.used"); > if (!GV || !GV->hasInitializer()) return; > @@ -1710,111 +104,6 @@ > } > } > > -/// SetupCompileUnits - Set up the unique vector of compile units. > -/// > -void MachineModuleInfo::SetupCompileUnits(Module &M) { > - std::vector CU; > - getAnchoredDescriptors(M, CU); > - > - for (unsigned i = 0, N = CU.size(); i < N; i++) { > - CompileUnits.insert(CU[i]); > - } > -} > - > -/// getCompileUnits - Return a vector of debug compile units. > -/// > -const UniqueVector MachineModuleInfo::getCompileUnits()const{ > - return CompileUnits; > -} > - > -/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the > -/// named GlobalVariable. > -void > -MachineModuleInfo::getGlobalVariablesUsing(Module &M, > - const std::string &RootName, > - std::vector&Result){ > - return ::getGlobalVariablesUsing(M, RootName, Result); > -} > - > -/// RecordSourceLine - Records location information and associates it with a > -/// debug label. Returns a unique label ID used to generate a label and > -/// provide correspondence to the source line list. > -unsigned MachineModuleInfo::RecordSourceLine(unsigned Line, unsigned Column, > - unsigned Source) { > - unsigned ID = NextLabelID(); > - Lines.push_back(SourceLineInfo(Line, Column, Source, ID)); > - return ID; > -} > - > -/// RecordSource - Register a source file with debug info. Returns an source > -/// ID. > -unsigned MachineModuleInfo::RecordSource(const std::string &Directory, > - const std::string &Source) { > - unsigned DirectoryID = Directories.insert(Directory); > - return SourceFiles.insert(SourceFileInfo(DirectoryID, Source)); > -} > -unsigned MachineModuleInfo::RecordSource(const CompileUnitDesc *CompileUnit) { > - return RecordSource(CompileUnit->getDirectory(), > - CompileUnit->getFileName()); > -} > - > -/// RecordRegionStart - Indicate the start of a region. > -/// > -unsigned MachineModuleInfo::RecordRegionStart(Value *V) { > - // FIXME - need to be able to handle split scopes because of bb cloning. > - DebugInfoDesc *ScopeDesc = DR.Deserialize(V); > - DebugScope *Scope = getOrCreateScope(ScopeDesc); > - unsigned ID = NextLabelID(); > - if (!Scope->getStartLabelID()) Scope->setStartLabelID(ID); > - return ID; > -} > - > -/// RecordRegionEnd - Indicate the end of a region. > -/// > -unsigned MachineModuleInfo::RecordRegionEnd(Value *V) { > - // FIXME - need to be able to handle split scopes because of bb cloning. > - DebugInfoDesc *ScopeDesc = DR.Deserialize(V); > - DebugScope *Scope = getOrCreateScope(ScopeDesc); > - unsigned ID = NextLabelID(); > - Scope->setEndLabelID(ID); > - return ID; > -} > - > -/// RecordVariable - Indicate the declaration of a local variable. > -/// > -void MachineModuleInfo::RecordVariable(GlobalValue *GV, unsigned FrameIndex) { > - VariableDesc *VD = cast(DR.Deserialize(GV)); > - DebugScope *Scope = getOrCreateScope(VD->getContext()); > - DebugVariable *DV = new DebugVariable(VD, FrameIndex); > - Scope->AddVariable(DV); > -} > - > -/// getOrCreateScope - Returns the scope associated with the given descriptor. > -/// > -DebugScope *MachineModuleInfo::getOrCreateScope(DebugInfoDesc *ScopeDesc) { > - DebugScope *&Slot = ScopeMap[ScopeDesc]; > - if (!Slot) { > - // FIXME - breaks down when the context is an inlined function. > - DebugInfoDesc *ParentDesc = NULL; > - if (BlockDesc *Block = dyn_cast(ScopeDesc)) { > - ParentDesc = Block->getContext(); > - } > - DebugScope *Parent = ParentDesc ? getOrCreateScope(ParentDesc) : NULL; > - Slot = new DebugScope(Parent, ScopeDesc); > - if (Parent) { > - Parent->AddScope(Slot); > - } else if (RootScope) { > - // FIXME - Add inlined function scopes to the root so we can delete > - // them later. Long term, handle inlined functions properly. > - RootScope->AddScope(Slot); > - } else { > - // First function is top level function. > - RootScope = Slot; > - } > - } > - return Slot; > -} > - > //===-EH-------------------------------------------------------------------===// > > /// getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62199&r1=62198&r2=62199&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 13 17:54:55 2009 > @@ -2041,7 +2041,7 @@ > GlobalVariable *GV = dyn_cast(GA->getGlobal()); > if (!GV) return false; > MachineModuleInfo *MMI = getMachineModuleInfo(); > - return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV); > + return MMI && MMI->hasDebugInfo(); > } > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From edwintorok at gmail.com Wed Jan 14 13:32:21 2009 From: edwintorok at gmail.com (=?ISO-8859-1?Q?T=F6r=F6k_Edwin?=) Date: Wed, 14 Jan 2009 21:32:21 +0200 Subject: [llvm-commits] [llvm] r62199 - in /llvm/trunk: include/llvm/CodeGen/MachineModuleInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/MachineModuleInfo.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp In-Reply-To: <496E38B9.8060002@cs.uiuc.edu> References: <200901132354.n0DNsuWr016259@zion.cs.uiuc.edu> <496E38B9.8060002@cs.uiuc.edu> Message-ID: <496E3DC5.40605@gmail.com> On 2009-01-14 21:10, John Criswell wrote: > I have some code from Edwin Torok that I'm using which currently relies > upon these Debug Info classes. Hi John, I assume you are refering to my SourceLocator class. That should have been superceded by the findStopPoint(), findBBStopPoint() and findDbgDeclare() in include/llvm/Analysis/DebugInfo.h. See lib/Analysis/DbgInfoPrinter.cpp for example usage. The DI* classes each take a GlobalVariable (that you usually obtain via DbgStopPoint->getVariable()), and then provide you accessor methods for all the details of that particular debug descriptor. All in all it should provide the same info SourceLocator provided, and they don't need DIDeserializer. [I think I CC'ed you when that patch was committed to mainline, sorry if I didn't.] Best regards, --Edwin From clattner at apple.com Wed Jan 14 13:42:09 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 14 Jan 2009 11:42:09 -0800 Subject: [llvm-commits] [llvm] r62236 - /llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> Message-ID: <33D66CD4-8D24-4EB9-8CFB-59B7C0B92FEC@apple.com> On Jan 14, 2009, at 9:51 AM, Nuno Lopes wrote: > Author: nlopes > Date: Wed Jan 14 11:51:41 2009 > New Revision: 62236 > > URL: http://llvm.org/viewvc/llvm-project?rev=62236&view=rev > Log: > fix crash in the case when some arg is null Hi Nuno, When can operands be null? -Chris > > > Modified: > llvm/trunk/lib/VMCore/AsmWriter.cpp > > Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62236&r1=62235&r2=62236&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) > +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Jan 14 11:51:41 2009 > @@ -1671,7 +1671,7 @@ > } else { > for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) { > Operand = I.getOperand(i); > - if (Operand->getType() != TheType) { > + if (Operand && Operand->getType() != TheType) { > PrintAllTypes = true; // We have differing types! > Print them all! > break; > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Wed Jan 14 14:10:24 2009 From: dpatel at apple.com (Devang Patel) Date: Wed, 14 Jan 2009 20:10:24 -0000 Subject: [llvm-commits] [llvm] r62243 - /llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Message-ID: <200901142010.n0EKAPLl003068@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jan 14 14:10:24 2009 New Revision: 62243 URL: http://llvm.org/viewvc/llvm-project?rev=62243&view=rev Log: xfail for now. Modified: llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Modified: llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2006-11-06-StackTrace.cpp?rev=62243&r1=62242&r2=62243&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp (original) +++ llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Wed Jan 14 14:10:24 2009 @@ -12,6 +12,7 @@ // Only works on ppc, x86 and x86_64. Should generalize? // FIXME: Un-XFAIL this test for Linux when debug stuff is working again. // XFAIL: alpha|ia64|arm|linux +// XFAIL: * #include From nunoplopes at sapo.pt Wed Jan 14 14:17:24 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Wed, 14 Jan 2009 20:17:24 -0000 Subject: [llvm-commits] [llvm] r62236 -/llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: <33D66CD4-8D24-4EB9-8CFB-59B7C0B92FEC@apple.com> References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> <33D66CD4-8D24-4EB9-8CFB-59B7C0B92FEC@apple.com> Message-ID: > On Jan 14, 2009, at 9:51 AM, Nuno Lopes wrote: > >> Author: nlopes >> Date: Wed Jan 14 11:51:41 2009 >> New Revision: 62236 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=62236&view=rev >> Log: >> fix crash in the case when some arg is null > > Hi Nuno, > > When can operands be null? > > -Chris There are some passes that nullify the args when doing cleanups. This check really helps when you're debuging and call dump(). This way it won't crash the app. IMHO, it doesn't hurt much and helps when debugging (anyway the writeOperand() code does the same). Nuno >> Modified: >> llvm/trunk/lib/VMCore/AsmWriter.cpp >> >> Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62236&r1=62235&r2=62236&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) >> +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Jan 14 11:51:41 2009 >> @@ -1671,7 +1671,7 @@ >> } else { >> for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) { >> Operand = I.getOperand(i); >> - if (Operand->getType() != TheType) { >> + if (Operand && Operand->getType() != TheType) { >> PrintAllTypes = true; // We have differing types! >> Print them all! >> break; >> } >> >> From clattner at apple.com Wed Jan 14 14:45:47 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 14 Jan 2009 12:45:47 -0800 Subject: [llvm-commits] [llvm] r62236 -/llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> <33D66CD4-8D24-4EB9-8CFB-59B7C0B92FEC@apple.com> Message-ID: On Jan 14, 2009, at 12:17 PM, Nuno Lopes wrote: >> On Jan 14, 2009, at 9:51 AM, Nuno Lopes wrote: >> >>> Author: nlopes >>> Date: Wed Jan 14 11:51:41 2009 >>> New Revision: 62236 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=62236&view=rev >>> Log: >>> fix crash in the case when some arg is null >> >> Hi Nuno, >> >> When can operands be null? >> >> -Chris > > There are some passes that nullify the args when doing cleanups. > This check > really helps when you're debuging and call dump(). This way it won't > crash > the app. > IMHO, it doesn't hurt much and helps when debugging (anyway the > writeOperand() code does the same). Ok. Please add a comment indicating that this shouldn't happen, but helps make dump() more tolerant of malformed IR, thanks! -Chris From sabre at nondot.org Wed Jan 14 15:01:17 2009 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Jan 2009 21:01:17 -0000 Subject: [llvm-commits] [llvm] r62244 - in /llvm/trunk: lib/Transforms/Scalar/SCCP.cpp test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll Message-ID: <200901142101.n0EL1HwX004856@zion.cs.uiuc.edu> Author: lattner Date: Wed Jan 14 15:01:16 2009 New Revision: 62244 URL: http://llvm.org/viewvc/llvm-project?rev=62244&view=rev Log: Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad! Added: llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=62244&r1=62243&r2=62244&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Wed Jan 14 15:01:16 2009 @@ -1749,8 +1749,7 @@ } else { for (BasicBlock::iterator BI = BB->begin(), E = BB->end(); BI != E; ) { Instruction *Inst = BI++; - if (Inst->getType() == Type::VoidTy || - isa(Inst)) + if (Inst->getType() == Type::VoidTy) continue; LatticeVal &IV = Values[Inst]; @@ -1766,7 +1765,7 @@ Inst->replaceAllUsesWith(Const); // Delete the instruction. - if (!isa(Inst)) + if (!isa(Inst) && !isa(Inst)) Inst->eraseFromParent(); // Hey, we just changed something! Added: llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll?rev=62244&view=auto ============================================================================== --- llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll (added) +++ llvm/trunk/test/Transforms/SCCP/2009-01-14-IPSCCP-Invoke.ll Wed Jan 14 15:01:16 2009 @@ -0,0 +1,28 @@ +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 42} +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep {ret i32 undef} +; PR3325 + +define i32 @main() { + %tmp1 = invoke i32 @f() + to label %UnifiedReturnBlock unwind label %lpad + +lpad: + unreachable + +UnifiedReturnBlock: + ret i32 %tmp1 +} + +define internal i32 @f() { + ret i32 42 +} + +declare i8* @__cxa_begin_catch(i8*) nounwind + +declare i8* @llvm.eh.exception() nounwind + +declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind + +declare void @__cxa_end_catch() + +declare i32 @__gxx_personality_v0(...) From eli.friedman at gmail.com Wed Jan 14 15:17:20 2009 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 14 Jan 2009 13:17:20 -0800 Subject: [llvm-commits] [llvm] r62045 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp In-Reply-To: <496E0C68.1070209@lip6.fr> References: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> <496E0C68.1070209@lip6.fr> Message-ID: On Wed, Jan 14, 2009 at 8:01 AM, Nicolas Geoffray wrote: > Quick question folllowing this patch. Getting the size of a type is > platform dependent, and since InstCombine makes lots of uses of > getTypeSize, InstCombine is therefore platform dependent. Is this OK? I > know this patch did not introduce the platform-dependency, but I was > just curious if that's OK, and if LLVM considers transformation passes > strongly platform dependent. Some passes are target-dependent, and some passes aren't. Passes which depend on platform-specific stuff use something like "AU.addRequired();" in getAnalysisUsage(). There hasn't really been much need for target-independent optimization passes, so InstCombine always requires TargetData even through it could do useful stuff without it. If you need a target-independent version of InstCombine (or for another pass in a similar situation), a patch to allow instantiating a version of InstCombine without the TargetData dependency would probably be okay. -Eli From foldr at codedgers.com Wed Jan 14 20:04:56 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 15 Jan 2009 02:04:56 -0000 Subject: [llvm-commits] [llvm] r62249 - in /llvm/trunk: docs/CompilerDriver.html tools/llvmc/doc/LLVMC-Reference.rst Message-ID: <200901150204.n0F24vd4014976@zion.cs.uiuc.edu> Author: foldr Date: Wed Jan 14 20:04:54 2009 New Revision: 62249 URL: http://llvm.org/viewvc/llvm-project?rev=62249&view=rev Log: Clarify the documentation a bit. Modified: llvm/trunk/docs/CompilerDriver.html llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Modified: llvm/trunk/docs/CompilerDriver.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerDriver.html?rev=62249&r1=62248&r2=62249&view=diff ============================================================================== --- llvm/trunk/docs/CompilerDriver.html (original) +++ llvm/trunk/docs/CompilerDriver.html Wed Jan 14 20:04:54 2009 @@ -263,13 +263,18 @@
  • Possible option types:

      -
    • switch_option - a simple boolean switch, for example -time.
    • -
    • parameter_option - option that takes an argument, for example --std=c99;
    • +
    • switch_option - a simple boolean switch without arguments, +for example -O2 or -time.
    • +
    • parameter_option - option that takes one argument, for +example -std=c99. It is also allowed to use spaces instead of +the equality sign: -std c99.
    • parameter_list_option - same as the above, but more than one -occurence of the option is allowed.
    • -
    • prefix_option - same as the parameter_option, but the option name -and parameter value are not separated.
    • +option occurence is allowed. +
    • prefix_option - same as the parameter_option, but the option +name and argument do not have to be separated. Example: +-ofile. This can be also specified as -o file; however, +-o=file will be parsed incorrectly (=file will be +interpreted as option value).
    • prefix_list_option - same as the above, but more than one occurence of the option is allowed; example: -lm -lpthread.
    • alias_option - a special option type for creating @@ -588,7 +593,7 @@ Mikhail Glushenkov
      LLVM Compiler Infrastructure
      -Last modified: $Date$ +Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $ Modified: llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst?rev=62249&r1=62248&r2=62249&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst (original) +++ llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Wed Jan 14 20:04:54 2009 @@ -262,16 +262,21 @@ * Possible option types: - - ``switch_option`` - a simple boolean switch, for example ``-time``. + - ``switch_option`` - a simple boolean switch without arguments, + for example ``-O2`` or ``-time``. - - ``parameter_option`` - option that takes an argument, for example - ``-std=c99``; + - ``parameter_option`` - option that takes one argument, for + example ``-std=c99``. It is also allowed to use spaces instead of + the equality sign: ``-std c99``. - ``parameter_list_option`` - same as the above, but more than one - occurence of the option is allowed. + option occurence is allowed. - - ``prefix_option`` - same as the parameter_option, but the option name - and parameter value are not separated. + - ``prefix_option`` - same as the parameter_option, but the option + name and argument do not have to be separated. Example: + ``-ofile``. This can be also specified as ``-o file``; however, + ``-o=file`` will be parsed incorrectly (``=file`` will be + interpreted as option value). - ``prefix_list_option`` - same as the above, but more than one occurence of the option is allowed; example: ``-lm -lpthread``. From foldr at codedgers.com Wed Jan 14 20:42:40 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 15 Jan 2009 02:42:40 -0000 Subject: [llvm-commits] [llvm] r62251 - in /llvm/trunk: docs/CompilerDriver.html tools/llvmc/doc/LLVMC-Reference.rst Message-ID: <200901150242.n0F2gfc7016236@zion.cs.uiuc.edu> Author: foldr Date: Wed Jan 14 20:42:40 2009 New Revision: 62251 URL: http://llvm.org/viewvc/llvm-project?rev=62251&view=rev Log: Some small documentation fixes. Modified: llvm/trunk/docs/CompilerDriver.html llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Modified: llvm/trunk/docs/CompilerDriver.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerDriver.html?rev=62251&r1=62250&r2=62251&view=diff ============================================================================== --- llvm/trunk/docs/CompilerDriver.html (original) +++ llvm/trunk/docs/CompilerDriver.html Wed Jan 14 20:42:40 2009 @@ -290,9 +290,10 @@
    • help - help string associated with this option. Used for --help output.
    • required - this option is obligatory.
    • -
    • hidden - this option should not appear in the --help -output (but should appear in the --help-hidden output).
    • -
    • really_hidden - the option should not appear in any help +
    • hidden - the description of this option will not appear in +the --help output (but will appear in the --help-hidden +output).
    • +
    • really_hidden - the option will not be mentioned in any help output.
    • extern - this option is defined in some other plugin, see below.
    @@ -303,7 +304,7 @@

    External options

    Sometimes, when linking several plugins together, one plugin needs to access options defined in some other plugin. Because of the way -options are implemented, such options should be marked as +options are implemented, such options must be marked as extern. This is what the extern option property is for. Example:

    @@ -574,13 +575,13 @@
     Ghostview are installed. There is also a --dump-graph option that
     creates a Graphviz source file (compilation-graph.dot) in the
     current directory.

    -

    Another useful option is --check-graph. It checks the compilation -graph for common errors like mismatched output/input language names, -multiple default edges and cycles. These checks can't be performed at -compile-time because the plugins can load code dynamically. When -invoked with --check-graph, llvmc doesn't perform any -compilation tasks and returns the number of encountered errors as its -status code.

    +

    Another useful llvmc option is --check-graph. It checks the +compilation graph for common errors like mismatched output/input +language names, multiple default edges and cycles. These checks can't +be performed at compile-time because the plugins can load code +dynamically. When invoked with --check-graph, llvmc doesn't +perform any compilation tasks and returns the number of encountered +errors as its status code.


    Modified: llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst?rev=62251&r1=62250&r2=62251&view=diff ============================================================================== --- llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst (original) +++ llvm/trunk/tools/llvmc/doc/LLVMC-Reference.rst Wed Jan 14 20:42:40 2009 @@ -294,10 +294,11 @@ - ``required`` - this option is obligatory. - - ``hidden`` - this option should not appear in the ``--help`` - output (but should appear in the ``--help-hidden`` output). + - ``hidden`` - the description of this option will not appear in + the ``--help`` output (but will appear in the ``--help-hidden`` + output). - - ``really_hidden`` - the option should not appear in any help + - ``really_hidden`` - the option will not be mentioned in any help output. - ``extern`` - this option is defined in some other plugin, see below. @@ -307,7 +308,7 @@ Sometimes, when linking several plugins together, one plugin needs to access options defined in some other plugin. Because of the way -options are implemented, such options should be marked as +options are implemented, such options must be marked as ``extern``. This is what the ``extern`` option property is for. Example:: @@ -614,13 +615,13 @@ creates a Graphviz source file (``compilation-graph.dot``) in the current directory. -Another useful option is ``--check-graph``. It checks the compilation -graph for common errors like mismatched output/input language names, -multiple default edges and cycles. These checks can't be performed at -compile-time because the plugins can load code dynamically. When -invoked with ``--check-graph``, ``llvmc`` doesn't perform any -compilation tasks and returns the number of encountered errors as its -status code. +Another useful ``llvmc`` option is ``--check-graph``. It checks the +compilation graph for common errors like mismatched output/input +language names, multiple default edges and cycles. These checks can't +be performed at compile-time because the plugins can load code +dynamically. When invoked with ``--check-graph``, ``llvmc`` doesn't +perform any compilation tasks and returns the number of encountered +errors as its status code. .. _Graphviz: http://www.graphviz.org/ .. _Ghostview: http://pages.cs.wisc.edu/~ghost/ From sabre at nondot.org Wed Jan 14 21:56:33 2009 From: sabre at nondot.org (Chris Lattner) Date: Thu, 15 Jan 2009 03:56:33 -0000 Subject: [llvm-commits] [test-suite] r62252 - in /test-suite/trunk: External/SPEC/Makefile.spec Makefile.programs Message-ID: <200901150356.n0F3uXXD018498@zion.cs.uiuc.edu> Author: lattner Date: Wed Jan 14 21:56:33 2009 New Revision: 62252 URL: http://llvm.org/viewvc/llvm-project?rev=62252&view=rev Log: make bugpoint-jit should run with -safe-run-llc. CBE often doesn't follow the same abi as the jit in cases where fastcc occurs etc. Modified: test-suite/trunk/External/SPEC/Makefile.spec test-suite/trunk/Makefile.programs Modified: test-suite/trunk/External/SPEC/Makefile.spec URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/External/SPEC/Makefile.spec?rev=62252&r1=62251&r2=62252&view=diff ============================================================================== --- test-suite/trunk/External/SPEC/Makefile.spec (original) +++ test-suite/trunk/External/SPEC/Makefile.spec Wed Jan 14 21:56:33 2009 @@ -147,7 +147,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-jit): \ Output/%.bugpoint-jit: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat $(SPEC_SANDBOX) bugpoint-$(RUN_TYPE) $@ $(REF_IN_DIR) \ - $(LBUGPOINT) ../$*.llvm.bc -run-jit $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) + $(LBUGPOINT) ../$*.llvm.bc -safe-run-llc -run-jit $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) @echo "===> Leaving Output/bugpoint-$(RUN_TYPE)" $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-jit-beta): \ Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=62252&r1=62251&r2=62252&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Wed Jan 14 21:56:33 2009 @@ -541,7 +541,7 @@ $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-jit): \ Output/%.bugpoint-jit: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat - $(LBUGPOINT) $< -run-jit $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) + $(LBUGPOINT) $< -run-jit -safe-run-llc $(BUGPOINT_OPTIONS) $(BUGPOINT_ARGS) $(PROGRAMS_TO_TEST:%=Output/%.bugpoint-cbe): \ Output/%.bugpoint-cbe: Output/%.llvm.bc $(LBUGPOINT) Output/%.out-nat From scottm at aero.org Wed Jan 14 22:41:47 2009 From: scottm at aero.org (Scott Michel) Date: Thu, 15 Jan 2009 04:41:47 -0000 Subject: [llvm-commits] [llvm] r62254 - in /llvm/trunk: lib/Target/CellSPU/SPU64InstrInfo.td lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td lib/Target/CellSPU/SPUNodes.td test/CodeGen/CellSPU/i64ops.ll test/CodeGen/CellSPU/useful-harnesses/i64operations.c Message-ID: <200901150441.n0F4flAg019893@zion.cs.uiuc.edu> Author: pingbak Date: Wed Jan 14 22:41:47 2009 New Revision: 62254 URL: http://llvm.org/viewvc/llvm-project?rev=62254&view=rev Log: - Convert remaining i64 custom lowering into custom instruction emission sequences in SPUDAGToDAGISel.cpp and SPU64InstrInfo.td, killing custom DAG node types as needed. - i64 mul is now a legal instruction, but emits an instruction sequence that stretches tblgen and the imagination, as well as violating laws of several small countries and most southern US states (just kidding, but looking at a function with 80+ parameters is really weird and just plain wrong.) - Update tests as needed. Modified: llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td llvm/trunk/lib/Target/CellSPU/SPUNodes.td llvm/trunk/test/CodeGen/CellSPU/i64ops.ll llvm/trunk/test/CodeGen/CellSPU/useful-harnesses/i64operations.c Modified: llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td Wed Jan 14 22:41:47 2009 @@ -2,7 +2,6 @@ // // Cell SPU 64-bit operations // -// Primary author: Scott Michel (scottm at aero.org) //===----------------------------------------------------------------------===// //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ @@ -240,3 +239,145 @@ // i64 setult: def : I64SETCCNegCond; def : I64SELECTNegCond; + +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ +// v2i64, i64 add +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ + +class v2i64_add_cg: + CodeFrag<(CGv4i32 lhs, rhs)>; + +class v2i64_add_1: + CodeFrag<(ADDXv4i32 lhs, rhs, (SHUFBv4i32 cg, cg, cg_mask))>; + +class v2i64_add: + v2i64_add_1.Fragment, cg_mask>; + +def : Pat<(SPUadd64 R64C:$rA, R64C:$rB, (v4i32 VECREG:$rCGmask)), + (ORi64_v2i64 v2i64_add<(ORv2i64_i64 R64C:$rA), + (ORv2i64_i64 R64C:$rB), + (v4i32 VECREG:$rCGmask)>.Fragment)>; + +def : Pat<(SPUadd64 (v2i64 VECREG:$rA), (v2i64 VECREG:$rB), + (v4i32 VECREG:$rCGmask)), + v2i64_add<(v2i64 VECREG:$rA), + (v2i64 VECREG:$rB), + (v4i32 VECREG:$rCGmask)>.Fragment>; + +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ +// v2i64, i64 subtraction +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ + +class v2i64_sub_bg: CodeFrag<(BGv4i32 lhs, rhs)>; + +class v2i64_sub: + CodeFrag<(SFXv4i32 lhs, rhs, (SHUFBv4i32 bg, bg, bg_mask))>; + +def : Pat<(SPUsub64 R64C:$rA, R64C:$rB, (v4i32 VECREG:$rCGmask)), + (ORi64_v2i64 v2i64_sub<(ORv2i64_i64 R64C:$rA), + (ORv2i64_i64 R64C:$rB), + v2i64_sub_bg<(ORv2i64_i64 R64C:$rA), + (ORv2i64_i64 R64C:$rB)>.Fragment, + (v4i32 VECREG:$rCGmask)>.Fragment)>; + +def : Pat<(SPUsub64 (v2i64 VECREG:$rA), (v2i64 VECREG:$rB), + (v4i32 VECREG:$rCGmask)), + v2i64_sub<(v2i64 VECREG:$rA), + (v2i64 VECREG:$rB), + v2i64_sub_bg<(v2i64 VECREG:$rA), + (v2i64 VECREG:$rB)>.Fragment, + (v4i32 VECREG:$rCGmask)>.Fragment>; + +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ +// v2i64, i64 multiply +// +// Note: i64 multiply is simply the vector->scalar conversion of the +// full-on v2i64 multiply, since the entire vector has to be manipulated +// anyway. +//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ + +class v2i64_mul_ahi64 : + CodeFrag<(SELBv4i32 rA, (ILv4i32 0), (FSMBIv4i32 0x0f0f))>; + +class v2i64_mul_bhi64 : + CodeFrag<(SELBv4i32 rB, (ILv4i32 0), (FSMBIv4i32 0x0f0f))>; + +class v2i64_mul_alo64 : + CodeFrag<(SELBv4i32 rB, (ILv4i32 0), (FSMBIv4i32 0xf0f0))>; + +class v2i64_mul_blo64 : + CodeFrag<(SELBv4i32 rB, (ILv4i32 0), (FSMBIv4i32 0xf0f0))>; + +class v2i64_mul_ashlq2: + CodeFrag<(SHLQBYIv4i32 rA, 0x2)>; + +class v2i64_mul_ashlq4: + CodeFrag<(SHLQBYIv4i32 rA, 0x4)>; + +class v2i64_mul_bshlq2 : + CodeFrag<(SHLQBYIv4i32 rB, 0x2)>; + +class v2i64_mul_bshlq4 : + CodeFrag<(SHLQBYIv4i32 rB, 0x4)>; + +class v2i64_highprod: + CodeFrag<(Av4i32 + (Av4i32 + (MPYUv4i32 v2i64_mul_bshlq4.Fragment, // a1 x b3 + v2i64_mul_ahi64.Fragment), + (MPYHv4i32 v2i64_mul_ahi64.Fragment, // a0 x b3 + v2i64_mul_bshlq4.Fragment)), + (Av4i32 + (MPYHv4i32 v2i64_mul_bhi64.Fragment, + v2i64_mul_ashlq4.Fragment), + (Av4i32 + (MPYHv4i32 v2i64_mul_ashlq4.Fragment, + v2i64_mul_bhi64.Fragment), + (Av4i32 + (MPYUv4i32 v2i64_mul_ashlq4.Fragment, + v2i64_mul_bhi64.Fragment), + (Av4i32 + (MPYHv4i32 v2i64_mul_ashlq2.Fragment, + v2i64_mul_bshlq2.Fragment), + (MPYUv4i32 v2i64_mul_ashlq2.Fragment, + v2i64_mul_bshlq2.Fragment))))))>; + +class v2i64_mul_a3_b3: + CodeFrag<(MPYUv4i32 v2i64_mul_alo64.Fragment, + v2i64_mul_blo64.Fragment)>; + +class v2i64_mul_a2_b3: + CodeFrag<(SELBv4i32 (SHLQBYIv4i32 + (MPYHHUv4i32 v2i64_mul_alo64.Fragment, + v2i64_mul_bshlq2.Fragment), 0x2), + (ILv4i32 0), + (FSMBIv4i32 0xc3c3))>; + +class v2i64_mul_a3_b2: + CodeFrag<(SELBv4i32 (SHLQBYIv4i32 + (MPYHHUv4i32 v2i64_mul_blo64.Fragment, + v2i64_mul_ashlq2.Fragment), 0x2), + (ILv4i32 0), + (FSMBIv4i32 0xc3c3))>; + +class v2i64_lowsum: + v2i64_add.Fragment, + v2i64_mul_a2_b3.Fragment, rCGmask>.Fragment, + v2i64_mul_a3_b2.Fragment, rCGmask>; + +class v2i64_mul: + v2i64_add.Fragment, + (SELBv4i32 v2i64_highprod.Fragment, + (ILv4i32 0), + (FSMBIv4i32 0x0f0f)), + rCGmask>; + +def : Pat<(SPUmul64 R64C:$rA, R64C:$rB, (v4i32 VECREG:$rCGmask)), + (ORi64_v2i64 v2i64_mul<(ORv2i64_i64 R64C:$rA), + (ORv2i64_i64 R64C:$rB), + (v4i32 VECREG:$rCGmask)>.Fragment)>; + +def : Pat<(SPUmul64 (v2i64 VECREG:$rA), (v2i64 VECREG:$rB), + (v4i32 VECREG:$rCGmask)), + v2i64_mul<(v2i64 VECREG:$rA), (v2i64 VECREG:$rB), + (v4i32 VECREG:$rCGmask)>.Fragment>; Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Wed Jan 14 22:41:47 2009 @@ -18,11 +18,13 @@ #include "SPUHazardRecognizers.h" #include "SPUFrameInfo.h" #include "SPURegisterNames.h" +#include "SPUTargetMachine.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetOptions.h" #include "llvm/ADT/Statistic.h" #include "llvm/Constants.h" @@ -254,6 +256,26 @@ return CurDAG->getTargetConstant(Imm, SPUtli.getPointerTy()); } + SDNode *emitBuildVector(SDValue build_vec) { + std::vector CV; + + for (size_t i = 0; i < build_vec.getNumOperands(); ++i) { + ConstantSDNode *V = dyn_cast(build_vec.getOperand(i)); + CV.push_back(const_cast(V->getConstantIntValue())); + } + + Constant *CP = ConstantVector::get(CV); + SDValue CPIdx = CurDAG->getConstantPool(CP, SPUtli.getPointerTy()); + unsigned Alignment = 1 << cast(CPIdx)->getAlignment(); + SDValue CGPoolOffset = + SPU::LowerConstantPool(CPIdx, *CurDAG, + SPUtli.getSPUTargetMachine()); + return SelectCode(CurDAG->getLoad(build_vec.getValueType(), + CurDAG->getEntryNode(), CGPoolOffset, + PseudoSourceValue::getConstantPool(), 0, + false, Alignment)); + } + /// Select - Convert the specified operand from a target-independent to a /// target-specific node if it hasn't already been changed. SDNode *Select(SDValue Op); @@ -647,22 +669,82 @@ TFI, Imm0), 0); n_ops = 2; } - } else if (Opc == ISD::ZERO_EXTEND) { - // (zero_extend:i16 (and:i8 , )) - const SDValue &Op1 = N->getOperand(0); - - if (Op.getValueType() == MVT::i16 && Op1.getValueType() == MVT::i8) { - if (Op1.getOpcode() == ISD::AND) { - // Fold this into a single ANDHI. This is often seen in expansions of i1 - // to i8, then i8 to i16 in logical/branching operations. - DEBUG(cerr << "CellSPU: Coalescing (zero_extend:i16 (and:i8 " - ", ))\n"); - NewOpc = SPU::ANDHIi8i16; - Ops[0] = Op1.getOperand(0); - Ops[1] = Op1.getOperand(1); - n_ops = 2; - } + } else if ((Opc == ISD::ZERO_EXTEND || Opc == ISD::ANY_EXTEND) + && OpVT == MVT::i64) { + SDValue Op0 = Op.getOperand(0); + MVT Op0VT = Op0.getValueType(); + MVT Op0VecVT = MVT::getVectorVT(Op0VT, (128 / Op0VT.getSizeInBits())); + MVT OpVecVT = MVT::getVectorVT(OpVT, (128 / OpVT.getSizeInBits())); + SDValue shufMask; + + switch (Op0VT.getSimpleVT()) { + default: + cerr << "CellSPU Select: Unhandled zero/any extend MVT\n"; + abort(); + /*NOTREACHED*/ + break; + case MVT::i32: + shufMask = CurDAG->getNode(ISD::BUILD_VECTOR, MVT::v4i32, + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x00010203, MVT::i32), + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x08090a0b, MVT::i32)); + break; + + case MVT::i16: + shufMask = CurDAG->getNode(ISD::BUILD_VECTOR, MVT::v4i32, + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x80800203, MVT::i32), + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x80800a0b, MVT::i32)); + break; + + case MVT::i8: + shufMask = CurDAG->getNode(ISD::BUILD_VECTOR, MVT::v4i32, + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x80808003, MVT::i32), + CurDAG->getConstant(0x80808080, MVT::i32), + CurDAG->getConstant(0x8080800b, MVT::i32)); + break; } + + SDNode *shufMaskLoad = emitBuildVector(shufMask); + SDNode *PromoteScalar = + SelectCode(CurDAG->getNode(SPUISD::PREFSLOT2VEC, Op0VecVT, Op0)); + + SDValue zextShuffle = + CurDAG->getNode(SPUISD::SHUFB, OpVecVT, + SDValue(PromoteScalar, 0), + SDValue(PromoteScalar, 0), + SDValue(shufMaskLoad, 0)); + + // N.B.: BIT_CONVERT replaces and updates the zextShuffle node, so we + // re-use it in the VEC2PREFSLOT selection without needing to explicitly + // call SelectCode (it's already done for us.) + SelectCode(CurDAG->getNode(ISD::BIT_CONVERT, OpVecVT, zextShuffle)); + return SelectCode(CurDAG->getNode(SPUISD::VEC2PREFSLOT, OpVT, + zextShuffle)); + } else if (Opc == ISD::ADD && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) { + SDNode *CGLoad = + emitBuildVector(SPU::getCarryGenerateShufMask(*CurDAG)); + + return SelectCode(CurDAG->getNode(SPUISD::ADD64_MARKER, OpVT, + Op.getOperand(0), Op.getOperand(1), + SDValue(CGLoad, 0))); + } else if (Opc == ISD::SUB && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) { + SDNode *CGLoad = + emitBuildVector(SPU::getBorrowGenerateShufMask(*CurDAG)); + + return SelectCode(CurDAG->getNode(SPUISD::SUB64_MARKER, OpVT, + Op.getOperand(0), Op.getOperand(1), + SDValue(CGLoad, 0))); + } else if (Opc == ISD::MUL && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) { + SDNode *CGLoad = + emitBuildVector(SPU::getCarryGenerateShufMask(*CurDAG)); + + return SelectCode(CurDAG->getNode(SPUISD::MUL64_MARKER, OpVT, + Op.getOperand(0), Op.getOperand(1), + SDValue(CGLoad, 0))); } else if (Opc == ISD::SHL) { if (OpVT == MVT::i64) { return SelectSHLi64(Op, OpVT); Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Jan 14 22:41:47 2009 @@ -78,6 +78,7 @@ return retval; } + } SPUTargetLowering::SPUTargetLowering(SPUTargetMachine &TM) @@ -208,13 +209,13 @@ // Custom lower i8, i32 and i64 multiplications setOperationAction(ISD::MUL, MVT::i8, Custom); setOperationAction(ISD::MUL, MVT::i32, Legal); - setOperationAction(ISD::MUL, MVT::i64, Expand); // libcall + setOperationAction(ISD::MUL, MVT::i64, Legal); // Need to custom handle (some) common i8, i64 math ops setOperationAction(ISD::ADD, MVT::i8, Custom); - setOperationAction(ISD::ADD, MVT::i64, Custom); + setOperationAction(ISD::ADD, MVT::i64, Legal); setOperationAction(ISD::SUB, MVT::i8, Custom); - setOperationAction(ISD::SUB, MVT::i64, Custom); + setOperationAction(ISD::SUB, MVT::i64, Legal); // SPU does not have BSWAP. It does have i32 support CTLZ. // CTPOP has to be custom lowered. @@ -243,11 +244,6 @@ setOperationAction(ISD::SETCC, MVT::i32, Legal); setOperationAction(ISD::SETCC, MVT::i64, Legal); - // Zero extension and sign extension for i64 have to be - // custom legalized - setOperationAction(ISD::ZERO_EXTEND, MVT::i64, Custom); - setOperationAction(ISD::ANY_EXTEND, MVT::i64, Custom); - // Custom lower i128 -> i64 truncates setOperationAction(ISD::TRUNCATE, MVT::i64, Custom); @@ -416,10 +412,9 @@ node_names[(unsigned) SPUISD::VEC_ROTR] = "SPUISD::VEC_ROTR"; node_names[(unsigned) SPUISD::SELECT_MASK] = "SPUISD::SELECT_MASK"; node_names[(unsigned) SPUISD::SELB] = "SPUISD::SELB"; - node_names[(unsigned) SPUISD::ADD_EXTENDED] = "SPUISD::ADD_EXTENDED"; - node_names[(unsigned) SPUISD::CARRY_GENERATE] = "SPUISD::CARRY_GENERATE"; - node_names[(unsigned) SPUISD::SUB_EXTENDED] = "SPUISD::SUB_EXTENDED"; - node_names[(unsigned) SPUISD::BORROW_GENERATE] = "SPUISD::BORROW_GENERATE"; + node_names[(unsigned) SPUISD::ADD64_MARKER] = "SPUISD::ADD64_MARKER"; + node_names[(unsigned) SPUISD::SUB64_MARKER] = "SPUISD::SUB64_MARKER"; + node_names[(unsigned) SPUISD::MUL64_MARKER] = "SPUISD::MUL64_MARKER"; } std::map::iterator i = node_names.find(Opcode); @@ -778,8 +773,8 @@ return SDValue(); } -/// Generate the address of a constant pool entry. -static SDValue +//! Generate the address of a constant pool entry. +SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) { MVT PtrVT = Op.getValueType(); ConstantPoolSDNode *CP = cast(Op); @@ -805,6 +800,12 @@ return SDValue(); } +//! Alternate entry point for generating the address of a constant pool entry +SDValue +SPU::LowerConstantPool(SDValue Op, SelectionDAG &DAG, const SPUTargetMachine &TM) { + return ::LowerConstantPool(Op, DAG, TM.getSubtargetImpl()); +} + static SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) { MVT PtrVT = Op.getValueType(); @@ -2185,123 +2186,34 @@ return SDValue(); } -static SDValue LowerI64Math(SDValue Op, SelectionDAG &DAG, unsigned Opc) -{ - MVT VT = Op.getValueType(); - MVT VecVT = MVT::getVectorVT(VT, (128 / VT.getSizeInBits())); - - SDValue Op0 = Op.getOperand(0); - - switch (Opc) { - case ISD::ZERO_EXTEND: - case ISD::ANY_EXTEND: { - MVT Op0VT = Op0.getValueType(); - MVT Op0VecVT = MVT::getVectorVT(Op0VT, (128 / Op0VT.getSizeInBits())); - - SDValue PromoteScalar = - DAG.getNode(SPUISD::PREFSLOT2VEC, Op0VecVT, Op0); - - // Use a shuffle to zero extend the i32 to i64 directly: - SDValue shufMask; - - switch (Op0VT.getSimpleVT()) { - default: - cerr << "CellSPU LowerI64Math: Unhandled zero/any extend MVT\n"; - abort(); - /*NOTREACHED*/ - break; - case MVT::i32: - shufMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x00010203, MVT::i32), - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x08090a0b, MVT::i32)); - break; - - case MVT::i16: - shufMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x80800203, MVT::i32), - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x80800a0b, MVT::i32)); - break; - - case MVT::i8: - shufMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x80808003, MVT::i32), - DAG.getConstant(0x80808080, MVT::i32), - DAG.getConstant(0x8080800b, MVT::i32)); - break; - } - - SDValue zextShuffle = DAG.getNode(SPUISD::SHUFB, Op0VecVT, - PromoteScalar, PromoteScalar, shufMask); - - return DAG.getNode(SPUISD::VEC2PREFSLOT, VT, - DAG.getNode(ISD::BIT_CONVERT, VecVT, zextShuffle)); - } - - case ISD::ADD: { - // Turn operands into vectors to satisfy type checking (shufb works on - // vectors) - SDValue Op0 = - DAG.getNode(SPUISD::PREFSLOT2VEC, MVT::v2i64, Op.getOperand(0)); - SDValue Op1 = - DAG.getNode(SPUISD::PREFSLOT2VEC, MVT::v2i64, Op.getOperand(1)); - SmallVector ShufBytes; - - // Create the shuffle mask for "rotating" the borrow up one register slot - // once the borrow is generated. - ShufBytes.push_back(DAG.getConstant(0x04050607, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0x80808080, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0x0c0d0e0f, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0x80808080, MVT::i32)); - - SDValue CarryGen = - DAG.getNode(SPUISD::CARRY_GENERATE, MVT::v2i64, Op0, Op1); - SDValue ShiftedCarry = - DAG.getNode(SPUISD::SHUFB, MVT::v2i64, - CarryGen, CarryGen, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - &ShufBytes[0], ShufBytes.size())); - - return DAG.getNode(SPUISD::VEC2PREFSLOT, MVT::i64, - DAG.getNode(SPUISD::ADD_EXTENDED, MVT::v2i64, - Op0, Op1, ShiftedCarry)); - } - - case ISD::SUB: { - // Turn operands into vectors to satisfy type checking (shufb works on - // vectors) - SDValue Op0 = - DAG.getNode(SPUISD::PREFSLOT2VEC, MVT::v2i64, Op.getOperand(0)); - SDValue Op1 = - DAG.getNode(SPUISD::PREFSLOT2VEC, MVT::v2i64, Op.getOperand(1)); - SmallVector ShufBytes; - - // Create the shuffle mask for "rotating" the borrow up one register slot - // once the borrow is generated. - ShufBytes.push_back(DAG.getConstant(0x04050607, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0xc0c0c0c0, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0x0c0d0e0f, MVT::i32)); - ShufBytes.push_back(DAG.getConstant(0xc0c0c0c0, MVT::i32)); - - SDValue BorrowGen = - DAG.getNode(SPUISD::BORROW_GENERATE, MVT::v2i64, Op0, Op1); - SDValue ShiftedBorrow = - DAG.getNode(SPUISD::SHUFB, MVT::v2i64, - BorrowGen, BorrowGen, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - &ShufBytes[0], ShufBytes.size())); - - return DAG.getNode(SPUISD::VEC2PREFSLOT, MVT::i64, - DAG.getNode(SPUISD::SUB_EXTENDED, MVT::v2i64, - Op0, Op1, ShiftedBorrow)); - } - } +//! Generate the carry-generate shuffle mask. +SDValue SPU::getCarryGenerateShufMask(SelectionDAG &DAG) { +SmallVector ShufBytes; + +// Create the shuffle mask for "rotating" the borrow up one register slot +// once the borrow is generated. +ShufBytes.push_back(DAG.getConstant(0x04050607, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0x80808080, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0x0c0d0e0f, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0x80808080, MVT::i32)); + +return DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + &ShufBytes[0], ShufBytes.size()); +} + +//! Generate the borrow-generate shuffle mask +SDValue SPU::getBorrowGenerateShufMask(SelectionDAG &DAG) { +SmallVector ShufBytes; + +// Create the shuffle mask for "rotating" the borrow up one register slot +// once the borrow is generated. +ShufBytes.push_back(DAG.getConstant(0x04050607, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0xc0c0c0c0, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0x0c0d0e0f, MVT::i32)); +ShufBytes.push_back(DAG.getConstant(0xc0c0c0c0, MVT::i32)); - return SDValue(); +return DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + &ShufBytes[0], ShufBytes.size()); } //! Lower byte immediate operations for v16i8 vectors: @@ -2576,11 +2488,6 @@ case ISD::RET: return LowerRET(Op, DAG, getTargetMachine()); - - case ISD::ZERO_EXTEND: - case ISD::ANY_EXTEND: - return LowerI64Math(Op, DAG, Opc); - // i8, i64 math ops: case ISD::ADD: case ISD::SUB: @@ -2591,8 +2498,6 @@ case ISD::SRA: { if (VT == MVT::i8) return LowerI8Math(Op, DAG, Opc, *this); - else if (VT == MVT::i64) - return LowerI64Math(Op, DAG, Opc); break; } @@ -2831,6 +2736,7 @@ break; } } + // Otherwise, return unchanged. #ifndef NDEBUG if (Result.getNode()) { Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Wed Jan 14 22:41:47 2009 @@ -52,10 +52,11 @@ ROTBYTES_LEFT_BITS, ///< Rotate bytes left by bit shift count SELECT_MASK, ///< Select Mask (FSM, FSMB, FSMH, FSMBI) SELB, ///< Select bits -> (b & mask) | (a & ~mask) - ADD_EXTENDED, ///< Add extended, with carry - CARRY_GENERATE, ///< Carry generate for ADD_EXTENDED - SUB_EXTENDED, ///< Subtract extended, with borrow - BORROW_GENERATE, ///< Borrow generate for SUB_EXTENDED + // Markers: These aren't used to generate target-dependent nodes, but + // are used during instruction selection. + ADD64_MARKER, ///< i64 addition marker + SUB64_MARKER, ///< i64 subtraction marker + MUL64_MARKER, ///< i64 multiply marker LAST_SPUISD ///< Last user-defined instruction }; } @@ -74,6 +75,12 @@ MVT ValueType); SDValue get_v4i32_imm(SDNode *N, SelectionDAG &DAG); SDValue get_v2i64_imm(SDNode *N, SelectionDAG &DAG); + + SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG, + const SPUTargetMachine &TM); + + SDValue getBorrowGenerateShufMask(SelectionDAG &DAG); + SDValue getCarryGenerateShufMask(SelectionDAG &DAG); } class SPUTargetMachine; // forward dec'l. @@ -86,8 +93,18 @@ SPUTargetMachine &SPUTM; public: + //! The venerable constructor + /*! + This is where the CellSPU backend sets operation handling (i.e., legal, + custom, expand or promote.) + */ SPUTargetLowering(SPUTargetMachine &TM); + //! Get the target machine + SPUTargetMachine &getSPUTargetMachine() { + return SPUTM; + } + /// getTargetNodeName() - This method returns the name of a target specific /// DAG node. virtual const char *getTargetNodeName(unsigned Opcode) const; Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Wed Jan 14 22:41:47 2009 @@ -705,17 +705,14 @@ class ADDXVecInst: ADDXInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rCarry), - [(set (vectype VECREG:$rT), - (SPUaddx (vectype VECREG:$rA), (vectype VECREG:$rB), - (vectype VECREG:$rCarry)))]>, + [/* no pattern */]>, RegConstraint<"$rCarry = $rT">, NoEncode<"$rCarry">; class ADDXRegInst: ADDXInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB, rclass:$rCarry), - [(set rclass:$rT, - (SPUaddx rclass:$rA, rclass:$rB, rclass:$rCarry))]>, + [/* no pattern */]>, RegConstraint<"$rCarry = $rT">, NoEncode<"$rCarry">; @@ -737,14 +734,12 @@ class CGVecInst: CGInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), - [(set (vectype VECREG:$rT), - (SPUcarry_gen (vectype VECREG:$rA), (vectype VECREG:$rB)))]>; + [/* no pattern */]>; class CGRegInst: CGInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB), - [(set rclass:$rT, - (SPUcarry_gen rclass:$rA, rclass:$rB))]>; + [/* no pattern */]>; multiclass CarryGenerate { def v2i64 : CGVecInst; @@ -765,17 +760,14 @@ class SFXVecInst: SFXInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rCarry), - [(set (vectype VECREG:$rT), - (SPUsubx (vectype VECREG:$rA), (vectype VECREG:$rB), - (vectype VECREG:$rCarry)))]>, + [/* no pattern */]>, RegConstraint<"$rCarry = $rT">, NoEncode<"$rCarry">; class SFXRegInst: SFXInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB, rclass:$rCarry), - [(set rclass:$rT, - (SPUsubx rclass:$rA, rclass:$rB, rclass:$rCarry))]>, + [/* no pattern */]>, RegConstraint<"$rCarry = $rT">, NoEncode<"$rCarry">; @@ -797,14 +789,12 @@ class BGVecInst: BGInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), - [(set (vectype VECREG:$rT), - (SPUborrow_gen (vectype VECREG:$rA), (vectype VECREG:$rB)))]>; + [/* no pattern */]>; class BGRegInst: BGInst<(outs rclass:$rT), (ins rclass:$rA, rclass:$rB), - [(set rclass:$rT, - (SPUborrow_gen rclass:$rA, rclass:$rB))]>; + [/* no pattern */]>; multiclass BorrowGenerate { def v4i32 : BGVecInst; @@ -894,7 +884,7 @@ "mpya\t$rT, $rA, $rB, $rC", IntegerMulDiv, pattern>; -def MPYAvec: +def MPYAv4i32: MPYAInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB, VECREG:$rC), [(set (v4i32 VECREG:$rT), (add (v4i32 (bitconvert (mul (v8i16 VECREG:$rA), @@ -939,7 +929,7 @@ "mpys\t$rT, $rA, $rB", IntegerMulDiv, [/* no pattern */]>; -def MPYSvec: +def MPYSv4i32: MPYSInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB)>; def MPYSr16: @@ -972,14 +962,20 @@ def MPYHHAr32: MPYHHAInst<(outs R32C:$rT), (ins R32C:$rA, R32C:$rB)>; -// mpyhhu: Multiply high-high, unsigned +// mpyhhu: Multiply high-high, unsigned, e.g.: +// +// +-------+-------+ +-------+-------+ +---------+ +// | a0 . a1 | x | b0 . b1 | = | a0 x b0 | +// +-------+-------+ +-------+-------+ +---------+ +// +// where a0, b0 are the upper 16 bits of the 32-bit word class MPYHHUInst: RRForm<0b01110011110, OOL, IOL, "mpyhhu\t$rT, $rA, $rB", IntegerMulDiv, [/* no pattern */]>; -def MPYHHUvec: +def MPYHHUv4i32: MPYHHUInst<(outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB)>; def MPYHHUr32: Modified: llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUMathInstr.td Wed Jan 14 22:41:47 2009 @@ -8,8 +8,6 @@ // // Any resemblance to libsimdmath or the Cell SDK simdmath library is // purely and completely coincidental. -// -// Primary author: Scott Michel (scottm at aero.org) //===----------------------------------------------------------------------===// //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Modified: llvm/trunk/lib/Target/CellSPU/SPUNodes.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNodes.td?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUNodes.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUNodes.td Wed Jan 14 22:41:47 2009 @@ -61,18 +61,20 @@ def SPUvecshift_type: SDTypeProfile<1, 2, [ SDTCisSameAs<0, 1>, SDTCisInt<2>]>; +// "marker" type for i64 operators that need a shuffle mask +// (i.e., uses cg or bg or another instruction that needs to +// use shufb to get things in the right place.) +// Op0: The result +// Op1, 2: LHS, RHS +// Op3: Carry-generate shuffle mask + +def SPUmarker_type : SDTypeProfile<1, 3, [ + SDTCisInt<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2> ]>; + //===----------------------------------------------------------------------===// // Synthetic/pseudo-instructions //===----------------------------------------------------------------------===// -/// Add extended, carry generate: -def SPUaddx : SDNode<"SPUISD::ADD_EXTENDED", SPUIntTrinaryOp, []>; -def SPUcarry_gen : SDNode<"SPUISD::CARRY_GENERATE", SDTIntBinOp, []>; - -// Subtract extended, borrow generate -def SPUsubx : SDNode<"SPUISD::SUB_EXTENDED", SPUIntTrinaryOp, []>; -def SPUborrow_gen : SDNode<"SPUISD::BORROW_GENERATE", SDTIntBinOp, []>; - // SPU CNTB: def SPUcntb : SDNode<"SPUISD::CNTB", SDTIntUnaryOp>; @@ -127,6 +129,12 @@ // Indirect [D-Form "imm($reg)" and X-Form "$reg($reg)"] addresses def SPUindirect : SDNode<"SPUISD::IndirectAddr", SDTIntBinOp, []>; +// i64 markers: supplies extra operands used to generate the i64 operator +// instruction sequences +def SPUadd64 : SDNode<"SPUISD::ADD64_MARKER", SPUmarker_type, []>; +def SPUsub64 : SDNode<"SPUISD::SUB64_MARKER", SPUmarker_type, []>; +def SPUmul64 : SDNode<"SPUISD::MUL64_MARKER", SPUmarker_type, []>; + //===----------------------------------------------------------------------===// // Constraints: (taken from PPCInstrInfo.td) //===----------------------------------------------------------------------===// Modified: llvm/trunk/test/CodeGen/CellSPU/i64ops.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/i64ops.ll?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/i64ops.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/i64ops.ll Wed Jan 14 22:41:47 2009 @@ -2,9 +2,15 @@ ; RUN: grep xswd %t1.s | count 3 ; RUN: grep xsbh %t1.s | count 1 ; RUN: grep xshw %t1.s | count 2 -; RUN: grep shufb %t1.s | count 4 -; RUN: grep cg %t1.s | count 1 -; RUN: grep addx %t1.s | count 1 +; RUN: grep shufb %t1.s | count 7 +; RUN: grep cg %t1.s | count 4 +; RUN: grep addx %t1.s | count 4 +; RUN: grep fsmbi %t1.s | count 3 +; RUN: grep il %t1.s | count 2 +; RUN: grep mpy %t1.s | count 10 +; RUN: grep mpyh %t1.s | count 6 +; RUN: grep mpyhhu %t1.s | count 2 +; RUN: grep mpyu %t1.s | count 4 ; ModuleID = 'stores.bc' target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" @@ -44,3 +50,8 @@ %1 = add i64 %a, %b ret i64 %1 } + +define i64 @mul_i64(i64 %a, i64 %b) nounwind { + %1 = mul i64 %a, %b + ret i64 %1 +} Modified: llvm/trunk/test/CodeGen/CellSPU/useful-harnesses/i64operations.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/useful-harnesses/i64operations.c?rev=62254&r1=62253&r2=62254&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/useful-harnesses/i64operations.c (original) +++ llvm/trunk/test/CodeGen/CellSPU/useful-harnesses/i64operations.c Wed Jan 14 22:41:47 2009 @@ -7,6 +7,7 @@ int64_t tval_d = 10001LL; int64_t tval_e = 10000LL; uint64_t tval_f = 0xffffff0750135eb9; +int64_t tval_g = -1; /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */ @@ -546,6 +547,12 @@ /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */ +int64_t i64_mul(int64_t a, int64_t b) { + return a * b; +} + +/* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */ + int main(void) { @@ -553,12 +560,13 @@ const char *something_failed = " %d tests failed.\n"; const char *all_tests_passed = " All tests passed.\n"; - printf("tval_a = %20lld (0x%020llx)\n", tval_a, tval_a); - printf("tval_b = %20lld (0x%020llx)\n", tval_b, tval_b); - printf("tval_c = %20lld (0x%020llx)\n", tval_c, tval_c); - printf("tval_d = %20lld (0x%020llx)\n", tval_d, tval_d); - printf("tval_e = %20lld (0x%020llx)\n", tval_e, tval_e); - printf("tval_f = %20llu (0x%020llx)\n", tval_f, tval_f); + printf("tval_a = %20lld (0x%016llx)\n", tval_a, tval_a); + printf("tval_b = %20lld (0x%016llx)\n", tval_b, tval_b); + printf("tval_c = %20lld (0x%016llx)\n", tval_c, tval_c); + printf("tval_d = %20lld (0x%016llx)\n", tval_d, tval_d); + printf("tval_e = %20lld (0x%016llx)\n", tval_e, tval_e); + printf("tval_f = %20llu (0x%016llx)\n", tval_f, tval_f); + printf("tval_g = %20llu (0x%016llx)\n", tval_g, tval_g); printf("----------------------------------------\n"); for (i = 0; i < ARR_SIZE(int64_preds); ++i) { @@ -649,5 +657,17 @@ printf("----------------------------------------\n"); + int64_t result; + + result = i64_mul(tval_g, tval_g); + printf("%20lld * %20lld = %20lld (0x%016llx)\n", tval_g, tval_g, result, result); + result = i64_mul(tval_d, tval_e); + printf("%20lld * %20lld = %20lld (0x%016llx)\n", tval_d, tval_e, result, result); + /* 0xba7a664f13077c9 */ + result = i64_mul(tval_a, tval_b); + printf("%20lld * %20lld = %20lld (0x%016llx)\n", tval_a, tval_b, result, result); + + printf("----------------------------------------\n"); + return 0; } From monping at apple.com Thu Jan 15 00:36:03 2009 From: monping at apple.com (Mon Ping Wang) Date: Wed, 14 Jan 2009 22:36:03 -0800 Subject: [llvm-commits] Patch: insert/extract element using a variable index Message-ID: Hi, We can't use insertps/extractps for insert/extract an element from a <4 x i32> vector using a variable index. This patch will cause Legalize to expand the operator for that case. --- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: vec_insert.patch Type: application/octet-stream Size: 2470 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090114/d8b00dcc/attachment.obj From clattner at apple.com Thu Jan 15 01:40:40 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 14 Jan 2009 23:40:40 -0800 Subject: [llvm-commits] [llvm] r62254 - in /llvm/trunk: lib/Target/CellSPU/SPU64InstrInfo.td lib/Target/CellSPU/SPUISelDAGToDAG.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/CellSPU/SPUISelLowering.h lib/Target/CellSPU/SPUInstrInfo.td lib/Target/CellSPU/SPUMathInstr.td lib/Target/CellSPU/SPUNodes.td test/CodeGen/CellSPU/i64ops.ll test/CodeGen/CellSPU/useful-harnesses/i64operations.c In-Reply-To: <200901150441.n0F4flAg019893@zion.cs.uiuc.edu> References: <200901150441.n0F4flAg019893@zion.cs.uiuc.edu> Message-ID: On Jan 14, 2009, at 8:41 PM, Scott Michel wrote: > +++ llvm/trunk/lib/Target/CellSPU/SPU64InstrInfo.td Wed Jan 14 > 22:41:47 2009 > @@ -2,7 +2,6 @@ > // > // Cell SPU 64-bit operations > // > -// Primary author: Scott Michel (scottm at aero.org) > // > = > = > = > ----------------------------------------------------------------------= > ==// Thanks Scott! -Chris From clattner at apple.com Thu Jan 15 01:53:04 2009 From: clattner at apple.com (Chris Lattner) Date: Wed, 14 Jan 2009 23:53:04 -0800 Subject: [llvm-commits] [llvm] r62045 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp In-Reply-To: <496E0C68.1070209@lip6.fr> References: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> <496E0C68.1070209@lip6.fr> Message-ID: <98B6F687-3514-4E03-B6BB-6813B2B706D8@apple.com> On Jan 14, 2009, at 8:01 AM, Nicolas Geoffray wrote: > Hi Chris, > > Quick question folllowing this patch. Getting the size of a type is > platform dependent, and since InstCombine makes lots of uses of > getTypeSize, InstCombine is therefore platform dependent. Is this > OK? I > know this patch did not introduce the platform-dependency, but I was > just curious if that's OK, and if LLVM considers transformation passes > strongly platform dependent. Hi Nicolas, In the current state of LLVM, this is definitely the right thing to do. However, I don't think that the current state is really what we want. target data info is *optional* in a module. It is always specified by (e.g.) llvm-gcc, but I don't think that target-independent languages like Java should have to specify it. In my ideal world, not specifying a target data string would transparently turn off the subset of optimizations that depend on target data info only (not all instcombines). Pragmatically speaking, the way I would like to (someday) implement this is to change "opt" (and friends) to only add TargetData to the passmanager if the module's targetdata string is non-empty. Doing this today would break all passes that addRequired(). This means that before we can do this, we have to change these passes (like instcombine) to not have a hard requirement on targetdata. IMO, mid-level optimizations that we want to run from "opt" or "llvm- ld" should never call addRequired/ getAnalysis. Instead, they should call getAnalysisToUpdate(). This method returns a pointer if TargetData is around, or returns null if not. That would mean that passes (like instcombine) that want to use targetdata would (for xforms that need it) check to see if the pointer is non-null, then try to do the xform in question. Does this seem reasonable? -Chris From baldrick at free.fr Thu Jan 15 02:42:54 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 09:42:54 +0100 Subject: [llvm-commits] [llvm] r62236 - /llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> Message-ID: <200901150942.54272.baldrick@free.fr> > fix crash in the case when some arg is null Testcase? D. From baldrick at free.fr Thu Jan 15 02:46:33 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 09:46:33 +0100 Subject: [llvm-commits] =?iso-8859-1?q?=5Bllvm=5D_r62045=09-_/llvm/trunk/l?= =?iso-8859-1?q?ib/Transforms/Scalar/InstructionCombining=2Ecpp?= In-Reply-To: <98B6F687-3514-4E03-B6BB-6813B2B706D8@apple.com> References: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> <496E0C68.1070209@lip6.fr> <98B6F687-3514-4E03-B6BB-6813B2B706D8@apple.com> Message-ID: <200901150946.33395.baldrick@free.fr> Hi Chris, > ...Instead, they should call getAnalysisToUpdate(). any objection if I rename getAnalysisToUpdate to getAnalysisIfAvailable? Ciao, Duncan. From baldrick at free.fr Thu Jan 15 03:13:19 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 10:13:19 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <0F92559C-EC5B-48AF-97D3-AFA8CBB0E795@apple.com> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901141246.56489.baldrick@free.fr> <0F92559C-EC5B-48AF-97D3-AFA8CBB0E795@apple.com> Message-ID: <200901151013.20308.baldrick@free.fr> Hi Evan, > Right. I am saying for array_ref that is turned into pointer > arithmetics + load / store i8, just return lvalue with alignment 1. It > is always correct. The down size I see if theoretically this could > prevent some optimization that combine multiple loads / stores into a > larger one. I think we can eliminate most of these potential cases by > calling getPointerAlignment() when the type is POINTER_TYPE. > > The main issue is I'd like to fix the bug where we emit memory > instructions with artificially high alignment. But I am willing to > invest a significant effort to change Emit. I'll cook up with another > patch with those x86-64 linux (which obviously hates me) failures fixed. I think your lvalue scheme is better for the long run than my expr_align one. However, for testing purposes I think it would be a good idea to also enhance expr_align and compare the results of the two schemes. As well as catching mistakes, this may help find places where the alignment produced is suboptimal. As for "Emit", this should not be changed if it can be avoided. Better to emit an alignment of 1 in tricky cases and have the LLVM optimizers improve it. Also, you use the alignment of LLVM types in some places IIRC. This is not great because (1) I think currently LLVM types may be more aligned than the corresponding gcc types (I want to fix this some day); (2) LLVM types can certainly be less aligned than the gcc type, which means you are using a suboptimal value. Finally, I think you have to be very careful in using type alignment at all. Type alignment is great when declaring variables - it gives the default alignment to use for the allocated memory; this default can of course be overridden. However it is basically useless for the purposes of loads and stores: there you need to estimate the minimum alignment that the storee is *guaranteed* to have. Knowing that the storee has a certain type doesn't guarantee anything about it's alignment at all! What is reliable is alignment of objects, i.e. the result of DECL_ALIGN. So I think that anywhere you can't get alignment from an object, you shouldn't use the type alignment, you should use 1 instead. Ciao, Duncan. From ggreif at gmail.com Thu Jan 15 05:10:58 2009 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 15 Jan 2009 11:10:58 -0000 Subject: [llvm-commits] [llvm] r62256 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200901151111.n0FBB0MT010772@zion.cs.uiuc.edu> Author: ggreif Date: Thu Jan 15 05:10:44 2009 New Revision: 62256 URL: http://llvm.org/viewvc/llvm-project?rev=62256&view=rev Log: minor refactoring: use a more specific API Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62256&r1=62255&r2=62256&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Jan 15 05:10:44 2009 @@ -1490,10 +1490,11 @@ MachineBasicBlock *Return = FuncInfo.MBBMap[I.getSuccessor(0)]; MachineBasicBlock *LandingPad = FuncInfo.MBBMap[I.getSuccessor(1)]; - if (isa(I.getCalledValue())) + const Value *Callee(I.getCalledValue()); + if (isa(Callee)) visitInlineAsm(&I); else - LowerCallTo(&I, getValue(I.getOperand(0)), false, LandingPad); + LowerCallTo(&I, getValue(Callee), false, LandingPad); // If the value of the invoke is used outside of its defining block, make it // available as a virtual register. From richard at xmos.com Thu Jan 15 05:19:03 2009 From: richard at xmos.com (Richard Osborne) Date: Thu, 15 Jan 2009 11:19:03 -0000 Subject: [llvm-commits] [llvm] r62257 - in /llvm/trunk/lib/Target/XCore: XCoreInstrInfo.cpp XCoreRegisterInfo.cpp Message-ID: <200901151119.n0FBJ673011026@zion.cs.uiuc.edu> Author: friedgold Date: Thu Jan 15 05:18:53 2009 New Revision: 62257 URL: http://llvm.org/viewvc/llvm-project?rev=62257&view=rev Log: Update the operands used when building LDAWSP instructions to match the .td changes in the last commit. Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp Modified: llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp?rev=62257&r1=62256&r2=62257&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreInstrInfo.cpp Thu Jan 15 05:18:53 2009 @@ -363,7 +363,7 @@ if (SrcRC == XCore::RRegsRegisterClass && SrcReg == XCore::SP && DestRC == XCore::GRRegsRegisterClass) { - BuildMI(MBB, I, get(XCore::LDAWSP_ru6), DestReg).addImm(0).addImm(0); + BuildMI(MBB, I, get(XCore::LDAWSP_ru6), DestReg).addImm(0); return true; } if (DestRC == XCore::RRegsRegisterClass && DestReg == XCore::SP && Modified: llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp?rev=62257&r1=62256&r2=62257&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreRegisterInfo.cpp Thu Jan 15 05:18:53 2009 @@ -481,7 +481,6 @@ // Set the FP from the SP. unsigned FramePtr = XCore::R10; BuildMI(MBB, MBBI, TII.get(XCore::LDAWSP_ru6), FramePtr) - .addImm(0) .addImm(0); if (emitFrameMoves) { // Show FP is now valid. From richard at xmos.com Thu Jan 15 05:32:42 2009 From: richard at xmos.com (Richard Osborne) Date: Thu, 15 Jan 2009 11:32:42 -0000 Subject: [llvm-commits] [llvm] r62258 - in /llvm/trunk: lib/Target/XCore/XCoreISelDAGToDAG.cpp test/CodeGen/XCore/2009-01-08-Crash.ll Message-ID: <200901151132.n0FBWhf4011517@zion.cs.uiuc.edu> Author: friedgold Date: Thu Jan 15 05:32:30 2009 New Revision: 62258 URL: http://llvm.org/viewvc/llvm-project?rev=62258&view=rev Log: Don't fold address calculations which use negative offsets into the ADDRspii addressing mode. Added: llvm/trunk/test/CodeGen/XCore/2009-01-08-Crash.ll Modified: llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp?rev=62258&r1=62257&r2=62258&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp Thu Jan 15 05:32:30 2009 @@ -92,8 +92,8 @@ ConstantSDNode *CN = 0; if ((FIN = dyn_cast(Addr.getOperand(0))) && (CN = dyn_cast(Addr.getOperand(1))) - && (CN->getSExtValue() % 4 == 0)) { - // Constant word offset from frame pointer + && (CN->getSExtValue() % 4 == 0 && CN->getSExtValue() >= 0)) { + // Constant positive word offset from frame index Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); Offset = CurDAG->getTargetConstant(CN->getSExtValue(), MVT::i32); return true; Added: llvm/trunk/test/CodeGen/XCore/2009-01-08-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/2009-01-08-Crash.ll?rev=62258&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/XCore/2009-01-08-Crash.ll (added) +++ llvm/trunk/test/CodeGen/XCore/2009-01-08-Crash.ll Thu Jan 15 05:32:30 2009 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=xcore > %t1.s +;; This caused a compilation failure since the +;; address arithmetic was folded into the LDWSP instruction, +;; resulting in a negative offset which eliminateFrameIndex was +;; unable to eliminate. +define i32 @test(i32 %bar) nounwind readnone { +entry: + %bar_addr = alloca i32 + %0 = getelementptr i32* %bar_addr, i32 -1 + %1 = load i32* %0, align 4 + ret i32 %1 +} From gohman at apple.com Thu Jan 15 10:29:46 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 16:29:46 -0000 Subject: [llvm-commits] [llvm] r62259 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCISelLowering.h Message-ID: <200901151629.n0FGTkEO023371@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 10:29:45 2009 New Revision: 62259 URL: http://llvm.org/viewvc/llvm-project?rev=62259&view=rev Log: Const-qualify getPreIndexedAddressParts and friends. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=62259&r1=62258&r2=62259&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Thu Jan 15 10:29:45 2009 @@ -676,7 +676,7 @@ virtual bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { return false; } @@ -686,7 +686,7 @@ virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { return false; } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=62259&r1=62258&r2=62259&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jan 15 10:29:45 2009 @@ -1726,7 +1726,7 @@ ARMTargetLowering::getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { if (Subtarget->isThumb()) return false; @@ -1760,7 +1760,7 @@ SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { if (Subtarget->isThumb()) return false; Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=62259&r1=62258&r2=62259&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Thu Jan 15 10:29:45 2009 @@ -100,7 +100,7 @@ virtual bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// getPostIndexedAddressParts - returns true by value, base pointer and /// offset pointer and addressing mode by reference if this node can be @@ -108,7 +108,7 @@ virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG); + SelectionDAG &DAG) const; virtual void computeMaskedBitsForTargetNode(const SDValue Op, const APInt &Mask, Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=62259&r1=62258&r2=62259&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Jan 15 10:29:45 2009 @@ -766,7 +766,7 @@ /// can be more efficiently represented with [r+imm]. bool PPCTargetLowering::SelectAddressRegReg(SDValue N, SDValue &Base, SDValue &Index, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { short imm = 0; if (N.getOpcode() == ISD::ADD) { if (isIntS16Immediate(N.getOperand(1), imm)) @@ -813,7 +813,8 @@ /// a signed 16-bit displacement [r+imm], and if it is not better /// represented as reg+reg. bool PPCTargetLowering::SelectAddressRegImm(SDValue N, SDValue &Disp, - SDValue &Base, SelectionDAG &DAG){ + SDValue &Base, + SelectionDAG &DAG) const { // If this can be more profitably realized as r+r, fail. if (SelectAddressRegReg(N, Disp, Base, DAG)) return false; @@ -898,7 +899,7 @@ /// represented as an indexed [r+r] operation. bool PPCTargetLowering::SelectAddressRegRegOnly(SDValue N, SDValue &Base, SDValue &Index, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { // Check to see if we can easily represent this as an [r+r] address. This // will fail if it thinks that the address is more profitably represented as // reg+imm, e.g. where imm = 0. @@ -925,7 +926,7 @@ /// [r+imm*4]. Suitable for use by STD and friends. bool PPCTargetLowering::SelectAddressRegImmShift(SDValue N, SDValue &Disp, SDValue &Base, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { // If this can be more profitably realized as r+r, fail. if (SelectAddressRegReg(N, Disp, Base, DAG)) return false; @@ -1013,7 +1014,7 @@ bool PPCTargetLowering::getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG) { + SelectionDAG &DAG) const { // Disabled by default for now. if (!EnablePPCPreinc) return false; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h?rev=62259&r1=62258&r2=62259&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Thu Jan 15 10:29:45 2009 @@ -239,30 +239,30 @@ virtual bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// SelectAddressRegReg - Given the specified addressed, check to see if it /// can be represented as an indexed [r+r] operation. Returns false if it /// can be more efficiently represented with [r+imm]. bool SelectAddressRegReg(SDValue N, SDValue &Base, SDValue &Index, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// SelectAddressRegImm - Returns true if the address N can be represented /// by a base register plus a signed 16-bit displacement [r+imm], and if it /// is not better represented as reg+reg. bool SelectAddressRegImm(SDValue N, SDValue &Disp, SDValue &Base, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// SelectAddressRegRegOnly - Given the specified addressed, force it to be /// represented as an indexed [r+r] operation. bool SelectAddressRegRegOnly(SDValue N, SDValue &Base, SDValue &Index, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// SelectAddressRegImmShift - Returns true if the address N can be /// represented by a base register plus a signed 14-bit displacement /// [r+imm*4]. Suitable for use by STD and friends. bool SelectAddressRegImmShift(SDValue N, SDValue &Disp, SDValue &Base, - SelectionDAG &DAG); + SelectionDAG &DAG) const; /// LowerOperation - Provide custom lowering hooks for some operations. From gohman at apple.com Thu Jan 15 10:43:02 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 16:43:02 -0000 Subject: [llvm-commits] [llvm] r62260 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp LegalizeVectorTypes.cpp Message-ID: <200901151643.n0FGh2V0023828@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 10:43:02 2009 New Revision: 62260 URL: http://llvm.org/viewvc/llvm-project?rev=62260&view=rev Log: Use const with TargetLowering references in a few more places. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=62260&r1=62259&r2=62260&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Jan 15 10:43:02 2009 @@ -542,7 +542,7 @@ /// ExpandConstantFP - Expands the ConstantFP node to an integer constant or /// a load from the constant pool. static SDValue ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP, - SelectionDAG &DAG, TargetLowering &TLI) { + SelectionDAG &DAG, const TargetLowering &TLI) { bool Extend = false; // If a FP immediate is precise when represented as a float and if the @@ -591,7 +591,8 @@ /// operations. static SDValue ExpandFCOPYSIGNToBitwiseOps(SDNode *Node, MVT NVT, - SelectionDAG &DAG, TargetLowering &TLI) { + SelectionDAG &DAG, + const TargetLowering &TLI) { MVT VT = Node->getValueType(0); MVT SrcVT = Node->getOperand(1).getValueType(); assert((SrcVT == MVT::f32 || SrcVT == MVT::f64) && @@ -633,7 +634,7 @@ /// ExpandUnalignedStore - Expands an unaligned store to 2 half-size stores. static SDValue ExpandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG, - TargetLowering &TLI) { + const TargetLowering &TLI) { SDValue Chain = ST->getChain(); SDValue Ptr = ST->getBasePtr(); SDValue Val = ST->getValue(); @@ -8301,7 +8302,7 @@ // Width: Preferred width of element type // VVT: Vector value type whose size we must match. // Returns VecEVT and EVT - the vector type and its associated element type -static void FindWidenVecType(TargetLowering &TLI, unsigned Width, MVT VVT, +static void FindWidenVecType(const TargetLowering &TLI, unsigned Width, MVT VVT, MVT& EVT, MVT& VecEVT) { // We start with the preferred width, make it a power of 2 and see if // we can find a vector type of that width. If not, we reduce it by Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=62260&r1=62259&r2=62260&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Thu Jan 15 10:43:02 2009 @@ -1886,7 +1886,8 @@ // VecVT: Vector value type whose size we must match. // Returns NewVecVT and NewEltVT - the vector type and its associated // element type. -static void FindAssocWidenVecType(TargetLowering &TLI, unsigned Width, MVT VecVT, +static void FindAssocWidenVecType(const TargetLowering &TLI, unsigned Width, + MVT VecVT, MVT& NewEltVT, MVT& NewVecVT) { unsigned EltWidth = Width + 1; if (TLI.isTypeLegal(VecVT)) { From gohman at apple.com Thu Jan 15 10:58:18 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 16:58:18 -0000 Subject: [llvm-commits] [llvm] r62262 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp SelectionDAG.cpp SelectionDAGBuild.cpp SelectionDAGISel.cpp Message-ID: <200901151658.n0FGwIpP024368@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 10:58:17 2009 New Revision: 62262 URL: http://llvm.org/viewvc/llvm-project?rev=62262&view=rev Log: More consts on TargetLowering references. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=62262&r1=62261&r2=62262&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Jan 15 10:58:17 2009 @@ -736,7 +736,7 @@ /// ExpandUnalignedLoad - Expands an unaligned load to 2 half-size loads. static SDValue ExpandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG, - TargetLowering &TLI) { + const TargetLowering &TLI) { int SVOffset = LD->getSrcValueOffset(); SDValue Chain = LD->getChain(); SDValue Ptr = LD->getBasePtr(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=62262&r1=62261&r2=62262&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Jan 15 10:58:17 2009 @@ -4982,7 +4982,7 @@ return "<>"; } if (G) { - TargetLowering &TLI = G->getTargetLoweringInfo(); + const TargetLowering &TLI = G->getTargetLoweringInfo(); const char *Name = TLI.getTargetNodeName(getOpcode()); if (Name) return Name; return "<>"; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62262&r1=62261&r2=62262&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Jan 15 10:58:17 2009 @@ -380,7 +380,7 @@ MVT ValueVT, ISD::NodeType AssertOp = ISD::DELETED_NODE) { assert(NumParts > 0 && "No parts to assemble!"); - TargetLowering &TLI = DAG.getTargetLoweringInfo(); + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); SDValue Val = Parts[0]; if (NumParts > 1) { @@ -525,7 +525,7 @@ static void getCopyToParts(SelectionDAG &DAG, SDValue Val, SDValue *Parts, unsigned NumParts, MVT PartVT, ISD::NodeType ExtendKind = ISD::ANY_EXTEND) { - TargetLowering &TLI = DAG.getTargetLoweringInfo(); + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); MVT PtrVT = TLI.getPointerTy(); MVT ValueVT = Val.getValueType(); unsigned PartBits = PartVT.getSizeInBits(); @@ -648,8 +648,7 @@ // Handle a multi-element vector. MVT IntermediateVT, RegisterVT; unsigned NumIntermediates; - unsigned NumRegs = - DAG.getTargetLoweringInfo() + unsigned NumRegs = TLI .getVectorTypeBreakdown(ValueVT, IntermediateVT, NumIntermediates, RegisterVT); unsigned NumElements = ValueVT.getVectorNumElements(); @@ -4819,7 +4818,7 @@ /// processed uses a memory 'm' constraint. static bool hasInlineAsmMemConstraint(std::vector &CInfos, - TargetLowering &TLI) { + const TargetLowering &TLI) { for (unsigned i = 0, e = CInfos.size(); i != e; ++i) { InlineAsm::ConstraintInfo &CI = CInfos[i]; for (unsigned j = 0, ee = CI.Codes.size(); j != ee; ++j) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=62262&r1=62261&r2=62262&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jan 15 10:58:17 2009 @@ -141,8 +141,8 @@ const TargetMachine *TM, MachineBasicBlock *BB, bool Fast) { - TargetLowering &TLI = IS->getTargetLowering(); - + const TargetLowering &TLI = IS->getTargetLowering(); + if (Fast) return createFastDAGScheduler(IS, DAG, TM, BB, Fast); if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency) @@ -399,7 +399,7 @@ /// CheckDAGForTailCallsAndFixThem - This Function looks for CALL nodes in the /// DAG and fixes their tailcall attribute operand. static void CheckDAGForTailCallsAndFixThem(SelectionDAG &DAG, - TargetLowering& TLI) { + const TargetLowering& TLI) { SDNode * Ret = NULL; SDValue Terminator = DAG.getRoot(); From evan.cheng at apple.com Thu Jan 15 11:01:23 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 15 Jan 2009 17:01:23 -0000 Subject: [llvm-commits] [llvm] r62263 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast-sext-zext.ll Message-ID: <200901151701.n0FH1NwC024494@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jan 15 11:01:23 2009 New Revision: 62263 URL: http://llvm.org/viewvc/llvm-project?rev=62263&view=rev Log: - Teach CanEvaluateInDifferentType of this xform: sext (zext ty1), ty2 -> zext ty2 - Looking at the number of sign bits of the a sext instruction to determine whether new trunc + sext pair should be added when its source is being evaluated in a different type. Added: llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62263&r1=62262&r2=62263&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan 15 11:01:23 2009 @@ -395,7 +395,7 @@ bool CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, unsigned CastOpc, - int &NumCastsRemoved); + int &NumCastsRemoved, bool &SeenTrunc); unsigned GetOrEnforceKnownAlignment(Value *V, unsigned PrefAlign = 0); @@ -7497,9 +7497,10 @@ /// If CastOpc is a sext or zext, we are asking if the low bits of the value can /// bit computed in a larger type, which is then and'd or sext_in_reg'd to get /// the final result. -bool InstCombiner::CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, - unsigned CastOpc, - int &NumCastsRemoved) { +bool +InstCombiner::CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, + unsigned CastOpc, + int &NumCastsRemoved, bool &SeenTrunc){ // We can always evaluate constants in another type. if (isa(V)) return true; @@ -7519,6 +7520,8 @@ // casts first. if (!isa(I->getOperand(0)) && I->hasOneUse()) ++NumCastsRemoved; + if (isa(I)) + SeenTrunc = true; return true; } } @@ -7527,7 +7530,8 @@ // require duplicating the instruction in general, which isn't profitable. if (!I->hasOneUse()) return false; - switch (I->getOpcode()) { + unsigned Opc = I->getOpcode(); + switch (Opc) { case Instruction::Add: case Instruction::Sub: case Instruction::Mul: @@ -7536,9 +7540,9 @@ case Instruction::Xor: // These operators can all arbitrarily be extended or truncated. return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved) && + NumCastsRemoved, SeenTrunc) && CanEvaluateInDifferentType(I->getOperand(1), Ty, CastOpc, - NumCastsRemoved); + NumCastsRemoved, SeenTrunc); case Instruction::Shl: // If we are truncating the result of this SHL, and if it's a shift of a @@ -7548,7 +7552,7 @@ if (BitWidth < OrigTy->getBitWidth() && CI->getLimitedValue(BitWidth) < BitWidth) return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved); + NumCastsRemoved, SeenTrunc); } break; case Instruction::LShr: @@ -7563,7 +7567,7 @@ APInt::getHighBitsSet(OrigBitWidth, OrigBitWidth-BitWidth)) && CI->getLimitedValue(BitWidth) < BitWidth) { return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved); + NumCastsRemoved, SeenTrunc); } } break; @@ -7573,22 +7577,27 @@ // If this is the same kind of case as our original (e.g. zext+zext), we // can safely replace it. Note that replacing it does not reduce the number // of casts in the input. - if (I->getOpcode() == CastOpc) + if (Opc == CastOpc) + return true; + + // sext (zext ty1), ty2 -> zext ty2 + if (CastOpc == Instruction::SExt && Opc == Instruction::ZExt && + I->hasOneUse()) return true; break; case Instruction::Select: { SelectInst *SI = cast(I); return CanEvaluateInDifferentType(SI->getTrueValue(), Ty, CastOpc, - NumCastsRemoved) && + NumCastsRemoved, SeenTrunc) && CanEvaluateInDifferentType(SI->getFalseValue(), Ty, CastOpc, - NumCastsRemoved); + NumCastsRemoved, SeenTrunc); } case Instruction::PHI: { // We can change a phi if we can change all operands. PHINode *PN = cast(I); for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (!CanEvaluateInDifferentType(PN->getIncomingValue(i), Ty, CastOpc, - NumCastsRemoved)) + NumCastsRemoved, SeenTrunc)) return false; return true; } @@ -7611,7 +7620,8 @@ // Otherwise, it must be an instruction. Instruction *I = cast(V); Instruction *Res = 0; - switch (I->getOpcode()) { + unsigned Opc = I->getOpcode(); + switch (Opc) { case Instruction::Add: case Instruction::Sub: case Instruction::Mul: @@ -7623,8 +7633,7 @@ case Instruction::Shl: { Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned); Value *RHS = EvaluateInDifferentType(I->getOperand(1), Ty, isSigned); - Res = BinaryOperator::Create((Instruction::BinaryOps)I->getOpcode(), - LHS, RHS); + Res = BinaryOperator::Create((Instruction::BinaryOps)Opc, LHS, RHS); break; } case Instruction::Trunc: @@ -7808,7 +7817,6 @@ } - /// Only the TRUNC, ZEXT, SEXT, and BITCAST can both operand and result as /// integer types. This function implements the common transforms for all those /// cases. @@ -7838,16 +7846,18 @@ // Attempt to propagate the cast into the instruction for int->int casts. int NumCastsRemoved = 0; + bool SeenTrunc = false; if (!isa(CI) && CanEvaluateInDifferentType(SrcI, cast(DestTy), - CI.getOpcode(), NumCastsRemoved)) { + CI.getOpcode(), NumCastsRemoved, SeenTrunc)) { // If this cast is a truncate, evaluting in a different type always // eliminates the cast, so it is always a win. If this is a zero-extension, // we need to do an AND to maintain the clear top-part of the computation, // so we require that the input have eliminated at least one cast. If this // is a sign extension, we insert two new casts (to do the extension) so we // require that two casts have been eliminated. - bool DoXForm; + bool DoXForm = false; + bool JustReplace = false; switch (CI.getOpcode()) { default: // All the others use floating point so we shouldn't actually @@ -7858,11 +7868,28 @@ break; case Instruction::ZExt: DoXForm = NumCastsRemoved >= 1; + // TODO: Check if we need to insert an AND. break; - case Instruction::SExt: + case Instruction::SExt: { DoXForm = NumCastsRemoved >= 2; + if (!SeenTrunc) { + // Do we have to emit a truncate to SrcBitSize followed by a sext? + // + // It's not safe to eliminate the trunc + sext pair if one of the + // eliminated cast is a truncate. e.g. + // t2 = trunc i32 t1 to i16 + // t3 = sext i16 t2 to i32 + // != + // i32 t1 + unsigned NumSignBits = ComputeNumSignBits(&CI); + if (NumSignBits > (DestBitSize - SrcBitSize)) { + DoXForm = true; + JustReplace = true; + } + } break; } + } if (DoXForm) { Value *Res = EvaluateInDifferentType(SrcI, DestTy, @@ -7882,6 +7909,10 @@ return BinaryOperator::CreateAnd(Res, C); } case Instruction::SExt: + if (JustReplace) + // Just replace this cast with the result. + return ReplaceInstUsesWith(CI, Res); + // We need to emit a cast to truncate, then a cast to sext. return CastInst::Create(Instruction::SExt, InsertCastBefore(Instruction::Trunc, Res, Src->getType(), @@ -12420,5 +12451,3 @@ FunctionPass *llvm::createInstructionCombiningPass() { return new InstCombiner(); } - - Added: llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll?rev=62263&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/cast-sext-zext.ll Thu Jan 15 11:01:23 2009 @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep sext + +define zeroext i16 @t(i8 zeroext %on_off, i16* nocapture %puls) nounwind readonly { +entry: + %0 = zext i8 %on_off to i32 + %1 = add i32 %0, -1 + %2 = sext i32 %1 to i64 + %3 = getelementptr i16* %puls, i64 %2 + %4 = load i16* %3, align 2 + ret i16 %4 +} From evan.cheng at apple.com Thu Jan 15 11:09:08 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 15 Jan 2009 17:09:08 -0000 Subject: [llvm-commits] [llvm] r62264 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200901151709.n0FH98NV024708@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jan 15 11:09:07 2009 New Revision: 62264 URL: http://llvm.org/viewvc/llvm-project?rev=62264&view=rev Log: Eliminate a redundant check. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62264&r1=62263&r2=62264&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan 15 11:09:07 2009 @@ -7581,8 +7581,7 @@ return true; // sext (zext ty1), ty2 -> zext ty2 - if (CastOpc == Instruction::SExt && Opc == Instruction::ZExt && - I->hasOneUse()) + if (CastOpc == Instruction::SExt && Opc == Instruction::ZExt) return true; break; case Instruction::Select: { From gohman at apple.com Thu Jan 15 11:34:09 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 17:34:09 -0000 Subject: [llvm-commits] [llvm] r62265 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h Message-ID: <200901151734.n0FHY9AQ025592@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 11:34:08 2009 New Revision: 62265 URL: http://llvm.org/viewvc/llvm-project?rev=62265&view=rev Log: Make getWidenVectorType const. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=62265&r1=62264&r2=62265&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Thu Jan 15 11:34:08 2009 @@ -300,7 +300,7 @@ /// If there is no vector type that we want to widen to, returns MVT::Other /// When and were to widen is target dependent based on the cost of /// scalarizing vs using the wider vector type. - virtual MVT getWidenVectorType(MVT VT); + virtual MVT getWidenVectorType(MVT VT) const; typedef std::vector::const_iterator legal_fpimm_iterator; legal_fpimm_iterator legal_fpimm_begin() const { Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62265&r1=62264&r2=62265&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jan 15 11:34:08 2009 @@ -8036,7 +8036,7 @@ /// When and where to widen is target dependent based on the cost of /// scalarizing vs using the wider vector type. -MVT X86TargetLowering::getWidenVectorType(MVT VT) { +MVT X86TargetLowering::getWidenVectorType(MVT VT) const { assert(VT.isVector()); if (isTypeLegal(VT)) return VT; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=62265&r1=62264&r2=62265&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Thu Jan 15 11:34:08 2009 @@ -499,7 +499,7 @@ /// If there is no vector type that we want to widen to, returns MVT::Other /// When and were to widen is target dependent based on the cost of /// scalarizing vs using the wider vector type. - virtual MVT getWidenVectorType(MVT VT); + virtual MVT getWidenVectorType(MVT VT) const; /// createFastISel - This method returns a target specific FastISel object, /// or null if the target does not support "fast" ISel. From gohman at apple.com Thu Jan 15 11:39:39 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 17:39:39 -0000 Subject: [llvm-commits] [llvm] r62266 - /llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200901151739.n0FHddNR025755@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 11:39:39 2009 New Revision: 62266 URL: http://llvm.org/viewvc/llvm-project?rev=62266&view=rev Log: Make getWidenVectorType const; this file was missed in the previous commit. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=62266&r1=62265&r2=62266&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Jan 15 11:39:39 2009 @@ -669,7 +669,7 @@ /// If there is no vector type that we want to widen to, returns MVT::Other /// When and where to widen is target dependent based on the cost of /// scalarizing vs using the wider vector type. -MVT TargetLowering::getWidenVectorType(MVT VT) { +MVT TargetLowering::getWidenVectorType(MVT VT) const { assert(VT.isVector()); if (isTypeLegal(VT)) return VT; From gohman at apple.com Thu Jan 15 11:57:09 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 17:57:09 -0000 Subject: [llvm-commits] [llvm] r62267 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Message-ID: <200901151757.n0FHv91q026360@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 11:57:09 2009 New Revision: 62267 URL: http://llvm.org/viewvc/llvm-project?rev=62267&view=rev Log: Add load-folding table entries for BT*ri8 instructions. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=62267&r1=62266&r2=62267&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Thu Jan 15 11:57:09 2009 @@ -223,6 +223,9 @@ // If the third value is 1, then it's folding either a load or a store. static const unsigned OpTbl0[][3] = { + { X86::BT16ri8, X86::BT16mi8, 1 }, + { X86::BT32ri8, X86::BT32mi8, 1 }, + { X86::BT64ri8, X86::BT64mi8, 1 }, { X86::CALL32r, X86::CALL32m, 1 }, { X86::CALL64r, X86::CALL64m, 1 }, { X86::CMP16ri, X86::CMP16mi, 1 }, From dpatel at apple.com Thu Jan 15 12:25:18 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 15 Jan 2009 18:25:18 -0000 Subject: [llvm-commits] [llvm] r62269 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfWriter.cpp test/DebugInfo/2009-01-15-RecordVariableCrash.ll Message-ID: <200901151825.n0FIPI77027269@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 12:25:17 2009 New Revision: 62269 URL: http://llvm.org/viewvc/llvm-project?rev=62269&view=rev Log: Use variable's context to identify respective DbgScope. Use light weight DebugInfo object directly. Added: llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62269&r1=62268&r2=62269&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 12:25:17 2009 @@ -1212,7 +1212,7 @@ class DbgScope { private: DbgScope *Parent; // Parent to this scope. - DIDescriptor *Desc; // Debug info descriptor for scope. + DIDescriptor Desc; // Debug info descriptor for scope. // Either subprogram or block. unsigned StartLabelID; // Label ID of the beginning of scope. unsigned EndLabelID; // Label ID of the end of scope. @@ -1220,7 +1220,7 @@ SmallVector Variables;// Variables declared in scope. public: - DbgScope(DbgScope *P, DIDescriptor *D) + DbgScope(DbgScope *P, DIDescriptor D) : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), Scopes(), Variables() {} ~DbgScope() { @@ -1230,7 +1230,7 @@ // Accessors. DbgScope *getParent() const { return Parent; } - DIDescriptor *getDesc() const { return Desc; } + DIDescriptor getDesc() const { return Desc; } unsigned getStartLabelID() const { return StartLabelID; } unsigned getEndLabelID() const { return EndLabelID; } SmallVector &getScopes() { return Scopes; } @@ -1307,7 +1307,7 @@ /// bool shouldEmit; - // RootScope - Top level scope for the current function. + // RootDbgScope - Top level scope for the current function. // DbgScope *RootDbgScope; @@ -2009,13 +2009,14 @@ if (!Slot) { // FIXME - breaks down when the context is an inlined function. DIDescriptor ParentDesc; - DIDescriptor *DB = new DIDescriptor(V); - if (DIBlock *Block = dyn_cast(DB)) { - ParentDesc = Block->getContext(); + DIDescriptor Desc(V); + if (Desc.getTag() == dwarf::DW_TAG_lexical_block) { + DIBlock Block(V); + ParentDesc = Block.getContext(); } DbgScope *Parent = ParentDesc.isNull() ? NULL : getOrCreateScope(ParentDesc.getGV()); - Slot = new DbgScope(Parent, DB); + Slot = new DbgScope(Parent, Desc); if (Parent) { Parent->AddScope(Slot); } else if (RootDbgScope) { @@ -2091,10 +2092,12 @@ void ConstructRootDbgScope(DbgScope *RootScope) { // Exit if there is no root scope. if (!RootScope) return; - if (RootScope->getDesc()->isNull()) return; + DIDescriptor Desc = RootScope->getDesc(); + if (Desc.isNull()) + return; // Get the subprogram debug information entry. - DISubprogram SPD(RootScope->getDesc()->getGV()); + DISubprogram SPD(Desc.getGV()); // Get the compile unit context. CompileUnit *Unit = FindCompileUnit(SPD.getCompileUnit()); @@ -3123,7 +3126,18 @@ /// RecordVariable - Indicate the declaration of a local variable. /// void RecordVariable(GlobalVariable *GV, unsigned FrameIndex) { - DbgScope *Scope = getOrCreateScope(GV); + DIDescriptor Desc(GV); + DbgScope *Scope = NULL; + if (Desc.getTag() == DW_TAG_variable) { + // GV is a global variable. + DIGlobalVariable DG(GV); + Scope = getOrCreateScope(DG.getContext().getGV()); + } else { + // or GV is a local variable. + DIVariable DV(GV); + Scope = getOrCreateScope(DV.getContext().getGV()); + } + assert (Scope && "Unable to find variable' scope"); DIVariable *VD = new DIVariable(GV); DbgVariable *DV = new DbgVariable(VD, FrameIndex); Scope->AddVariable(DV); Added: llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll?rev=62269&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll (added) +++ llvm/trunk/test/DebugInfo/2009-01-15-RecordVariableCrash.ll Thu Jan 15 12:25:17 2009 @@ -0,0 +1,355 @@ +; RUN: llvm-as < %s | llc -f -o /dev/null + %llvm.dbg.anchor.type = type { i32, i32 } + %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } + %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } + %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, i8*, i8* } + %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, i8*, i8* } + %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* } + %struct._RuneCharClass = type { [14 x i8], i32 } + %struct._RuneEntry = type { i32, i32, i32, i32* } + %struct._RuneLocale = type { [8 x i8], [32 x i8], i32 (i8*, i32, i8**)*, i32 (i32, i8*, i32, i8**)*, i32, [256 x i32], [256 x i32], [256 x i32], %struct._RuneRange, %struct._RuneRange, %struct._RuneRange, i8*, i32, i32, %struct._RuneCharClass* } + %struct._RuneRange = type { i32, %struct._RuneEntry* } + at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str = internal constant [4 x i8] c"x.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at .str1 = internal constant [5 x i8] c"/tmp\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at .str2 = internal constant [57 x i8] c"4.2.1 (Based on Apple Inc. build 5628) (LLVM build 9999)\00", section "llvm.metadata" ; <[57 x i8]*> [#uses=1] + at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([57 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] + at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] + at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str4 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 21, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, i1 true, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at .str5 = internal constant [2 x i8] c"i\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 22, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at .str6 = internal constant [8 x i8] c"islower\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] + at .str7 = internal constant [8 x i8] c"ctype.h\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] + at .str8 = internal constant [13 x i8] c"/usr/include\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1] + at llvm.dbg.subprogram9 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str6, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str6, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 267, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 true, i1 true, i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at .str10 = internal constant [3 x i8] c"_c\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] + at llvm.dbg.variable11 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram9 to { }*), i8* getelementptr ([3 x i8]* @.str10, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 266, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at .str12 = internal constant [9 x i8] c"__istype\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] + at llvm.dbg.subprogram13 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([9 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([9 x i8]* @.str12, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 171, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 true, i1 true, i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at .str14 = internal constant [19 x i8] c"__darwin_ct_rune_t\00", section "llvm.metadata" ; <[19 x i8]*> [#uses=1] + at .str15 = internal constant [9 x i8] c"_types.h\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1] + at .str16 = internal constant [18 x i8] c"/usr/include/i386\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] + at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458774, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([19 x i8]* @.str14, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 70, i64 0, i64 0, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([9 x i8]* @.str15, i32 0, i32 0), i8* getelementptr ([18 x i8]* @.str16, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at llvm.dbg.variable17 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram13 to { }*), i8* getelementptr ([3 x i8]* @.str10, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 170, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at .str18 = internal constant [18 x i8] c"long unsigned int\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1] + at llvm.dbg.basictype19 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str18, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] + at .str20 = internal constant [3 x i8] c"_f\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] + at llvm.dbg.variable21 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram13 to { }*), i8* getelementptr ([3 x i8]* @.str20, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 170, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype19 to { }*), i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at _DefaultRuneLocale = external global %struct._RuneLocale ; <%struct._RuneLocale*> [#uses=1] + at .str22 = internal constant [8 x i8] c"isascii\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] + at llvm.dbg.subprogram23 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str22, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str22, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 153, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 true, i1 true, i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at llvm.dbg.variable24 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram23 to { }*), i8* getelementptr ([3 x i8]* @.str10, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 152, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at .str25 = internal constant [8 x i8] c"toupper\00", section "llvm.metadata" ; <[8 x i8]*> [#uses=1] + at llvm.dbg.subprogram26 = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([8 x i8]* @.str25, i32 0, i32 0), i8* getelementptr ([8 x i8]* @.str25, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 316, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 true, i1 true, i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at llvm.dbg.variable27 = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram26 to { }*), i8* getelementptr ([3 x i8]* @.str10, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 315, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([8 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str8, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + +define i32 @main() nounwind { +entry: + %retval = alloca i32 ; [#uses=1] + %i = alloca i32 ; [#uses=16] + %iftmp.5 = alloca i32 ; [#uses=3] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) + %0 = bitcast i32* %i to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*)) + call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + store i32 0, i32* %i, align 4 + br label %bb13 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb + +bb: ; preds = %bb13, %1 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %2 = load i32* %i, align 4 ; [#uses=1] + %3 = call i32 @islower(i32 %2) nounwind ; [#uses=1] + %4 = icmp eq i32 %3, 0 ; [#uses=1] + br i1 %4, label %bb3, label %bb1 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb1 + +bb1: ; preds = %5, %bb + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %6 = load i32* %i, align 4 ; [#uses=1] + %7 = icmp sle i32 %6, 96 ; [#uses=1] + br i1 %7, label %bb11, label %bb2 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb2 + +bb2: ; preds = %8, %bb1 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %9 = load i32* %i, align 4 ; [#uses=1] + %10 = icmp sgt i32 %9, 122 ; [#uses=1] + br i1 %10, label %bb11, label %bb3 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb3 + +bb3: ; preds = %11, %bb2, %bb + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %12 = load i32* %i, align 4 ; [#uses=1] + %13 = call i32 @islower(i32 %12) nounwind ; [#uses=1] + %14 = icmp ne i32 %13, 0 ; [#uses=1] + br i1 %14, label %bb6, label %bb4 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb4 + +bb4: ; preds = %15, %bb3 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %16 = load i32* %i, align 4 ; [#uses=1] + %17 = icmp sle i32 %16, 96 ; [#uses=1] + br i1 %17, label %bb6, label %bb5 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb5 + +bb5: ; preds = %18, %bb4 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %19 = load i32* %i, align 4 ; [#uses=1] + %20 = icmp sle i32 %19, 122 ; [#uses=1] + br i1 %20, label %bb11, label %bb6 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb6 + +bb6: ; preds = %21, %bb5, %bb4, %bb3 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %22 = load i32* %i, align 4 ; [#uses=1] + %23 = call i32 @toupper(i32 %22) nounwind ; [#uses=1] + %24 = load i32* %i, align 4 ; [#uses=1] + %25 = icmp sle i32 %24, 96 ; [#uses=1] + br i1 %25, label %bb9, label %bb7 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb7 + +bb7: ; preds = %26, %bb6 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %27 = load i32* %i, align 4 ; [#uses=1] + %28 = icmp sgt i32 %27, 122 ; [#uses=1] + br i1 %28, label %bb9, label %bb8 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb8 + +bb8: ; preds = %29, %bb7 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %30 = load i32* %i, align 4 ; [#uses=1] + %31 = sub i32 %30, 32 ; [#uses=1] + store i32 %31, i32* %iftmp.5, align 4 + br label %bb10 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb9 + +bb9: ; preds = %32, %bb7, %bb6 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %33 = load i32* %i, align 4 ; [#uses=1] + store i32 %33, i32* %iftmp.5, align 4 + br label %bb10 + +bb10: ; preds = %bb9, %bb8 + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %34 = load i32* %iftmp.5, align 4 ; [#uses=1] + %35 = icmp ne i32 %23, %34 ; [#uses=1] + br i1 %35, label %bb11, label %bb12 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 24, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb11 + +bb11: ; preds = %36, %bb10, %bb5, %bb2, %bb1 + call void @llvm.dbg.stoppoint(i32 26, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @exit(i32 2) noreturn nounwind + unreachable + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 26, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb12 + +bb12: ; preds = %37, %bb10 + call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %38 = load i32* %i, align 4 ; [#uses=1] + %39 = add i32 %38, 1 ; [#uses=1] + store i32 %39, i32* %i, align 4 + br label %bb13 + +bb13: ; preds = %bb12, %entry + call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %40 = load i32* %i, align 4 ; [#uses=1] + %41 = icmp sle i32 %40, 255 ; [#uses=1] + br i1 %41, label %bb, label %bb14 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 23, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb14 + +bb14: ; preds = %42, %bb13 + call void @llvm.dbg.stoppoint(i32 27, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @exit(i32 0) noreturn nounwind + unreachable + +return: ; No predecessors! + %retval15 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint(i32 27, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*)) + ret i32 %retval15 +} + +declare void @llvm.dbg.func.start({ }*) nounwind + +declare void @llvm.dbg.declare({ }*, { }*) nounwind + +declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind + +define internal i32 @islower(i32 %_c) nounwind { +entry: + %_c_addr = alloca i32 ; [#uses=3] + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram9 to { }*)) + %1 = bitcast i32* %_c_addr to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable11 to { }*)) + store i32 %_c, i32* %_c_addr + call void @llvm.dbg.stoppoint(i32 268, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %2 = load i32* %_c_addr, align 4 ; [#uses=1] + %3 = call i32 @__istype(i32 %2, i32 4096) nounwind ; [#uses=1] + store i32 %3, i32* %0, align 4 + %4 = load i32* %0, align 4 ; [#uses=1] + store i32 %4, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint(i32 268, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram9 to { }*)) + ret i32 %retval1 +} + +define internal i32 @toupper(i32 %_c) nounwind { +entry: + %_c_addr = alloca i32 ; [#uses=3] + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram26 to { }*)) + %1 = bitcast i32* %_c_addr to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable27 to { }*)) + store i32 %_c, i32* %_c_addr + call void @llvm.dbg.stoppoint(i32 317, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %2 = load i32* %_c_addr, align 4 ; [#uses=1] + %3 = call i32 @__toupper(i32 %2) nounwind ; [#uses=1] + store i32 %3, i32* %0, align 4 + %4 = load i32* %0, align 4 ; [#uses=1] + store i32 %4, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint(i32 317, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram26 to { }*)) + ret i32 %retval1 +} + +declare void @exit(i32) noreturn nounwind + +declare void @llvm.dbg.region.end({ }*) nounwind + +define internal i32 @__istype(i32 %_c, i32 %_f) nounwind { +entry: + %_c_addr = alloca i32 ; [#uses=5] + %_f_addr = alloca i32 ; [#uses=4] + %retval = alloca i32 ; [#uses=2] + %iftmp.0 = alloca i32 ; [#uses=3] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram13 to { }*)) + %1 = bitcast i32* %_c_addr to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable17 to { }*)) + store i32 %_c, i32* %_c_addr + %2 = bitcast i32* %_f_addr to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable21 to { }*)) + store i32 %_f, i32* %_f_addr + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %3 = load i32* %_c_addr, align 4 ; [#uses=1] + %4 = call i32 @isascii(i32 %3) nounwind ; [#uses=1] + %5 = icmp ne i32 %4, 0 ; [#uses=1] + br i1 %5, label %bb, label %bb1 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb + +bb: ; preds = %6, %entry + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %7 = load i32* %_c_addr, align 4 ; [#uses=1] + %8 = getelementptr [256 x i32]* getelementptr (%struct._RuneLocale* @_DefaultRuneLocale, i32 0, i32 5), i32 0, i32 %7 ; [#uses=1] + %9 = load i32* %8, align 4 ; [#uses=1] + %10 = load i32* %_f_addr, align 4 ; [#uses=1] + %11 = and i32 %9, %10 ; [#uses=1] + %12 = icmp ne i32 %11, 0 ; [#uses=1] + %13 = zext i1 %12 to i32 ; [#uses=1] + store i32 %13, i32* %iftmp.0, align 4 + br label %bb2 + ; No predecessors! + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + br label %bb1 + +bb1: ; preds = %14, %entry + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %15 = load i32* %_c_addr, align 4 ; [#uses=1] + %16 = load i32* %_f_addr, align 4 ; [#uses=1] + %17 = call i32 @__maskrune(i32 %15, i32 %16) nounwind ; [#uses=1] + %18 = icmp ne i32 %17, 0 ; [#uses=1] + %19 = zext i1 %18 to i32 ; [#uses=1] + store i32 %19, i32* %iftmp.0, align 4 + br label %bb2 + +bb2: ; preds = %bb1, %bb + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %20 = load i32* %iftmp.0, align 4 ; [#uses=1] + store i32 %20, i32* %0, align 4 + %21 = load i32* %0, align 4 ; [#uses=1] + store i32 %21, i32* %retval, align 4 + br label %return + +return: ; preds = %bb2 + %retval3 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint(i32 175, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram13 to { }*)) + ret i32 %retval3 +} + +define internal i32 @isascii(i32 %_c) nounwind { +entry: + %_c_addr = alloca i32 ; [#uses=3] + %retval = alloca i32 ; [#uses=2] + %0 = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram23 to { }*)) + %1 = bitcast i32* %_c_addr to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %1, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*)) + store i32 %_c, i32* %_c_addr + call void @llvm.dbg.stoppoint(i32 154, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + %2 = load i32* %_c_addr, align 4 ; [#uses=1] + %3 = and i32 %2, -128 ; [#uses=1] + %4 = icmp eq i32 %3, 0 ; [#uses=1] + %5 = zext i1 %4 to i32 ; [#uses=1] + store i32 %5, i32* %0, align 4 + %6 = load i32* %0, align 4 ; [#uses=1] + store i32 %6, i32* %retval, align 4 + br label %return + +return: ; preds = %entry + %retval1 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint(i32 154, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*)) + call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram23 to { }*)) + ret i32 %retval1 +} + +declare i32 @__maskrune(i32, i32) + +declare i32 @__toupper(i32) From ggreif at gmail.com Thu Jan 15 12:40:09 2009 From: ggreif at gmail.com (Gabor Greif) Date: Thu, 15 Jan 2009 18:40:09 -0000 Subject: [llvm-commits] [llvm] r62271 - /llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Message-ID: <200901151840.n0FIe9h6027747@zion.cs.uiuc.edu> Author: ggreif Date: Thu Jan 15 12:40:09 2009 New Revision: 62271 URL: http://llvm.org/viewvc/llvm-project?rev=62271&view=rev Log: avoid using iterators when they get invalidated potentially this fixes PR3332 Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=62271&r1=62270&r2=62271&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Thu Jan 15 12:40:09 2009 @@ -155,8 +155,18 @@ // Since we inlined some uninlined call sites in the callee into the caller, // add edges from the caller to all of the callees of the callee. - for (CallGraphNode::iterator I = CalleeNode->begin(), - E = CalleeNode->end(); I != E; ++I) { + CallGraphNode::iterator I = CalleeNode->begin(), E = CalleeNode->end(); + + // Consider the case where CalleeNode == CallerNode. + typedef std::pair CallRecord; + std::vector CallCache; + if (CalleeNode == CallerNode) { + CallCache.assign(I, E); + I = CallCache.begin(); + E = CallCache.end(); + } + + for (; I != E; ++I) { const Instruction *OrigCall = I->first.getInstruction(); DenseMap::iterator VMI = ValueMap.find(OrigCall); @@ -514,8 +524,8 @@ TheCall->replaceAllUsesWith(PHI); } - // Loop over all of the return instructions adding entries to the PHI node as - // appropriate. + // Loop over all of the return instructions adding entries to the PHI node + // as appropriate. if (PHI) { for (unsigned i = 0, e = Returns.size(); i != e; ++i) { ReturnInst *RI = Returns[i]; From nunoplopes at sapo.pt Thu Jan 15 12:40:57 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Thu, 15 Jan 2009 18:40:57 -0000 Subject: [llvm-commits] [llvm] r62272 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <200901151840.n0FIev7e027784@zion.cs.uiuc.edu> Author: nlopes Date: Thu Jan 15 12:40:57 2009 New Revision: 62272 URL: http://llvm.org/viewvc/llvm-project?rev=62272&view=rev Log: add comment to explain my previous commit, as asked by Chris Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62272&r1=62271&r2=62272&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Jan 15 12:40:57 2009 @@ -1671,6 +1671,8 @@ } else { for (unsigned i = 1, E = I.getNumOperands(); i != E; ++i) { Operand = I.getOperand(i); + // note that Operand shouldn't be null, but the test helps make dump() + // more tolerant of malformed IR if (Operand && Operand->getType() != TheType) { PrintAllTypes = true; // We have differing types! Print them all! break; From nunoplopes at sapo.pt Thu Jan 15 12:41:08 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Thu, 15 Jan 2009 18:41:08 -0000 Subject: [llvm-commits] [llvm]r62236 -/llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu><33D66CD4-8D24-4EB9-8CFB-59B7C0B92FEC@apple.com> Message-ID: <4A23D63619A7408C8C3E378C4DAA38C7@pc07654> >>>> Author: nlopes >>>> Date: Wed Jan 14 11:51:41 2009 >>>> New Revision: 62236 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=62236&view=rev >>>> Log: >>>> fix crash in the case when some arg is null >>> >>> Hi Nuno, >>> >>> When can operands be null? >>> >>> -Chris >> >> There are some passes that nullify the args when doing cleanups. >> This check >> really helps when you're debuging and call dump(). This way it won't >> crash >> the app. >> IMHO, it doesn't hurt much and helps when debugging (anyway the >> writeOperand() code does the same). > > Ok. Please add a comment indicating that this shouldn't happen, but > helps make dump() more tolerant of malformed IR, thanks! > > -Chris Ok, done! Nuno From nunoplopes at sapo.pt Thu Jan 15 12:42:44 2009 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Thu, 15 Jan 2009 18:42:44 -0000 Subject: [llvm-commits] [llvm] r62236 - /llvm/trunk/lib/VMCore/AsmWriter.cpp In-Reply-To: <200901150942.54272.baldrick@free.fr> References: <200901141751.n0EHpgrm030796@zion.cs.uiuc.edu> <200901150942.54272.baldrick@free.fr> Message-ID: <9C76D69FF3754750A37CD7DEBA58BE9F@pc07654> >> fix crash in the case when some arg is null > > Testcase? I don't have any particular test case. I've explained this in another message I sent to Chris (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090112/072156.html) Nuno From gohman at apple.com Thu Jan 15 13:20:51 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 19:20:51 -0000 Subject: [llvm-commits] [llvm] r62275 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ lib/Target/XCore/ Message-ID: <200901151920.n0FJKqnH029662@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 13:20:50 2009 New Revision: 62275 URL: http://llvm.org/viewvc/llvm-project?rev=62275&view=rev Log: Move a few containers out of ScheduleDAGInstrs::BuildSchedGraph and into the ScheduleDAGInstrs class, so that they don't get destructed and re-constructed for each block. This fixes a compile-time hot spot in the post-pass scheduler. To help facilitate this, tidy and do some minor reorganization in the scheduler constructor functions. Modified: llvm/trunk/include/llvm/CodeGen/LinkAllCodegenComponents.h llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h llvm/trunk/include/llvm/CodeGen/SchedulerRegistry.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/ScheduleDAGEmit.cpp llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/LinkAllCodegenComponents.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LinkAllCodegenComponents.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LinkAllCodegenComponents.h (original) +++ llvm/trunk/include/llvm/CodeGen/LinkAllCodegenComponents.h Thu Jan 15 13:20:50 2009 @@ -42,11 +42,11 @@ llvm::linkOcamlGC(); llvm::linkShadowStackGC(); - (void) llvm::createBURRListDAGScheduler(NULL, NULL, NULL, NULL, false); - (void) llvm::createTDRRListDAGScheduler(NULL, NULL, NULL, NULL, false); - (void) llvm::createTDListDAGScheduler(NULL, NULL, NULL, NULL, false); - (void) llvm::createFastDAGScheduler(NULL, NULL, NULL, NULL, false); - (void) llvm::createDefaultScheduler(NULL, NULL, NULL, NULL, false); + (void) llvm::createBURRListDAGScheduler(NULL, false); + (void) llvm::createTDRRListDAGScheduler(NULL, false); + (void) llvm::createTDListDAGScheduler(NULL, false); + (void) llvm::createFastDAGScheduler(NULL, false); + (void) llvm::createDefaultScheduler(NULL, false); } } ForceCodegenLinking; // Force link by creating a global definition. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Thu Jan 15 13:20:50 2009 @@ -421,15 +421,14 @@ const TargetInstrInfo *TII; // Target instruction information const TargetRegisterInfo *TRI; // Target processor register info TargetLowering *TLI; // Target lowering info - MachineFunction *MF; // Machine function + MachineFunction &MF; // Machine function MachineRegisterInfo &MRI; // Virtual/real register map MachineConstantPool *ConstPool; // Target constant pool std::vector Sequence; // The schedule. Null SUnit*'s // represent noop instructions. std::vector SUnits; // The scheduling units. - ScheduleDAG(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm); + explicit ScheduleDAG(MachineFunction &mf); virtual ~ScheduleDAG(); @@ -440,7 +439,7 @@ /// Run - perform scheduling. /// - void Run(); + void Run(SelectionDAG *DAG, MachineBasicBlock *MBB); /// BuildSchedGraph - Build SUnits and set up their Preds and Succs /// to form the scheduling dependency graph. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAGInstrs.h Thu Jan 15 13:20:50 2009 @@ -16,6 +16,7 @@ #define LLVM_CODEGEN_SCHEDULEDAGINSTRS_H #include "llvm/CodeGen/ScheduleDAG.h" +#include "llvm/Target/TargetRegisterInfo.h" namespace llvm { class MachineLoopInfo; @@ -25,11 +26,22 @@ const MachineLoopInfo &MLI; const MachineDominatorTree &MDT; + /// Defs, Uses - Remember where defs and uses of each physical register + /// are as we iterate upward through the instructions. This is allocated + /// here instead of inside BuildSchedGraph to avoid the need for it to be + /// initialized and destructed for each block. + std::vector Defs[TargetRegisterInfo::FirstVirtualRegister]; + std::vector Uses[TargetRegisterInfo::FirstVirtualRegister]; + + /// PendingLoads - Remember where unknown loads are after the most recent + /// unknown store, as we iterate. As with Defs and Uses, this is here + /// to minimize construction/destruction. + std::vector PendingLoads; + public: - ScheduleDAGInstrs(MachineBasicBlock *bb, - const TargetMachine &tm, - const MachineLoopInfo &mli, - const MachineDominatorTree &mdt); + explicit ScheduleDAGInstrs(MachineFunction &mf, + const MachineLoopInfo &mli, + const MachineDominatorTree &mdt); virtual ~ScheduleDAGInstrs() {} Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h Thu Jan 15 13:20:50 2009 @@ -74,8 +74,7 @@ /// class ScheduleDAGSDNodes : public ScheduleDAG { public: - ScheduleDAGSDNodes(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm); + explicit ScheduleDAGSDNodes(MachineFunction &mf); virtual ~ScheduleDAGSDNodes() {} Modified: llvm/trunk/include/llvm/CodeGen/SchedulerRegistry.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SchedulerRegistry.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SchedulerRegistry.h (original) +++ llvm/trunk/include/llvm/CodeGen/SchedulerRegistry.h Thu Jan 15 13:20:50 2009 @@ -32,9 +32,7 @@ class RegisterScheduler : public MachinePassRegistryNode { public: - typedef ScheduleDAG *(*FunctionPassCtor)(SelectionDAGISel*, SelectionDAG*, - const TargetMachine *, - MachineBasicBlock*, bool); + typedef ScheduleDAG *(*FunctionPassCtor)(SelectionDAGISel*, bool); static MachinePassRegistry Registry; @@ -66,44 +64,28 @@ /// createBURRListDAGScheduler - This creates a bottom up register usage /// reduction list scheduler. ScheduleDAG* createBURRListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast); /// createTDRRListDAGScheduler - This creates a top down register usage /// reduction list scheduler. ScheduleDAG* createTDRRListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast); /// createTDListDAGScheduler - This creates a top-down list scheduler with /// a hazard recognizer. ScheduleDAG* createTDListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast); - + /// createFastDAGScheduler - This creates a "fast" scheduler. /// ScheduleDAG *createFastDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast); /// createDefaultScheduler - This creates an instruction scheduler appropriate /// for the target. ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast); } // end namespace llvm - #endif Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Thu Jan 15 13:20:50 2009 @@ -41,9 +41,11 @@ /// pattern-matching instruction selectors. class SelectionDAGISel : public FunctionPass { public: + const TargetMachine &TM; TargetLowering &TLI; - MachineRegisterInfo *RegInfo; FunctionLoweringInfo *FuncInfo; + MachineFunction *MF; + MachineRegisterInfo *RegInfo; SelectionDAG *CurDAG; SelectionDAGLowering *SDL; MachineBasicBlock *BB; @@ -52,7 +54,7 @@ bool Fast; static char ID; - explicit SelectionDAGISel(TargetLowering &tli, bool fast = false); + explicit SelectionDAGISel(TargetMachine &tm, bool fast = false); virtual ~SelectionDAGISel(); TargetLowering &getTargetLowering() { return TLI; } Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu Jan 15 13:20:50 2009 @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Support/Compiler.h" @@ -78,11 +79,17 @@ /// Topo - A topological ordering for SUnits. ScheduleDAGTopologicalSort Topo; + /// AllocatableSet - The set of allocatable registers. + /// We'll be ignoring anti-dependencies on non-allocatable registers, + /// because they may not be safe to break. + const BitVector AllocatableSet; + public: - SchedulePostRATDList(MachineBasicBlock *mbb, const TargetMachine &tm, + SchedulePostRATDList(MachineFunction &MF, const MachineLoopInfo &MLI, const MachineDominatorTree &MDT) - : ScheduleDAGInstrs(mbb, tm, MLI, MDT), Topo(SUnits) {} + : ScheduleDAGInstrs(MF, MLI, MDT), Topo(SUnits), + AllocatableSet(TRI->getAllocatableSet(MF)) {} void Schedule(); @@ -100,13 +107,13 @@ const MachineLoopInfo &MLI = getAnalysis(); const MachineDominatorTree &MDT = getAnalysis(); + SchedulePostRATDList Scheduler(Fn, MLI, MDT); + // Loop over all of the basic blocks for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); MBB != MBBe; ++MBB) { - SchedulePostRATDList Scheduler(MBB, Fn.getTarget(), MLI, MDT); - - Scheduler.Run(); + Scheduler.Run(0, MBB); Scheduler.EmitSchedule(); } @@ -195,10 +202,6 @@ DOUT << "Critical path has total latency " << (Max ? Max->getDepth() + Max->Latency : 0) << "\n"; - // We'll be ignoring anti-dependencies on non-allocatable registers, because - // they may not be safe to break. - const BitVector AllocatableSet = TRI->getAllocatableSet(*MF); - // Track progress along the critical path through the SUnit graph as we walk // the instructions. SUnit *CriticalPathSU = Max; @@ -444,8 +447,8 @@ // TODO: Instead of picking the first free register, consider which might // be the best. if (AntiDepReg != 0) { - for (TargetRegisterClass::iterator R = RC->allocation_order_begin(*MF), - RE = RC->allocation_order_end(*MF); R != RE; ++R) { + for (TargetRegisterClass::iterator R = RC->allocation_order_begin(MF), + RE = RC->allocation_order_end(MF); R != RE; ++R) { unsigned NewReg = *R; // Don't replace a register with itself. if (NewReg == AntiDepReg) continue; Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Thu Jan 15 13:20:50 2009 @@ -21,14 +21,13 @@ #include using namespace llvm; -ScheduleDAG::ScheduleDAG(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm) - : DAG(dag), BB(bb), TM(tm), MRI(BB->getParent()->getRegInfo()) { - TII = TM.getInstrInfo(); - MF = BB->getParent(); - TRI = TM.getRegisterInfo(); - TLI = TM.getTargetLowering(); - ConstPool = MF->getConstantPool(); +ScheduleDAG::ScheduleDAG(MachineFunction &mf) + : DAG(0), BB(0), TM(mf.getTarget()), + TII(TM.getInstrInfo()), + TRI(TM.getRegisterInfo()), + TLI(TM.getTargetLowering()), + MF(mf), MRI(mf.getRegInfo()), + ConstPool(MF.getConstantPool()) { } ScheduleDAG::~ScheduleDAG() {} @@ -46,7 +45,12 @@ /// Run - perform scheduling. /// -void ScheduleDAG::Run() { +void ScheduleDAG::Run(SelectionDAG *dag, MachineBasicBlock *bb) { + SUnits.clear(); + Sequence.clear(); + DAG = dag; + BB = bb; + Schedule(); DOUT << "*** Final schedule ***\n"; Modified: llvm/trunk/lib/CodeGen/ScheduleDAGEmit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGEmit.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAGEmit.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAGEmit.cpp Thu Jan 15 13:20:50 2009 @@ -29,7 +29,7 @@ using namespace llvm; void ScheduleDAG::AddMemOperand(MachineInstr *MI, const MachineMemOperand &MO) { - MI->addMemOperand(*MF, MO); + MI->addMemOperand(MF, MO); } void ScheduleDAG::EmitNoop() { Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Thu Jan 15 13:20:50 2009 @@ -52,16 +52,18 @@ LE = Header->livein_end(); LI != LE; ++LI) LoopLiveIns.insert(*LI); - VisitRegion(MDT.getNode(Header), Loop, LoopLiveIns); + const MachineDomTreeNode *Node = MDT.getNode(Header); + const MachineBasicBlock *MBB = Node->getBlock(); + assert(Loop->contains(MBB) && + "Loop does not contain header!"); + VisitRegion(Node, MBB, Loop, LoopLiveIns); } private: void VisitRegion(const MachineDomTreeNode *Node, + const MachineBasicBlock *MBB, const MachineLoop *Loop, const SmallSet &LoopLiveIns) { - MachineBasicBlock *MBB = Node->getBlock(); - if (!Loop->contains(MBB)) return; - unsigned Count = 0; for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end(); I != E; ++I, ++Count) { @@ -77,33 +79,28 @@ } const std::vector &Children = Node->getChildren(); - for (unsigned I = 0, E = Children.size(); I != E; ++I) - VisitRegion(Children[I], Loop, LoopLiveIns); + for (std::vector::const_iterator I = + Children.begin(), E = Children.end(); I != E; ++I) { + const MachineDomTreeNode *ChildNode = *I; + MachineBasicBlock *ChildBlock = ChildNode->getBlock(); + if (Loop->contains(ChildBlock)) + VisitRegion(ChildNode, ChildBlock, Loop, LoopLiveIns); + } } }; } -ScheduleDAGInstrs::ScheduleDAGInstrs(MachineBasicBlock *bb, - const TargetMachine &tm, +ScheduleDAGInstrs::ScheduleDAGInstrs(MachineFunction &mf, const MachineLoopInfo &mli, const MachineDominatorTree &mdt) - : ScheduleDAG(0, bb, tm), MLI(mli), MDT(mdt) {} + : ScheduleDAG(mf), MLI(mli), MDT(mdt) {} void ScheduleDAGInstrs::BuildSchedGraph() { - SUnits.clear(); SUnits.reserve(BB->size()); // We build scheduling units by walking a block's instruction list from bottom // to top. - // Remember where defs and uses of each physical register are as we procede. - std::vector Defs[TargetRegisterInfo::FirstVirtualRegister] = {}; - std::vector Uses[TargetRegisterInfo::FirstVirtualRegister] = {}; - - // Remember where unknown loads are after the most recent unknown store - // as we procede. - std::vector PendingLoads; - // Remember where a generic side-effecting instruction is as we procede. If // ChainMMO is null, this is assumed to have arbitrary side-effects. If // ChainMMO is non-null, then Chain makes only a single memory reference. @@ -378,6 +375,12 @@ if (TID.isTerminator() || MI->isLabel()) Terminator = SU; } + + for (int i = 0, e = TRI->getNumRegs(); i != e; ++i) { + Defs[i].clear(); + Uses[i].clear(); + } + PendingLoads.clear(); } void ScheduleDAGInstrs::ComputeLatency(SUnit *SU) { Modified: llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp Thu Jan 15 13:20:50 2009 @@ -34,7 +34,7 @@ template<> struct DOTGraphTraits : public DefaultDOTGraphTraits { static std::string getGraphName(const ScheduleDAG *G) { - return G->MF->getFunction()->getName(); + return G->MF.getFunction()->getName(); } static bool renderGraphFromBottomUp() { @@ -83,8 +83,8 @@ void ScheduleDAG::viewGraph() { // This code is only for debugging! #ifndef NDEBUG - ViewGraph(this, "dag." + MF->getFunction()->getName(), - "Scheduling-Units Graph for " + MF->getFunction()->getName() + ':' + + ViewGraph(this, "dag." + MF.getFunction()->getName(), + "Scheduling-Units Graph for " + MF.getFunction()->getName() + ':' + BB->getBasicBlock()->getName()); #else cerr << "ScheduleDAG::viewGraph is only available in debug builds on " Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Jan 15 13:20:50 2009 @@ -49,7 +49,7 @@ class VISIBILITY_HIDDEN DAGCombiner { SelectionDAG &DAG; - TargetLowering &TLI; + const TargetLowering &TLI; CombineLevel Level; bool LegalOperations; bool LegalTypes; @@ -2836,7 +2836,7 @@ static bool ExtendUsesToFormExtLoad(SDNode *N, SDValue N0, unsigned ExtOpc, SmallVector &ExtendNodes, - TargetLowering &TLI) { + const TargetLowering &TLI) { bool HasCopyToRegUses = false; bool isTruncFree = TLI.isTruncateFree(N->getValueType(0), N0.getValueType()); for (SDNode::use_iterator UI = N0.getNode()->use_begin(), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp Thu Jan 15 13:20:50 2009 @@ -14,9 +14,9 @@ #define DEBUG_TYPE "pre-RA-sched" #include "llvm/CodeGen/ScheduleDAGSDNodes.h" #include "llvm/CodeGen/SchedulerRegistry.h" +#include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" @@ -71,9 +71,8 @@ std::vector LiveRegCycles; public: - ScheduleDAGFast(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm) - : ScheduleDAGSDNodes(dag, bb, tm) {} + ScheduleDAGFast(MachineFunction &mf) + : ScheduleDAGSDNodes(mf) {} void Schedule(); @@ -619,9 +618,6 @@ // Public Constructor Functions //===----------------------------------------------------------------------===// -llvm::ScheduleDAG* llvm::createFastDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool) { - return new ScheduleDAGFast(DAG, BB, *TM); +llvm::ScheduleDAG* llvm::createFastDAGScheduler(SelectionDAGISel *IS, bool) { + return new ScheduleDAGFast(*IS->MF); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Thu Jan 15 13:20:50 2009 @@ -25,7 +25,6 @@ #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" @@ -62,11 +61,10 @@ HazardRecognizer *HazardRec; public: - ScheduleDAGList(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm, + ScheduleDAGList(MachineFunction &mf, SchedulingPriorityQueue *availqueue, HazardRecognizer *HR) - : ScheduleDAGSDNodes(dag, bb, tm), + : ScheduleDAGSDNodes(mf), AvailableQueue(availqueue), HazardRec(HR) { } @@ -268,10 +266,8 @@ /// new hazard recognizer. This scheduler takes ownership of the hazard /// recognizer and deletes it when done. ScheduleDAG* llvm::createTDListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast) { - return new ScheduleDAGList(DAG, BB, *TM, + bool Fast) { + return new ScheduleDAGList(*IS->MF, new LatencyPriorityQueue(), IS->CreateTargetHazardRecognizer()); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Jan 15 13:20:50 2009 @@ -18,6 +18,7 @@ #define DEBUG_TYPE "pre-RA-sched" #include "llvm/CodeGen/ScheduleDAGSDNodes.h" #include "llvm/CodeGen/SchedulerRegistry.h" +#include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" @@ -72,10 +73,10 @@ ScheduleDAGTopologicalSort Topo; public: - ScheduleDAGRRList(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm, bool isbottomup, + ScheduleDAGRRList(MachineFunction &mf, + bool isbottomup, SchedulingPriorityQueue *availqueue) - : ScheduleDAGSDNodes(dag, bb, tm), isBottomUp(isbottomup), + : ScheduleDAGSDNodes(mf), isBottomUp(isbottomup), AvailableQueue(availqueue), Topo(SUnits) { } @@ -1346,32 +1347,29 @@ //===----------------------------------------------------------------------===// llvm::ScheduleDAG* llvm::createBURRListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool) { - const TargetInstrInfo *TII = TM->getInstrInfo(); - const TargetRegisterInfo *TRI = TM->getRegisterInfo(); + const TargetMachine &TM = IS->TM; + const TargetInstrInfo *TII = TM.getInstrInfo(); + const TargetRegisterInfo *TRI = TM.getRegisterInfo(); BURegReductionPriorityQueue *PQ = new BURegReductionPriorityQueue(TII, TRI); ScheduleDAGRRList *SD = - new ScheduleDAGRRList(DAG, BB, *TM, true, PQ); + new ScheduleDAGRRList(*IS->MF, true, PQ); PQ->setScheduleDAG(SD); return SD; } llvm::ScheduleDAG* llvm::createTDRRListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool) { - const TargetInstrInfo *TII = TM->getInstrInfo(); - const TargetRegisterInfo *TRI = TM->getRegisterInfo(); + const TargetMachine &TM = IS->TM; + const TargetInstrInfo *TII = TM.getInstrInfo(); + const TargetRegisterInfo *TRI = TM.getRegisterInfo(); TDRegReductionPriorityQueue *PQ = new TDRegReductionPriorityQueue(TII, TRI); - ScheduleDAGRRList *SD = new ScheduleDAGRRList(DAG, BB, *TM, false, PQ); + ScheduleDAGRRList *SD = + new ScheduleDAGRRList(*IS->MF, false, PQ); PQ->setScheduleDAG(SD); return SD; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp Thu Jan 15 13:20:50 2009 @@ -22,9 +22,8 @@ #include "llvm/Support/raw_ostream.h" using namespace llvm; -ScheduleDAGSDNodes::ScheduleDAGSDNodes(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm) - : ScheduleDAG(dag, bb, tm) { +ScheduleDAGSDNodes::ScheduleDAGSDNodes(MachineFunction &mf) + : ScheduleDAG(mf) { } SUnit *ScheduleDAGSDNodes::Clone(SUnit *Old) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp Thu Jan 15 13:20:50 2009 @@ -381,7 +381,7 @@ unsigned SubIdx = cast(Node->getOperand(1))->getZExtValue(); // Create the extract_subreg machine instruction. - MachineInstr *MI = BuildMI(*MF, TII->get(TargetInstrInfo::EXTRACT_SUBREG)); + MachineInstr *MI = BuildMI(MF, TII->get(TargetInstrInfo::EXTRACT_SUBREG)); // Figure out the register class to create for the destreg. unsigned VReg = getVR(Node->getOperand(0), VRBaseMap); @@ -427,7 +427,7 @@ } // Create the insert_subreg or subreg_to_reg machine instruction. - MachineInstr *MI = BuildMI(*MF, TII->get(Opc)); + MachineInstr *MI = BuildMI(MF, TII->get(Opc)); MI->addOperand(MachineOperand::CreateReg(VRBase, true)); // If creating a subreg_to_reg, then the first input operand @@ -484,7 +484,7 @@ #endif // Create the new machine instruction. - MachineInstr *MI = BuildMI(*MF, II); + MachineInstr *MI = BuildMI(MF, II); // Add result register values for things that are defined by this // instruction. @@ -568,7 +568,7 @@ --NumOps; // Ignore the flag operand. // Create the inline asm machine instruction. - MachineInstr *MI = BuildMI(*MF, TII->get(TargetInstrInfo::INLINEASM)); + MachineInstr *MI = BuildMI(MF, TII->get(TargetInstrInfo::INLINEASM)); // Add the asm string as an external symbol operand. const char *AsmStr = Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jan 15 13:20:50 2009 @@ -137,19 +137,16 @@ /// createDefaultScheduler - This creates an instruction scheduler appropriate /// for the target. ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast) { const TargetLowering &TLI = IS->getTargetLowering(); if (Fast) - return createFastDAGScheduler(IS, DAG, TM, BB, Fast); + return createFastDAGScheduler(IS, Fast); if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency) - return createTDListDAGScheduler(IS, DAG, TM, BB, Fast); + return createTDListDAGScheduler(IS, Fast); assert(TLI.getSchedulingPreference() == TargetLowering::SchedulingForRegPressure && "Unknown sched type!"); - return createBURRListDAGScheduler(IS, DAG, TM, BB, Fast); + return createBURRListDAGScheduler(IS, Fast); } } @@ -266,8 +263,8 @@ // SelectionDAGISel code //===----------------------------------------------------------------------===// -SelectionDAGISel::SelectionDAGISel(TargetLowering &tli, bool fast) : - FunctionPass(&ID), TLI(tli), +SelectionDAGISel::SelectionDAGISel(TargetMachine &tm, bool fast) : + FunctionPass(&ID), TM(tm), TLI(*tm.getTargetLowering()), FuncInfo(new FunctionLoweringInfo(TLI)), CurDAG(new SelectionDAG(TLI, *FuncInfo)), SDL(new SelectionDAGLowering(*CurDAG, TLI, *FuncInfo)), @@ -304,22 +301,21 @@ AA = &getAnalysis(); TargetMachine &TM = TLI.getTargetMachine(); - MachineFunction &MF = MachineFunction::construct(&Fn, TM); - const MachineRegisterInfo &MRI = MF.getRegInfo(); + MF = &MachineFunction::construct(&Fn, TM); const TargetInstrInfo &TII = *TM.getInstrInfo(); const TargetRegisterInfo &TRI = *TM.getRegisterInfo(); - if (MF.getFunction()->hasGC()) - GFI = &getAnalysis().getFunctionInfo(*MF.getFunction()); + if (MF->getFunction()->hasGC()) + GFI = &getAnalysis().getFunctionInfo(*MF->getFunction()); else GFI = 0; - RegInfo = &MF.getRegInfo(); + RegInfo = &MF->getRegInfo(); DOUT << "\n\n\n=== " << Fn.getName() << "\n"; - FuncInfo->set(Fn, MF, EnableFastISel); + FuncInfo->set(Fn, *MF, EnableFastISel); MachineModuleInfo *MMI = getAnalysisToUpdate(); DwarfWriter *DW = getAnalysisToUpdate(); - CurDAG->init(MF, MMI, DW); + CurDAG->init(*MF, MMI, DW); SDL->init(GFI, *AA); for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) @@ -327,17 +323,17 @@ // Mark landing pad. FuncInfo->MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad(); - SelectAllBasicBlocks(Fn, MF, MMI, DW, TII); + SelectAllBasicBlocks(Fn, *MF, MMI, DW, TII); // If the first basic block in the function has live ins that need to be // copied into vregs, emit the copies into the top of the block before // emitting the code for the block. - EmitLiveInCopies(MF.begin(), MRI, TRI, TII); + EmitLiveInCopies(MF->begin(), *RegInfo, TRI, TII); // Add function live-ins to entry block live-in set. for (MachineRegisterInfo::livein_iterator I = RegInfo->livein_begin(), E = RegInfo->livein_end(); I != E; ++I) - MF.begin()->addLiveIn(I->first); + MF->begin()->addLiveIn(I->first); #ifndef NDEBUG assert(FuncInfo->CatchInfoFound.size() == FuncInfo->CatchInfoLost.size() && @@ -365,7 +361,7 @@ /// IsFixedFrameObjectWithPosOffset - Check if object is a fixed frame object and /// whether object offset >= 0. static bool -IsFixedFrameObjectWithPosOffset(MachineFrameInfo * MFI, SDValue Op) { +IsFixedFrameObjectWithPosOffset(MachineFrameInfo *MFI, SDValue Op) { if (!isa(Op)) return false; FrameIndexSDNode * FrameIdxNode = dyn_cast(Op); @@ -380,7 +376,7 @@ /// assumes all arguments sourcing from FORMAL_ARGUMENTS or a CopyFromReg with /// virtual registers would be overwritten by direct lowering. static bool IsPossiblyOverwrittenArgumentOfTailCall(SDValue Op, - MachineFrameInfo * MFI) { + MachineFrameInfo *MFI) { RegisterSDNode * OpReg = NULL; if (Op.getOpcode() == ISD::FORMAL_ARGUMENTS || (Op.getOpcode()== ISD::CopyFromReg && @@ -694,14 +690,15 @@ DEBUG(BB->dump()); } -void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, +void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, + MachineFunction &MF, MachineModuleInfo *MMI, DwarfWriter *DW, const TargetInstrInfo &TII) { // Initialize the Fast-ISel state, if needed. FastISel *FastIS = 0; if (EnableFastISel) - FastIS = TLI.createFastISel(*FuncInfo->MF, MMI, DW, + FastIS = TLI.createFastISel(MF, MMI, DW, FuncInfo->ValueMap, FuncInfo->MBBMap, FuncInfo->StaticAllocaMap @@ -1075,9 +1072,8 @@ RegisterScheduler::setDefault(Ctor); } - TargetMachine &TM = getTargetLowering().getTargetMachine(); - ScheduleDAG *Scheduler = Ctor(this, CurDAG, &TM, BB, Fast); - Scheduler->Run(); + ScheduleDAG *Scheduler = Ctor(this, Fast); + Scheduler->Run(CurDAG, BB); return Scheduler; } Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -46,7 +46,7 @@ public: explicit ARMDAGToDAGISel(ARMTargetMachine &tm) - : SelectionDAGISel(*tm.getTargetLowering()), TM(tm), + : SelectionDAGISel(tm), TM(tm), Subtarget(&TM.getSubtarget()) { } Modified: llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -143,7 +143,7 @@ public: explicit AlphaDAGToDAGISel(AlphaTargetMachine &TM) - : SelectionDAGISel(*TM.getTargetLowering()) + : SelectionDAGISel(TM) {} /// getI64Imm - Return a target constant with the specified value, of type Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -227,7 +227,7 @@ public: explicit SPUDAGToDAGISel(SPUTargetMachine &tm) : - SelectionDAGISel(*tm.getTargetLowering()), + SelectionDAGISel(tm), TM(tm), SPUtli(*tm.getTargetLowering()) {} Modified: llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -38,7 +38,7 @@ unsigned GlobalBaseReg; public: explicit IA64DAGToDAGISel(IA64TargetMachine &TM) - : SelectionDAGISel(*TM.getTargetLowering()) {} + : SelectionDAGISel(TM) {} virtual bool runOnFunction(Function &Fn) { // Make sure we re-emit a set of the global base reg if necessary Modified: llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -55,7 +55,7 @@ public: explicit MipsDAGToDAGISel(MipsTargetMachine &tm) : - SelectionDAGISel(*tm.getTargetLowering()), + SelectionDAGISel(tm), TM(tm), Subtarget(tm.getSubtarget()) {} virtual void InstructionSelect(); Modified: llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h (original) +++ llvm/trunk/lib/Target/PIC16/PIC16ISelDAGToDAG.h Thu Jan 15 13:20:50 2009 @@ -35,7 +35,7 @@ public: explicit PIC16DAGToDAGISel(PIC16TargetMachine &tm) : - SelectionDAGISel(PIC16Lowering), + SelectionDAGISel(tm), TM(tm), PIC16Lowering(*TM.getTargetLowering()) {} // Pass Name Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -44,7 +44,7 @@ unsigned GlobalBaseReg; public: explicit PPCDAGToDAGISel(PPCTargetMachine &tm) - : SelectionDAGISel(*tm.getTargetLowering()), TM(tm), + : SelectionDAGISel(tm), TM(tm), PPCLowering(*TM.getTargetLowering()), PPCSubTarget(*TM.getSubtargetImpl()) {} Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -34,7 +34,7 @@ const SparcSubtarget &Subtarget; public: explicit SparcDAGToDAGISel(SparcTargetMachine &TM) - : SelectionDAGISel(*TM.getTargetLowering()), + : SelectionDAGISel(TM), Subtarget(TM.getSubtarget()) { } Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -126,7 +126,7 @@ public: X86DAGToDAGISel(X86TargetMachine &tm, bool fast) - : SelectionDAGISel(*tm.getTargetLowering(), fast), + : SelectionDAGISel(tm, fast), TM(tm), X86Lowering(*TM.getTargetLowering()), Subtarget(&TM.getSubtarget()), OptForSize(false) {} Modified: llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp?rev=62275&r1=62274&r2=62275&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreISelDAGToDAG.cpp Thu Jan 15 13:20:50 2009 @@ -42,7 +42,7 @@ public: XCoreDAGToDAGISel(XCoreTargetMachine &TM) - : SelectionDAGISel(*TM.getTargetLowering()), + : SelectionDAGISel(TM), Lowering(*TM.getTargetLowering()), Subtarget(*TM.getSubtargetImpl()) { } From dpatel at apple.com Thu Jan 15 13:26:23 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 15 Jan 2009 19:26:23 -0000 Subject: [llvm-commits] [llvm] r62276 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp test/FrontendC++/2006-11-06-StackTrace.cpp Message-ID: <200901151926.n0FJQNRn029887@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 13:26:23 2009 New Revision: 62276 URL: http://llvm.org/viewvc/llvm-project?rev=62276&view=rev Log: Use lightweight DebugInfo objects directly. Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=62276&r1=62275&r2=62276&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Thu Jan 15 13:26:23 2009 @@ -160,6 +160,7 @@ // ctor. DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {} + public: /// isDerivedType - Return true if the specified tag is legal for /// DIDerivedType. static bool isDerivedType(unsigned TAG); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62276&r1=62275&r2=62276&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 13:26:23 2009 @@ -1668,13 +1668,15 @@ // Construct type. DIE Buffer(DW_TAG_base_type); - if (DIBasicType *BT = dyn_cast(&Ty)) - ConstructTypeDIE(DW_Unit, Buffer, BT); - else if (DIDerivedType *DT = dyn_cast(&Ty)) - ConstructTypeDIE(DW_Unit, Buffer, DT); - else if (DICompositeType *CT = dyn_cast(&Ty)) - ConstructTypeDIE(DW_Unit, Buffer, CT); - + if (Ty.isBasicType(Ty.getTag())) + ConstructTypeDIE(DW_Unit, Buffer, DIBasicType(Ty.getGV())); + else if (Ty.isDerivedType(Ty.getTag())) + ConstructTypeDIE(DW_Unit, Buffer, DIDerivedType(Ty.getGV())); + else { + assert (Ty.isCompositeType(Ty.getTag()) && "Unknown kind of DIType"); + ConstructTypeDIE(DW_Unit, Buffer, DICompositeType(Ty.getGV())); + } + // Add debug information entry to entity and unit. DIE *Die = DW_Unit->AddDie(Buffer); SetDIEntry(Slot, Die); @@ -1683,33 +1685,33 @@ /// ConstructTypeDIE - Construct basic type die from DIBasicType. void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, - DIBasicType *BTy) { + DIBasicType BTy) { // Get core information. - const std::string &Name = BTy->getName(); + const std::string &Name = BTy.getName(); Buffer.setTag(DW_TAG_base_type); - AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BTy->getEncoding()); + AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, BTy.getEncoding()); // Add name if not anonymous or intermediate type. if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name); - uint64_t Size = BTy->getSizeInBits() >> 3; + uint64_t Size = BTy.getSizeInBits() >> 3; AddUInt(&Buffer, DW_AT_byte_size, 0, Size); } /// ConstructTypeDIE - Construct derived type die from DIDerivedType. void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, - DIDerivedType *DTy) { + DIDerivedType DTy) { // Get core information. - const std::string &Name = DTy->getName(); - uint64_t Size = DTy->getSizeInBits() >> 3; - unsigned Tag = DTy->getTag(); + const std::string &Name = DTy.getName(); + uint64_t Size = DTy.getSizeInBits() >> 3; + unsigned Tag = DTy.getTag(); // FIXME - Workaround for templates. if (Tag == DW_TAG_inheritance) Tag = DW_TAG_reference_type; Buffer.setTag(Tag); // Map to main type, void will not have a type. - DIType FromTy = DTy->getTypeDerivedFrom(); + DIType FromTy = DTy.getTypeDerivedFrom(); AddType(DW_Unit, &Buffer, FromTy); // Add name if not anonymous or intermediate type. @@ -1721,26 +1723,26 @@ // Add source line info if available and TyDesc is not a forward // declaration. - // FIXME - Enable this. if (!DTy->isForwardDecl()) + // FIXME - Enable this. if (!DTy.isForwardDecl()) // FIXME - Enable this. AddSourceLine(&Buffer, *DTy); } /// ConstructTypeDIE - Construct type DIE from DICompositeType. void ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, - DICompositeType *CTy) { + DICompositeType CTy) { // Get core information. - const std::string &Name = CTy->getName(); - uint64_t Size = CTy->getSizeInBits() >> 3; - unsigned Tag = CTy->getTag(); + const std::string &Name = CTy.getName(); + uint64_t Size = CTy.getSizeInBits() >> 3; + unsigned Tag = CTy.getTag(); switch (Tag) { case DW_TAG_vector_type: case DW_TAG_array_type: - ConstructArrayTypeDIE(DW_Unit, Buffer, CTy); + ConstructArrayTypeDIE(DW_Unit, Buffer, &CTy); break; //FIXME - Enable this. // case DW_TAG_enumeration_type: - // DIArray Elements = CTy->getTypeArray(); + // DIArray Elements = CTy.getTypeArray(); // // Add enumerators to enumeration type. // for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) // ConstructEnumTypeDIE(Buffer, &Elements.getElement(i)); @@ -1749,27 +1751,17 @@ { // Add prototype flag. AddUInt(&Buffer, DW_AT_prototyped, DW_FORM_flag, 1); - DIArray Elements = CTy->getTypeArray(); + DIArray Elements = CTy.getTypeArray(); // Add return type. DIDescriptor RTy = Elements.getElement(0); - if (DIBasicType *BT = dyn_cast(&RTy)) - AddType(DW_Unit, &Buffer, *BT); - else if (DIDerivedType *DT = dyn_cast(&RTy)) - AddType(DW_Unit, &Buffer, *DT); - else if (DICompositeType *CT = dyn_cast(&RTy)) - AddType(DW_Unit, &Buffer, *CT); + AddType(DW_Unit, &Buffer, DIType(RTy.getGV())); //AddType(DW_Unit, &Buffer, Elements.getElement(0)); // Add arguments. for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(DW_TAG_formal_parameter); DIDescriptor Ty = Elements.getElement(i); - if (DIBasicType *BT = dyn_cast(&Ty)) - AddType(DW_Unit, &Buffer, *BT); - else if (DIDerivedType *DT = dyn_cast(&Ty)) - AddType(DW_Unit, &Buffer, *DT); - else if (DICompositeType *CT = dyn_cast(&Ty)) - AddType(DW_Unit, &Buffer, *CT); + AddType(DW_Unit, &Buffer, DIType(Ty.getGV())); Buffer.AddChild(Arg); } } @@ -1778,16 +1770,20 @@ case DW_TAG_union_type: { // Add elements to structure type. - DIArray Elements = CTy->getTypeArray(); + DIArray Elements = CTy.getTypeArray(); // Add elements to structure type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); - if (DISubprogram *SP = dyn_cast(&Element)) - ConstructFieldTypeDIE(DW_Unit, Buffer, SP); - else if (DIDerivedType *DT = dyn_cast(&Element)) + if (Element.getTag() == dwarf::DW_TAG_subprogram) + ConstructFieldTypeDIE(DW_Unit, Buffer, DISubprogram(Element.getGV())); + else if (Element.getTag() == dwarf::DW_TAG_variable) + ConstructFieldTypeDIE(DW_Unit, Buffer, + DIGlobalVariable(Element.getGV())); + else { + DIDerivedType DT = DIDerivedType(Element.getGV()); + assert (DT.isDerivedType(DT.getTag()) && "Unexpected strcut element"); ConstructFieldTypeDIE(DW_Unit, Buffer, DT); - else if (DIGlobalVariable *GV = dyn_cast(&Element)) - ConstructFieldTypeDIE(DW_Unit, Buffer, GV); + } } } break; @@ -1804,7 +1800,7 @@ else { // Add zero size even if it is not a forward declaration. // FIXME - Enable this. - // if (!CTy->isDefinition()) + // if (!CTy.isDefinition()) // AddUInt(&Buffer, DW_AT_declaration, DW_FORM_flag, 1); // else // AddUInt(&Buffer, DW_AT_byte_size, 0, 0); @@ -1813,14 +1809,14 @@ // Add source line info if available and TyDesc is not a forward // declaration. // FIXME - Enable this. - // if (CTy->isForwardDecl()) + // if (CTy.isForwardDecl()) // AddSourceLine(&Buffer, *CTy); } // ConstructSubrangeDIE - Construct subrange DIE from DISubrange. - void ConstructSubrangeDIE (DIE &Buffer, DISubrange *SR, DIE *IndexTy) { - int64_t L = SR->getLo(); - int64_t H = SR->getHi(); + void ConstructSubrangeDIE (DIE &Buffer, DISubrange SR, DIE *IndexTy) { + int64_t L = SR.getLo(); + int64_t H = SR.getHi(); DIE *DW_Subrange = new DIE(DW_TAG_subrange_type); if (L != H) { AddDIEntry(DW_Subrange, DW_AT_type, DW_FORM_ref4, IndexTy); @@ -1851,8 +1847,8 @@ // Add subranges to array type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); - if (DISubrange *SR = dyn_cast(&Element)) - ConstructSubrangeDIE(Buffer, SR, IndexTy); + if (Element.getTag() == dwarf::DW_TAG_subrange_type) + ConstructSubrangeDIE(Buffer, DISubrange(Element.getGV()), IndexTy); } } @@ -1870,16 +1866,16 @@ /// ConstructFieldTypeDIE - Construct variable DIE for a struct field. void ConstructFieldTypeDIE(CompileUnit *DW_Unit, - DIE &Buffer, DIGlobalVariable *V) { + DIE &Buffer, DIGlobalVariable V) { DIE *VariableDie = new DIE(DW_TAG_variable); - const std::string &LinkageName = V->getLinkageName(); + const std::string &LinkageName = V.getLinkageName(); if (!LinkageName.empty()) AddString(VariableDie, DW_AT_MIPS_linkage_name, DW_FORM_string, LinkageName); // FIXME - Enable this. AddSourceLine(VariableDie, V); - AddType(DW_Unit, VariableDie, V->getType()); - if (!V->isLocalToUnit()) + AddType(DW_Unit, VariableDie, V.getType()); + if (!V.isLocalToUnit()) AddUInt(VariableDie, DW_AT_external, DW_FORM_flag, 1); AddUInt(VariableDie, DW_AT_declaration, DW_FORM_flag, 1); Buffer.AddChild(VariableDie); @@ -1887,62 +1883,49 @@ /// ConstructFieldTypeDIE - Construct subprogram DIE for a struct field. void ConstructFieldTypeDIE(CompileUnit *DW_Unit, - DIE &Buffer, DISubprogram *SP, + DIE &Buffer, DISubprogram SP, bool IsConstructor = false) { DIE *Method = new DIE(DW_TAG_subprogram); - AddString(Method, DW_AT_name, DW_FORM_string, SP->getName()); - const std::string &LinkageName = SP->getLinkageName(); + AddString(Method, DW_AT_name, DW_FORM_string, SP.getName()); + const std::string &LinkageName = SP.getLinkageName(); if (!LinkageName.empty()) AddString(Method, DW_AT_MIPS_linkage_name, DW_FORM_string, LinkageName); // FIXME - Enable this. AddSourceLine(Method, SP); - DICompositeType MTy = SP->getType(); + DICompositeType MTy = SP.getType(); DIArray Args = MTy.getTypeArray(); // Add Return Type. - if (!IsConstructor) { - DIDescriptor Ty = Args.getElement(0); - if (DIBasicType *BT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *BT); - else if (DIDerivedType *DT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *DT); - else if (DICompositeType *CT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *CT); - } + if (!IsConstructor) + AddType(DW_Unit, Method, DIType(Args.getElement(0).getGV())); // Add arguments. for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { DIE *Arg = new DIE(DW_TAG_formal_parameter); - DIDescriptor Ty = Args.getElement(i); - if (DIBasicType *BT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *BT); - else if (DIDerivedType *DT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *DT); - else if (DICompositeType *CT = dyn_cast(&Ty)) - AddType(DW_Unit, Method, *CT); + AddType(DW_Unit, Method, DIType(Args.getElement(i).getGV())); AddUInt(Arg, DW_AT_artificial, DW_FORM_flag, 1); // ??? Method->AddChild(Arg); } - if (!SP->isLocalToUnit()) + if (!SP.isLocalToUnit()) AddUInt(Method, DW_AT_external, DW_FORM_flag, 1); Buffer.AddChild(Method); } - /// COnstructFieldTypeDIE - Construct derived type DIE for a struct field. + /// ConstructFieldTypeDIE - Construct derived type DIE for a struct field. void ConstructFieldTypeDIE(CompileUnit *DW_Unit, DIE &Buffer, - DIDerivedType *DTy) { - unsigned Tag = DTy->getTag(); + DIDerivedType DTy) { + unsigned Tag = DTy.getTag(); DIE *MemberDie = new DIE(Tag); - if (!DTy->getName().empty()) - AddString(MemberDie, DW_AT_name, DW_FORM_string, DTy->getName()); + if (!DTy.getName().empty()) + AddString(MemberDie, DW_AT_name, DW_FORM_string, DTy.getName()); // FIXME - Enable this. AddSourceLine(MemberDie, DTy); - DIType FromTy = DTy->getTypeDerivedFrom(); + DIType FromTy = DTy.getTypeDerivedFrom(); AddType(DW_Unit, MemberDie, FromTy); - uint64_t Size = DTy->getSizeInBits(); - uint64_t Offset = DTy->getOffsetInBits(); + uint64_t Size = DTy.getSizeInBits(); + uint64_t Offset = DTy.getOffsetInBits(); // FIXME Handle bitfields Modified: llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2006-11-06-StackTrace.cpp?rev=62276&r1=62275&r2=62276&view=diff ============================================================================== --- llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp (original) +++ llvm/trunk/test/FrontendC++/2006-11-06-StackTrace.cpp Thu Jan 15 13:26:23 2009 @@ -12,7 +12,6 @@ // Only works on ppc, x86 and x86_64. Should generalize? // FIXME: Un-XFAIL this test for Linux when debug stuff is working again. // XFAIL: alpha|ia64|arm|linux -// XFAIL: * #include From baldrick at free.fr Thu Jan 15 13:52:03 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 20:52:03 +0100 Subject: [llvm-commits] [llvm] r62263 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast-sext-zext.ll In-Reply-To: <200901151701.n0FH1NwC024494@zion.cs.uiuc.edu> References: <200901151701.n0FH1NwC024494@zion.cs.uiuc.edu> Message-ID: <200901152052.04024.baldrick@free.fr> Hi, > - Teach CanEvaluateInDifferentType of this xform: sext (zext ty1), ty2 -> zext ty2 this is only correct if the zext is non-trivial, i.e. the result type is not equal to the operand type. Ciao, Duncan. From evan.cheng at apple.com Thu Jan 15 14:05:43 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 15 Jan 2009 12:05:43 -0800 Subject: [llvm-commits] [llvm] r62263 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast-sext-zext.ll In-Reply-To: <200901152052.04024.baldrick@free.fr> References: <200901151701.n0FH1NwC024494@zion.cs.uiuc.edu> <200901152052.04024.baldrick@free.fr> Message-ID: That's not legal, right? Evan On Jan 15, 2009, at 11:52 AM, Duncan Sands wrote: > Hi, > >> - Teach CanEvaluateInDifferentType of this xform: sext (zext ty1), >> ty2 -> zext ty2 > > this is only correct if the zext is non-trivial, i.e. the result > type is not equal to the operand type. > > Ciao, > > Duncan. From gohman at apple.com Thu Jan 15 14:18:19 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 12:18:19 -0800 Subject: [llvm-commits] Patch: insert/extract element using a variable index In-Reply-To: References: Message-ID: Hi Mon Ping, In the test, please add -march=x86 to the llc line, so that it works on non-x86 hosts. Otherwise, this patch looks good to me. Dan On Jan 14, 2009, at 10:36 PM, Mon Ping Wang wrote: > Hi, > > We can't use insertps/extractps for insert/extract an element from a > <4 x i32> vector using a variable index. This patch will cause > Legalize to expand the operator for that case. > > --- Mon Ping > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From rafael.espindola at gmail.com Thu Jan 15 14:18:42 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 15 Jan 2009 20:18:42 -0000 Subject: [llvm-commits] [llvm] r62279 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/Analysis/IPA/ lib/Archive/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/JIT/ lib/Linker/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CBackend/ lib/Target/CellSPU/AsmPrinter/ lib/Target/CppBackend/ lib/Target/IA64/ lib/Target/MSIL/ lib/Target/Mips/ ... Message-ID: <200901152018.n0FKIjTg031777@zion.cs.uiuc.edu> Author: rafael Date: Thu Jan 15 14:18:42 2009 New Revision: 62279 URL: http://llvm.org/viewvc/llvm-project?rev=62279&view=rev Log: Add the private linkage. Added: llvm/trunk/test/Assembler/private.ll llvm/trunk/test/CodeGen/ARM/private.ll llvm/trunk/test/CodeGen/Alpha/private.ll llvm/trunk/test/CodeGen/CellSPU/private.ll llvm/trunk/test/CodeGen/IA64/private.ll llvm/trunk/test/CodeGen/Mips/private.ll llvm/trunk/test/CodeGen/PowerPC/private.ll llvm/trunk/test/CodeGen/SPARC/private.ll llvm/trunk/test/CodeGen/X86/private.ll llvm/trunk/test/CodeGen/XCore/private.ll Modified: llvm/trunk/docs/LangRef.html llvm/trunk/include/llvm/GlobalValue.h llvm/trunk/include/llvm/Module.h llvm/trunk/include/llvm/Support/Mangler.h llvm/trunk/lib/Analysis/IPA/Andersens.cpp llvm/trunk/lib/Analysis/IPA/CallGraph.cpp llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp llvm/trunk/lib/Archive/Archive.cpp llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/LLParser.cpp llvm/trunk/lib/AsmParser/LLToken.h llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp llvm/trunk/lib/Linker/LinkArchives.cpp llvm/trunk/lib/Linker/LinkModules.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.cpp llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp llvm/trunk/lib/Target/X86/X86Subtarget.cpp llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/Transforms/IPO/Internalize.cpp llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp llvm/trunk/lib/Transforms/Scalar/SCCP.cpp llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp llvm/trunk/lib/Transforms/Utils/InlineCost.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/Mangler.cpp llvm/trunk/lib/VMCore/Module.cpp llvm/trunk/lib/VMCore/Verifier.cpp llvm/trunk/tools/bugpoint/ExtractFunction.cpp llvm/trunk/tools/llvm-nm/llvm-nm.cpp Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Thu Jan 15 14:18:42 2009 @@ -480,13 +480,20 @@
    -
    internal:
    +
    private:
    -
    Global values with internal linkage are only directly accessible by +
    Global values with private linkage are only directly accessible by objects in the current module. In particular, linking code into a module with - an internal global value may cause the internal to be renamed as necessary to - avoid collisions. Because the symbol is internal to the module, all - references can be updated. This corresponds to the notion of the + an private global value may cause the private to be renamed as necessary to + avoid collisions. Because the symbol is private to the module, all + references can be updated. This doesn't show up in any symbol table in the + object file. +
    + +
    internal:
    + +
    Similar to private, but the value show as a local symbol (STB_LOCAL in + the case of ELF) in the object file. This corresponds to the notion of the 'static' keyword in C.
    Modified: llvm/trunk/include/llvm/GlobalValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/include/llvm/GlobalValue.h (original) +++ llvm/trunk/include/llvm/GlobalValue.h Thu Jan 15 14:18:42 2009 @@ -35,6 +35,7 @@ WeakLinkage, ///< Keep one copy of named function when linking (weak) AppendingLinkage, ///< Special purpose, only applies to global arrays InternalLinkage, ///< Rename collisions when linking (static functions) + PrivateLinkage, ///< Like Internal, but omit from symbol table DLLImportLinkage, ///< Function to be imported from DLL DLLExportLinkage, ///< Function to be accessible from DLL ExternalWeakLinkage,///< ExternalWeak linkage description @@ -104,6 +105,10 @@ bool hasCommonLinkage() const { return Linkage == CommonLinkage; } bool hasAppendingLinkage() const { return Linkage == AppendingLinkage; } bool hasInternalLinkage() const { return Linkage == InternalLinkage; } + bool hasPrivateLinkage() const { return Linkage == PrivateLinkage; } + bool hasLocalLinkage() const { + return Linkage == InternalLinkage || Linkage == PrivateLinkage; + } bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; } bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; } bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; } Modified: llvm/trunk/include/llvm/Module.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/include/llvm/Module.h (original) +++ llvm/trunk/include/llvm/Module.h Thu Jan 15 14:18:42 2009 @@ -188,7 +188,7 @@ /// getOrInsertFunction - Look up the specified function in the module symbol /// table. Four possibilities: /// 1. If it does not exist, add a prototype for the function and return it. - /// 2. If it exists, and has internal linkage, the existing function is + /// 2. If it exists, and has a local linkage, the existing function is /// renamed and a new one is inserted. /// 3. Otherwise, if the existing function has the correct prototype, return /// the existing function. Modified: llvm/trunk/include/llvm/Support/Mangler.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Mangler.h (original) +++ llvm/trunk/include/llvm/Support/Mangler.h Thu Jan 15 14:18:42 2009 @@ -29,6 +29,7 @@ /// symbol is marked as not needing this prefix. const char *Prefix; + const char *PrivatePrefix; /// UseQuotes - If this is set, the target accepts global names in quotes, /// e.g. "foo bar" is a legal name. This syntax is used instead of escaping /// the space character. By default, this is false. @@ -58,7 +59,7 @@ // Mangler ctor - if a prefix is specified, it will be prepended onto all // symbols. - Mangler(Module &M, const char *Prefix = ""); + Mangler(Module &M, const char *Prefix = "", const char *privatePrefix = ""); /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted /// strings for assembler labels. Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Thu Jan 15 14:18:42 2009 @@ -1084,7 +1084,7 @@ // At some point we should just add constraints for the escaping functions // at solve time, but this slows down solving. For now, we simply mark // address taken functions as escaping and treat them as external. - if (!F->hasInternalLinkage() || AnalyzeUsesOfFunction(F)) + if (!F->hasLocalLinkage() || AnalyzeUsesOfFunction(F)) AddConstraintsForNonInternalLinkage(F); if (!F->isDeclaration()) { Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Thu Jan 15 14:18:42 2009 @@ -112,7 +112,7 @@ CallGraphNode *Node = getOrInsertFunction(F); // If this function has external linkage, anything could call it. - if (!F->hasInternalLinkage()) { + if (!F->hasLocalLinkage()) { ExternalCallingNode->addCalledFunction(CallSite(), Node); // Found the entry point? Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Thu Jan 15 14:18:42 2009 @@ -164,7 +164,7 @@ void GlobalsModRef::AnalyzeGlobals(Module &M) { std::vector Readers, Writers; for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->hasInternalLinkage()) { + if (I->hasLocalLinkage()) { if (!AnalyzeUsesOfPointer(I, Readers, Writers)) { // Remember that we are tracking this global. NonAddressTakenGlobals.insert(I); @@ -175,7 +175,7 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (I->hasInternalLinkage()) { + if (I->hasLocalLinkage()) { if (!AnalyzeUsesOfPointer(I, Readers, Writers)) { // Remember that we are tracking this global, and the mod/ref fns NonAddressTakenGlobals.insert(I); @@ -504,7 +504,7 @@ // If we are asking for mod/ref info of a direct call with a pointer to a // global we are tracking, return information if we have it. if (GlobalValue *GV = dyn_cast(P->getUnderlyingObject())) - if (GV->hasInternalLinkage()) + if (GV->hasLocalLinkage()) if (Function *F = CS.getCalledFunction()) if (NonAddressTakenGlobals.count(GV)) if (FunctionRecord *FR = getFunctionInfo(F)) Modified: llvm/trunk/lib/Archive/Archive.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Archive/Archive.cpp (original) +++ llvm/trunk/lib/Archive/Archive.cpp Thu Jan 15 14:18:42 2009 @@ -188,13 +188,13 @@ static void getSymbols(Module*M, std::vector& symbols) { // Loop over global variables for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI) - if (!GI->isDeclaration() && !GI->hasInternalLinkage()) + if (!GI->isDeclaration() && !GI->hasLocalLinkage()) if (!GI->getName().empty()) symbols.push_back(GI->getName()); // Loop over functions for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI) - if (!FI->isDeclaration() && !FI->hasInternalLinkage()) + if (!FI->isDeclaration() && !FI->hasLocalLinkage()) if (!FI->getName().empty()) symbols.push_back(FI->getName()); Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Thu Jan 15 14:18:42 2009 @@ -453,6 +453,7 @@ KEYWORD(declare); KEYWORD(define); KEYWORD(global); KEYWORD(constant); + KEYWORD(private); KEYWORD(internal); KEYWORD(linkonce); KEYWORD(weak); Modified: llvm/trunk/lib/AsmParser/LLParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) +++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Jan 15 14:18:42 2009 @@ -113,6 +113,7 @@ // optional leading prefixes, the production is: // GlobalVar ::= OptionalLinkage OptionalVisibility OptionalThreadLocal // OptionalAddrSpace ('constant'|'global') ... + case lltok::kw_private: // OptionalLinkage case lltok::kw_internal: // OptionalLinkage case lltok::kw_weak: // OptionalLinkage case lltok::kw_linkonce: // OptionalLinkage @@ -375,7 +376,8 @@ if (Linkage != GlobalValue::ExternalLinkage && Linkage != GlobalValue::WeakLinkage && - Linkage != GlobalValue::InternalLinkage) + Linkage != GlobalValue::InternalLinkage && + Linkage != GlobalValue::PrivateLinkage) return Error(LinkageLoc, "invalid linkage type for alias"); Constant *Aliasee; @@ -738,6 +740,7 @@ /// ParseOptionalLinkage /// ::= /*empty*/ +/// ::= 'private' /// ::= 'internal' /// ::= 'weak' /// ::= 'linkonce' @@ -751,6 +754,7 @@ HasLinkage = false; switch (Lex.getKind()) { default: Res = GlobalValue::ExternalLinkage; return false; + case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break; case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break; case lltok::kw_weak: Res = GlobalValue::WeakLinkage; break; case lltok::kw_linkonce: Res = GlobalValue::LinkOnceLinkage; break; @@ -2065,6 +2069,7 @@ if (isDefine) return Error(LinkageLoc, "invalid linkage for function definition"); break; + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: Modified: llvm/trunk/lib/AsmParser/LLToken.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLToken.h (original) +++ llvm/trunk/lib/AsmParser/LLToken.h Thu Jan 15 14:18:42 2009 @@ -36,7 +36,7 @@ kw_declare, kw_define, kw_global, kw_constant, - kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, + kw_private, kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, kw_dllexport, kw_common, kw_default, kw_hidden, kw_protected, kw_extern_weak, kw_external, kw_thread_local, Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Jan 15 14:18:42 2009 @@ -67,6 +67,7 @@ case 6: return GlobalValue::DLLExportLinkage; case 7: return GlobalValue::ExternalWeakLinkage; case 8: return GlobalValue::CommonLinkage; + case 9: return GlobalValue::PrivateLinkage; } } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Jan 15 14:18:42 2009 @@ -284,6 +284,7 @@ case GlobalValue::DLLExportLinkage: return 6; case GlobalValue::ExternalWeakLinkage: return 7; case GlobalValue::CommonLinkage: return 8; + case GlobalValue::PrivateLinkage: return 9; } } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -139,7 +139,7 @@ } bool AsmPrinter::doInitialization(Module &M) { - Mang = new Mangler(M, TAI->getGlobalPrefix()); + Mang = new Mangler(M, TAI->getGlobalPrefix(), TAI->getPrivateGlobalPrefix()); GCModuleInfo *MI = getAnalysisToUpdate(); assert(MI && "AsmPrinter didn't require GCModuleInfo?"); @@ -199,7 +199,7 @@ O << "\t.globl\t" << Name << '\n'; else if (I->hasWeakLinkage()) O << TAI->getWeakRefDirective() << Name << '\n'; - else if (!I->hasInternalLinkage()) + else if (!I->hasLocalLinkage()) assert(0 && "Invalid alias linkage"); printVisibility(Name, I->getVisibility()); Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 14:18:42 2009 @@ -3272,7 +3272,8 @@ // Externally visible entry into the functions eh frame info. // If the corresponding function is static, this should not be // externally visible. - if (linkage != Function::InternalLinkage) { + if (linkage != Function::InternalLinkage && + linkage != Function::PrivateLinkage) { if (const char *GlobalEHDirective = TAI->getGlobalEHDirective()) O << GlobalEHDirective << EHFrameInfo.FnName << "\n"; } Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Thu Jan 15 14:18:42 2009 @@ -174,6 +174,8 @@ case GlobalValue::WeakLinkage: FnSym.SetBind(ELFWriter::ELFSym::STB_WEAK); break; + case GlobalValue::PrivateLinkage: + assert (0 && "PrivateLinkage should not be in the symbol table."); case GlobalValue::InternalLinkage: FnSym.SetBind(ELFWriter::ELFSym::STB_LOCAL); break; @@ -329,7 +331,8 @@ // Set the idx of the .bss section BSSSym.SectionIdx = BSSSection.SectionIdx; - SymbolTable.push_back(BSSSym); + if (!GV->hasPrivateLinkage()) + SymbolTable.push_back(BSSSym); // Reserve space in the .bss section for this symbol. BSSSection.Size += Size; Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Thu Jan 15 14:18:42 2009 @@ -371,7 +371,7 @@ SecDataOut.outbyte(0); } // Globals without external linkage apparently do not go in the symbol table. - if (GV->getLinkage() != GlobalValue::InternalLinkage) { + if (!GV->hasLocalLinkage()) { MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TM); Sym.n_value = Sec->size; SymbolTable.push_back(Sym); @@ -959,6 +959,9 @@ GVName = TAI->getGlobalPrefix() + name; n_type |= GV->hasHiddenVisibility() ? N_PEXT : N_EXT; break; + case GlobalValue::PrivateLinkage: + GVName = TAI->getPrivateGlobalPrefix() + name; + break; case GlobalValue::InternalLinkage: GVName = TAI->getGlobalPrefix() + name; break; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Jan 15 14:18:42 2009 @@ -4276,7 +4276,7 @@ // Check for well-known libc/libm calls. If the function is internal, it // can't be a library call. unsigned NameLen = F->getNameLen(); - if (!F->hasInternalLinkage() && NameLen) { + if (!F->hasLocalLinkage() && NameLen) { const char *NameStr = F->getNameStart(); if (NameStr[0] == 'c' && ((NameLen == 8 && !strcmp(NameStr, "copysign")) || Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Thu Jan 15 14:18:42 2009 @@ -249,7 +249,7 @@ // an old-style (llvmgcc3) static ctor with __main linked in and in use. If // this is the case, don't execute any of the global ctors, __main will do // it. - if (!GV || GV->isDeclaration() || GV->hasInternalLinkage()) return; + if (!GV || GV->isDeclaration() || GV->hasLocalLinkage()) return; // Should be an array of '{ int, void ()* }' structs. The first value is // the init priority, which we ignore. @@ -893,7 +893,7 @@ for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { const GlobalValue *GV = I; - if (GV->hasInternalLinkage() || GV->isDeclaration() || + if (GV->hasLocalLinkage() || GV->isDeclaration() || GV->hasAppendingLinkage() || !GV->hasName()) continue;// Ignore external globals and globals with internal linkage. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Jan 15 14:18:42 2009 @@ -554,7 +554,7 @@ addGlobalMapping(GV, Ptr); } } else { - if (isGVCompilationDisabled() && !GV->hasInternalLinkage()) { + if (isGVCompilationDisabled() && !GV->hasLocalLinkage()) { cerr << "Compilation of non-internal GlobalValue is disabled!\n"; abort(); } Modified: llvm/trunk/lib/Linker/LinkArchives.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkArchives.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkArchives.cpp (original) +++ llvm/trunk/lib/Linker/LinkArchives.cpp Thu Jan 15 14:18:42 2009 @@ -50,7 +50,7 @@ if (I->hasName()) { if (I->isDeclaration()) UndefinedSymbols.insert(I->getName()); - else if (!I->hasInternalLinkage()) { + else if (!I->hasLocalLinkage()) { assert(!I->hasDLLImportLinkage() && "Found dllimported non-external symbol!"); DefinedSymbols.insert(I->getName()); @@ -62,7 +62,7 @@ if (I->hasName()) { if (I->isDeclaration()) UndefinedSymbols.insert(I->getName()); - else if (!I->hasInternalLinkage()) { + else if (!I->hasLocalLinkage()) { assert(!I->hasDLLImportLinkage() && "Found dllimported non-external symbol!"); DefinedSymbols.insert(I->getName()); Modified: llvm/trunk/lib/Linker/LinkModules.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Linker/LinkModules.cpp (original) +++ llvm/trunk/lib/Linker/LinkModules.cpp Thu Jan 15 14:18:42 2009 @@ -1,4 +1,4 @@ -//===- lib/Linker/LinkModules.cpp - Module Linker Implementation ----------===// + //===- lib/Linker/LinkModules.cpp - Module Linker Implementation ----------===// // // The LLVM Compiler Infrastructure // @@ -415,7 +415,7 @@ // If there is a conflict, rename the conflict. if (GlobalValue *ConflictGV = cast_or_null(ST.lookup(Name))) { - assert(ConflictGV->hasInternalLinkage() && + assert(ConflictGV->hasLocalLinkage() && "Not conflicting with a static global, should link instead!"); GV->takeName(ConflictGV); ConflictGV->setName(Name); // This will cause ConflictGV to get renamed @@ -444,7 +444,7 @@ static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src, GlobalValue::LinkageTypes <, bool &LinkFromSrc, std::string *Err) { - assert((!Dest || !Src->hasInternalLinkage()) && + assert((!Dest || !Src->hasLocalLinkage()) && "If Src has internal linkage, Dest shouldn't be set!"); if (!Dest) { // Linking something to nothing. @@ -536,13 +536,13 @@ // Check to see if may have to link the global with the global, alias or // function. - if (SGV->hasName() && !SGV->hasInternalLinkage()) + if (SGV->hasName() && !SGV->hasLocalLinkage()) DGV = cast_or_null(DestSymTab.lookup(SGV->getNameStart(), SGV->getNameEnd())); // If we found a global with the same name in the dest module, but it has // internal linkage, we are really not doing any linkage here. - if (DGV && DGV->hasInternalLinkage()) + if (DGV && DGV->hasLocalLinkage()) DGV = 0; // If types don't agree due to opaque types, try to resolve them. @@ -573,7 +573,7 @@ // If the LLVM runtime renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename // it. - if (!NewDGV->hasInternalLinkage() && NewDGV->getName() != SGV->getName()) + if (!NewDGV->hasLocalLinkage() && NewDGV->getName() != SGV->getName()) ForceRenaming(NewDGV, SGV->getName()); // Make sure to remember this mapping. @@ -643,7 +643,7 @@ // If the symbol table renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename. - if (NewDGV->getName() != SGV->getName() && !NewDGV->hasInternalLinkage()) + if (NewDGV->getName() != SGV->getName() && !NewDGV->hasLocalLinkage()) ForceRenaming(NewDGV, SGV->getName()); // Inherit const as appropriate. @@ -687,10 +687,12 @@ return GlobalValue::ExternalLinkage; else if (SGV->hasWeakLinkage() || DGV->hasWeakLinkage()) return GlobalValue::WeakLinkage; - else { - assert(SGV->hasInternalLinkage() && DGV->hasInternalLinkage() && - "Unexpected linkage type"); + else if (SGV->hasInternalLinkage() && DGV->hasInternalLinkage()) return GlobalValue::InternalLinkage; + else { + assert (SGV->hasPrivateLinkage() && DGV->hasPrivateLinkage() && + "Unexpected linkage type"); + return GlobalValue::PrivateLinkage; } } @@ -715,7 +717,7 @@ GlobalValue* DGV = NULL; // Try to find something 'similar' to SGA in destination module. - if (!DGV && !SGA->hasInternalLinkage()) { + if (!DGV && !SGA->hasLocalLinkage()) { DGV = Dest->getNamedAlias(SGA->getName()); // If types don't agree due to opaque types, try to resolve them. @@ -723,7 +725,7 @@ RecursiveResolveTypes(SGA->getType(), DGV->getType()); } - if (!DGV && !SGA->hasInternalLinkage()) { + if (!DGV && !SGA->hasLocalLinkage()) { DGV = Dest->getGlobalVariable(SGA->getName()); // If types don't agree due to opaque types, try to resolve them. @@ -731,7 +733,7 @@ RecursiveResolveTypes(SGA->getType(), DGV->getType()); } - if (!DGV && !SGA->hasInternalLinkage()) { + if (!DGV && !SGA->hasLocalLinkage()) { DGV = Dest->getFunction(SGA->getName()); // If types don't agree due to opaque types, try to resolve them. @@ -740,7 +742,7 @@ } // No linking to be performed on internal stuff. - if (DGV && DGV->hasInternalLinkage()) + if (DGV && DGV->hasLocalLinkage()) DGV = NULL; if (GlobalAlias *DGA = dyn_cast_or_null(DGV)) { @@ -831,7 +833,7 @@ // If the symbol table renamed the alias, but it is an externally visible // symbol, DGA must be an global value with internal linkage. Rename it. if (NewGA->getName() != SGA->getName() && - !NewGA->hasInternalLinkage()) + !NewGA->hasLocalLinkage()) ForceRenaming(NewGA, SGA->getName()); // Remember this mapping so uses in the source module get remapped @@ -912,13 +914,13 @@ // Check to see if may have to link the function with the global, alias or // function. - if (SF->hasName() && !SF->hasInternalLinkage()) + if (SF->hasName() && !SF->hasLocalLinkage()) DGV = cast_or_null(DestSymTab.lookup(SF->getNameStart(), SF->getNameEnd())); // If we found a global with the same name in the dest module, but it has // internal linkage, we are really not doing any linkage here. - if (DGV && DGV->hasInternalLinkage()) + if (DGV && DGV->hasLocalLinkage()) DGV = 0; // If types don't agree due to opaque types, try to resolve them. @@ -943,7 +945,7 @@ // If the LLVM runtime renamed the function, but it is an externally // visible symbol, DF must be an existing function with internal linkage. // Rename it. - if (!NewDF->hasInternalLinkage() && NewDF->getName() != SF->getName()) + if (!NewDF->hasLocalLinkage() && NewDF->getName() != SF->getName()) ForceRenaming(NewDF, SF->getName()); // ... and remember this mapping... @@ -982,7 +984,7 @@ // If the symbol table renamed the function, but it is an externally // visible symbol, DF must be an existing function with internal // linkage. Rename it. - if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage()) + if (NewDF->getName() != SF->getName() && !NewDF->hasLocalLinkage()) ForceRenaming(NewDF, SF->getName()); // Remember this mapping so uses in the source module get remapped Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jan 15 14:18:42 2009 @@ -808,7 +808,7 @@ GlobalValue *GV = cast(Op)->getGlobal(); Reloc::Model RelocM = getTargetMachine().getRelocationModel(); if (RelocM == Reloc::PIC_) { - bool UseGOTOFF = GV->hasInternalLinkage() || GV->hasHiddenVisibility(); + bool UseGOTOFF = GV->hasLocalLinkage() || GV->hasHiddenVisibility(); ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT"); SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -197,6 +197,7 @@ const Function *F = MF.getFunction(); switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: SwitchToTextSection("\t.text", F); break; @@ -847,11 +848,11 @@ } } - if (GVar->hasInternalLinkage() || GVar->mayBeOverridden()) { + if (GVar->hasLocalLinkage() || GVar->mayBeOverridden()) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (isDarwin) { - if (GVar->hasInternalLinkage()) { + if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << "," << Size << ',' << Align; } else if (GVar->hasCommonLinkage()) { @@ -869,7 +870,7 @@ return; } } else if (TAI->getLCOMMDirective() != NULL) { - if (GVar->hasInternalLinkage()) { + if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << "," << Size; } else { O << TAI->getCOMMDirective() << name << "," << Size; @@ -878,7 +879,7 @@ } } else { SwitchToSection(TAI->SectionForGlobal(GVar)); - if (GVar->hasInternalLinkage()) + if (GVar->hasLocalLinkage()) O << "\t.local\t" << name << "\n"; O << TAI->getCOMMDirective() << name << "," << Size; if (TAI->getCOMMDirectiveTakesAlignment()) @@ -909,6 +910,7 @@ case GlobalValue::ExternalLinkage: O << "\t.globl " << name << "\n"; // FALL THROUGH + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: break; default: Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Thu Jan 15 14:18:42 2009 @@ -513,7 +513,7 @@ SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset()); // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { - if (GV->hasInternalLinkage()) { + if (GV->hasLocalLinkage()) { SDValue Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA, DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); SDValue Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, GA, Hi); Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -169,6 +169,7 @@ O << "\t.ent " << CurrentFnName << "\n"; + assert (!F->hasPrivateLinkage() && "add private prefix."); O << CurrentFnName << ":\n"; // Print out code for the function. Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Jan 15 14:18:42 2009 @@ -1910,7 +1910,7 @@ if (getGlobalVariableClass(I)) continue; - if (I->hasInternalLinkage()) + if (I->hasLocalLinkage()) Out << "static "; else Out << "extern "; @@ -1946,7 +1946,7 @@ if (getGlobalVariableClass(I)) continue; - if (I->hasInternalLinkage()) + if (I->hasLocalLinkage()) Out << "static "; else if (I->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; @@ -2190,7 +2190,7 @@ /// isStructReturn - Should this function actually return a struct by-value? bool isStructReturn = F->hasStructRetAttr(); - if (F->hasInternalLinkage()) Out << "static "; + if (F->hasLocalLinkage()) Out << "static "; if (F->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; if (F->hasDLLExportLinkage()) Out << "__declspec(dllexport) "; switch (F->getCallingConv()) { Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -442,6 +442,7 @@ switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: // Symbols default to internal. break; case Function::ExternalLinkage: @@ -536,7 +537,7 @@ if (C->isNullValue() && /* FIXME: Verify correct */ !GVar->hasSection() && - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. @@ -545,7 +546,7 @@ O << "\t.type " << name << ", @object\n"; O << name << ":\n"; O << "\t.zero " << Size << '\n'; - } else if (GVar->hasInternalLinkage()) { + } else if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << ',' << Size; } else { O << ".comm " << name << ',' << Size; @@ -573,6 +574,7 @@ O << "\t.global " << name << '\n' << "\t.type " << name << ", @object\n"; // FALL THROUGH + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: break; default: @@ -617,4 +619,3 @@ SPUTargetMachine &tm) { return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo()); } - Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Jan 15 14:18:42 2009 @@ -292,6 +292,8 @@ switch (LT) { case GlobalValue::InternalLinkage: Out << "GlobalValue::InternalLinkage"; break; + case GlobalValue::PrivateLinkage: + Out << "GlobalValue::PrivateLinkage"; break; case GlobalValue::LinkOnceLinkage: Out << "GlobalValue::LinkOnceLinkage "; break; case GlobalValue::WeakLinkage: Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Thu Jan 15 14:18:42 2009 @@ -61,7 +61,7 @@ Mangler *Mang) const { if (GV==0) return false; - if (GV->hasInternalLinkage() && !isa(GV) && + if (GV->hasLocalLinkage() && !isa(GV) && ((strlen(getPrivateGlobalPrefix()) != 0 && Mang->getValueName(GV).substr(0,strlen(getPrivateGlobalPrefix())) == getPrivateGlobalPrefix()) || Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Thu Jan 15 14:18:42 2009 @@ -44,6 +44,7 @@ if (const Function *F = dyn_cast(GV)) { switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: case Function::DLLExportLinkage: case Function::ExternalLinkage: @@ -184,4 +185,3 @@ return Flags; } - Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -275,10 +275,10 @@ if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. - if (GVar->hasInternalLinkage()) { + if (GVar->hasLocalLinkage()) { O << "\t.lcomm " << name << "#," << Size << ',' << (1 << Align); O << '\n'; @@ -307,6 +307,7 @@ O << TAI->getGlobalDirective() << name << '\n'; // FALL THROUGH case GlobalValue::InternalLinkage: + case GlobalValue::PrivateLinkage: break; case GlobalValue::GhostLinkage: cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n"; Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Thu Jan 15 14:18:42 2009 @@ -349,10 +349,10 @@ return ArgumentVT; // Function else if (const Function* F = dyn_cast(V)) - return F->hasInternalLinkage() ? InternalVT : GlobalVT; + return F->hasLocalLinkage() ? InternalVT : GlobalVT; // Variable else if (const GlobalVariable* G = dyn_cast(V)) - return G->hasInternalLinkage() ? InternalVT : GlobalVT; + return G->hasLocalLinkage() ? InternalVT : GlobalVT; // Constant else if (isa(V)) return isa(V) ? ConstExprVT : ConstVT; @@ -1401,7 +1401,7 @@ void MSILWriter::printFunction(const Function& F) { bool isSigned = F.paramHasAttr(0, Attribute::SExt); Out << "\n.method static "; - Out << (F.hasInternalLinkage() ? "private " : "public "); + Out << (F.hasLocalLinkage() ? "private " : "public "); if (F.isVarArg()) Out << "vararg "; Out << getTypeName(F.getReturnType(),isSigned) << getConvModopt(F.getCallingConv()) << getValueName(&F) << '\n'; Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -275,9 +275,6 @@ O << "\n\n"; - // What's my mangled name? - CurrentFnName = Mang->getValueName(MF.getFunction()); - // Emit the function start directives emitFunctionStart(MF); @@ -384,7 +381,10 @@ return; case MachineOperand::MO_GlobalAddress: - O << Mang->getValueName(MO.getGlobal()); + { + const GlobalValue *GV = MO.getGlobal(); + O << Mang->getValueName(GV); + } break; case MachineOperand::MO_ExternalSymbol: @@ -449,7 +449,7 @@ bool MipsAsmPrinter:: doInitialization(Module &M) { - Mang = new Mangler(M); + Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix()); // Tell the assembler which ABI we are using O << "\t.section .mdebug." << emitCurrentABIString() << '\n'; @@ -502,10 +502,10 @@ if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. - if (GVar->hasInternalLinkage()) + if (GVar->hasLocalLinkage()) O << "\t.local\t" << name << '\n'; O << TAI->getCOMMDirective() << name << ',' << Size; @@ -531,6 +531,7 @@ // If external or appending, declare as a global symbol O << TAI->getGlobalDirective() << name << '\n'; // Fall Through + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: if (CVA && CVA->isCString()) printSizeAndType = false; Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Jan 15 14:18:42 2009 @@ -216,7 +216,7 @@ // if this is a internal constant string, there is a special // section for it, but not in small data/bss. - if (GVA->hasInitializer() && GV->hasInternalLinkage()) { + if (GVA->hasInitializer() && GV->hasLocalLinkage()) { Constant *C = GVA->getInitializer(); const ConstantArray *CVA = dyn_cast(C); if (CVA && CVA->isCString()) @@ -489,7 +489,7 @@ SDValue ResNode = DAG.getLoad(MVT::i32, DAG.getEntryNode(), GA, NULL, 0); // On functions and global targets not internal linked only // a load from got/GP is necessary for PIC to work. - if (!GV->hasInternalLinkage() || isa(GV)) + if (!GV->hasLocalLinkage() || isa(GV)) return ResNode; SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); return DAG.getNode(ISD::ADD, MVT::i32, ResNode, Lo); Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -584,6 +584,7 @@ switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: // Symbols default to internal. break; case Function::ExternalLinkage: @@ -686,7 +687,7 @@ if (C->isNullValue() && /* FIXME: Verify correct */ !GVar->hasSection() && - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. @@ -695,7 +696,7 @@ O << "\t.type " << name << ", @object\n"; O << name << ":\n"; O << "\t.zero " << Size << '\n'; - } else if (GVar->hasInternalLinkage()) { + } else if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << ',' << Size; } else { O << ".comm " << name << ',' << Size; @@ -723,6 +724,7 @@ << "\t.type " << name << ", @object\n"; // FALL THROUGH case GlobalValue::InternalLinkage: + case GlobalValue::PrivateLinkage: break; default: cerr << "Unknown linkage type!"; @@ -911,7 +913,7 @@ if (C->isNullValue() && /* FIXME: Verify correct */ !GVar->hasSection() && - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. @@ -919,7 +921,7 @@ O << "\t.globl " << name << '\n'; O << "\t.zerofill __DATA, __common, " << name << ", " << Size << ", " << Align; - } else if (GVar->hasInternalLinkage()) { + } else if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << ',' << Size << ',' << Align; } else if (!GVar->hasCommonLinkage()) { O << "\t.globl " << name << '\n' Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -98,8 +98,6 @@ static unsigned BBNumber = 0; O << "\n\n"; - // What's my mangled name? - CurrentFnName = Mang->getValueName(MF.getFunction()); // Print out the label for the function. const Function *F = MF.getFunction(); @@ -168,7 +166,10 @@ printBasicBlockLabel(MO.getMBB()); return; case MachineOperand::MO_GlobalAddress: - O << Mang->getValueName(MO.getGlobal()); + { + const GlobalValue *GV = MO.getGlobal(); + O << Mang->getValueName(GV); + } break; case MachineOperand::MO_ExternalSymbol: O << MO.getSymbolName(); @@ -218,7 +219,7 @@ } bool SparcAsmPrinter::doInitialization(Module &M) { - Mang = new Mangler(M); + Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix()); return false; // success } @@ -255,10 +256,10 @@ if (C->isNullValue() && !GVar->hasSection()) { if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. - if (GVar->hasInternalLinkage()) + if (GVar->hasLocalLinkage()) O << "\t.local " << name << '\n'; O << TAI->getCOMMDirective() << name << ',' << Size; @@ -284,6 +285,7 @@ // If external or appending, declare as a global symbol O << TAI->getGlobalDirective() << name << '\n'; // FALL THROUGH + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: break; case GlobalValue::GhostLinkage: Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -159,6 +159,7 @@ switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); case Function::InternalLinkage: // Symbols default to internal. + case Function::PrivateLinkage: EmitAlignment(FnAlign, F); break; case Function::DLLExportLinkage: @@ -188,7 +189,7 @@ else if (Subtarget->isTargetCygMing()) { O << "\t.def\t " << CurrentFnName << ";\t.scl\t" << - (F->getLinkage() == Function::InternalLinkage ? COFF::C_STAT : COFF::C_EXT) + (F->hasInternalLinkage() ? COFF::C_STAT : COFF::C_EXT) << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT) << ";\t.endef\n"; } @@ -421,7 +422,7 @@ if (shouldPrintPLT(TM, Subtarget)) { // Assemble call via PLT for externally visible symbols if (!GV->hasHiddenVisibility() && !GV->hasProtectedVisibility() && - !GV->hasInternalLinkage()) + !GV->hasLocalLinkage()) O << "@PLT"; } if (Subtarget->isTargetCygMing() && GV->isDeclaration()) @@ -789,11 +790,11 @@ } if (!GVar->isThreadLocal() && - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (TAI->getLCOMMDirective() != NULL) { - if (GVar->hasInternalLinkage()) { + if (GVar->hasLocalLinkage()) { O << TAI->getLCOMMDirective() << name << ',' << Size; if (Subtarget->isTargetDarwin()) O << ',' << Align; @@ -813,7 +814,7 @@ } } else { if (!Subtarget->isTargetCygMing()) { - if (GVar->hasInternalLinkage()) + if (GVar->hasLocalLinkage()) O << "\t.local\t" << name << '\n'; } O << TAI->getCOMMDirective() << name << ',' << Size; @@ -849,6 +850,7 @@ // If external or appending, declare as a global symbol O << "\t.globl " << name << '\n'; // FALL THROUGH + case GlobalValue::PrivateLinkage: case GlobalValue::InternalLinkage: break; default: Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -145,6 +145,7 @@ FnAlign = 1; switch (F->getLinkage()) { default: assert(0 && "Unsupported linkage type!"); + case Function::PrivateLinkage: case Function::InternalLinkage: EmitAlignment(FnAlign); break; Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Thu Jan 15 14:18:42 2009 @@ -56,7 +56,7 @@ // Extra load is needed for all externally visible. if (isDirectCall) return false; - if (GV->hasInternalLinkage() || GV->hasHiddenVisibility()) + if (GV->hasLocalLinkage() || GV->hasHiddenVisibility()) return false; return true; } else if (isTargetCygMing() || isTargetWindows()) { @@ -79,7 +79,7 @@ // returns false. if (TM.getRelocationModel() == Reloc::PIC_) return !isDirectCall && - (GV->hasInternalLinkage() || GV->hasExternalLinkage()); + (GV->hasLocalLinkage() || GV->hasExternalLinkage()); return false; } Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Thu Jan 15 14:18:42 2009 @@ -198,6 +198,7 @@ } // FALL THROUGH case GlobalValue::InternalLinkage: + case GlobalValue::PrivateLinkage: break; case GlobalValue::GhostLinkage: cerr << "Should not have any unmaterialized functions!\n"; @@ -259,6 +260,7 @@ switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); case Function::InternalLinkage: // Symbols default to internal. + case Function::PrivateLinkage: break; case Function::ExternalLinkage: emitGlobalDirective(CurrentFnName); @@ -299,9 +301,6 @@ // Print out jump tables referenced by the function EmitJumpTableInfo(MF.getJumpTableInfo(), MF); - // What's my mangled name? - CurrentFnName = Mang->getValueName(MF.getFunction()); - // Emit the function start directives emitFunctionStart(MF); @@ -367,9 +366,12 @@ printBasicBlockLabel(MO.getMBB()); break; case MachineOperand::MO_GlobalAddress: - O << Mang->getValueName(MO.getGlobal()); - if (MO.getGlobal()->hasExternalWeakLinkage()) - ExtWeakSymbols.insert(MO.getGlobal()); + { + const GlobalValue *GV = MO.getGlobal(); + O << Mang->getValueName(GV); + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); + } break; case MachineOperand::MO_ExternalSymbol: O << MO.getSymbolName(); Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Jan 15 14:18:42 2009 @@ -114,7 +114,7 @@ Function *F = CGN->getFunction(); // Make sure that it is local to this module. - if (!F || !F->hasInternalLinkage()) return false; + if (!F || !F->hasLocalLinkage()) return false; // First check: see if there are any pointer arguments! If not, quick exit. SmallVector, 16> PointerArgs; Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Thu Jan 15 14:18:42 2009 @@ -72,7 +72,7 @@ // If this GV is dead, remove it. GV->removeDeadConstantUsers(); - if (GV->use_empty() && GV->hasInternalLinkage()) { + if (GV->use_empty() && GV->hasLocalLinkage()) { GV->eraseFromParent(); continue; } @@ -86,7 +86,7 @@ if (Slot == 0) { // Nope, add it to the map. Slot = GV; - } else if (GV->hasInternalLinkage()) { // Yup, this is a duplicate! + } else if (GV->hasLocalLinkage()) { // Yup, this is a duplicate! // Make all uses of the duplicate constant use the canonical version. Replacements.push_back(std::make_pair(GV, Slot)); } Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Jan 15 14:18:42 2009 @@ -172,7 +172,7 @@ /// llvm.vastart is never called, the varargs list is dead for the function. bool DAE::DeleteDeadVarargs(Function &Fn) { assert(Fn.getFunctionType()->isVarArg() && "Function isn't varargs!"); - if (Fn.isDeclaration() || !Fn.hasInternalLinkage()) return false; + if (Fn.isDeclaration() || !Fn.hasLocalLinkage()) return false; // Ensure that the function is only directly called. for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); I != E; ++I) { @@ -424,7 +424,7 @@ return; } - if (!F.hasInternalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) { + if (!F.hasLocalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) { MarkLive(F); return; } Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Thu Jan 15 14:18:42 2009 @@ -63,7 +63,7 @@ I != E; ++I) { if (CallInst* callInst = dyn_cast(&*I)) { Function* Callee = callInst->getCalledFunction(); - if (Callee && Callee->hasInternalLinkage()) + if (Callee && Callee->hasLocalLinkage()) Callee->setLinkage(GlobalValue::ExternalLinkage); } } @@ -85,6 +85,7 @@ bool isolateGV(Module &M) { // Mark all globals internal + // FIXME: what should we do with private linkage? for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) if (!I->isDeclaration()) { I->setLinkage(GlobalValue::InternalLinkage); Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Thu Jan 15 14:18:42 2009 @@ -63,7 +63,7 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { Changed |= RemoveUnusedGlobalValue(*I); // Functions with external linkage are needed if they have a body - if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && + if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && !I->isDeclaration()) GlobalIsNeeded(I); } @@ -73,7 +73,7 @@ Changed |= RemoveUnusedGlobalValue(*I); // Externally visible & appending globals are needed, if they have an // initializer. - if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && + if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && !I->isDeclaration()) GlobalIsNeeded(I); } Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Jan 15 14:18:42 2009 @@ -464,7 +464,7 @@ if (!GlobalUsersSafeToSRA(GV)) return 0; - assert(GV->hasInternalLinkage() && !GV->isConstant()); + assert(GV->hasLocalLinkage() && !GV->isConstant()); Constant *Init = GV->getInitializer(); const Type *Ty = Init->getType(); @@ -1808,12 +1808,12 @@ for (Module::iterator FI = M.begin(), E = M.end(); FI != E; ) { Function *F = FI++; F->removeDeadConstantUsers(); - if (F->use_empty() && (F->hasInternalLinkage() || + if (F->use_empty() && (F->hasLocalLinkage() || F->hasLinkOnceLinkage())) { M.getFunctionList().erase(F); Changed = true; ++NumFnDeleted; - } else if (F->hasInternalLinkage()) { + } else if (F->hasLocalLinkage()) { if (F->getCallingConv() == CallingConv::C && !F->isVarArg() && OnlyCalledDirectly(F)) { // If this function has C calling conventions, is not a varargs @@ -1843,7 +1843,7 @@ for (Module::global_iterator GVI = M.global_begin(), E = M.global_end(); GVI != E; ) { GlobalVariable *GV = GVI++; - if (!GV->isConstant() && GV->hasInternalLinkage() && + if (!GV->isConstant() && GV->hasLocalLinkage() && GV->hasInitializer()) Changed |= ProcessInternalGlobal(GV, GVI); } @@ -1982,7 +1982,7 @@ /// globals. This should be kept up to date with CommitValueTo. static bool isSimpleEnoughPointerToCommit(Constant *C) { if (GlobalVariable *GV = dyn_cast(C)) { - if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage()) + if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) return false; // do not allow weak/linkonce/dllimport/dllexport linkage. return !GV->isDeclaration(); // reject external globals. } @@ -1991,7 +1991,7 @@ if (CE->getOpcode() == Instruction::GetElementPtr && isa(CE->getOperand(0))) { GlobalVariable *GV = cast(CE->getOperand(0)); - if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage()) + if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) return false; // do not allow weak/linkonce/dllimport/dllexport linkage. return GV->hasInitializer() && ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE); Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Jan 15 14:18:42 2009 @@ -63,7 +63,7 @@ if (!I->isDeclaration()) { // Delete any klingons. I->removeDeadConstantUsers(); - if (I->hasInternalLinkage()) + if (I->hasLocalLinkage()) LocalChange |= PropagateConstantsIntoArguments(*I); Changed |= PropagateConstantReturn(*I); } Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Thu Jan 15 14:18:42 2009 @@ -68,7 +68,7 @@ // If we inlined the last possible call site to the function, delete the // function body now. - if (Callee->use_empty() && Callee->hasInternalLinkage() && + if (Callee->use_empty() && Callee->hasLocalLinkage() && !SCCFunctions.count(Callee)) { DOUT << " -> Deleting dead function: " << Callee->getName() << "\n"; CallGraphNode *CalleeNode = CG[Callee]; @@ -240,7 +240,7 @@ if (DNR && DNR->count(F)) continue; - if ((F->hasLinkOnceLinkage() || F->hasInternalLinkage()) && + if ((F->hasLinkOnceLinkage() || F->hasLocalLinkage()) && F->use_empty()) { // Remove any call graph edges from the function to its callees. Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Thu Jan 15 14:18:42 2009 @@ -121,9 +121,10 @@ bool Changed = false; // Mark all functions not in the api as internal. + // FIXME: maybe use private linkage? for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && // Function must be defined here - !I->hasInternalLinkage() && // Can't already have internal linkage + !I->hasLocalLinkage() && // Can't already have internal linkage !ExternalNames.count(I->getName())) {// Not marked to keep external? I->setLinkage(GlobalValue::InternalLinkage); // Remove a callgraph edge from the external node to this function. @@ -149,9 +150,10 @@ // Mark all global variables with initializers that are not in the api as // internal as well. + // FIXME: maybe use private linkage? for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isDeclaration() && !I->hasInternalLinkage() && + if (!I->isDeclaration() && !I->hasLocalLinkage() && !ExternalNames.count(I->getName())) { I->setLinkage(GlobalValue::InternalLinkage); Changed = true; Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Jan 15 14:18:42 2009 @@ -245,7 +245,7 @@ Function *G = FnVec[j]; if (!F->mayBeOverridden()) { - if (G->hasInternalLinkage()) { + if (G->hasLocalLinkage()) { F->setAlignment(std::max(F->getAlignment(), G->getAlignment())); G->replaceAllUsesWith(F); G->eraseFromParent(); @@ -329,7 +329,7 @@ if (F->isDeclaration() || F->isIntrinsic()) continue; - if (!F->hasInternalLinkage() && !F->hasExternalLinkage() && + if (!F->hasLocalLinkage() && !F->hasExternalLinkage() && !F->hasWeakLinkage()) continue; Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Jan 15 14:18:42 2009 @@ -95,7 +95,7 @@ OnlyUsedBy(C->getOperand(i), C)) Operands.insert(C->getOperand(i)); if (GlobalVariable *GV = dyn_cast(C)) { - if (!GV->hasInternalLinkage()) return; // Don't delete non static globals. + if (!GV->hasLocalLinkage()) return; // Don't delete non static globals. GV->eraseFromParent(); } else if (!isa(C)) @@ -114,7 +114,7 @@ for (ValueSymbolTable::iterator VI = ST.begin(), VE = ST.end(); VI != VE; ) { Value *V = VI->getValue(); ++VI; - if (!isa(V) || cast(V)->hasInternalLinkage()) { + if (!isa(V) || cast(V)->hasLocalLinkage()) { if (!PreserveDbgInfo || strncmp(V->getNameStart(), "llvm.dbg", 8)) // Set name to "", removing from symbol table! V->setName(""); @@ -162,13 +162,13 @@ for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0) + if (I->hasLocalLinkage() && llvmUsedValues.count(I) == 0) if (!PreserveDbgInfo || strncmp(I->getNameStart(), "llvm.dbg", 8)) I->setName(""); // Internal symbols can't participate in linkage } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { - if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0) + if (I->hasLocalLinkage() && llvmUsedValues.count(I) == 0) if (!PreserveDbgInfo || strncmp(I->getNameStart(), "llvm.dbg", 8)) I->setName(""); // Internal symbols can't participate in linkage StripSymtab(I->getValueSymbolTable(), PreserveDbgInfo); @@ -268,6 +268,7 @@ // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as linkonce // but since we are removing all debug information, make them internal now. + // FIXME: Use private linkage maybe? if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units")) if (GlobalVariable *GV = dyn_cast(C)) GV->setLinkage(GlobalValue::InternalLinkage); @@ -299,7 +300,7 @@ Constant *C = DeadConstants.back(); DeadConstants.pop_back(); if (GlobalVariable *GV = dyn_cast(C)) { - if (GV->hasInternalLinkage()) + if (GV->hasLocalLinkage()) RemoveDeadConstant(GV); } else @@ -329,4 +330,3 @@ bool StripNonDebugSymbols::runOnModule(Module &M) { return StripSymbolNames(M, true); } - Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Thu Jan 15 14:18:42 2009 @@ -82,7 +82,7 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { Function *F = CGN->getFunction(); - if (!F || F->isDeclaration() || !F->hasInternalLinkage()) + if (!F || F->isDeclaration() || !F->hasLocalLinkage()) return false; // Make sure that function returns struct. Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu Jan 15 14:18:42 2009 @@ -203,7 +203,7 @@ /// and out of the specified function (which cannot have its address taken), /// this method must be called. void AddTrackedFunction(Function *F) { - assert(F->hasInternalLinkage() && "Can only track internal functions!"); + assert(F->hasLocalLinkage() && "Can only track internal functions!"); // Add an entry, F -> undef. if (const StructType *STy = dyn_cast(F->getReturnType())) { for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) @@ -609,7 +609,7 @@ Function *F = I.getParent()->getParent(); // If we are tracking the return value of this function, merge it in. - if (!F->hasInternalLinkage()) + if (!F->hasLocalLinkage()) return; if (!TrackedRetVals.empty() && I.getNumOperands() == 1) { @@ -1170,7 +1170,7 @@ // The common case is that we aren't tracking the callee, either because we // are not doing interprocedural analysis or the callee is indirect, or is // external. Handle these cases first. - if (F == 0 || !F->hasInternalLinkage()) { + if (F == 0 || !F->hasLocalLinkage()) { CallOverdefined: // Void return and not tracking callee, just bail. if (I->getType() == Type::VoidTy) return; @@ -1656,7 +1656,7 @@ // taken or that are external as overdefined. // for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) - if (!F->hasInternalLinkage() || AddressIsTaken(F)) { + if (!F->hasLocalLinkage() || AddressIsTaken(F)) { if (!F->isDeclaration()) Solver.MarkBlockExecutable(F->begin()); for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); @@ -1671,7 +1671,7 @@ // their addresses taken, we can propagate constants through them. for (Module::global_iterator G = M.global_begin(), E = M.global_end(); G != E; ++G) - if (!G->isConstant() && G->hasInternalLinkage() && !AddressIsTaken(G)) + if (!G->isConstant() && G->hasLocalLinkage() && !AddressIsTaken(G)) Solver.TrackValueOfGlobalVariable(G); // Solve for constants. Modified: llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp Thu Jan 15 14:18:42 2009 @@ -130,7 +130,7 @@ // Inline if (InlineFunction(CS, NULL, TD)) { - if (Callee->use_empty() && Callee->hasInternalLinkage()) + if (Callee->use_empty() && Callee->hasLocalLinkage()) DeadFunctions.insert(Callee); Changed = true; CallSites.erase(CallSites.begin() + index); Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Thu Jan 15 14:18:42 2009 @@ -199,7 +199,7 @@ // If there is only one call of the function, and it has internal linkage, // make it almost guaranteed to be inlined. // - if (Callee->hasInternalLinkage() && Callee->hasOneUse()) + if (Callee->hasLocalLinkage() && Callee->hasOneUse()) InlineCost -= 15000; // If this function uses the coldcc calling convention, prefer not to inline Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Jan 15 14:18:42 2009 @@ -1149,6 +1149,7 @@ static void PrintLinkage(GlobalValue::LinkageTypes LT, raw_ostream &Out) { switch (LT) { + case GlobalValue::PrivateLinkage: Out << "private "; break; case GlobalValue::InternalLinkage: Out << "internal "; break; case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break; case GlobalValue::WeakLinkage: Out << "weak "; break; Modified: llvm/trunk/lib/VMCore/Mangler.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Mangler.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Mangler.cpp (original) +++ llvm/trunk/lib/VMCore/Mangler.cpp Thu Jan 15 14:18:42 2009 @@ -147,14 +147,20 @@ Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++); } else { Name = makeNameProper(GV->getName() + Suffix, Prefix); + std::string prefix; + if (GV->hasPrivateLinkage()) + prefix = PrivatePrefix; + else + prefix = ""; + Name = prefix + Name; } return Name; } -Mangler::Mangler(Module &M, const char *prefix) - : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false), - Count(0), TypeCounter(0) { +Mangler::Mangler(Module &M, const char *prefix, const char *privatePrefix) + : Prefix(prefix), PrivatePrefix (privatePrefix), UseQuotes(false), + PreserveAsmNames(false), Count(0), TypeCounter(0) { std::fill(AcceptableChars, array_endof(AcceptableChars), 0); // Letters and numbers are acceptable. Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Thu Jan 15 14:18:42 2009 @@ -153,7 +153,7 @@ } // Okay, the function exists. Does it have externally visible linkage? - if (F->hasInternalLinkage()) { + if (F->hasLocalLinkage()) { // Clear the function's name. F->setName(""); // Retry, now there won't be a conflict. @@ -238,14 +238,14 @@ /// symbol table. If it does not exist, return null. The type argument /// should be the underlying type of the global, i.e., it should not have /// the top-level PointerType, which represents the address of the global. -/// If AllowInternal is set to true, this function will return types that -/// have InternalLinkage. By default, these types are not returned. +/// If AllowLocal is set to true, this function will return types that +/// have an local. By default, these types are not returned. /// GlobalVariable *Module::getGlobalVariable(const std::string &Name, - bool AllowInternal) const { + bool AllowLocal) const { if (Value *V = ValSymTab->lookup(Name)) { GlobalVariable *Result = dyn_cast(V); - if (Result && (AllowInternal || !Result->hasInternalLinkage())) + if (Result && (AllowLocal || !Result->hasLocalLinkage())) return Result; } return 0; @@ -376,4 +376,3 @@ return; } } - Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Jan 15 14:18:42 2009 @@ -350,7 +350,7 @@ GV.hasExternalWeakLinkage() || GV.hasGhostLinkage() || (isa(GV) && - (GV.hasInternalLinkage() || GV.hasWeakLinkage())), + (GV.hasLocalLinkage() || GV.hasWeakLinkage())), "Global is external, but doesn't have external or dllimport or weak linkage!", &GV); @@ -384,7 +384,7 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) { Assert1(!GA.getName().empty(), "Alias name cannot be empty!", &GA); - Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() || + Assert1(GA.hasExternalLinkage() || GA.hasLocalLinkage() || GA.hasWeakLinkage(), "Alias should have external or external weak linkage!", &GA); Assert1(GA.getAliasee(), Added: llvm/trunk/test/Assembler/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/Assembler/private.ll (added) +++ llvm/trunk/test/Assembler/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,9 @@ +; Test to make sure that the 'private' tag is not lost! +; +; RUN: llvm-as < %s | llvm-dis | grep private + +declare void @foo() + +define private void @foo() { + ret void +} Added: llvm/trunk/test/CodeGen/ARM/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/private.ll (added) +++ llvm/trunk/test/CodeGen/ARM/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,22 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi > %t +; RUN: grep .Lfoo: %t +; RUN: egrep bl.*\.Lfoo %t +; RUN: grep .Lbaz: %t +; RUN: grep long.*\.Lbaz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} + Added: llvm/trunk/test/CodeGen/Alpha/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/private.ll (added) +++ llvm/trunk/test/CodeGen/Alpha/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc > %t +; RUN: grep .Lfoo: %t +; RUN: grep call.*\.Lfoo %t +; RUN: grep .Lbaz: %t +; RUN: grep movl.*\.Lbaz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/CellSPU/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/private.ll (added) +++ llvm/trunk/test/CodeGen/CellSPU/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,22 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -march=cellspu > %t +; RUN: grep .Lfoo: %t +; RUN: grep brsl.*\.Lfoo %t +; RUN: grep .Lbaz: %t +; RUN: grep ila.*\.Lbaz %t + + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/IA64/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/IA64/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/IA64/private.ll (added) +++ llvm/trunk/test/CodeGen/IA64/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -march=ia64 > %t +; RUN: grep .foo: %t +; RUN: grep br.call.sptk.*\.foo %t +; RUN: grep .baz: %t +; RUN: grep ltoff.*\.baz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/Mips/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Mips/private.ll (added) +++ llvm/trunk/test/CodeGen/Mips/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -march=mips > %t +; RUN: grep \\\$foo: %t +; RUN: grep call.*\\\$foo %t +; RUN: grep \\\$baz: %t +; RUN: grep lw.*\\\$baz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/PowerPC/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/private.ll (added) +++ llvm/trunk/test/CodeGen/PowerPC/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -mtriple=powerpc-unknown-linux-gnu > %t +; RUN: grep .Lfoo: %t +; RUN: grep bl.*\.Lfoo %t +; RUN: grep .Lbaz: %t +; RUN: grep lis.*\.Lbaz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/SPARC/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/SPARC/private.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -march=sparc > %t +; RUN: grep .foo: %t +; RUN: grep call.*\.foo %t +; RUN: grep .baz: %t +; RUN: grep ld.*\.baz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/X86/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/private.ll (added) +++ llvm/trunk/test/CodeGen/X86/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,20 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep .Lfoo: +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep call.*\.Lfoo +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep .Lbaz: +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep movl.*\.Lbaz + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Added: llvm/trunk/test/CodeGen/XCore/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/private.ll?rev=62279&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/XCore/private.ll (added) +++ llvm/trunk/test/CodeGen/XCore/private.ll Thu Jan 15 14:18:42 2009 @@ -0,0 +1,21 @@ +; Test to make sure that the 'private' is used correctly. +; +; RUN: llvm-as < %s | llc -march=xcore > %t +; RUN: grep .Lfoo: %t +; RUN: grep bl.*\.Lfoo %t +; RUN: grep .Lbaz: %t +; RUN: grep ldw.*\.Lbaz %t + +declare void @foo() + +define private void @foo() { + ret void +} + + at baz = private global i32 4; + +define i32 @bar() { + call void @foo() + %1 = load i32* @baz, align 4 + ret i32 %1 +} Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Thu Jan 15 14:18:42 2009 @@ -199,7 +199,7 @@ /// prune appropriate entries out of M1s list. static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2){ GlobalVariable *GV = M1->getNamedGlobal(GlobalName); - if (!GV || GV->isDeclaration() || GV->hasInternalLinkage() || + if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() || !GV->use_empty()) return; std::vector > M1Tors, M2Tors; Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=62279&r1=62278&r2=62279&view=diff ============================================================================== --- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original) +++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Thu Jan 15 14:18:42 2009 @@ -68,6 +68,7 @@ } static char TypeCharForSymbol(GlobalValue &GV) { + /* FIXME: what to do with private linkage? */ if (GV.isDeclaration()) return 'U'; if (GV.hasLinkOnceLinkage()) return 'C'; if (GV.hasCommonLinkage()) return 'C'; @@ -91,7 +92,7 @@ return; if ((TypeChar == 'U') && DefinedOnly) return; - if (GV.hasInternalLinkage () && ExternalOnly) + if (GV.hasLocalLinkage () && ExternalOnly) return; if (OutputFormat == posix) { std::cout << GV.getName () << " " << TypeCharForSymbol (GV) << " " From baldrick at free.fr Thu Jan 15 14:27:09 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 21:27:09 +0100 Subject: [llvm-commits] [llvm] r62263 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast-sext-zext.ll In-Reply-To: References: <200901151701.n0FH1NwC024494@zion.cs.uiuc.edu> <200901152052.04024.baldrick@free.fr> Message-ID: <200901152127.09658.baldrick@free.fr> Hi Evan, > That's not legal, right? you are right (I checked the verifier). Sorry for the noise! Duncan. From dpatel at apple.com Thu Jan 15 14:59:21 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 15 Jan 2009 20:59:21 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62280 - /llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Message-ID: <200901152059.n0FKxLCQ000609@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 14:59:21 2009 New Revision: 62280 URL: http://llvm.org/viewvc/llvm-project?rev=62280&view=rev Log: Fix build failure. Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp?rev=62280&r1=62279&r2=62280&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-linker-hack.cpp Thu Jan 15 14:59:21 2009 @@ -53,7 +53,7 @@ llvm::createScalarReplAggregatesPass(); llvm::createCFGSimplificationPass(); - llvm::createDefaultScheduler(NULL, NULL, NULL, NULL, false); + llvm::createDefaultScheduler(NULL, NULL); llvm::createLinearScanRegisterAllocator(); llvm::createLocalRegisterAllocator(); From wangmp at apple.com Thu Jan 15 15:10:21 2009 From: wangmp at apple.com (Mon P Wang) Date: Thu, 15 Jan 2009 21:10:21 -0000 Subject: [llvm-commits] [llvm] r62281 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/vec_insert-8.ll Message-ID: <200901152110.n0FLAL7W000923@zion.cs.uiuc.edu> Author: wangmp Date: Thu Jan 15 15:10:20 2009 New Revision: 62281 URL: http://llvm.org/viewvc/llvm-project?rev=62281&view=rev Log: Expand insert/extract of a <4 x i32> with a variable index. Added: llvm/trunk/test/CodeGen/X86/vec_insert-8.ll Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=62281&r1=62280&r2=62281&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jan 15 15:10:20 2009 @@ -766,12 +766,12 @@ // information. setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v16i8, Custom); setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v8i16, Custom); - setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i32, Legal); + setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4i32, Custom); setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v4f32, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v16i8, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v8i16, Custom); - setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4i32, Legal); + setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4i32, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v4f32, Custom); if (Subtarget->is64Bit()) { @@ -4248,6 +4248,10 @@ DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, Op.getOperand(0)), Op.getOperand(1)); return DAG.getNode(ISD::BIT_CONVERT, MVT::f32, Extract); + } else if (VT == MVT::i32) { + // ExtractPS works with constant index. + if (isa(Op.getOperand(1))) + return Op; } return SDValue(); } @@ -4362,6 +4366,10 @@ // combine either bitwise AND or insert of float 0.0 to set these bits. N2 = DAG.getIntPtrConstant(cast(N2)->getZExtValue() << 4); return DAG.getNode(X86ISD::INSERTPS, VT, N0, N1, N2); + } else if (EVT == MVT::i32) { + // InsertPS works with constant index. + if (isa(N2)) + return Op; } return SDValue(); } Added: llvm/trunk/test/CodeGen/X86/vec_insert-8.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_insert-8.ll?rev=62281&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_insert-8.ll (added) +++ llvm/trunk/test/CodeGen/X86/vec_insert-8.ll Thu Jan 15 15:10:20 2009 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -o %t -f + +; tests variable insert and extract of a 4 x i32 + +define <4 x i32> @var_insert(<4 x i32> %x, i32 %val, i32 %idx) nounwind { +entry: + %tmp3 = insertelement <4 x i32> %x, i32 %val, i32 %idx ; <<4 x i32>> [#uses=1] + ret <4 x i32> %tmp3 +} + +define i32 @var_extract(<4 x i32> %x, i32 %idx) nounwind { +entry: + %tmp3 = extractelement <4 x i32> %x, i32 %idx ; <> [#uses=1] + ret i32 %tmp3 +} From monping at apple.com Thu Jan 15 15:10:49 2009 From: monping at apple.com (Mon Ping Wang) Date: Thu, 15 Jan 2009 13:10:49 -0800 Subject: [llvm-commits] Patch: insert/extract element using a variable index In-Reply-To: References: Message-ID: <8CFEE060-064C-405E-81BD-3838C2FA1D4B@apple.com> Hi Dan, Done. Thanks, -- Mon Ping On Jan 15, 2009, at 12:18 PM, Dan Gohman wrote: > Hi Mon Ping, > > In the test, please add -march=x86 to the llc line, so that it > works on non-x86 hosts. Otherwise, this patch looks good to me. > > Dan > > On Jan 14, 2009, at 10:36 PM, Mon Ping Wang wrote: > >> Hi, >> >> We can't use insertps/extractps for insert/extract an element from a >> <4 x i32> vector using a variable index. This patch will cause >> Legalize to expand the operator for that case. >> >> --- Mon Ping >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From monping at apple.com Thu Jan 15 15:35:52 2009 From: monping at apple.com (Mon Ping Wang) Date: Thu, 15 Jan 2009 13:35:52 -0800 Subject: [llvm-commits] patch: widen bit convert operand Message-ID: <7467D9B8-3BDB-4941-82D4-A5C05ED94B1D@apple.com> Hi, This fixes a bug in widening an operand of a bit convert. Please let me know if you have any comments. Thanks, -- Mon Ping -------------- next part -------------- A non-text attachment was scrubbed... Name: bit_widen.patch Type: application/octet-stream Size: 3231 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090115/a158380c/attachment.obj From rafael.espindola at gmail.com Thu Jan 15 15:51:46 2009 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 15 Jan 2009 21:51:46 -0000 Subject: [llvm-commits] [llvm] r62282 - in /llvm/trunk: lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp test/CodeGen/Alpha/private.ll Message-ID: <200901152151.n0FLpkOG002378@zion.cs.uiuc.edu> Author: rafael Date: Thu Jan 15 15:51:46 2009 New Revision: 62282 URL: http://llvm.org/viewvc/llvm-project?rev=62282&view=rev Log: Fix Alpha test and support for private linkage. Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp llvm/trunk/test/CodeGen/Alpha/private.ll Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=62282&r1=62281&r2=62282&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Thu Jan 15 15:51:46 2009 @@ -155,6 +155,7 @@ switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); case Function::InternalLinkage: // Symbols default to internal. + case Function::PrivateLinkage: break; case Function::ExternalLinkage: O << "\t.globl " << CurrentFnName << "\n"; @@ -169,7 +170,6 @@ O << "\t.ent " << CurrentFnName << "\n"; - assert (!F->hasPrivateLinkage() && "add private prefix."); O << CurrentFnName << ":\n"; // Print out code for the function. @@ -238,6 +238,7 @@ O << TAI->getGlobalDirective() << name << "\n"; break; case GlobalValue::InternalLinkage: + case GlobalValue::PrivateLinkage: break; default: assert(0 && "Unknown linkage type!"); Modified: llvm/trunk/test/CodeGen/Alpha/private.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/private.ll?rev=62282&r1=62281&r2=62282&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/private.ll (original) +++ llvm/trunk/test/CodeGen/Alpha/private.ll Thu Jan 15 15:51:46 2009 @@ -1,10 +1,10 @@ ; Test to make sure that the 'private' is used correctly. ; -; RUN: llvm-as < %s | llc > %t -; RUN: grep .Lfoo: %t -; RUN: grep call.*\.Lfoo %t -; RUN: grep .Lbaz: %t -; RUN: grep movl.*\.Lbaz %t +; RUN: llvm-as < %s | llc -march=alpha > %t +; RUN: grep \\\$foo: %t +; RUN: grep bsr.*\\\$\\\$foo %t +; RUN: grep \\\$baz: %t +; RUN: grep ldah.*\\\$baz %t declare void @foo() From baldrick at free.fr Thu Jan 15 15:56:55 2009 From: baldrick at free.fr (Duncan Sands) Date: Thu, 15 Jan 2009 22:56:55 +0100 Subject: [llvm-commits] patch: widen bit convert operand In-Reply-To: <7467D9B8-3BDB-4941-82D4-A5C05ED94B1D@apple.com> References: <7467D9B8-3BDB-4941-82D4-A5C05ED94B1D@apple.com> Message-ID: <200901152256.55464.baldrick@free.fr> Hi Mon Ping, > This fixes a bug in widening an operand of a bit convert. Please let > me know if you have any comments. it looks good to me. Ciao, Duncan. From gohman at apple.com Thu Jan 15 16:01:38 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 22:01:38 -0000 Subject: [llvm-commits] [llvm] r62283 - in /llvm/trunk: include/llvm/CodeGen/MachineBasicBlock.h lib/CodeGen/MachineLICM.cpp Message-ID: <200901152201.n0FM1coK002691@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 16:01:38 2009 New Revision: 62283 URL: http://llvm.org/viewvc/llvm-project?rev=62283&view=rev Log: Simplify the MachineLICM pass by having it only traverse outer loops, hoisting instructions all the way out in one step rather than hoisting them one nest level at a time. Also, make a few other code simplifications. This speeds up MachineLICM by several fold. Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h llvm/trunk/lib/CodeGen/MachineLICM.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=62283&r1=62282&r2=62283&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Thu Jan 15 16:01:38 2009 @@ -263,6 +263,12 @@ MachineInstr *remove(MachineInstr *I) { return Insts.remove(I); } void clear() { Insts.clear(); } + /// splice - Take an instruction from MBB 'Other' at the position From, + /// and insert it into this MBB right before 'where'. + void splice(iterator where, MachineBasicBlock *Other, iterator From) { + Insts.splice(where, Other->Insts, From); + } + /// splice - Take a block of instructions from MBB 'Other' in the range [From, /// To), and insert them into this MBB right before 'where'. void splice(iterator where, MachineBasicBlock *Other, iterator From, Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=62283&r1=62282&r2=62283&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Thu Jan 15 16:01:38 2009 @@ -10,6 +10,14 @@ // This pass performs loop invariant code motion on machine instructions. We // attempt to remove as much code from the body of a loop as possible. // +// This pass does not attempt to throttle itself to limit register pressure. +// The register allocation phases are expected to perform rematerialization +// to recover when register pressure is high. +// +// This pass is not intended to be a replacement or a complete alternative +// for the LLVM-IR-level LICM pass. It is only designed to hoist simple +// constructs that are not exposed before lowering and instruction selection. +// //===----------------------------------------------------------------------===// #define DEBUG_TYPE "machine-licm" @@ -42,6 +50,7 @@ // State that is updated as we process loops bool Changed; // True if a loop is changed. MachineLoop *CurLoop; // The current loop we are working on. + MachineBasicBlock *CurPreheader; // The preheader for CurLoop. public: static char ID; // Pass identification, replacement for typeid MachineLICM() : MachineFunctionPass(&ID) {} @@ -60,34 +69,6 @@ MachineFunctionPass::getAnalysisUsage(AU); } private: - /// VisitAllLoops - Visit all of the loops in depth first order and try to - /// hoist invariant instructions from them. - /// - void VisitAllLoops(MachineLoop *L) { - const std::vector &SubLoops = L->getSubLoops(); - - for (MachineLoop::iterator - I = SubLoops.begin(), E = SubLoops.end(); I != E; ++I) { - MachineLoop *ML = *I; - - // Traverse the body of the loop in depth first order on the dominator - // tree so that we are guaranteed to see definitions before we see uses. - VisitAllLoops(ML); - HoistRegion(DT->getNode(ML->getHeader())); - } - - HoistRegion(DT->getNode(L->getHeader())); - } - - /// IsInSubLoop - A little predicate that returns true if the specified - /// basic block is in a subloop of the current one, not the current one - /// itself. - /// - bool IsInSubLoop(MachineBasicBlock *BB) { - assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop"); - return LI->getLoopFor(BB) != CurLoop; - } - /// IsLoopInvariantInst - Returns true if the instruction is loop /// invariant. I.e., all virtual register operands are defined outside of /// the loop, physical registers aren't accessed (explicitly or implicitly), @@ -95,25 +76,6 @@ /// bool IsLoopInvariantInst(MachineInstr &I); - /// FindPredecessors - Get all of the predecessors of the loop that are not - /// back-edges. - /// - void FindPredecessors(std::vector &Preds) { - const MachineBasicBlock *Header = CurLoop->getHeader(); - - for (MachineBasicBlock::const_pred_iterator - I = Header->pred_begin(), E = Header->pred_end(); I != E; ++I) - if (!CurLoop->contains(*I)) - Preds.push_back(*I); - } - - /// MoveInstToEndOfBlock - Moves the machine instruction to the bottom of - /// the predecessor basic block (but before the terminator instructions). - /// - void MoveInstToEndOfBlock(MachineBasicBlock *ToMBB, - MachineBasicBlock *FromMBB, - MachineInstr *MI); - /// HoistRegion - Walk the specified region of the CFG (defined by all /// blocks dominated by the specified block, and that are in the current /// loop) in depth first order w.r.t the DominatorTree. This allows us to @@ -135,6 +97,15 @@ FunctionPass *llvm::createMachineLICMPass() { return new MachineLICM(); } +/// LoopIsOuterMostWithPreheader - Test if the given loop is the outer-most +/// loop that has a preheader. +static bool LoopIsOuterMostWithPreheader(MachineLoop *CurLoop) { + for (MachineLoop *L = CurLoop->getParentLoop(); L; L = L->getParentLoop()) + if (L->getLoopPreheader()) + return false; + return true; +} + /// Hoist expressions out of the specified loop. Note, alias info for inner loop /// is not preserved so it is not a good idea to run LICM multiple times on one /// loop. @@ -155,10 +126,21 @@ I = LI->begin(), E = LI->end(); I != E; ++I) { CurLoop = *I; - // Visit all of the instructions of the loop. We want to visit the subloops - // first, though, so that we can hoist their invariants first into their - // containing loop before we process that loop. - VisitAllLoops(CurLoop); + // Only visit outer-most preheader-sporting loops. + if (!LoopIsOuterMostWithPreheader(CurLoop)) + continue; + + // Determine the block to which to hoist instructions. If we can't find a + // suitable loop preheader, we can't do any hoisting. + // + // FIXME: We are only hoisting if the basic block coming into this loop + // has only one successor. This isn't the case in general because we haven't + // broken critical edges or added preheaders. + CurPreheader = CurLoop->getLoopPreheader(); + if (!CurPreheader) + continue; + + HoistRegion(DT->getNode(CurLoop->getHeader())); } return Changed; @@ -176,18 +158,15 @@ // If this subregion is not in the top level loop at all, exit. if (!CurLoop->contains(BB)) return; - // Only need to process the contents of this block if it is not part of a - // subloop (which would already have been processed). - if (!IsInSubLoop(BB)) - for (MachineBasicBlock::iterator - I = BB->begin(), E = BB->end(); I != E; ) { - MachineInstr &MI = *I++; - - // Try hoisting the instruction out of the loop. We can only do this if - // all of the operands of the instruction are loop invariant and if it is - // safe to hoist the instruction. - Hoist(MI); - } + for (MachineBasicBlock::iterator + I = BB->begin(), E = BB->end(); I != E; ) { + MachineInstr &MI = *I++; + + // Try hoisting the instruction out of the loop. We can only do this if + // all of the operands of the instruction are loop invariant and if it is + // safe to hoist the instruction. + Hoist(MI); + } const std::vector &Children = N->getChildren(); @@ -252,20 +231,16 @@ if (!MO.isReg()) continue; - if (MO.isDef() && TargetRegisterInfo::isPhysicalRegister(MO.getReg())) - // Don't hoist an instruction that defines a physical register. - return false; - - if (!MO.isUse()) - continue; - unsigned Reg = MO.getReg(); if (Reg == 0) continue; - // Don't hoist instructions that access physical registers. + // Don't hoist an instruction that uses or defines a physical register. if (TargetRegisterInfo::isPhysicalRegister(Reg)) return false; + if (!MO.isUse()) + continue; + assert(RegInfo->getVRegDef(Reg) && "Machine instr not mapped for this vreg?!"); @@ -279,64 +254,27 @@ return true; } -/// MoveInstToEndOfBlock - Moves the machine instruction to the bottom of the -/// predecessor basic block (but before the terminator instructions). -/// -void MachineLICM::MoveInstToEndOfBlock(MachineBasicBlock *ToMBB, - MachineBasicBlock *FromMBB, - MachineInstr *MI) { - DEBUG({ - DOUT << "Hoisting " << *MI; - if (ToMBB->getBasicBlock()) - DOUT << " to MachineBasicBlock " - << ToMBB->getBasicBlock()->getName(); - if (FromMBB->getBasicBlock()) - DOUT << " from MachineBasicBlock " - << FromMBB->getBasicBlock()->getName(); - DOUT << "\n"; - }); - - MachineBasicBlock::iterator WhereIter = ToMBB->getFirstTerminator(); - MachineBasicBlock::iterator To, From = FromMBB->begin(); - - while (&*From != MI) - ++From; - - assert(From != FromMBB->end() && "Didn't find instr in BB!"); - - To = From; - ToMBB->splice(WhereIter, FromMBB, From, ++To); - ++NumHoisted; -} - /// Hoist - When an instruction is found to use only loop invariant operands /// that are safe to hoist, this instruction is called to do the dirty work. /// void MachineLICM::Hoist(MachineInstr &MI) { if (!IsLoopInvariantInst(MI)) return; - std::vector Preds; - - // Non-back-edge predecessors. - FindPredecessors(Preds); + // Now move the instructions to the predecessor, inserting it before any + // terminator instructions. + DEBUG({ + DOUT << "Hoisting " << MI; + if (CurPreheader->getBasicBlock()) + DOUT << " to MachineBasicBlock " + << CurPreheader->getBasicBlock()->getName(); + if (MI.getParent()->getBasicBlock()) + DOUT << " from MachineBasicBlock " + << MI.getParent()->getBasicBlock()->getName(); + DOUT << "\n"; + }); - // Either we don't have any predecessors(?!) or we have more than one, which - // is forbidden. - if (Preds.empty() || Preds.size() != 1) return; - - // Check that the predecessor is qualified to take the hoisted instruction. - // I.e., there is only one edge from the predecessor, and it's to the loop - // header. - MachineBasicBlock *MBB = Preds.front(); - - // FIXME: We are assuming at first that the basic block coming into this loop - // has only one successor. This isn't the case in general because we haven't - // broken critical edges or added preheaders. - if (MBB->succ_size() != 1) return; - assert(*MBB->succ_begin() == CurLoop->getHeader() && - "The predecessor doesn't feed directly into the loop header!"); + CurPreheader->splice(CurPreheader->getFirstTerminator(), MI.getParent(), &MI); - // Now move the instructions to the predecessor. - MoveInstToEndOfBlock(MBB, MI.getParent(), &MI); + ++NumHoisted; Changed = true; } From nicolas.geoffray at lip6.fr Thu Jan 15 16:01:20 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 15 Jan 2009 23:01:20 +0100 Subject: [llvm-commits] [llvm] r62045 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp In-Reply-To: <98B6F687-3514-4E03-B6BB-6813B2B706D8@apple.com> References: <200901112015.n0BKFLnj013960@zion.cs.uiuc.edu> <496E0C68.1070209@lip6.fr> <98B6F687-3514-4E03-B6BB-6813B2B706D8@apple.com> Message-ID: <496FB230.8070702@lip6.fr> Hi Chris, Chris Lattner wrote: > On Jan 14, 2009, at 8:01 AM, Nicolas Geoffray wrote: > >> Hi Chris, >> >> Quick question folllowing this patch. Getting the size of a type is >> platform dependent, and since InstCombine makes lots of uses of >> getTypeSize, InstCombine is therefore platform dependent. Is this >> OK? I >> know this patch did not introduce the platform-dependency, but I was >> just curious if that's OK, and if LLVM considers transformation passes >> strongly platform dependent. >> > > Hi Nicolas, > > In the current state of LLVM, this is definitely the right thing to do. > > OK. > However, I don't think that the current state is really what we want. Agree. > > target data info is *optional* in a module. It is always specified by > (e.g.) llvm-gcc, but I don't think that target-independent languages > like Java should have to specify it. Agree. > In my ideal world, not > specifying a target data string would transparently turn off the > subset of optimizations that depend on target data info only (not all > instcombines). > > Pragmatically speaking, the way I would like to (someday) implement > this is to change "opt" (and friends) to only add TargetData to the > passmanager if the module's targetdata string is non-empty. Doing > this today would break all passes that addRequired(). > This means that before we can do this, we have to change these passes > (like instcombine) to not have a hard requirement on targetdata. > > IMO, mid-level optimizations that we want to run from "opt" or "llvm- > ld" should never call addRequired/ > getAnalysis. Instead, they should call > getAnalysisToUpdate(). This method returns a pointer if > TargetData is around, or returns null if not. That would mean that > passes (like instcombine) that want to use targetdata would (for > xforms that need it) check to see if the pointer is non-null, then try > to do the xform in question. > > Does this seem reasonable? > Yes it does. VMKit outputs a portable .bc from Java or C#, and it's unfortunate opt is changing it to a non-portable .bc file. Nicolas From gohman at apple.com Thu Jan 15 16:18:13 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 22:18:13 -0000 Subject: [llvm-commits] [llvm] r62284 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/CellSPU/ lib/Target/PowerPC/ Message-ID: <200901152218.n0FMIDVN003308@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 16:18:12 2009 New Revision: 62284 URL: http://llvm.org/viewvc/llvm-project?rev=62284&view=rev Log: Generalize the HazardRecognizer interface so that it can be used to support MachineInstr-based scheduling in addition to SDNode-based scheduling. Added: llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h - copied, changed from r62275, llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.cpp llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.h llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h Thu Jan 15 16:18:12 2009 @@ -19,45 +19,6 @@ #include "llvm/CodeGen/SelectionDAG.h" namespace llvm { - /// HazardRecognizer - This determines whether or not an instruction can be - /// issued this cycle, and whether or not a noop needs to be inserted to handle - /// the hazard. - class HazardRecognizer { - public: - virtual ~HazardRecognizer(); - - enum HazardType { - NoHazard, // This instruction can be emitted at this cycle. - Hazard, // This instruction can't be emitted at this cycle. - NoopHazard // This instruction can't be emitted, and needs noops. - }; - - /// getHazardType - Return the hazard type of emitting this node. There are - /// three possible results. Either: - /// * NoHazard: it is legal to issue this instruction on this cycle. - /// * Hazard: issuing this instruction would stall the machine. If some - /// other instruction is available, issue it first. - /// * NoopHazard: issuing this instruction would break the program. If - /// some other instruction can be issued, do so, otherwise issue a noop. - virtual HazardType getHazardType(SDNode *) { - return NoHazard; - } - - /// EmitInstruction - This callback is invoked when an instruction is - /// emitted, to advance the hazard state. - virtual void EmitInstruction(SDNode *) {} - - /// AdvanceCycle - This callback is invoked when no instructions can be - /// issued on this cycle without a hazard. This should increment the - /// internal state of the hazard recognizer so that previously "Hazard" - /// instructions will now not be hazards. - virtual void AdvanceCycle() {} - - /// EmitNoop - This callback is invoked when a noop was added to the - /// instruction stream. - virtual void EmitNoop() {} - }; - /// ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs. /// /// Edges between SUnits are initially based on edges in the SelectionDAG, Copied: llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h (from r62275, llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h) URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h?p2=llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h&p1=llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h&r1=62275&r2=62284&rev=62284&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAGSDNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h Thu Jan 15 16:18:12 2009 @@ -1,4 +1,4 @@ -//===---- llvm/CodeGen/ScheduleDAGSDNodes.h - SDNode Scheduling -*- C++ -*-===// +//=- llvm/CodeGen/ScheduleHazardRecognizer.h - Scheduling Support -*- C++ -*-=// // // The LLVM Compiler Infrastructure // @@ -7,193 +7,57 @@ // //===----------------------------------------------------------------------===// // -// This file implements the ScheduleDAGSDNodes class, which implements -// scheduling for an SDNode-based dependency graph. +// This file implements the ScheduleHazardRecognizer class, which implements +// hazard-avoidance heuristics for scheduling. // //===----------------------------------------------------------------------===// -#ifndef LLVM_CODEGEN_SCHEDULEDAGSDNODES_H -#define LLVM_CODEGEN_SCHEDULEDAGSDNODES_H - -#include "llvm/CodeGen/ScheduleDAG.h" -#include "llvm/CodeGen/SelectionDAG.h" +#ifndef LLVM_CODEGEN_SCHEDULEHAZARDRECOGNIZER_H +#define LLVM_CODEGEN_SCHEDULEHAZARDRECOGNIZER_H namespace llvm { - /// HazardRecognizer - This determines whether or not an instruction can be - /// issued this cycle, and whether or not a noop needs to be inserted to handle - /// the hazard. - class HazardRecognizer { - public: - virtual ~HazardRecognizer(); - - enum HazardType { - NoHazard, // This instruction can be emitted at this cycle. - Hazard, // This instruction can't be emitted at this cycle. - NoopHazard // This instruction can't be emitted, and needs noops. - }; - - /// getHazardType - Return the hazard type of emitting this node. There are - /// three possible results. Either: - /// * NoHazard: it is legal to issue this instruction on this cycle. - /// * Hazard: issuing this instruction would stall the machine. If some - /// other instruction is available, issue it first. - /// * NoopHazard: issuing this instruction would break the program. If - /// some other instruction can be issued, do so, otherwise issue a noop. - virtual HazardType getHazardType(SDNode *) { - return NoHazard; - } - - /// EmitInstruction - This callback is invoked when an instruction is - /// emitted, to advance the hazard state. - virtual void EmitInstruction(SDNode *) {} - - /// AdvanceCycle - This callback is invoked when no instructions can be - /// issued on this cycle without a hazard. This should increment the - /// internal state of the hazard recognizer so that previously "Hazard" - /// instructions will now not be hazards. - virtual void AdvanceCycle() {} - - /// EmitNoop - This callback is invoked when a noop was added to the - /// instruction stream. - virtual void EmitNoop() {} - }; - /// ScheduleDAGSDNodes - A ScheduleDAG for scheduling SDNode-based DAGs. - /// - /// Edges between SUnits are initially based on edges in the SelectionDAG, - /// and additional edges can be added by the schedulers as heuristics. - /// SDNodes such as Constants, Registers, and a few others that are not - /// interesting to schedulers are not allocated SUnits. - /// - /// SDNodes with MVT::Flag operands are grouped along with the flagged - /// nodes into a single SUnit so that they are scheduled together. - /// - /// SDNode-based scheduling graphs do not use SDep::Anti or SDep::Output - /// edges. Physical register dependence information is not carried in - /// the DAG and must be handled explicitly by schedulers. - /// - class ScheduleDAGSDNodes : public ScheduleDAG { - public: - explicit ScheduleDAGSDNodes(MachineFunction &mf); - - virtual ~ScheduleDAGSDNodes() {} - - /// isPassiveNode - Return true if the node is a non-scheduled leaf. - /// - static bool isPassiveNode(SDNode *Node) { - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (isa(Node)) return true; - if (Node->getOpcode() == ISD::EntryToken) return true; - return false; - } - - /// NewSUnit - Creates a new SUnit and return a ptr to it. - /// - SUnit *NewSUnit(SDNode *N) { -#ifndef NDEBUG - const SUnit *Addr = 0; - if (SUnits.size() > 0) - Addr = &SUnits[0]; -#endif - SUnits.push_back(SUnit(N, (unsigned)SUnits.size())); - assert((Addr == 0 || Addr == &SUnits[0]) && - "SUnits std::vector reallocated on the fly!"); - SUnits.back().OrigNode = &SUnits.back(); - return &SUnits.back(); - } - - /// Clone - Creates a clone of the specified SUnit. It does not copy the - /// predecessors / successors info nor the temporary scheduling states. - /// - SUnit *Clone(SUnit *N); - - virtual SelectionDAG *getDAG() { return DAG; } - - /// BuildSchedGraph - Build the SUnit graph from the selection dag that we - /// are input. This SUnit graph is similar to the SelectionDAG, but - /// excludes nodes that aren't interesting to scheduling, and represents - /// flagged together nodes with a single SUnit. - virtual void BuildSchedGraph(); - - /// ComputeLatency - Compute node latency. - /// - virtual void ComputeLatency(SUnit *SU); - - /// CountResults - The results of target nodes have register or immediate - /// operands first, then an optional chain, and optional flag operands - /// (which do not go into the machine instrs.) - static unsigned CountResults(SDNode *Node); - - /// CountOperands - The inputs to target nodes have any actual inputs first, - /// followed by special operands that describe memory references, then an - /// optional chain operand, then flag operands. Compute the number of - /// actual operands that will go into the resulting MachineInstr. - static unsigned CountOperands(SDNode *Node); - - /// ComputeMemOperandsEnd - Find the index one past the last - /// MemOperandSDNode operand - static unsigned ComputeMemOperandsEnd(SDNode *Node); - - /// EmitNode - Generate machine code for an node and needed dependencies. - /// VRBaseMap contains, for each already emitted node, the first virtual - /// register number for the results of the node. - /// - void EmitNode(SDNode *Node, bool IsClone, - DenseMap &VRBaseMap); - - virtual MachineBasicBlock *EmitSchedule(); - - /// Schedule - Order nodes according to selected style, filling - /// in the Sequence member. - /// - virtual void Schedule() = 0; - - virtual void dumpNode(const SUnit *SU) const; - - virtual std::string getGraphNodeLabel(const SUnit *SU) const; - - virtual void getCustomGraphFeatures(GraphWriter &GW) const; - - private: - /// EmitSubregNode - Generate machine code for subreg nodes. - /// - void EmitSubregNode(SDNode *Node, - DenseMap &VRBaseMap); - - /// getVR - Return the virtual register corresponding to the specified result - /// of the specified node. - unsigned getVR(SDValue Op, DenseMap &VRBaseMap); - - /// getDstOfCopyToRegUse - If the only use of the specified result number of - /// node is a CopyToReg, return its destination register. Return 0 otherwise. - unsigned getDstOfOnlyCopyToRegUse(SDNode *Node, unsigned ResNo) const; - - void AddOperand(MachineInstr *MI, SDValue Op, unsigned IIOpNum, - const TargetInstrDesc *II, - DenseMap &VRBaseMap); - - /// EmitCopyFromReg - Generate machine code for an CopyFromReg node or an - /// implicit physical register output. - void EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone, - unsigned SrcReg, - DenseMap &VRBaseMap); - - void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI, - const TargetInstrDesc &II, bool IsClone, - DenseMap &VRBaseMap); - - /// BuildSchedUnits, AddSchedEdges - Helper functions for BuildSchedGraph. - void BuildSchedUnits(); - void AddSchedEdges(); +class SUnit; + +/// HazardRecognizer - This determines whether or not an instruction can be +/// issued this cycle, and whether or not a noop needs to be inserted to handle +/// the hazard. +class ScheduleHazardRecognizer { +public: + virtual ~ScheduleHazardRecognizer(); + + enum HazardType { + NoHazard, // This instruction can be emitted at this cycle. + Hazard, // This instruction can't be emitted at this cycle. + NoopHazard // This instruction can't be emitted, and needs noops. }; + + /// getHazardType - Return the hazard type of emitting this node. There are + /// three possible results. Either: + /// * NoHazard: it is legal to issue this instruction on this cycle. + /// * Hazard: issuing this instruction would stall the machine. If some + /// other instruction is available, issue it first. + /// * NoopHazard: issuing this instruction would break the program. If + /// some other instruction can be issued, do so, otherwise issue a noop. + virtual HazardType getHazardType(SUnit *) { + return NoHazard; + } + + /// EmitInstruction - This callback is invoked when an instruction is + /// emitted, to advance the hazard state. + virtual void EmitInstruction(SUnit *) {} + + /// AdvanceCycle - This callback is invoked when no instructions can be + /// issued on this cycle without a hazard. This should increment the + /// internal state of the hazard recognizer so that previously "Hazard" + /// instructions will now not be hazards. + virtual void AdvanceCycle() {} + + /// EmitNoop - This callback is invoked when a noop was added to the + /// instruction stream. + virtual void EmitNoop() {} +}; + } #endif Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Thu Jan 15 16:18:12 2009 @@ -33,7 +33,7 @@ class TargetLowering; class TargetInstrInfo; class FunctionLoweringInfo; - class HazardRecognizer; + class ScheduleHazardRecognizer; class GCFunctionInfo; class ScheduleDAG; @@ -93,7 +93,7 @@ /// CreateTargetHazardRecognizer - Return a newly allocated hazard recognizer /// to use for this target when scheduling the DAG. - virtual HazardRecognizer *CreateTargetHazardRecognizer(); + virtual ScheduleHazardRecognizer *CreateTargetHazardRecognizer(); protected: /// DAGSize - Size of DAG being instruction selected. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Jan 15 16:18:12 2009 @@ -1293,7 +1293,23 @@ return getOperand(getNumOperands()-1).getNode(); return 0; } - + + // If this is a pseudo op, like copyfromreg, look to see if there is a + // real target node flagged to it. If so, return the target node. + const SDNode *getFlaggedMachineNode() const { + const SDNode *FoundNode = this; + + // Climb up flag edges until a machine-opcode node is found, or the + // end of the chain is reached. + while (!FoundNode->isMachineOpcode()) { + const SDNode *N = FoundNode->getFlaggedNode(); + if (!N) break; + FoundNode = N; + } + + return FoundNode; + } + /// getNumValues - Return the number of values defined/returned by this /// operator. /// Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAG.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Thu Jan 15 16:18:12 2009 @@ -14,6 +14,7 @@ #define DEBUG_TYPE "pre-RA-sched" #include "llvm/CodeGen/ScheduleDAG.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -561,3 +562,5 @@ ScheduleDAGTopologicalSort::ScheduleDAGTopologicalSort( std::vector &sunits) : SUnits(sunits) {} + +ScheduleHazardRecognizer::~ScheduleHazardRecognizer() {} Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Thu Jan 15 16:18:12 2009 @@ -21,6 +21,7 @@ #define DEBUG_TYPE "pre-RA-sched" #include "llvm/CodeGen/LatencyPriorityQueue.h" #include "llvm/CodeGen/ScheduleDAGSDNodes.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/CodeGen/SchedulerRegistry.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -58,12 +59,12 @@ std::vector PendingQueue; /// HazardRec - The hazard recognizer to use. - HazardRecognizer *HazardRec; + ScheduleHazardRecognizer *HazardRec; public: ScheduleDAGList(MachineFunction &mf, SchedulingPriorityQueue *availqueue, - HazardRecognizer *HR) + ScheduleHazardRecognizer *HR) : ScheduleDAGSDNodes(mf), AvailableQueue(availqueue), HazardRec(HR) { } @@ -82,9 +83,6 @@ }; } // end anonymous namespace -HazardRecognizer::~HazardRecognizer() {} - - /// Schedule - Schedule the DAG using list scheduling. void ScheduleDAGList::Schedule() { DOUT << "********** List Scheduling **********\n"; @@ -190,31 +188,20 @@ } SUnit *FoundSUnit = 0; - SDNode *FoundNode = 0; bool HasNoopHazards = false; while (!AvailableQueue->empty()) { SUnit *CurSUnit = AvailableQueue->pop(); - // Get the node represented by this SUnit. - FoundNode = CurSUnit->getNode(); - - // If this is a pseudo op, like copyfromreg, look to see if there is a - // real target node flagged to it. If so, use the target node. - while (!FoundNode->isMachineOpcode()) { - SDNode *N = FoundNode->getFlaggedNode(); - if (!N) break; - FoundNode = N; - } - - HazardRecognizer::HazardType HT = HazardRec->getHazardType(FoundNode); - if (HT == HazardRecognizer::NoHazard) { + ScheduleHazardRecognizer::HazardType HT = + HazardRec->getHazardType(CurSUnit); + if (HT == ScheduleHazardRecognizer::NoHazard) { FoundSUnit = CurSUnit; break; } // Remember if this is a noop hazard. - HasNoopHazards |= HT == HazardRecognizer::NoopHazard; + HasNoopHazards |= HT == ScheduleHazardRecognizer::NoopHazard; NotReady.push_back(CurSUnit); } @@ -228,7 +215,7 @@ // If we found a node to schedule, do it now. if (FoundSUnit) { ScheduleNodeTopDown(FoundSUnit, CurCycle); - HazardRec->EmitInstruction(FoundNode); + HazardRec->EmitInstruction(FoundSUnit); // If this is a pseudo-op node, we don't want to increment the current // cycle. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jan 15 16:18:12 2009 @@ -34,6 +34,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/ScheduleDAGSDNodes.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/CodeGen/SchedulerRegistry.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/DwarfWriter.h" @@ -1079,8 +1080,8 @@ } -HazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() { - return new HazardRecognizer(); +ScheduleHazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() { + return new ScheduleHazardRecognizer(); } //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.cpp Thu Jan 15 16:18:12 2009 @@ -17,6 +17,8 @@ #include "SPUHazardRecognizers.h" #include "SPU.h" #include "SPUInstrInfo.h" +#include "llvm/CodeGen/ScheduleDAG.h" +#include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/Support/Debug.h" using namespace llvm; @@ -38,14 +40,15 @@ /// instruction. Currently returns NoHazard. /// /// \return NoHazard -HazardRecognizer::HazardType -SPUHazardRecognizer::getHazardType(SDNode *Node) +ScheduleHazardRecognizer::HazardType +SPUHazardRecognizer::getHazardType(SUnit *SU) { // Initial thoughts on how to do this, but this code cannot work unless the // function's prolog and epilog code are also being scheduled so that we can // accurately determine which pipeline is being scheduled. #if 0 - HazardRecognizer::HazardType retval = NoHazard; + const SDNode *Node = SU->getNode()->getFlaggedMachineNode(); + ScheduleHazardRecognizer::HazardType retval = NoHazard; bool mustBeOdd = false; switch (Node->getOpcode()) { @@ -120,7 +123,7 @@ #endif } -void SPUHazardRecognizer::EmitInstruction(SDNode *Node) +void SPUHazardRecognizer::EmitInstruction(SUnit *SU) { } Modified: llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.h?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUHazardRecognizers.h Thu Jan 15 16:18:12 2009 @@ -15,13 +15,14 @@ #ifndef SPUHAZRECS_H #define SPUHAZRECS_H -#include "llvm/CodeGen/ScheduleDAGSDNodes.h" -#include "SPUInstrInfo.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" namespace llvm { + +class TargetInstrInfo; /// SPUHazardRecognizer -class SPUHazardRecognizer : public HazardRecognizer +class SPUHazardRecognizer : public ScheduleHazardRecognizer { private: const TargetInstrInfo &TII; @@ -29,8 +30,8 @@ public: SPUHazardRecognizer(const TargetInstrInfo &TII); - virtual HazardType getHazardType(SDNode *Node); - virtual void EmitInstruction(SDNode *Node); + virtual HazardType getHazardType(SUnit *SU); + virtual void EmitInstruction(SUnit *SU); virtual void AdvanceCycle(); virtual void EmitNoop(); }; @@ -38,4 +39,3 @@ } // end namespace llvm #endif - Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Thu Jan 15 16:18:12 2009 @@ -353,7 +353,7 @@ /// CreateTargetHazardRecognizer - Return the hazard recognizer to use for /// this target when scheduling the DAG. - virtual HazardRecognizer *CreateTargetHazardRecognizer() { + virtual ScheduleHazardRecognizer *CreateTargetHazardRecognizer() { const TargetInstrInfo *II = TM.getInstrInfo(); assert(II && "No InstrInfo?"); return new SPUHazardRecognizer(*II); Modified: llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp Thu Jan 15 16:18:12 2009 @@ -15,6 +15,7 @@ #include "PPCHazardRecognizers.h" #include "PPC.h" #include "PPCInstrInfo.h" +#include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/Support/Debug.h" using namespace llvm; @@ -118,8 +119,9 @@ /// terminate terminate the dispatch group. We turn NoopHazard for any /// instructions that wouldn't terminate the dispatch group that would cause a /// pipeline flush. -HazardRecognizer::HazardType PPCHazardRecognizer970:: -getHazardType(SDNode *Node) { +ScheduleHazardRecognizer::HazardType PPCHazardRecognizer970:: +getHazardType(SUnit *SU) { + const SDNode *Node = SU->getNode()->getFlaggedMachineNode(); bool isFirst, isSingle, isCracked, isLoad, isStore; PPCII::PPC970_Unit InstrType = GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked, @@ -217,7 +219,8 @@ return NoHazard; } -void PPCHazardRecognizer970::EmitInstruction(SDNode *Node) { +void PPCHazardRecognizer970::EmitInstruction(SUnit *SU) { + const SDNode *Node = SU->getNode()->getFlaggedMachineNode(); bool isFirst, isSingle, isCracked, isLoad, isStore; PPCII::PPC970_Unit InstrType = GetInstrType(Node->getOpcode(), isFirst, isSingle, isCracked, Modified: llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h Thu Jan 15 16:18:12 2009 @@ -14,7 +14,8 @@ #ifndef PPCHAZRECS_H #define PPCHAZRECS_H -#include "llvm/CodeGen/ScheduleDAGSDNodes.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" +#include "llvm/CodeGen/SelectionDAGNodes.h" #include "PPCInstrInfo.h" namespace llvm { @@ -25,7 +26,7 @@ /// avoid structural hazards that cause significant performance penalties (e.g. /// setting the CTR register then branching through it within a dispatch group), /// or storing then loading from the same address within a dispatch group. -class PPCHazardRecognizer970 : public HazardRecognizer { +class PPCHazardRecognizer970 : public ScheduleHazardRecognizer { const TargetInstrInfo &TII; unsigned NumIssued; // Number of insts issued, including advanced cycles. @@ -47,8 +48,8 @@ public: PPCHazardRecognizer970(const TargetInstrInfo &TII); - virtual HazardType getHazardType(SDNode *Node); - virtual void EmitInstruction(SDNode *Node); + virtual HazardType getHazardType(SUnit *SU); + virtual void EmitInstruction(SUnit *SU); virtual void AdvanceCycle(); virtual void EmitNoop(); Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=62284&r1=62283&r2=62284&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Thu Jan 15 16:18:12 2009 @@ -181,7 +181,7 @@ /// CreateTargetHazardRecognizer - Return the hazard recognizer to use for /// this target when scheduling the DAG. - virtual HazardRecognizer *CreateTargetHazardRecognizer() { + virtual ScheduleHazardRecognizer *CreateTargetHazardRecognizer() { // Should use subtarget info to pick the right hazard recognizer. For // now, always return a PPC970 recognizer. const TargetInstrInfo *II = TM.getInstrInfo(); From wangmp at apple.com Thu Jan 15 16:43:39 2009 From: wangmp at apple.com (Mon P Wang) Date: Thu, 15 Jan 2009 22:43:39 -0000 Subject: [llvm-commits] [llvm] r62285 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/X86/widen_cast-6.ll Message-ID: <200901152243.n0FMhdrN004214@zion.cs.uiuc.edu> Author: wangmp Date: Thu Jan 15 16:43:38 2009 New Revision: 62285 URL: http://llvm.org/viewvc/llvm-project?rev=62285&view=rev Log: Added missing support to widen an operand from a bit convert. Added: llvm/trunk/test/CodeGen/X86/widen_cast-6.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=62285&r1=62284&r2=62285&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Thu Jan 15 16:43:38 2009 @@ -606,6 +606,7 @@ // Widen Vector Operand. bool WidenVectorOperand(SDNode *N, unsigned ResNo); + SDValue WidenVecOp_BIT_CONVERT(SDNode *N); SDValue WidenVecOp_CONCAT_VECTORS(SDNode *N); SDValue WidenVecOp_EXTRACT_VECTOR_ELT(SDNode *N); SDValue WidenVecOp_STORE(SDNode* N); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=62285&r1=62284&r2=62285&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Thu Jan 15 16:43:38 2009 @@ -1735,6 +1735,7 @@ assert(0 && "Do not know how to widen this operator's operand!"); abort(); + case ISD::BIT_CONVERT: Res = WidenVecOp_BIT_CONVERT(N); break; case ISD::CONCAT_VECTORS: Res = WidenVecOp_CONCAT_VECTORS(N); break; case ISD::EXTRACT_VECTOR_ELT: Res = WidenVecOp_EXTRACT_VECTOR_ELT(N); break; case ISD::STORE: Res = WidenVecOp_STORE(N); break; @@ -1786,6 +1787,36 @@ return DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], NumElts); } +SDValue DAGTypeLegalizer::WidenVecOp_BIT_CONVERT(SDNode *N) { + MVT VT = N->getValueType(0); + SDValue InOp = GetWidenedVector(N->getOperand(0)); + MVT InWidenVT = InOp.getValueType(); + + // Check if we can convert between two legal vector types and extract. + unsigned InWidenSize = InWidenVT.getSizeInBits(); + unsigned Size = VT.getSizeInBits(); + if (InWidenSize % Size == 0 && !VT.isVector()) { + unsigned NewNumElts = InWidenSize / Size; + MVT NewVT = MVT::getVectorVT(VT, NewNumElts); + if (TLI.isTypeLegal(NewVT)) { + SDValue BitOp = DAG.getNode(ISD::BIT_CONVERT, NewVT, InOp); + return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, VT, BitOp, + DAG.getIntPtrConstant(0)); + } + } + + // Lower the bit-convert to a store/load from the stack. Create the stack + // frame object. Make sure it is aligned for both the source and destination + // types. + SDValue FIPtr = DAG.CreateStackTemporary(InWidenVT, VT); + + // Emit a store to the stack slot. + SDValue Store = DAG.getStore(DAG.getEntryNode(), InOp, FIPtr, NULL, 0); + + // Result is a load from the stack slot. + return DAG.getLoad(VT, Store, FIPtr, NULL, 0); +} + SDValue DAGTypeLegalizer::WidenVecOp_CONCAT_VECTORS(SDNode *N) { // If the input vector is not legal, it is likely that we will not find a // legal vector of the same size. Replace the concatenate vector with a Added: llvm/trunk/test/CodeGen/X86/widen_cast-6.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/widen_cast-6.ll?rev=62285&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/widen_cast-6.ll (added) +++ llvm/trunk/test/CodeGen/X86/widen_cast-6.ll Thu Jan 15 16:43:38 2009 @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse41 -disable-mmx -o %t -f +; RUN: grep movd %t | count 1 + +; Test bit convert that requires widening in the operand. + +define i32 @return_v2hi() nounwind { +entry: + %retval12 = bitcast <2 x i16> zeroinitializer to i32 ; [#uses=1] + ret i32 %retval12 +} From dpatel at apple.com Thu Jan 15 17:41:32 2009 From: dpatel at apple.com (Devang Patel) Date: Thu, 15 Jan 2009 23:41:32 -0000 Subject: [llvm-commits] [llvm] r62286 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/DebugInfo/2009-01-15-dbg_declare.ll Message-ID: <200901152341.n0FNfXrh006212@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 17:41:32 2009 New Revision: 62286 URL: http://llvm.org/viewvc/llvm-project?rev=62286&view=rev Log: Validate dbg_* intrinsics before lowering them. Added: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/include/llvm/CodeGen/DwarfWriter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DwarfWriter.h?rev=62286&r1=62285&r2=62286&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/DwarfWriter.h (original) +++ llvm/trunk/include/llvm/CodeGen/DwarfWriter.h Thu Jan 15 17:41:32 2009 @@ -29,6 +29,7 @@ class DwarfException; class MachineModuleInfo; class MachineFunction; +class Value; class Module; class GlobalVariable; class TargetAsmInfo; @@ -75,6 +76,8 @@ /// void EndFunction(MachineFunction *MF); + /// ValidDebugInfo - Return true if V represents valid debug info value. + bool ValidDebugInfo(Value *V); /// label. Returns a unique label ID used to generate a label and provide /// correspondence to the source line list. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62286&r1=62285&r2=62286&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 17:41:32 2009 @@ -19,6 +19,7 @@ #include "llvm/ADT/UniqueVector.h" #include "llvm/Module.h" #include "llvm/DerivedTypes.h" +#include "llvm/Constants.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -100,6 +101,25 @@ getGlobalVariablesUsing(UseRoot, Result); } +/// getGlobalVariable - Return either a direct or cast Global value. +/// +static GlobalVariable *getGlobalVariable(Value *V) { + if (GlobalVariable *GV = dyn_cast(V)) { + return GV; + } else if (ConstantExpr *CE = dyn_cast(V)) { + if (CE->getOpcode() == Instruction::BitCast) { + return dyn_cast(CE->getOperand(0)); + } else if (CE->getOpcode() == Instruction::GetElementPtr) { + for (unsigned int i=1; igetNumOperands(); i++) { + if (!CE->getOperand(i)->isNullValue()) + return NULL; + } + return dyn_cast(CE->getOperand(0)); + } + } + return NULL; +} + //===----------------------------------------------------------------------===// /// DWLabel - Labels are used to track locations in the assembler file. /// Labels appear in the form @verbatim @endverbatim, @@ -3056,6 +3076,26 @@ public: + /// ValidDebugInfo - Return true if V represents valid debug info value. + bool ValidDebugInfo(Value *V) { + GlobalVariable *GV = getGlobalVariable(V); + if (!GV) + return false; + + if (GV->getLinkage() != GlobalValue::InternalLinkage + && GV->getLinkage() != GlobalValue::LinkOnceLinkage) + return false; + + DIDescriptor DI(GV); + // Check current version. Allow Version6 for now. + unsigned Version = DI.getVersion(); + if (Version != DIDescriptor::Version7 && Version != DIDescriptor::Version6) + return false; + + //FIXME - Check individual descriptors. + return true; + } + /// RecordSourceLine - Records location information and associates it with a /// label. Returns a unique label ID used to generate a label and provide /// correspondence to the source line list. @@ -4221,6 +4261,11 @@ MMI->EndFunction(); } +/// ValidDebugInfo - Return true if V represents valid debug info value. +bool DwarfWriter::ValidDebugInfo(Value *V) { + return DD->ValidDebugInfo(V); +} + /// RecordSourceLine - Records location information and associates it with a /// label. Returns a unique label ID used to generate a label and provide /// correspondence to the source line list. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=62286&r1=62285&r2=62286&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Jan 15 17:41:32 2009 @@ -317,7 +317,7 @@ default: break; case Intrinsic::dbg_stoppoint: { DbgStopPointInst *SPI = cast(I); - if (DW && SPI->getContext()) { + if (DW && SPI->getContext() && DW->ValidDebugInfo(SPI->getContext())) { DICompileUnit CU(cast(SPI->getContext())); unsigned SrcFile = DW->RecordSource(CU.getDirectory(), CU.getFilename()); @@ -331,7 +331,7 @@ } case Intrinsic::dbg_region_start: { DbgRegionStartInst *RSI = cast(I); - if (DW && RSI->getContext()) { + if (DW && RSI->getContext() && DW->ValidDebugInfo(RSI->getContext())) { unsigned ID = DW->RecordRegionStart(cast(RSI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -341,7 +341,7 @@ } case Intrinsic::dbg_region_end: { DbgRegionEndInst *REI = cast(I); - if (DW && REI->getContext()) { + if (DW && REI->getContext() && DW->ValidDebugInfo(REI->getContext())) { unsigned ID = DW->RecordRegionEnd(cast(REI->getContext())); const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL); @@ -353,7 +353,7 @@ if (!DW) return true; DbgFuncStartInst *FSI = cast(I); Value *SP = FSI->getSubprogram(); - if (SP) { + if (SP && DW->ValidDebugInfo(SP)) { // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is // what (most?) gdb expects. DISubprogram Subprogram(cast(SP)); @@ -375,7 +375,7 @@ case Intrinsic::dbg_declare: { DbgDeclareInst *DI = cast(I); Value *Variable = DI->getVariable(); - if (DW && Variable) { + if (DW && Variable && DW->ValidDebugInfo(Variable)) { // Determine the address of the declared object. Value *Address = DI->getAddress(); if (BitCastInst *BCI = dyn_cast(Address)) Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62286&r1=62285&r2=62286&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Jan 15 17:41:32 2009 @@ -3746,7 +3746,7 @@ case Intrinsic::dbg_stoppoint: { DwarfWriter *DW = DAG.getDwarfWriter(); DbgStopPointInst &SPI = cast(I); - if (DW && SPI.getContext()) + if (DW && SPI.getContext() && DW->ValidDebugInfo(SPI.getContext())) DAG.setRoot(DAG.getDbgStopPoint(getRoot(), SPI.getLine(), SPI.getColumn(), @@ -3756,7 +3756,7 @@ case Intrinsic::dbg_region_start: { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionStartInst &RSI = cast(I); - if (DW && RSI.getContext()) { + if (DW && RSI.getContext() && DW->ValidDebugInfo(RSI.getContext())) { unsigned LabelID = DW->RecordRegionStart(cast(RSI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); @@ -3767,7 +3767,7 @@ case Intrinsic::dbg_region_end: { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionEndInst &REI = cast(I); - if (DW && REI.getContext()) { + if (DW && REI.getContext() && DW->ValidDebugInfo(REI.getContext())) { unsigned LabelID = DW->RecordRegionEnd(cast(REI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); @@ -3780,7 +3780,7 @@ if (!DW) return 0; DbgFuncStartInst &FSI = cast(I); Value *SP = FSI.getSubprogram(); - if (SP) { + if (SP && DW->ValidDebugInfo(SP)) { // llvm.dbg.func.start implicitly defines a dbg_stoppoint which is // what (most?) gdb expects. DISubprogram Subprogram(cast(SP)); @@ -3802,7 +3802,7 @@ DwarfWriter *DW = DAG.getDwarfWriter(); DbgDeclareInst &DI = cast(I); Value *Variable = DI.getVariable(); - if (DW && Variable) + if (DW && Variable && DW->ValidDebugInfo(Variable)) DAG.setRoot(DAG.getNode(ISD::DECLARE, MVT::Other, getRoot(), getValue(DI.getAddress()), getValue(Variable))); return 0; Added: llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll?rev=62286&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll (added) +++ llvm/trunk/test/DebugInfo/2009-01-15-dbg_declare.ll Thu Jan 15 17:41:32 2009 @@ -0,0 +1,15 @@ + +; RUN: llvm-as < %s | llc -f -o /dev/null +target triple = "powerpc-apple-darwin9.5" + %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }*, i8*, i8* } + at llvm.dbg.variable24 = external constant %llvm.dbg.variable.type ; <%llvm.dbg.variable.type*> [#uses=1] + +declare void @llvm.dbg.declare({ }*, { }*) nounwind + +define i32 @isascii(i32 %_c) nounwind { +entry: + call void @llvm.dbg.declare({ }* null, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*)) + unreachable +} + + From dpatel at apple.com Thu Jan 15 18:50:54 2009 From: dpatel at apple.com (Devang Patel) Date: Fri, 16 Jan 2009 00:50:54 -0000 Subject: [llvm-commits] [llvm] r62288 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfWriter.cpp test/DebugInfo/2009-01-15-member.ll Message-ID: <200901160050.n0G0osdm008742@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 18:50:53 2009 New Revision: 62288 URL: http://llvm.org/viewvc/llvm-project?rev=62288&view=rev Log: Do not stumble over forward declared struct member. Added: llvm/trunk/test/DebugInfo/2009-01-15-member.ll Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62288&r1=62287&r2=62288&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 18:50:53 2009 @@ -1791,6 +1791,11 @@ { // Add elements to structure type. DIArray Elements = CTy.getTypeArray(); + + // A forward struct declared type may not have elements available. + if (Elements.isNull()) + break; + // Add elements to structure type. for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) { DIDescriptor Element = Elements.getElement(i); Added: llvm/trunk/test/DebugInfo/2009-01-15-member.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-01-15-member.ll?rev=62288&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/2009-01-15-member.ll (added) +++ llvm/trunk/test/DebugInfo/2009-01-15-member.ll Thu Jan 15 18:50:53 2009 @@ -0,0 +1,30 @@ +; RUN: llvm-as < %s | llc -f -o /dev/null + %llvm.dbg.anchor.type = type { i32, i32 } + %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32, i8*, i8* } + %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* } + %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i8*, i8* } + %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, i8*, i8* } + %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }*, i8*, i8* } + %struct.f = type opaque + %struct.s = type { %struct.f*, i32 } + at s2 = common global %struct.s zeroinitializer ; <%struct.s*> [#uses=1] + at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str = internal constant [4 x i8] c"t.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at .str1 = internal constant [6 x i8] c"/tmp/\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] + at .str2 = internal constant [57 x i8] c"4.2.1 (Based on Apple Inc. build 5628) (LLVM build 2091)\00", section "llvm.metadata" ; <[57 x i8]*> [#uses=1] + at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([57 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] + at .str3 = internal constant [2 x i8] c"s\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at .str4 = internal constant [2 x i8] c"f\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at llvm.dbg.composite5 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str4, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 2, i64 0, i64 0, i64 0, i32 60, { }* null, { }* null, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] + at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite5 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at .str6 = internal constant [3 x i8] c"f1\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] + at llvm.dbg.derivedtype7 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str6, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 4, i64 32, i64 32, i64 0, i32 1, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at .str8 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str8, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5, i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] + at .str9 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at llvm.dbg.derivedtype10 = internal constant %llvm.dbg.derivedtype.type { i32 458765, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str9, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 5, i64 32, i64 32, i64 32, i32 1, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at llvm.dbg.array = internal constant [2 x { }*] [ { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype7 to { }*), { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype10 to { }*) ], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1] + at llvm.dbg.composite11 = internal constant %llvm.dbg.composite.type { i32 458771, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([2 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, i64 64, i64 32, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str1, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1] + at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str12 = internal constant [3 x i8] c"s2\00", section "llvm.metadata" ; <[3 x i8]*> [#uses=1] + at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* getelementptr ([3 x i8]* @.str12, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 6, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite11 to { }*), i1 false, i1 true, { }* bitcast (%struct.s* @s2 to { }*), i8* null, i8* null }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] From gohman at apple.com Thu Jan 15 19:33:36 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 16 Jan 2009 01:33:36 -0000 Subject: [llvm-commits] [llvm] r62291 - in /llvm/trunk: include/llvm/CodeGen/ScheduleHazardRecognizer.h lib/CodeGen/PostRASchedulerList.cpp lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp lib/Target/PowerPC/PPCHazardRecognizers.cpp lib/Target/PowerPC/PPCHazardRecognizers.h Message-ID: <200901160133.n0G1Xal5010178@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 19:33:36 2009 New Revision: 62291 URL: http://llvm.org/viewvc/llvm-project?rev=62291&view=rev Log: Initial hazard recognizer support in post-pass scheduling. This includes a new toy hazard recognizier heuristic which attempts to direct the scheduler to avoid clumping large groups of loads or stores too densely. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h Modified: llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h?rev=62291&r1=62290&r2=62291&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleHazardRecognizer.h Thu Jan 15 19:33:36 2009 @@ -55,7 +55,10 @@ /// EmitNoop - This callback is invoked when a noop was added to the /// instruction stream. - virtual void EmitNoop() {} + virtual void EmitNoop() { + // Default implementation: count it as a cycle. + AdvanceCycle(); + } }; } Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=62291&r1=62290&r2=62291&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original) +++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu Jan 15 19:33:36 2009 @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/ScheduleHazardRecognizer.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetRegisterInfo.h" @@ -36,6 +37,7 @@ #include using namespace llvm; +STATISTIC(NumNoops, "Number of noops inserted"); STATISTIC(NumStalls, "Number of pipeline stalls"); static cl::opt @@ -43,6 +45,11 @@ cl::desc("Break post-RA scheduling anti-dependencies"), cl::init(true), cl::Hidden); +static cl::opt +EnablePostRAHazardAvoidance("avoid-hazards", + cl::desc("Enable simple hazard-avoidance"), + cl::init(true), cl::Hidden); + namespace { class VISIBILITY_HIDDEN PostRAScheduler : public MachineFunctionPass { public: @@ -84,12 +91,21 @@ /// because they may not be safe to break. const BitVector AllocatableSet; + /// HazardRec - The hazard recognizer to use. + ScheduleHazardRecognizer *HazardRec; + public: SchedulePostRATDList(MachineFunction &MF, const MachineLoopInfo &MLI, - const MachineDominatorTree &MDT) + const MachineDominatorTree &MDT, + ScheduleHazardRecognizer *HR) : ScheduleDAGInstrs(MF, MLI, MDT), Topo(SUnits), - AllocatableSet(TRI->getAllocatableSet(MF)) {} + AllocatableSet(TRI->getAllocatableSet(MF)), + HazardRec(HR) {} + + ~SchedulePostRATDList() { + delete HazardRec; + } void Schedule(); @@ -99,6 +115,62 @@ void ListScheduleTopDown(); bool BreakAntiDependencies(); }; + + /// SimpleHazardRecognizer - A *very* simple hazard recognizer. It uses + /// a coarse classification and attempts to avoid that instructions of + /// a given class aren't grouped too densely together. + class SimpleHazardRecognizer : public ScheduleHazardRecognizer { + /// Class - A simple classification for SUnits. + enum Class { + Other, Load, Store + }; + + /// Window - The Class values of the most recently issued + /// instructions. + Class Window[8]; + + /// getClass - Classify the given SUnit. + Class getClass(const SUnit *SU) { + const MachineInstr *MI = SU->getInstr(); + const TargetInstrDesc &TID = MI->getDesc(); + if (TID.mayLoad()) + return Load; + if (TID.mayStore()) + return Store; + return Other; + } + + /// Step - Rotate the existing entries in Window and insert the + /// given class value in position as the most recent. + void Step(Class C) { + std::copy(Window+1, array_endof(Window), Window); + Window[array_lengthof(Window)-1] = C; + } + + public: + SimpleHazardRecognizer() : Window() {} + + virtual HazardType getHazardType(SUnit *SU) { + Class C = getClass(SU); + if (C == Other) + return NoHazard; + unsigned Score = 0; + for (int i = 0; i != array_lengthof(Window); ++i) + if (Window[i] == C) + Score += i + 1; + if (Score > array_lengthof(Window) * 2) + return Hazard; + return NoHazard; + } + + virtual void EmitInstruction(SUnit *SU) { + Step(getClass(SU)); + } + + virtual void AdvanceCycle() { + Step(Other); + } + }; } bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) { @@ -106,8 +178,11 @@ const MachineLoopInfo &MLI = getAnalysis(); const MachineDominatorTree &MDT = getAnalysis(); + ScheduleHazardRecognizer *HR = EnablePostRAHazardAvoidance ? + new SimpleHazardRecognizer : + new ScheduleHazardRecognizer(); - SchedulePostRATDList Scheduler(Fn, MLI, MDT); + SchedulePostRATDList Scheduler(Fn, MLI, MDT, HR); // Loop over all of the basic blocks for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); @@ -634,6 +709,7 @@ // While Available queue is not empty, grab the node with the highest // priority. If it is not ready put it back. Schedule the node. + std::vector NotReady; Sequence.reserve(SUnits.size()); while (!AvailableQueue.empty() || !PendingQueue.empty()) { // Check to see if any of the pending instructions are ready to issue. If @@ -650,28 +726,63 @@ MinDepth = PendingQueue[i]->getDepth(); } - // If there are no instructions available, don't try to issue anything. + // If there are no instructions available, don't try to issue anything, and + // don't advance the hazard recognizer. if (AvailableQueue.empty()) { CurCycle = MinDepth != ~0u ? MinDepth : CurCycle + 1; continue; } - SUnit *FoundSUnit = AvailableQueue.pop(); - + SUnit *FoundSUnit = 0; + + bool HasNoopHazards = false; + while (!AvailableQueue.empty()) { + SUnit *CurSUnit = AvailableQueue.pop(); + + ScheduleHazardRecognizer::HazardType HT = + HazardRec->getHazardType(CurSUnit); + if (HT == ScheduleHazardRecognizer::NoHazard) { + FoundSUnit = CurSUnit; + break; + } + + // Remember if this is a noop hazard. + HasNoopHazards |= HT == ScheduleHazardRecognizer::NoopHazard; + + NotReady.push_back(CurSUnit); + } + + // Add the nodes that aren't ready back onto the available list. + if (!NotReady.empty()) { + AvailableQueue.push_all(NotReady); + NotReady.clear(); + } + // If we found a node to schedule, do it now. if (FoundSUnit) { ScheduleNodeTopDown(FoundSUnit, CurCycle); + HazardRec->EmitInstruction(FoundSUnit); // If this is a pseudo-op node, we don't want to increment the current // cycle. if (FoundSUnit->Latency) // Don't increment CurCycle for pseudo-ops! - ++CurCycle; - } else { + ++CurCycle; + } else if (!HasNoopHazards) { // Otherwise, we have a pipeline stall, but no other problem, just advance // the current cycle and try again. DOUT << "*** Advancing cycle, no work to do\n"; + HazardRec->AdvanceCycle(); ++NumStalls; ++CurCycle; + } else { + // Otherwise, we have no instructions to issue and we have instructions + // that will fault if we don't do this right. This is the case for + // processors without pipeline interlocks and other cases. + DOUT << "*** Emitting noop\n"; + HazardRec->EmitNoop(); + Sequence.push_back(0); // NULL here means noop + ++NumNoops; + ++CurCycle; } } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=62291&r1=62290&r2=62291&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Thu Jan 15 19:33:36 2009 @@ -234,7 +234,7 @@ // processors without pipeline interlocks and other cases. DOUT << "*** Emitting noop\n"; HazardRec->EmitNoop(); - Sequence.push_back(0); // NULL SUnit* -> noop + Sequence.push_back(0); // NULL here means noop ++NumNoops; ++CurCycle; } Modified: llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp?rev=62291&r1=62290&r2=62291&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.cpp Thu Jan 15 19:33:36 2009 @@ -302,7 +302,3 @@ if (NumIssued == 5) EndDispatchGroup(); } - -void PPCHazardRecognizer970::EmitNoop() { - AdvanceCycle(); -} Modified: llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h?rev=62291&r1=62290&r2=62291&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCHazardRecognizers.h Thu Jan 15 19:33:36 2009 @@ -51,7 +51,6 @@ virtual HazardType getHazardType(SUnit *SU); virtual void EmitInstruction(SUnit *SU); virtual void AdvanceCycle(); - virtual void EmitNoop(); private: /// EndDispatchGroup - Called when we are finishing a new dispatch group. From foldr at codedgers.com Thu Jan 15 19:31:30 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Thu, 15 Jan 2009 17:31:30 -0800 Subject: [llvm-commits] [PATCH] Support for multi-valued options in CommandLine Message-ID: <20090115173130.20022wpyki5qco74@webmail.codedgers.com> Hi, this adds support for multi-valued options to CommandLine (needed to implement some Darwin-specific options in llvmc). Used like this: // Zero or more occurences, 2 values cl::list MultiValuedOption("multi-valued", cl::multi_val(2)); // One and only one occurence, 3 values cl::list MultiValuedOption("multi-valued", cl::multi_val(3), cl::Required); -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Support-for-multi-valued-options-in-CommandLine.patch Type: text/x-patch Size: 6981 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20090115/509b85ce/attachment.bin From gohman at apple.com Thu Jan 15 19:46:47 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 16 Jan 2009 01:46:47 -0000 Subject: [llvm-commits] [test-suite] r62293 - /test-suite/trunk/Makefile.programs Message-ID: <200901160146.n0G1kl0h010587@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 19:46:47 2009 New Revision: 62293 URL: http://llvm.org/viewvc/llvm-project?rev=62293&view=rev Log: New LLCBETA options: Drop -break-anti-dependencies, which is now on by default with the post-pass scheduler, and -enable-tail-merge=false, which does not currently conflict with the post-pass scheduler. Add -machine-licm. Modified: test-suite/trunk/Makefile.programs Modified: test-suite/trunk/Makefile.programs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=62293&r1=62292&r2=62293&view=diff ============================================================================== --- test-suite/trunk/Makefile.programs (original) +++ test-suite/trunk/Makefile.programs Thu Jan 15 19:46:47 2009 @@ -226,7 +226,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -disable-post-RA-scheduler=false -break-anti-dependencies -enable-tail-merge=false +LLCBETAOPTION := -disable-post-RA-scheduler=false -machine-licm #-machine-licm #-fast-isel #-aggressive-remat From dpatel at apple.com Thu Jan 15 19:49:46 2009 From: dpatel at apple.com (Devang Patel) Date: Fri, 16 Jan 2009 01:49:46 -0000 Subject: [llvm-commits] [llvm] r62294 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901160149.n0G1nktx010670@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 19:49:46 2009 New Revision: 62294 URL: http://llvm.org/viewvc/llvm-project?rev=62294&view=rev Log: Any debug info symbol is only valid if atleast one compile unit is seen. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62294&r1=62293&r2=62294&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 19:49:46 2009 @@ -3083,6 +3083,10 @@ /// ValidDebugInfo - Return true if V represents valid debug info value. bool ValidDebugInfo(Value *V) { + + if (!shouldEmit) + return false; + GlobalVariable *GV = getGlobalVariable(V); if (!GV) return false; From gohman at apple.com Thu Jan 15 20:05:52 2009 From: gohman at apple.com (Dan Gohman) Date: Fri, 16 Jan 2009 02:05:52 -0000 Subject: [llvm-commits] [llvm] r62296 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200901160205.n0G25q6T011180@zion.cs.uiuc.edu> Author: djg Date: Thu Jan 15 20:05:52 2009 New Revision: 62296 URL: http://llvm.org/viewvc/llvm-project?rev=62296&view=rev Log: Add support for instructions with multiple ComplexPatterns, by adding more information to the temporary variables names so that they don't conflict. Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=62296&r1=62295&r2=62296&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Jan 15 20:05:52 2009 @@ -613,8 +613,8 @@ std::string Fn = CP->getSelectFunc(); unsigned NumOps = CP->getNumOperands(); for (unsigned i = 0; i < NumOps; ++i) { - emitDecl("CPTmp" + utostr(i)); - emitCode("SDValue CPTmp" + utostr(i) + ";"); + emitDecl("CPTmp" + RootName + "_" + utostr(i)); + emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";"); } if (CP->hasProperty(SDNPHasChain)) { emitDecl("CPInChain"); @@ -625,7 +625,7 @@ std::string Code = Fn + "(" + RootName + ", " + RootName; for (unsigned i = 0; i < NumOps; i++) - Code += ", CPTmp" + utostr(i); + Code += ", CPTmp" + RootName + "_" + utostr(i); if (CP->hasProperty(SDNPHasChain)) { ChainName = "Chain" + ChainSuffix; Code += ", CPInChain, Chain" + ChainSuffix; @@ -687,8 +687,8 @@ std::string Fn = CP->getSelectFunc(); unsigned NumOps = CP->getNumOperands(); for (unsigned i = 0; i < NumOps; ++i) { - emitDecl("CPTmp" + utostr(i)); - emitCode("SDValue CPTmp" + utostr(i) + ";"); + emitDecl("CPTmp" + RootName + "_" + utostr(i)); + emitCode("SDValue CPTmp" + RootName + "_" + utostr(i) + ";"); } if (CP->hasProperty(SDNPHasChain)) { const SDNodeInfo &PInfo = CGP.getSDNodeInfo(Parent->getOperator()); @@ -713,7 +713,7 @@ } Code += RootName; for (unsigned i = 0; i < NumOps; i++) - Code += ", CPTmp" + utostr(i); + Code += ", CPTmp" + RootName + "_" + utostr(i); if (CP->hasProperty(SDNPHasChain)) Code += ", CPInChain, Chain" + ChainSuffix; emitCheck(Code + ")"); @@ -862,7 +862,7 @@ NodeOps.push_back(Val); } else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) { for (unsigned i = 0; i < CP->getNumOperands(); ++i) { - NodeOps.push_back("CPTmp" + utostr(i)); + NodeOps.push_back("CPTmp" + Val + "_" + utostr(i)); } } else { // This node, probably wrapped in a SDNodeXForm, behaves like a leaf From gohman at apple.com Thu Jan 15 20:09:18 2009 From: gohman at apple.com (Dan Gohman) Date: Thu, 15 Jan 2009 18:09:18 -0800 Subject: [llvm-commits] [llvm] r62296 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp In-Reply-To: <200901160205.n0G25q6T011180@zion.cs.uiuc.edu> References: <200901160205.n0G25q6T011180@zion.cs.uiuc.edu> Message-ID: <3BE91A67-08D1-4A09-A747-401D7ACE3E1B@apple.com> On Jan 15, 2009, at 6:05 PM, Dan Gohman wrote: > Author: djg > Date: Thu Jan 15 20:05:52 2009 > New Revision: 62296 > > URL: http://llvm.org/viewvc/llvm-project?rev=62296&view=rev > Log: > Add support for instructions with multiple ComplexPatterns, by > adding more information to the temporary variables names so that > they don't conflict. I forgot to mention that this is from a patch by Brandner! Dan From evan.cheng at apple.com Thu Jan 15 20:11:43 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 16 Jan 2009 02:11:43 -0000 Subject: [llvm-commits] [llvm] r62297 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/cast.ll Message-ID: <200901160211.n0G2Bh3l011444@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jan 15 20:11:43 2009 New Revision: 62297 URL: http://llvm.org/viewvc/llvm-project?rev=62297&view=rev Log: Clean up previous cast optimization a bit. Also make zext elimination a bit more aggressive: if it's not necessary to emit an AND (i.e. high bits are already zero), it's profitable to evaluate the operand at a different type. Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/test/Transforms/InstCombine/cast.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=62297&r1=62296&r2=62297&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan 15 20:11:43 2009 @@ -394,8 +394,7 @@ Value *EvaluateInDifferentType(Value *V, const Type *Ty, bool isSigned); bool CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, - unsigned CastOpc, - int &NumCastsRemoved, bool &SeenTrunc); + unsigned CastOpc, int &NumCastsRemoved); unsigned GetOrEnforceKnownAlignment(Value *V, unsigned PrefAlign = 0); @@ -7497,10 +7496,9 @@ /// If CastOpc is a sext or zext, we are asking if the low bits of the value can /// bit computed in a larger type, which is then and'd or sext_in_reg'd to get /// the final result. -bool -InstCombiner::CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, - unsigned CastOpc, - int &NumCastsRemoved, bool &SeenTrunc){ +bool InstCombiner::CanEvaluateInDifferentType(Value *V, const IntegerType *Ty, + unsigned CastOpc, + int &NumCastsRemoved){ // We can always evaluate constants in another type. if (isa(V)) return true; @@ -7520,8 +7518,6 @@ // casts first. if (!isa(I->getOperand(0)) && I->hasOneUse()) ++NumCastsRemoved; - if (isa(I)) - SeenTrunc = true; return true; } } @@ -7540,9 +7536,9 @@ case Instruction::Xor: // These operators can all arbitrarily be extended or truncated. return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved, SeenTrunc) && + NumCastsRemoved) && CanEvaluateInDifferentType(I->getOperand(1), Ty, CastOpc, - NumCastsRemoved, SeenTrunc); + NumCastsRemoved); case Instruction::Shl: // If we are truncating the result of this SHL, and if it's a shift of a @@ -7552,7 +7548,7 @@ if (BitWidth < OrigTy->getBitWidth() && CI->getLimitedValue(BitWidth) < BitWidth) return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved, SeenTrunc); + NumCastsRemoved); } break; case Instruction::LShr: @@ -7567,7 +7563,7 @@ APInt::getHighBitsSet(OrigBitWidth, OrigBitWidth-BitWidth)) && CI->getLimitedValue(BitWidth) < BitWidth) { return CanEvaluateInDifferentType(I->getOperand(0), Ty, CastOpc, - NumCastsRemoved, SeenTrunc); + NumCastsRemoved); } } break; @@ -7587,16 +7583,16 @@ case Instruction::Select: { SelectInst *SI = cast(I); return CanEvaluateInDifferentType(SI->getTrueValue(), Ty, CastOpc, - NumCastsRemoved, SeenTrunc) && + NumCastsRemoved) && CanEvaluateInDifferentType(SI->getFalseValue(), Ty, CastOpc, - NumCastsRemoved, SeenTrunc); + NumCastsRemoved); } case Instruction::PHI: { // We can change a phi if we can change all operands. PHINode *PN = cast(I); for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) if (!CanEvaluateInDifferentType(PN->getIncomingValue(i), Ty, CastOpc, - NumCastsRemoved, SeenTrunc)) + NumCastsRemoved)) return false; return true; } @@ -7845,10 +7841,9 @@ // Attempt to propagate the cast into the instruction for int->int casts. int NumCastsRemoved = 0; - bool SeenTrunc = false; if (!isa(CI) && CanEvaluateInDifferentType(SrcI, cast(DestTy), - CI.getOpcode(), NumCastsRemoved, SeenTrunc)) { + CI.getOpcode(), NumCastsRemoved)) { // If this cast is a truncate, evaluting in a different type always // eliminates the cast, so it is always a win. If this is a zero-extension, // we need to do an AND to maintain the clear top-part of the computation, @@ -7865,14 +7860,27 @@ case Instruction::Trunc: DoXForm = true; break; - case Instruction::ZExt: + case Instruction::ZExt: { DoXForm = NumCastsRemoved >= 1; - // TODO: Check if we need to insert an AND. + if (!DoXForm) { + // If it's unnecessary to issue an AND to clear the high bits, it's + // always profitable to do this xform. + Value *TryRes = EvaluateInDifferentType(SrcI, DestTy, + CI.getOpcode() == Instruction::SExt); + APInt Mask(APInt::getBitsSet(DestBitSize, SrcBitSize, DestBitSize)); + if (MaskedValueIsZero(TryRes, Mask)) + return ReplaceInstUsesWith(CI, TryRes); + else if (Instruction *TryI = dyn_cast(TryRes)) + if (TryI->use_empty()) + EraseInstFromFunction(*TryI); + } break; + } case Instruction::SExt: { DoXForm = NumCastsRemoved >= 2; - if (!SeenTrunc) { - // Do we have to emit a truncate to SrcBitSize followed by a sext? + if (!DoXForm && !isa(SrcI)) { + // If we do not have to emit the truncate + sext pair, then it's always + // profitable to do this xform. // // It's not safe to eliminate the trunc + sext pair if one of the // eliminated cast is a truncate. e.g. @@ -7880,11 +7888,14 @@ // t3 = sext i16 t2 to i32 // != // i32 t1 - unsigned NumSignBits = ComputeNumSignBits(&CI); - if (NumSignBits > (DestBitSize - SrcBitSize)) { - DoXForm = true; - JustReplace = true; - } + Value *TryRes = EvaluateInDifferentType(SrcI, DestTy, + CI.getOpcode() == Instruction::SExt); + unsigned NumSignBits = ComputeNumSignBits(TryRes); + if (NumSignBits > (DestBitSize - SrcBitSize)) + return ReplaceInstUsesWith(CI, TryRes); + else if (Instruction *TryI = dyn_cast(TryRes)) + if (TryI->use_empty()) + EraseInstFromFunction(*TryI); } break; } @@ -7893,6 +7904,10 @@ if (DoXForm) { Value *Res = EvaluateInDifferentType(SrcI, DestTy, CI.getOpcode() == Instruction::SExt); + if (JustReplace) + // Just replace this cast with the result. + return ReplaceInstUsesWith(CI, Res); + assert(Res->getType() == DestTy); switch (CI.getOpcode()) { default: assert(0 && "Unknown cast type!"); @@ -7901,15 +7916,24 @@ // Just replace this cast with the result. return ReplaceInstUsesWith(CI, Res); case Instruction::ZExt: { - // We need to emit an AND to clear the high bits. assert(SrcBitSize < DestBitSize && "Not a zext?"); + + // If the high bits are already zero, just replace this cast with the + // result. + APInt Mask(APInt::getBitsSet(DestBitSize, SrcBitSize, DestBitSize)); + if (MaskedValueIsZero(Res, Mask)) + return ReplaceInstUsesWith(CI, Res); + + // We need to emit an AND to clear the high bits. Constant *C = ConstantInt::get(APInt::getLowBitsSet(DestBitSize, SrcBitSize)); return BinaryOperator::CreateAnd(Res, C); } - case Instruction::SExt: - if (JustReplace) - // Just replace this cast with the result. + case Instruction::SExt: { + // If the high bits are already filled with sign bit, just replace this + // cast with the result. + unsigned NumSignBits = ComputeNumSignBits(Res); + if (NumSignBits > (DestBitSize - SrcBitSize)) return ReplaceInstUsesWith(CI, Res); // We need to emit a cast to truncate, then a cast to sext. @@ -7917,6 +7941,7 @@ InsertCastBefore(Instruction::Trunc, Res, Src->getType(), CI), DestTy); } + } } } Modified: llvm/trunk/test/Transforms/InstCombine/cast.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/cast.ll?rev=62297&r1=62296&r2=62297&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/cast.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/cast.ll Thu Jan 15 20:11:43 2009 @@ -254,3 +254,10 @@ ret i1 %e } +define i64 @test38(i32 %a) { + %1 = icmp eq i32 %a, -2 + %2 = zext i1 %1 to i8 + %3 = xor i8 %2, 1 + %4 = zext i8 %3 to i64 + ret i64 %4 +} From dpatel at apple.com Thu Jan 15 20:15:14 2009 From: dpatel at apple.com (Devang Patel) Date: Fri, 16 Jan 2009 02:15:14 -0000 Subject: [llvm-commits] [llvm] r62298 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200901160215.n0G2FEHq011745@zion.cs.uiuc.edu> Author: dpatel Date: Thu Jan 15 20:15:14 2009 New Revision: 62298 URL: http://llvm.org/viewvc/llvm-project?rev=62298&view=rev Log: Validate debug info values only if DwarfDebug is initialized. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62298&r1=62297&r2=62298&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 20:15:14 2009 @@ -4272,7 +4272,7 @@ /// ValidDebugInfo - Return true if V represents valid debug info value. bool DwarfWriter::ValidDebugInfo(Value *V) { - return DD->ValidDebugInfo(V); + return DD && DD->ValidDebugInfo(V); } /// RecordSourceLine - Records location information and associates it with a From evan.cheng at apple.com Thu Jan 15 20:16:37 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 16 Jan 2009 02:16:37 -0000 Subject: [llvm-commits] [llvm] r62299 - /llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Message-ID: <200901160216.n0G2Gcox011887@zion.cs.uiuc.edu> Author: evancheng Date: Thu Jan 15 20:16:37 2009 New Revision: 62299 URL: http://llvm.org/viewvc/llvm-project?rev=62299&view=rev Log: ARMCompilationCallback should not save / restore vfp registers if vfp is not available. Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=62299&r1=62298&r2=62299&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Thu Jan 15 20:16:37 2009 @@ -60,7 +60,7 @@ // whole compilation callback doesn't exist as far as the caller is // concerned, so we can't just preserve the callee saved regs. "stmdb sp!, {r0, r1, r2, r3, lr}\n" -#ifdef __APPLE__ +#ifndef __SOFTFP__ "fstmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n" #endif // The LR contains the address of the stub function on entry. @@ -83,7 +83,7 @@ // 6-20 | D0..D7 | Saved VFP registers // +--------+ // -#ifdef __APPLE__ +#ifndef __SOFTFP__ // Restore VFP caller-saved registers. "fldmfdd sp!, {d0, d1, d2, d3, d4, d5, d6, d7}\n" #endif From evan.cheng at apple.com Thu Jan 15 20:21:39 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 15 Jan 2009 18:21:39 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r62076 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200901151013.20308.baldrick@free.fr> References: <200901120344.n0C3iCF6028584@zion.cs.uiuc.edu> <200901141246.56489.baldrick@free.fr> <0F92559C-EC5B-48AF-97D3-AFA8CBB0E795@apple.com> <200901151013.20308.baldrick@free.fr> Message-ID: On Jan 15, 2009, at 1:13 AM, Duncan Sands wrote: > Hi Evan, > >> Right. I am saying for array_ref that is turned into pointer >> arithmetics + load / store i8, just return lvalue with alignment 1. >> It >> is always correct. The down size I see if theoretically this could >> prevent some optimization that combine multiple loads / stores into a >> larger one. I think we can eliminate most of these potential cases by >> calling getPointerAlignment() when the type is POINTER_TYPE. >> >> The main issue is I'd like to fix the bug where we emit memory >> instructions with artificially high alignment. But I am willing to >> invest a significant effort to change Emit. I'll cook up with another >> patch with those x86-64 linux (which obviously hates me) failures >> fixed. > > I think your lvalue scheme is better for the long run than my > expr_align > one. However, for testing purposes I think it would be a good idea > to also > enhance expr_align and compare the results of the two schemes. As > well as I am not going to enhance expr_align for two reasons 1) no time :-) 2) my assumptions / understanding are still the same so whatever mistake there may be in the LValue patch is likely to be in expr_align. > > catching mistakes, this may help find places where the alignment > produced > is suboptimal. As for "Emit", this should not be changed if it can be > avoided. Better to emit an alignment of 1 in tricky cases and have > the > LLVM optimizers improve it. Also, you use the alignment of LLVM types > in some places IIRC. This is not great because (1) I think > currently LLVM > types may be more aligned than the corresponding gcc types (I want > to fix > this some day); (2) LLVM types can certainly be less aligned than > the gcc > type, which means you are using a suboptimal value. Finally, I > think you Ok. > > have to be very careful in using type alignment at all. Type > alignment is > great when declaring variables - it gives the default alignment to > use for > the allocated memory; this default can of course be overridden. > However it > is basically useless for the purposes of loads and stores: there you > need > to estimate the minimum alignment that the storee is *guaranteed* to > have. > Knowing that the storee has a certain type doesn't guarantee > anything about > it's alignment at all! What is reliable is alignment of objects, > i.e. the > result of DECL_ALIGN. So I think that anywhere you can't get > alignment from > an object, you shouldn't use the type alignment, you should use 1 > instead. Ok. I'll check in a new patch soon. Please test Ada build (I am sure you will). Evan > > > Ciao, > > Duncan. From sanjiv.gupta at microchip.com Thu Jan 15 20:45:46 2009 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Fri, 16 Jan 2009 02:45:46 -0000 Subject: [llvm-commits] [llvm] r62301 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200901160245.n0G2jkji012932@zion.cs.uiuc.edu> Author: sgupta Date: Thu Jan 15 20:45:46 2009 New Revision: 62301 URL: http://llvm.org/viewvc/llvm-project?rev=62301&view=rev Log: Few targets do not have a single directive to emit global constants. For example, PIC16 needs to break a long or int constant into mulitple parts and emit multiple directives. So Allow targets to overried EmitConstantValueOnly(). Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62301&r1=62300&r2=62301&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Jan 15 20:45:46 2009 @@ -317,7 +317,7 @@ /// EmitConstantValueOnly - Print out the specified constant, without a /// storage class. Only constants of first-class type are allowed here. - void EmitConstantValueOnly(const Constant *CV); + virtual void EmitConstantValueOnly(const Constant *CV); /// EmitGlobalConstant - Print a general LLVM constant to the .s file. void EmitGlobalConstant(const Constant* CV); From clattner at apple.com Thu Jan 15 21:40:49 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 15 Jan 2009 19:40:49 -0800 Subject: [llvm-commits] [llvm] r62301 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h In-Reply-To: <200901160245.n0G2jkji012932@zion.cs.uiuc.edu> References: <200901160245.n0G2jkji012932@zion.cs.uiuc.edu> Message-ID: <8DBC6A64-C6AC-4516-BDD6-2B202099D82A@apple.com> On Jan 15, 2009, at 6:45 PM, Sanjiv Gupta wrote: > Author: sgupta > Date: Thu Jan 15 20:45:46 2009 > New Revision: 62301 > > URL: http://llvm.org/viewvc/llvm-project?rev=62301&view=rev > Log: > Few targets do not have a single directive to emit global constants. > For example, PIC16 needs to break a long or int constant into > mulitple parts and emit multiple directives. So Allow targets to > overried EmitConstantValueOnly(). Hi Sanjiv, I don't think this is the right approach. EmitConstantValueOnly should handle this case directly by checking to see if you have a directive to emit a 32-bit integer value. This is how we handle "lack of i64 emission" on 32-bit targets. -Chris > > > Modified: > llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > > Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62301&r1=62300&r2=62301&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) > +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Jan 15 20:45:46 > 2009 > @@ -317,7 +317,7 @@ > > /// EmitConstantValueOnly - Print out the specified constant, > without a > /// storage class. Only constants of first-class type are > allowed here. > - void EmitConstantValueOnly(const Constant *CV); > + virtual void EmitConstantValueOnly(const Constant *CV); > > /// EmitGlobalConstant - Print a general LLVM constant to the .s > file. > void EmitGlobalConstant(const Constant* CV); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From foldr at codedgers.com Thu Jan 15 22:11:55 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 16 Jan 2009 05:11:55 +0100 Subject: [llvm-commits] [PATCH] Registry.h should not depend on CommandLine.h. Message-ID: <1232079115-2683-1-git-send-email-foldr@codedgers.com> Split Support/Registry.h into two files so that we have less to recompile every time CommandLine.h is changed. Also delete some trailing whitespace. --- include/llvm/Support/Registry.h | 148 +++----- include/llvm/Support/RegistryParser.h | 55 +++ include/llvm/Target/TargetMachineRegistry.h | 17 +- lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 47 ++-- lib/CodeGen/OcamlGC.cpp | 5 +- lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 469 ++++++++++++------------ lib/CodeGen/ShadowStackGC.cpp | 129 ++++---- lib/ExecutionEngine/JIT/TargetSelect.cpp | 7 +- tools/llc/llc.cpp | 47 ++-- 9 files changed, 479 insertions(+), 445 deletions(-) create mode 100644 include/llvm/Support/RegistryParser.h diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index c9fb0a1..454679b 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -8,14 +8,12 @@ //===----------------------------------------------------------------------===// // // Defines a registry template for discovering pluggable modules. -// +// //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_REGISTRY_H #define LLVM_SUPPORT_REGISTRY_H -#include "llvm/Support/CommandLine.h" - namespace llvm { /// A simple registry entry which provides only a name, description, and /// no-argument constructor. @@ -23,34 +21,34 @@ namespace llvm { class SimpleRegistryEntry { const char *Name, *Desc; T *(*Ctor)(); - + public: SimpleRegistryEntry(const char *N, const char *D, T *(*C)()) : Name(N), Desc(D), Ctor(C) {} - + const char *getName() const { return Name; } const char *getDesc() const { return Desc; } T *instantiate() const { return Ctor(); } }; - - + + /// Traits for registry entries. If using other than SimpleRegistryEntry, it /// is necessary to define an alternate traits class. template class RegistryTraits { RegistryTraits(); // Do not implement. - + public: typedef SimpleRegistryEntry entry; - + /// nameof/descof - Accessors for name and description of entries. These are // used to generate help for command-line options. static const char *nameof(const entry &Entry) { return Entry.getName(); } static const char *descof(const entry &Entry) { return Entry.getDesc(); } }; - - + + /// A global registry used in conjunction with static constructors to make /// pluggable components (like targets or garbage collectors) "just work" when /// linked with an executable. @@ -59,37 +57,37 @@ namespace llvm { public: typedef U traits; typedef typename U::entry entry; - + class node; class listener; class iterator; - + private: Registry(); // Do not implement. - + static void Announce(const entry &E) { for (listener *Cur = ListenerHead; Cur; Cur = Cur->Next) Cur->registered(E); } - + friend class node; static node *Head, *Tail; - + friend class listener; static listener *ListenerHead, *ListenerTail; - + public: class iterator; - - + + /// Node in linked list of entries. - /// + /// class node { friend class iterator; - + node *Next; const entry& Val; - + public: node(const entry& V) : Next(0), Val(V) { if (Tail) @@ -97,63 +95,63 @@ namespace llvm { else Head = this; Tail = this; - + Announce(V); } }; - - + + /// Iterators for registry entries. - /// + /// class iterator { const node *Cur; - + public: explicit iterator(const node *N) : Cur(N) {} - + bool operator==(const iterator &That) const { return Cur == That.Cur; } bool operator!=(const iterator &That) const { return Cur != That.Cur; } iterator &operator++() { Cur = Cur->Next; return *this; } const entry &operator*() const { return Cur->Val; } const entry *operator->() const { return &Cur->Val; } }; - + static iterator begin() { return iterator(Head); } static iterator end() { return iterator(0); } - - + + /// Abstract base class for registry listeners, which are informed when new /// entries are added to the registry. Simply subclass and instantiate: - /// + /// /// class CollectorPrinter : public Registry::listener { /// protected: /// void registered(const Registry::entry &e) { /// cerr << "collector now available: " << e->getName() << "\n"; /// } - /// + /// /// public: /// CollectorPrinter() { init(); } // Print those already registered. /// }; - /// + /// /// CollectorPrinter Printer; - /// + /// class listener { listener *Prev, *Next; - + friend void Registry::Announce(const entry &E); - + protected: /// Called when an entry is added to the registry. - /// + /// virtual void registered(const entry &) = 0; - + /// Calls 'registered' for each pre-existing entry. - /// + /// void init() { for (iterator I = begin(), E = end(); I != E; ++I) registered(*I); } - + public: listener() : Prev(ListenerTail), Next(0) { if (Prev) @@ -162,7 +160,7 @@ namespace llvm { ListenerHead = this; ListenerTail = this; } - + virtual ~listener() { if (Next) Next->Prev = Prev; @@ -174,79 +172,53 @@ namespace llvm { ListenerHead = Next; } }; - - + + /// A static registration template. Use like such: - /// + /// /// Registry::Add /// X("fancy-gc", "Newfangled garbage collector."); - /// + /// /// Use of this template requires that: - /// + /// /// 1. The registered subclass has a default constructor. - // + // /// 2. The registry entry type has a constructor compatible with this /// signature: - /// + /// /// entry(const char *Name, const char *ShortDesc, T *(*Ctor)()); - /// + /// /// If you have more elaborate requirements, then copy and modify. - /// + /// template class Add { entry Entry; node Node; - + static T *CtorFn() { return new V(); } - + public: Add(const char *Name, const char *Desc) : Entry(Name, Desc, CtorFn), Node(Entry) {} }; - - - /// A command-line parser for a registry. Use like such: - /// - /// static cl::opt::entry, false, - /// Registry::Parser> - /// GCOpt("gc", cl::desc("Garbage collector to use."), - /// cl::value_desc()); - /// - /// To make use of the value: - /// - /// Collector *TheCollector = GCOpt->instantiate(); - /// - class Parser : public cl::parser, public listener{ - typedef U traits; - typedef typename U::entry entry; - - protected: - void registered(const entry &E) { - addLiteralOption(traits::nameof(E), &E, traits::descof(E)); - } - - public: - void initialize(cl::Option &O) { - listener::init(); - cl::parser::initialize(O); - } - }; - + + /// Registry::Parser now lives in llvm/Support/RegistryParser.h. + }; - - + + template typename Registry::node *Registry::Head; - + template typename Registry::node *Registry::Tail; - + template typename Registry::listener *Registry::ListenerHead; - + template typename Registry::listener *Registry::ListenerTail; - + } #endif diff --git a/include/llvm/Support/RegistryParser.h b/include/llvm/Support/RegistryParser.h new file mode 100644 index 0000000..d1d0f6d --- /dev/null +++ b/include/llvm/Support/RegistryParser.h @@ -0,0 +1,55 @@ +//=== Registry.h - Linker-supported plugin registries -----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Defines a command-line parser for a registry. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_REGISTRY_PARSER_H +#define LLVM_SUPPORT_REGISTRY_PARSER_H + +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Registry.h" + +namespace llvm { + + /// A command-line parser for a registry. Use like such: + /// + /// static cl::opt::entry, false, + /// RegistryParser > + /// GCOpt("gc", cl::desc("Garbage collector to use."), + /// cl::value_desc()); + /// + /// To make use of the value: + /// + /// Collector *TheCollector = GCOpt->instantiate(); + /// + template > + class RegistryParser : + public cl::parser, + public Registry::listener { + typedef U traits; + typedef typename U::entry entry; + typedef typename Registry::listener listener; + + protected: + void registered(const entry &E) { + addLiteralOption(traits::nameof(E), &E, traits::descof(E)); + } + + public: + void initialize(cl::Option &O) { + listener::init(); + cl::parser::initialize(O); + } + }; + +} + +#endif // LLVM_SUPPORT_REGISTRY_PARSER_H diff --git a/include/llvm/Target/TargetMachineRegistry.h b/include/llvm/Target/TargetMachineRegistry.h index 2607ad5..b7ea448 100644 --- a/include/llvm/Target/TargetMachineRegistry.h +++ b/include/llvm/Target/TargetMachineRegistry.h @@ -17,19 +17,20 @@ #ifndef LLVM_TARGET_TARGETMACHINEREGISTRY_H #define LLVM_TARGET_TARGETMACHINEREGISTRY_H +#include "llvm/Module.h" #include "llvm/Support/Registry.h" namespace llvm { class Module; class TargetMachine; - + struct TargetMachineRegistryEntry { const char *Name; const char *ShortDesc; TargetMachine *(*CtorFn)(const Module &, const std::string &); unsigned (*ModuleMatchQualityFn)(const Module &M); unsigned (*JITMatchQualityFn)(); - + public: TargetMachineRegistryEntry(const char *N, const char *SD, TargetMachine *(*CF)(const Module &, const std::string &), @@ -38,12 +39,12 @@ namespace llvm { : Name(N), ShortDesc(SD), CtorFn(CF), ModuleMatchQualityFn(MMF), JITMatchQualityFn(JMF) {} }; - + template<> class RegistryTraits { public: typedef TargetMachineRegistryEntry entry; - + static const char *nameof(const entry &Entry) { return Entry.Name; } static const char *descof(const entry &Entry) { return Entry.ShortDesc; } }; @@ -67,12 +68,12 @@ namespace llvm { /// themselves with the tool they are linked. Targets should define an /// instance of this and implement the static methods described in the /// TargetMachine comments. - /// The type 'TargetMachineImpl' should provide a constructor with two + /// The type 'TargetMachineImpl' should provide a constructor with two /// parameters: /// - const Module& M: the module that is being compiled: - /// - const std::string& FS: target-specific string describing target + /// - const std::string& FS: target-specific string describing target /// flavour. - + template struct RegisterTarget { RegisterTarget(const char *Name, const char *ShortDesc) @@ -85,7 +86,7 @@ namespace llvm { private: TargetMachineRegistry::entry Entry; TargetMachineRegistry::node Node; - + static TargetMachine *Allocator(const Module &M, const std::string &FS) { return new TargetMachineImpl(M, FS); } diff --git a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp index 4e42df5..8ba903a 100644 --- a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -10,11 +10,12 @@ // This file implements printing the assembly code for an Ocaml frametable. // //===----------------------------------------------------------------------===// - + #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/Module.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" @@ -28,11 +29,11 @@ namespace { public: void beginAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); - + void finishAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); }; - + } static GCMetadataPrinterRegistry::Add @@ -43,7 +44,7 @@ void llvm::linkOcamlGCPrinter() { } static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI, const char *Id) { const std::string &MId = M.getModuleIdentifier(); - + std::string Mangled; Mangled += TAI.getGlobalPrefix(); Mangled += "caml"; @@ -51,10 +52,10 @@ static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, Mangled.append(MId.begin(), std::find(MId.begin(), MId.end(), '.')); Mangled += "__"; Mangled += Id; - + // Capitalize the first letter of the module name. Mangled[Letter] = toupper(Mangled[Letter]); - + if (const char *GlobalDirective = TAI.getGlobalDirective()) OS << GlobalDirective << Mangled << "\n"; OS << Mangled << ":\n"; @@ -64,13 +65,13 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI) { AP.SwitchToSection(TAI.getTextSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin"); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin"); } /// emitAssembly - Print the frametable. The ocaml frametable format is thus: -/// +/// /// extern "C" struct align(sizeof(intptr_t)) { /// uint16_t NumDescriptors; /// struct align(sizeof(intptr_t)) { @@ -80,11 +81,11 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, /// uint16_t LiveOffsets[NumLiveOffsets]; /// } Descriptors[NumDescriptors]; /// } caml${module}__frametable; -/// +/// /// Note that this precludes programs from stack frames larger than 64K /// (FrameSize and LiveOffsets would overflow). FrameTablePrinter will abort if /// either condition is detected in a function which uses the GC. -/// +/// void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI) { const char *AddressDirective; @@ -99,19 +100,19 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, AP.SwitchToSection(TAI.getTextSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end"); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end"); - + OS << AddressDirective << 0; // FIXME: Why does ocaml emit this?? AP.EOL(); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable"); - + for (iterator I = begin(), IE = end(); I != IE; ++I) { GCFunctionInfo &FI = **I; - + uint64_t FrameSize = FI.getFrameSize(); if (FrameSize >= 1<<16) { cerr << "Function '" << FI.getFunction().getNameStart() @@ -120,10 +121,10 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, cerr << "(" << uintptr_t(&FI) << ")\n"; abort(); // Very rude! } - + OS << "\t" << TAI.getCommentString() << " live roots for " << FI.getFunction().getNameStart() << "\n"; - + for (GCFunctionInfo::iterator J = FI.begin(), JE = FI.end(); J != JE; ++J) { size_t LiveCount = FI.live_size(J); if (LiveCount >= 1<<16) { @@ -132,27 +133,27 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, << "Live root count " << LiveCount << " >= 65536.\n"; abort(); // Very rude! } - + OS << AddressDirective << TAI.getPrivateGlobalPrefix() << "label" << J->Num; AP.EOL("call return address"); - + AP.EmitInt16(FrameSize); AP.EOL("stack frame size"); - + AP.EmitInt16(LiveCount); AP.EOL("live root count"); - + for (GCFunctionInfo::live_iterator K = FI.live_begin(J), KE = FI.live_end(J); K != KE; ++K) { assert(K->StackOffset < 1<<16 && "GC root stack offset is outside of fixed stack frame and out " "of range for ocaml GC!"); - + OS << "\t.word\t" << K->StackOffset; AP.EOL("stack offset"); } - + AP.EmitAlignment(AddressAlignLog); } } diff --git a/lib/CodeGen/OcamlGC.cpp b/lib/CodeGen/OcamlGC.cpp index 0b90444..f7bc9f3 100644 --- a/lib/CodeGen/OcamlGC.cpp +++ b/lib/CodeGen/OcamlGC.cpp @@ -9,13 +9,14 @@ // // This file implements lowering for the llvm.gc* intrinsics compatible with // Objective Caml 3.10.0, which uses a liveness-accurate static stack map. -// +// // The frametable emitter is in OcamlGCPrinter.cpp. // //===----------------------------------------------------------------------===// - + #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/GCStrategy.h" +#include "llvm/Support/Compiler.h" using namespace llvm; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 241ad00..7dc64e0 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -47,6 +47,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" @@ -148,7 +149,7 @@ namespace llvm { /// have aggregate-typed registers. The values at this point do not necessarily /// have legal types, so each value may require one or more registers of some /// legal type. - /// + /// struct VISIBILITY_HIDDEN RegsForValue { /// TLI - The TargetLowering object. /// @@ -158,7 +159,7 @@ namespace llvm { /// may need be promoted or synthesized from one or more registers. /// SmallVector ValueVTs; - + /// RegVTs - The value types of the registers. This is the same size as /// ValueVTs and it records, for each value, what the type of the assigned /// register or registers are. (Individual values are never synthesized @@ -169,21 +170,21 @@ namespace llvm { /// it is necessary to have a separate record of the types. /// SmallVector RegVTs; - + /// Regs - This list holds the registers assigned to the values. /// Each legal or promoted value requires one register, and each /// expanded value requires multiple registers. /// SmallVector Regs; - + RegsForValue() : TLI(0) {} - + RegsForValue(const TargetLowering &tli, - const SmallVector ®s, + const SmallVector ®s, MVT regvt, MVT valuevt) : TLI(&tli), ValueVTs(1, valuevt), RegVTs(1, regvt), Regs(regs) {} RegsForValue(const TargetLowering &tli, - const SmallVector ®s, + const SmallVector ®s, const SmallVector ®vts, const SmallVector &valuevts) : TLI(&tli), ValueVTs(valuevts), RegVTs(regvts), Regs(regs) {} @@ -201,7 +202,7 @@ namespace llvm { Reg += NumRegs; } } - + /// append - Add the specified values to this one. void append(const RegsForValue &RHS) { TLI = RHS.TLI; @@ -209,24 +210,24 @@ namespace llvm { RegVTs.append(RHS.RegVTs.begin(), RHS.RegVTs.end()); Regs.append(RHS.Regs.begin(), RHS.Regs.end()); } - - + + /// getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from - /// this value and returns the result as a ValueVTs value. This uses + /// this value and returns the result as a ValueVTs value. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. SDValue getCopyFromRegs(SelectionDAG &DAG, SDValue &Chain, SDValue *Flag) const; /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the - /// specified value into the registers specified by this object. This uses + /// specified value into the registers specified by this object. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. void getCopyToRegs(SDValue Val, SelectionDAG &DAG, SDValue &Chain, SDValue *Flag) const; - + /// AddInlineAsmOperands - Add this value to the specified inlineasm node - /// operand list. This adds the code marker and includes the number of + /// operand list. This adds the code marker and includes the number of /// values added into it. void AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, std::vector &Ops) const; @@ -234,7 +235,7 @@ namespace llvm { } /// isUsedOutsideOfDefiningBlock - Return true if this instruction is used by -/// PHI nodes or outside of the basic block that defines it, or used by a +/// PHI nodes or outside of the basic block that defines it, or used by a /// switch or atomic instruction, which may expand to multiple basic blocks. static bool isUsedOutsideOfDefiningBlock(Instruction *I) { if (isa(I)) return true; @@ -291,7 +292,7 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, if (ConstantInt *CUI = dyn_cast(AI->getArraySize())) { const Type *Ty = AI->getAllocatedType(); uint64_t TySize = TLI.getTargetData()->getTypePaddedSize(Ty); - unsigned Align = + unsigned Align = std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), AI->getAlignment()); @@ -321,7 +322,7 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, PHINode *PN; for (BasicBlock::iterator I = BB->begin();(PN = dyn_cast(I)); ++I){ if (PN->use_empty()) continue; - + unsigned PHIReg = ValueMap[PN]; assert(PHIReg && "PHI node does not have an assigned virtual register!"); @@ -667,7 +668,7 @@ static void getCopyToParts(SelectionDAG &DAG, SDValue Val, PtrVT)); else Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, - IntermediateVT, Val, + IntermediateVT, Val, DAG.getConstant(i, PtrVT)); // Split the intermediate operands into legal parts. @@ -777,7 +778,7 @@ void SelectionDAGLowering::visit(unsigned Opcode, User &I) { case Instruction::OPCODE:return visit##OPCODE((CLASS&)I); #include "llvm/Instruction.def" } -} +} void SelectionDAGLowering::visitAdd(User &I) { if (I.getType()->isFPOrFPVector()) @@ -796,22 +797,22 @@ void SelectionDAGLowering::visitMul(User &I) { SDValue SelectionDAGLowering::getValue(const Value *V) { SDValue &N = NodeMap[V]; if (N.getNode()) return N; - + if (Constant *C = const_cast(dyn_cast(V))) { MVT VT = TLI.getValueType(V->getType(), true); - + if (ConstantInt *CI = dyn_cast(C)) return N = DAG.getConstant(*CI, VT); if (GlobalValue *GV = dyn_cast(C)) return N = DAG.getGlobalAddress(GV, VT); - + if (isa(C)) return N = DAG.getConstant(0, TLI.getPointerTy()); - + if (ConstantFP *CFP = dyn_cast(C)) return N = DAG.getConstantFP(*CFP, VT); - + if (isa(C) && !isa(V->getType()) && !V->getType()->isAggregateType()) return N = DAG.getNode(ISD::UNDEF, VT); @@ -822,7 +823,7 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { assert(N1.getNode() && "visit didn't populate the ValueMap!"); return N1; } - + if (isa(C) || isa(C)) { SmallVector Constants; for (User::const_op_iterator OI = C->op_begin(), OE = C->op_end(); @@ -858,7 +859,7 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { const VectorType *VecTy = cast(V->getType()); unsigned NumElements = VecTy->getNumElements(); - + // Now that we know the number and type of the elements, get that number of // elements into the Ops array based on what kind of constant it is. SmallVector Ops; @@ -879,11 +880,11 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { Op = DAG.getConstant(0, EltVT); Ops.assign(NumElements, Op); } - + // Create a BUILD_VECTOR node. return NodeMap[V] = DAG.getNode(ISD::BUILD_VECTOR, VT, &Ops[0], Ops.size()); } - + // If this is a static alloca, generate it as the frameindex instead of // computation. if (const AllocaInst *AI = dyn_cast(V)) { @@ -892,10 +893,10 @@ SDValue SelectionDAGLowering::getValue(const Value *V) { if (SI != FuncInfo.StaticAllocaMap.end()) return DAG.getFrameIndex(SI->second, TLI.getPointerTy()); } - + unsigned InReg = FuncInfo.ValueMap[V]; assert(InReg && "Value not in map!"); - + RegsForValue RFV(TLI, InReg, V->getType()); SDValue Chain = DAG.getEntryNode(); return RFV.getCopyFromRegs(DAG, Chain, NULL); @@ -907,10 +908,10 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) { DAG.setRoot(DAG.getNode(ISD::RET, MVT::Other, getControlRoot())); return; } - + SmallVector NewValues; NewValues.push_back(getControlRoot()); - for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { + for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { SmallVector ValueVTs; ComputeValueVTs(TLI, I.getOperand(i)->getType(), ValueVTs); unsigned NumValues = ValueVTs.size(); @@ -933,7 +934,7 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) { MVT PartVT = TLI.getRegisterType(VT); SmallVector Parts(NumParts); ISD::NodeType ExtendKind = ISD::ANY_EXTEND; - + const Function *F = I.getParent()->getParent(); if (F->paramHasAttr(0, Attribute::SExt)) ExtendKind = ISD::SIGN_EXTEND; @@ -963,7 +964,7 @@ void SelectionDAGLowering::visitRet(ReturnInst &I) { void SelectionDAGLowering::ExportFromCurrentBlock(Value *V) { // No need to export constants. if (!isa(V) && !isa(V)) return; - + // Already exported? if (FuncInfo.isExportedInst(V)) return; @@ -979,11 +980,11 @@ bool SelectionDAGLowering::isExportableFromCurrentBlock(Value *V, // Can export from current BB. if (VI->getParent() == FromBB) return true; - + // Is already exported, noop. return FuncInfo.isExportedInst(V); } - + // If this is an argument, we can export it if the BB is the entry block or // if it is already exported. if (isa(V)) { @@ -993,7 +994,7 @@ bool SelectionDAGLowering::isExportableFromCurrentBlock(Value *V, // Otherwise, can only export this if it is already exported. return FuncInfo.isExportedInst(V); } - + // Otherwise, constants can always be exported. return true; } @@ -1034,7 +1035,7 @@ static ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred) { } if (FiniteOnlyFPMath()) return FOC; - else + else return FPC; } @@ -1102,7 +1103,7 @@ SelectionDAGLowering::EmitBranchForMergedCondition(Value *Cond, SwitchCases.push_back(CB); } -/// FindMergedConditions - If Cond is an expression like +/// FindMergedConditions - If Cond is an expression like void SelectionDAGLowering::FindMergedConditions(Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, @@ -1110,7 +1111,7 @@ void SelectionDAGLowering::FindMergedConditions(Value *Cond, unsigned Opc) { // If this node is not part of the or/and tree, emit it as a branch. Instruction *BOp = dyn_cast(Cond); - if (!BOp || !(isa(BOp) || isa(BOp)) || + if (!BOp || !(isa(BOp) || isa(BOp)) || (unsigned)BOp->getOpcode() != Opc || !BOp->hasOneUse() || BOp->getParent() != CurBB->getBasicBlock() || !InBlock(BOp->getOperand(0), CurBB->getBasicBlock()) || @@ -1118,13 +1119,13 @@ void SelectionDAGLowering::FindMergedConditions(Value *Cond, EmitBranchForMergedCondition(Cond, TBB, FBB, CurBB); return; } - + // Create TmpBB after CurBB. MachineFunction::iterator BBI = CurBB; MachineFunction &MF = DAG.getMachineFunction(); MachineBasicBlock *TmpBB = MF.CreateMachineBasicBlock(CurBB->getBasicBlock()); CurBB->getParent()->insert(++BBI, TmpBB); - + if (Opc == Instruction::Or) { // Codegen X | Y as: // jmp_if_X TBB @@ -1133,10 +1134,10 @@ void SelectionDAGLowering::FindMergedConditions(Value *Cond, // jmp_if_Y TBB // jmp FBB // - + // Emit the LHS condition. FindMergedConditions(BOp->getOperand(0), TBB, TmpBB, CurBB, Opc); - + // Emit the RHS condition into TmpBB. FindMergedConditions(BOp->getOperand(1), TBB, FBB, TmpBB, Opc); } else { @@ -1149,10 +1150,10 @@ void SelectionDAGLowering::FindMergedConditions(Value *Cond, // jmp FBB // // This requires creation of TmpBB after CurBB. - + // Emit the LHS condition. FindMergedConditions(BOp->getOperand(0), TmpBB, FBB, CurBB, Opc); - + // Emit the RHS condition into TmpBB. FindMergedConditions(BOp->getOperand(1), TBB, FBB, TmpBB, Opc); } @@ -1161,10 +1162,10 @@ void SelectionDAGLowering::FindMergedConditions(Value *Cond, /// If the set of cases should be emitted as a series of branches, return true. /// If we should emit this as a bunch of and/or'd together conditions, return /// false. -bool +bool SelectionDAGLowering::ShouldEmitAsBranches(const std::vector &Cases){ if (Cases.size() != 2) return true; - + // If this is two comparisons of the same values or'd or and'd together, they // will get folded into a single comparison, so don't emit two blocks. if ((Cases[0].CmpLHS == Cases[1].CmpLHS && @@ -1173,7 +1174,7 @@ SelectionDAGLowering::ShouldEmitAsBranches(const std::vector &Cases){ Cases[0].CmpLHS == Cases[1].CmpRHS)) { return false; } - + return true; } @@ -1190,7 +1191,7 @@ void SelectionDAGLowering::visitBr(BranchInst &I) { if (I.isUnconditional()) { // Update machine-CFG edges. CurMBB->addSuccessor(Succ0MBB); - + // If this is not a fall-through branch, emit the branch. if (Succ0MBB != NextBlock) DAG.setRoot(DAG.getNode(ISD::BR, MVT::Other, getControlRoot(), @@ -1207,9 +1208,9 @@ void SelectionDAGLowering::visitBr(BranchInst &I) { // this as a sequence of branches instead of setcc's with and/or operations. // For example, instead of something like: // cmp A, B - // C = seteq + // C = seteq // cmp D, E - // F = setle + // F = setle // or C, F // jnz foo // Emit: @@ -1219,7 +1220,7 @@ void SelectionDAGLowering::visitBr(BranchInst &I) { // jle foo // if (BinaryOperator *BOp = dyn_cast(CondVal)) { - if (BOp->hasOneUse() && + if (BOp->hasOneUse() && (BOp->getOpcode() == Instruction::And || BOp->getOpcode() == Instruction::Or)) { FindMergedConditions(BOp, Succ0MBB, Succ1MBB, CurMBB, BOp->getOpcode()); @@ -1227,29 +1228,29 @@ void SelectionDAGLowering::visitBr(BranchInst &I) { // exported from this block, export them now. This block should always // be the first entry. assert(SwitchCases[0].ThisBB == CurMBB && "Unexpected lowering!"); - + // Allow some cases to be rejected. if (ShouldEmitAsBranches(SwitchCases)) { for (unsigned i = 1, e = SwitchCases.size(); i != e; ++i) { ExportFromCurrentBlock(SwitchCases[i].CmpLHS); ExportFromCurrentBlock(SwitchCases[i].CmpRHS); } - + // Emit the branch for this block. visitSwitchCase(SwitchCases[0]); SwitchCases.erase(SwitchCases.begin()); return; } - + // Okay, we decided not to do this, remove any inserted MBB's and clear // SwitchCases. for (unsigned i = 1, e = SwitchCases.size(); i != e; ++i) CurMBB->getParent()->erase(SwitchCases[i].ThisBB); - + SwitchCases.clear(); } } - + // Create a CaseBlock record representing this branch. CaseBlock CB(ISD::SETEQ, CondVal, ConstantInt::getTrue(), NULL, Succ0MBB, Succ1MBB, CurMBB); @@ -1785,9 +1786,9 @@ bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR, MachineBasicBlock *FalseBB = 0, *TrueBB = 0; // We know that we branch to the LHS if the Value being switched on is - // less than the Pivot value, C. We use this to optimize our binary + // less than the Pivot value, C. We use this to optimize our binary // tree a bit, by recognizing that if SV is greater than or equal to the - // LHS's Case Value, and that Case Value is exactly one less than the + // LHS's Case Value, and that Case Value is exactly one less than the // Pivot's Value, then we can branch directly to the LHS's Target, // rather than creating a leaf node for it. if ((LHSR.second - LHSR.first) == 1 && @@ -1816,7 +1817,7 @@ bool SelectionDAGLowering::handleBTSplitSwitchCase(CaseRec& CR, } // Create a CaseBlock record representing a conditional branch to - // the LHS node if the value being switched on SV is less than C. + // the LHS node if the value being switched on SV is less than C. // Otherwise, branch to LHS. CaseBlock CB(ISD::SETLT, SV, C, NULL, TrueBB, FalseBB, CR.CaseBB); @@ -2094,7 +2095,7 @@ void SelectionDAGLowering::visitSub(User &I) { void SelectionDAGLowering::visitBinary(User &I, unsigned OpCode) { SDValue Op1 = getValue(I.getOperand(0)); SDValue Op2 = getValue(I.getOperand(1)); - + setValue(&I, DAG.getNode(OpCode, Op1.getValueType(), Op1, Op2)); } @@ -2107,7 +2108,7 @@ void SelectionDAGLowering::visitShift(User &I, unsigned Opcode) { else if (TLI.getShiftAmountTy().bitsGT(Op2.getValueType())) Op2 = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), Op2); } - + setValue(&I, DAG.getNode(Opcode, Op1.getValueType(), Op1, Op2)); } @@ -2157,7 +2158,7 @@ void SelectionDAGLowering::visitVFCmp(User &I) { SDValue Op2 = getValue(I.getOperand(1)); ISD::CondCode Condition = getFCmpCondCode(predicate); MVT DestVT = TLI.getValueType(I.getType()); - + setValue(&I, DAG.getVSetCC(DestVT, Op1, Op2, Condition)); } @@ -2213,14 +2214,14 @@ void SelectionDAGLowering::visitFPTrunc(User &I) { setValue(&I, DAG.getNode(ISD::FP_ROUND, DestVT, N, DAG.getIntPtrConstant(0))); } -void SelectionDAGLowering::visitFPExt(User &I){ +void SelectionDAGLowering::visitFPExt(User &I){ // FPTrunc is never a no-op cast, no need to check SDValue N = getValue(I.getOperand(0)); MVT DestVT = TLI.getValueType(I.getType()); setValue(&I, DAG.getNode(ISD::FP_EXTEND, DestVT, N)); } -void SelectionDAGLowering::visitFPToUI(User &I) { +void SelectionDAGLowering::visitFPToUI(User &I) { // FPToUI is never a no-op cast, no need to check SDValue N = getValue(I.getOperand(0)); MVT DestVT = TLI.getValueType(I.getType()); @@ -2234,14 +2235,14 @@ void SelectionDAGLowering::visitFPToSI(User &I) { setValue(&I, DAG.getNode(ISD::FP_TO_SINT, DestVT, N)); } -void SelectionDAGLowering::visitUIToFP(User &I) { +void SelectionDAGLowering::visitUIToFP(User &I) { // UIToFP is never a no-op cast, no need to check SDValue N = getValue(I.getOperand(0)); MVT DestVT = TLI.getValueType(I.getType()); setValue(&I, DAG.getNode(ISD::UINT_TO_FP, DestVT, N)); } -void SelectionDAGLowering::visitSIToFP(User &I){ +void SelectionDAGLowering::visitSIToFP(User &I){ // SIToFP is never a no-op cast, no need to check SDValue N = getValue(I.getOperand(0)); MVT DestVT = TLI.getValueType(I.getType()); @@ -2257,7 +2258,7 @@ void SelectionDAGLowering::visitPtrToInt(User &I) { SDValue Result; if (DestVT.bitsLT(SrcVT)) Result = DAG.getNode(ISD::TRUNCATE, DestVT, N); - else + else // Note: ZERO_EXTEND can handle cases where the sizes are equal too Result = DAG.getNode(ISD::ZERO_EXTEND, DestVT, N); setValue(&I, Result); @@ -2271,16 +2272,16 @@ void SelectionDAGLowering::visitIntToPtr(User &I) { MVT DestVT = TLI.getValueType(I.getType()); if (DestVT.bitsLT(SrcVT)) setValue(&I, DAG.getNode(ISD::TRUNCATE, DestVT, N)); - else + else // Note: ZERO_EXTEND can handle cases where the sizes are equal too setValue(&I, DAG.getNode(ISD::ZERO_EXTEND, DestVT, N)); } -void SelectionDAGLowering::visitBitCast(User &I) { +void SelectionDAGLowering::visitBitCast(User &I) { SDValue N = getValue(I.getOperand(0)); MVT DestVT = TLI.getValueType(I.getType()); - // BitCast assures us that source and destination are the same size so this + // BitCast assures us that source and destination are the same size so this // is either a BIT_CONVERT or a no-op. if (DestVT != N.getValueType()) setValue(&I, DAG.getNode(ISD::BIT_CONVERT, DestVT, N)); // convert types @@ -2443,7 +2444,7 @@ void SelectionDAGLowering::visitShuffleVector(User &I) { } else { StartIdx[Input] = (MinRange[Input]/MaskNumElts)*MaskNumElts; if (MaxRange[Input] - StartIdx[Input] < MaskNumElts && - StartIdx[Input] + MaskNumElts < SrcNumElts) + StartIdx[Input] + MaskNumElts < SrcNumElts) RangeUse[Input] = 1; // Extract from a multiple of the mask length. } } @@ -2477,7 +2478,7 @@ void SelectionDAGLowering::visitShuffleVector(User &I) { else { Idx = Idx - SrcNumElts - StartIdx[1] + MaskNumElts; MappedOps.push_back(DAG.getConstant(Idx, MaskEltVT)); - } + } } } Mask = DAG.getNode(ISD::BUILD_VECTOR, Mask.getValueType(), @@ -2604,13 +2605,13 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) { // If this is a constant subscript, handle it quickly. if (ConstantInt *CI = dyn_cast(Idx)) { if (CI->getZExtValue() == 0) continue; - uint64_t Offs = + uint64_t Offs = TD->getTypePaddedSize(Ty)*cast(CI)->getSExtValue(); N = DAG.getNode(ISD::ADD, N.getValueType(), N, DAG.getIntPtrConstant(Offs)); continue; } - + // N = N + Idx * ElementSize; uint64_t ElementSize = TD->getTypePaddedSize(Ty); SDValue IdxN = getValue(Idx); @@ -2732,7 +2733,7 @@ void SelectionDAGLowering::visitLoad(LoadInst &I) { Values[i] = L; Chains[i] = L.getValue(1); } - + if (!ConstantMemory) { SDValue Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &Chains[0], NumValues); @@ -2782,7 +2783,7 @@ void SelectionDAGLowering::visitStore(StoreInst &I) { /// visitTargetIntrinsic - Lower a call of a target intrinsic to an INTRINSIC /// node. -void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, +void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, unsigned Intrinsic) { bool HasChain = !I.doesNotAccessMemory(); bool OnlyLoad = HasChain && I.onlyReadsMemory(); @@ -2793,7 +2794,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, if (OnlyLoad) { // We don't need to serialize loads against other loads. Ops.push_back(DAG.getRoot()); - } else { + } else { Ops.push_back(getRoot()); } } @@ -2802,7 +2803,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, TargetLowering::IntrinsicInfo Info; bool IsTgtIntrinsic = TLI.getTgtMemIntrinsic(Info, I, Intrinsic); - // Add the intrinsic ID as an integer operand if it's not a target intrinsic. + // Add the intrinsic ID as an integer operand if it's not a target intrinsic. if (!IsTgtIntrinsic) Ops.push_back(DAG.getConstant(Intrinsic, TLI.getPointerTy())); @@ -2820,11 +2821,11 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, if (VT.isVector()) { const VectorType *DestTy = cast(I.getType()); MVT EltVT = TLI.getValueType(DestTy->getElementType()); - + VT = MVT::getVectorVT(EltVT, DestTy->getNumElements()); assert(VT != MVT::Other && "Intrinsic uses a non-legal type?"); } - + assert(TLI.isTypeLegal(VT) && "Intrinsic uses a non-legal type?"); VTs.push_back(VT); } @@ -2864,7 +2865,7 @@ void SelectionDAGLowering::visitTargetIntrinsic(CallInst &I, if (const VectorType *PTy = dyn_cast(I.getType())) { MVT VT = TLI.getValueType(PTy); Result = DAG.getNode(ISD::BIT_CONVERT, VT, Result); - } + } setValue(&I, Result); } } @@ -2971,16 +2972,16 @@ getF32Constant(SelectionDAG &DAG, unsigned Flt) { return DAG.getConstantFP(APFloat(APInt(32, Flt)), MVT::f32); } -/// Inlined utility function to implement binary input atomic intrinsics for +/// Inlined utility function to implement binary input atomic intrinsics for /// visitIntrinsicCall: I is a call instruction /// Op is the associated NodeType for I const char * SelectionDAGLowering::implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op) { - SDValue Root = getRoot(); + SDValue Root = getRoot(); SDValue L = DAG.getAtomic(Op, getValue(I.getOperand(2)).getValueType().getSimpleVT(), Root, - getValue(I.getOperand(1)), + getValue(I.getOperand(1)), getValue(I.getOperand(2)), I.getOperand(1)); setValue(&I, L); @@ -3153,7 +3154,7 @@ SelectionDAGLowering::visitLog(CallInst &I) { // LogofMantissa = // -1.1609546f + // (1.4034025f - 0.23903021f * x) * x; - // + // // error 0.0034276066, which is better than 8 bits SDValue t0 = DAG.getNode(ISD::FMUL, MVT::f32, X, getF32Constant(DAG, 0xbe74c456)); @@ -3250,7 +3251,7 @@ SelectionDAGLowering::visitLog2(CallInst &I) { // Get the significand and build it into a floating-point number with // exponent of 1. SDValue X = GetSignificand(DAG, Op1); - + // Different possible minimax approximations of significand in // floating-point for various degrees of accuracy over [1,2]. if (LimitFloatPrecision <= 6) { @@ -3276,7 +3277,7 @@ SelectionDAGLowering::visitLog2(CallInst &I) { // (4.07009056f + // (-2.12067489f + // (.645142248f - 0.816157886e-1f * x) * x) * x) * x; - // + // // error 0.0000876136000, which is better than 13 bits SDValue t0 = DAG.getNode(ISD::FMUL, MVT::f32, X, getF32Constant(DAG, 0xbda7262e)); @@ -3360,7 +3361,7 @@ SelectionDAGLowering::visitLog10(CallInst &I) { if (LimitFloatPrecision <= 6) { // For floating-point precision of 6: - // + // // Log10ofMantissa = // -0.50419619f + // (0.60948995f - 0.10380950f * x) * x; @@ -3458,7 +3459,7 @@ SelectionDAGLowering::visitExp2(CallInst &I) { if (LimitFloatPrecision <= 6) { // For floating-point precision of 6: - // + // // TwoToFractionalPartOfX = // 0.997535578f + // (0.735607626f + 0.252464424f * x) * x; @@ -3469,7 +3470,7 @@ SelectionDAGLowering::visitExp2(CallInst &I) { SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3f3c50c8)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3f7f5e7e)); SDValue t6 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, t5); SDValue TwoToFractionalPartOfX = @@ -3490,7 +3491,7 @@ SelectionDAGLowering::visitExp2(CallInst &I) { SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3e65b8f3)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3f324b07)); SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, t5, X); SDValue t7 = DAG.getNode(ISD::FADD, MVT::f32, t6, @@ -3516,7 +3517,7 @@ SelectionDAGLowering::visitExp2(CallInst &I) { SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3ab24b87)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3c1d8c17)); SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, t5, X); SDValue t7 = DAG.getNode(ISD::FADD, MVT::f32, t6, @@ -3587,18 +3588,18 @@ SelectionDAGLowering::visitPow(CallInst &I) { if (LimitFloatPrecision <= 6) { // For floating-point precision of 6: - // + // // twoToFractionalPartOfX = // 0.997535578f + // (0.735607626f + 0.252464424f * x) * x; - // + // // error 0.0144103317, which is 6 bits SDValue t2 = DAG.getNode(ISD::FMUL, MVT::f32, X, getF32Constant(DAG, 0x3e814304)); SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3f3c50c8)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3f7f5e7e)); SDValue t6 = DAG.getNode(ISD::BIT_CONVERT, MVT::i32, t5); SDValue TwoToFractionalPartOfX = @@ -3619,7 +3620,7 @@ SelectionDAGLowering::visitPow(CallInst &I) { SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3e65b8f3)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3f324b07)); SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, t5, X); SDValue t7 = DAG.getNode(ISD::FADD, MVT::f32, t6, @@ -3645,7 +3646,7 @@ SelectionDAGLowering::visitPow(CallInst &I) { SDValue t3 = DAG.getNode(ISD::FADD, MVT::f32, t2, getF32Constant(DAG, 0x3ab24b87)); SDValue t4 = DAG.getNode(ISD::FMUL, MVT::f32, t3, X); - SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, + SDValue t5 = DAG.getNode(ISD::FADD, MVT::f32, t4, getF32Constant(DAG, 0x3c1d8c17)); SDValue t6 = DAG.getNode(ISD::FMUL, MVT::f32, t5, X); SDValue t7 = DAG.getNode(ISD::FADD, MVT::f32, t6, @@ -3757,7 +3758,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionStartInst &RSI = cast(I); if (DW && RSI.getContext() && DW->ValidDebugInfo(RSI.getContext())) { - unsigned LabelID = + unsigned LabelID = DW->RecordRegionStart(cast(RSI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); } @@ -3768,7 +3769,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DwarfWriter *DW = DAG.getDwarfWriter(); DbgRegionEndInst &REI = cast(I); if (DW && REI.getContext() && DW->ValidDebugInfo(REI.getContext())) { - unsigned LabelID = + unsigned LabelID = DW->RecordRegionEnd(cast(REI.getContext())); DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); } @@ -3790,7 +3791,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { // Record the source line but does not create a label for the normal // function start. It will be emitted at asm emission time. However, // create a label if this is a beginning of inlined function. - unsigned LabelID = + unsigned LabelID = DW->RecordSourceLine(Subprogram.getLineNumber(), 0, SrcFile); if (DW->getRecordSourceLineCount() != 1) DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getRoot(), LabelID)); @@ -3807,7 +3808,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { getValue(DI.getAddress()), getValue(Variable))); return 0; } - + case Intrinsic::eh_exception: { if (!CurMBB->isLandingPad()) { // FIXME: Mark exception register as live in. Hack for PR1508. @@ -3829,7 +3830,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); MVT VT = (Intrinsic == Intrinsic::eh_selector_i32 ? MVT::i32 : MVT::i64); - + if (MMI) { if (CurMBB->isLandingPad()) AddCatchInfo(I, MMI, CurMBB); @@ -3853,7 +3854,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { } else { setValue(&I, DAG.getConstant(0, VT)); } - + return 0; } @@ -4108,7 +4109,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { if (GFI) { Value *Alloca = I.getOperand(1); Constant *TypeMap = cast(I.getOperand(2)); - + FrameIndexSDNode *FI = cast(getValue(Alloca).getNode()); GFI->addStackRoot(FI->getIndex(), TypeMap); } @@ -4151,7 +4152,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DAG.setRoot(DAG.getNode(ISD::PREFETCH, MVT::Other, &Ops[0], 4)); return 0; } - + case Intrinsic::memory_barrier: { SDValue Ops[6]; Ops[0] = getRoot(); @@ -4162,12 +4163,12 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { return 0; } case Intrinsic::atomic_cmp_swap: { - SDValue Root = getRoot(); + SDValue Root = getRoot(); SDValue L = DAG.getAtomic(ISD::ATOMIC_CMP_SWAP, getValue(I.getOperand(2)).getValueType().getSimpleVT(), Root, - getValue(I.getOperand(1)), + getValue(I.getOperand(1)), getValue(I.getOperand(2)), getValue(I.getOperand(3)), I.getOperand(1)); @@ -4302,7 +4303,7 @@ void SelectionDAGLowering::visitCall(CallInst &I) { setValue(&I, DAG.getNode(ISD::FABS, Tmp.getValueType(), Tmp)); return; } - } else if (NameStr[0] == 's' && + } else if (NameStr[0] == 's' && ((NameLen == 3 && !strcmp(NameStr, "sin")) || (NameLen == 4 && !strcmp(NameStr, "sinf")) || (NameLen == 4 && !strcmp(NameStr, "sinl")))) { @@ -4342,10 +4343,10 @@ void SelectionDAGLowering::visitCall(CallInst &I) { /// getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from -/// this value and returns the result as a ValueVT value. This uses +/// this value and returns the result as a ValueVT value. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. -SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, +SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, SDValue &Chain, SDValue *Flag) const { // Assemble the legal parts into the final values. @@ -4367,7 +4368,7 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, *Flag = P.getValue(2); } Chain = P.getValue(1); - + // If the source register was virtual and if we know something about it, // add an assert node. if (TargetRegisterInfo::isVirtualRegister(Regs[Part+i]) && @@ -4376,11 +4377,11 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, FunctionLoweringInfo &FLI = DAG.getFunctionLoweringInfo(); if (FLI.LiveOutRegInfo.size() > SlotNo) { FunctionLoweringInfo::LiveOutInfo &LOI = FLI.LiveOutRegInfo[SlotNo]; - + unsigned RegSize = RegisterVT.getSizeInBits(); unsigned NumSignBits = LOI.NumSignBits; unsigned NumZeroBits = LOI.KnownZero.countLeadingOnes(); - + // FIXME: We capture more information than the dag can represent. For // now, just use the tightest assertzext/assertsext possible. bool isSExt = true; @@ -4401,7 +4402,7 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, isSExt = true, FromVT = MVT::i32; // ASSERT SEXT 32 else if (NumZeroBits >= RegSize-33) isSExt = false, FromVT = MVT::i32; // ASSERT ZEXT 32 - + if (FromVT != MVT::Other) { P = DAG.getNode(isSExt ? ISD::AssertSext : ISD::AssertZext, RegisterVT, P, DAG.getValueType(FromVT)); @@ -4409,10 +4410,10 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, } } } - + Parts[i] = P; } - + Values[Value] = getCopyFromParts(DAG, Parts.begin(), NumRegs, RegisterVT, ValueVT); Part += NumRegs; @@ -4425,7 +4426,7 @@ SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG, } /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the -/// specified value into the registers specified by this object. This uses +/// specified value into the registers specified by this object. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG, @@ -4455,9 +4456,9 @@ void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG, } Chains[i] = Part.getValue(0); } - + if (NumRegs == 1 || Flag) - // If NumRegs > 1 && Flag is used then the use of the last CopyToReg is + // If NumRegs > 1 && Flag is used then the use of the last CopyToReg is // flagged to it. That is the CopyToReg nodes and the user are considered // a single scheduling unit. If we create a TokenFactor and return it as // chain, then the TokenFactor is both a predecessor (operand) of the @@ -4473,7 +4474,7 @@ void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG, } /// AddInlineAsmOperands - Add this value to the specified inlineasm node -/// operand list. This adds the code marker and includes the number of +/// operand list. This adds the code marker and includes the number of /// values added into it. void RegsForValue::AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, std::vector &Ops) const { @@ -4489,7 +4490,7 @@ void RegsForValue::AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, } } -/// isAllocatableRegister - If the specified register is safe to allocate, +/// isAllocatableRegister - If the specified register is safe to allocate, /// i.e. it isn't a stack pointer or some other special register, return the /// register class for the register. Otherwise, return null. static const TargetRegisterClass * @@ -4503,7 +4504,7 @@ isAllocatableRegister(unsigned Reg, MachineFunction &MF, MVT ThisVT = MVT::Other; const TargetRegisterClass *RC = *RCI; - // If none of the the value types for this register class are valid, we + // If none of the the value types for this register class are valid, we // can't use it. For example, 64-bit reg classes on 32-bit targets. for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end(); I != E; ++I) { @@ -4517,9 +4518,9 @@ isAllocatableRegister(unsigned Reg, MachineFunction &MF, } } } - + if (ThisVT == MVT::Other) continue; - + // NOTE: This isn't ideal. In particular, this might allocate the // frame pointer in functions that need it (due to them not being taken // out of allocation, because a variable sized allocation hasn't been seen @@ -4535,13 +4536,13 @@ isAllocatableRegister(unsigned Reg, MachineFunction &MF, } } return FoundRC; -} +} namespace llvm { /// AsmOperandInfo - This contains information for each constraint that we are /// lowering. -struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : +struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : public TargetLowering::AsmOperandInfo { /// CallOperand - If this is the result output operand or a clobber /// this is null, otherwise it is the incoming operand to the CallInst. @@ -4551,15 +4552,15 @@ struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : /// AssignedRegs - If this is a register or register class operand, this /// contains the set of register corresponding to the operand. RegsForValue AssignedRegs; - + explicit SDISelAsmOperandInfo(const InlineAsm::ConstraintInfo &info) : TargetLowering::AsmOperandInfo(info), CallOperand(0,0) { } - + /// MarkAllocatedRegs - Once AssignedRegs is set, mark the assigned registers /// busy in OutputRegs/InputRegs. void MarkAllocatedRegs(bool isOutReg, bool isInReg, - std::set &OutputRegs, + std::set &OutputRegs, std::set &InputRegs, const TargetRegisterInfo &TRI) const { if (isOutReg) { @@ -4571,24 +4572,24 @@ struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : MarkRegAndAliases(AssignedRegs.Regs[i], InputRegs, TRI); } } - + /// getCallOperandValMVT - Return the MVT of the Value* that this operand /// corresponds to. If there is no Value* for this operand, it returns /// MVT::Other. MVT getCallOperandValMVT(const TargetLowering &TLI, const TargetData *TD) const { if (CallOperandVal == 0) return MVT::Other; - + if (isa(CallOperandVal)) return TLI.getPointerTy(); - + const llvm::Type *OpTy = CallOperandVal->getType(); - + // If this is an indirect operand, the operand is a pointer to the // accessed type. if (isIndirect) OpTy = cast(OpTy)->getElementType(); - + // If OpTy is not a single value, it may be a struct/union that we // can tile with integers. if (!OpTy->isSingleValueType() && OpTy->isSized()) { @@ -4605,14 +4606,14 @@ struct VISIBILITY_HIDDEN SDISelAsmOperandInfo : break; } } - + return TLI.getValueType(OpTy, true); } - + private: /// MarkRegAndAliases - Mark the specified register and all aliases in the /// specified set. - static void MarkRegAndAliases(unsigned Reg, std::set &Regs, + static void MarkRegAndAliases(unsigned Reg, std::set &Regs, const TargetRegisterInfo &TRI) { assert(TargetRegisterInfo::isPhysicalRegister(Reg) && "Isn't a physreg"); Regs.insert(Reg); @@ -4635,7 +4636,7 @@ private: /// void SelectionDAGLowering:: GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, - std::set &OutputRegs, + std::set &OutputRegs, std::set &InputRegs) { // Compute whether this value requires an input register, an output register, // or both. @@ -4644,8 +4645,8 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, switch (OpInfo.Type) { case InlineAsm::isOutput: isOutReg = true; - - // If there is an input constraint that matches this, we need to reserve + + // If there is an input constraint that matches this, we need to reserve // the input register so no other inputs allocate to it. isInReg = OpInfo.hasMatchingInput(); break; @@ -4658,14 +4659,14 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, isInReg = true; break; } - - + + MachineFunction &MF = DAG.getMachineFunction(); SmallVector Regs; - + // If this is a constraint for a single physreg, or a constraint for a // register class, find it. - std::pair PhysReg = + std::pair PhysReg = TLI.getRegForInlineAsmConstraint(OpInfo.ConstraintCode, OpInfo.ConstraintVT); @@ -4695,10 +4696,10 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, OpInfo.ConstraintVT = RegVT; } } - + NumRegs = TLI.getNumRegisters(OpInfo.ConstraintVT); } - + MVT RegVT; MVT ValueVT = OpInfo.ConstraintVT; @@ -4707,12 +4708,12 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, if (PhysReg.first) { if (OpInfo.ConstraintVT == MVT::Other) ValueVT = *PhysReg.second->vt_begin(); - + // Get the actual register value type. This is important, because the user // may have asked for (e.g.) the AX register in i32 type. We need to // remember that AX is actually i16 to get the right extension. RegVT = *PhysReg.second->vt_begin(); - + // This is a explicit reference to a physical register. Regs.push_back(PhysReg.first); @@ -4720,8 +4721,8 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, if (NumRegs != 1) { TargetRegisterClass::iterator I = PhysReg.second->begin(); for (; *I != PhysReg.first; ++I) - assert(I != PhysReg.second->end() && "Didn't find reg!"); - + assert(I != PhysReg.second->end() && "Didn't find reg!"); + // Already added the first reg. --NumRegs; ++I; for (; NumRegs; --NumRegs, ++I) { @@ -4734,13 +4735,13 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs, *TRI); return; } - + // Otherwise, if this was a reference to an LLVM register class, create vregs // for this reference. std::vector RegClassRegs; const TargetRegisterClass *RC = PhysReg.second; if (RC) { - // If this is a tied register, our regalloc doesn't know how to maintain + // If this is a tied register, our regalloc doesn't know how to maintain // the constraint, so we have to pick a register to pin the input/output to. // If it isn't a matched constraint, go ahead and create vreg and let the // regalloc do its thing. @@ -4753,15 +4754,15 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, MachineRegisterInfo &RegInfo = MF.getRegInfo(); for (; NumRegs; --NumRegs) Regs.push_back(RegInfo.createVirtualRegister(PhysReg.second)); - + OpInfo.AssignedRegs = RegsForValue(TLI, Regs, RegVT, ValueVT); return; } - + // Otherwise, we can't allocate it. Let the code below figure out how to // maintain these constraints. RegClassRegs.assign(PhysReg.second->begin(), PhysReg.second->end()); - + } else { // This is a reference to a register class that doesn't directly correspond // to an LLVM register class. Allocate NumRegs consecutive, available, @@ -4769,7 +4770,7 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, RegClassRegs = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, OpInfo.ConstraintVT); } - + const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo(); unsigned NumAllocated = 0; for (unsigned i = 0, e = RegClassRegs.size(); i != e; ++i) { @@ -4781,7 +4782,7 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, NumAllocated = 0; continue; } - + // Check to see if this register is allocatable (i.e. don't give out the // stack pointer). if (RC == 0) { @@ -4792,7 +4793,7 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, continue; } } - + // Okay, this register is good, we can use it. ++NumAllocated; @@ -4803,14 +4804,14 @@ GetRegistersForValue(SDISelAsmOperandInfo &OpInfo, // Mark all of the allocated registers used. for (unsigned i = RegStart; i != RegEnd; ++i) Regs.push_back(RegClassRegs[i]); - - OpInfo.AssignedRegs = RegsForValue(TLI, Regs, *RC->vt_begin(), + + OpInfo.AssignedRegs = RegsForValue(TLI, Regs, *RC->vt_begin(), OpInfo.ConstraintVT); OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs, *TRI); return; } } - + // Otherwise, we couldn't allocate enough registers for this. } @@ -4838,10 +4839,10 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { /// ConstraintOperands - Information about all of the constraints. std::vector ConstraintOperands; - + SDValue Chain = getRoot(); SDValue Flag; - + std::set OutputRegs, InputRegs; // Do a prepass over the constraints, canonicalizing them, and building up the @@ -4850,13 +4851,13 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { ConstraintInfos = IA->ParseConstraints(); bool hasMemory = hasInlineAsmMemConstraint(ConstraintInfos, TLI); - + unsigned ArgNo = 0; // ArgNo - The argument of the CallInst. unsigned ResNo = 0; // ResNo - The result number of the next output. for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) { ConstraintOperands.push_back(SDISelAsmOperandInfo(ConstraintInfos[i])); SDISelAsmOperandInfo &OpInfo = ConstraintOperands.back(); - + MVT OpVT = MVT::Other; // Compute the value type for each operand. @@ -4867,7 +4868,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { OpInfo.CallOperandVal = CS.getArgument(ArgNo++); break; } - + // The return value of the call is this value. As such, there is no // corresponding argument. assert(CS.getType() != Type::VoidTy && "Bad inline asm!"); @@ -4895,18 +4896,18 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { } else { OpInfo.CallOperand = getValue(OpInfo.CallOperandVal); } - + OpVT = OpInfo.getCallOperandValMVT(TLI, TD); } - + OpInfo.ConstraintVT = OpVT; } - + // Second pass over the constraints: compute which constraint option to use // and assign registers to constraints that want a specific physreg. for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) { SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i]; - + // If this is an output operand with a matching input operand, look up the // matching input. If their types mismatch, e.g. one is an integer, the // other is floating point, or their sizes are different, flag it as an @@ -4925,7 +4926,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { Input.ConstraintVT = OpInfo.ConstraintVT; } } - + // Compute the constraint code and ConstraintType to use. TLI.ComputeConstraintToUse(OpInfo, OpInfo.CallOperand, hasMemory, &DAG); @@ -4935,11 +4936,11 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { !OpInfo.isIndirect) { assert(OpInfo.Type == InlineAsm::isInput && "Can only indirectify direct input operands!"); - + // Memory operands really want the address of the value. If we don't have // an indirect input, put it in the constpool if we can, otherwise spill // it to a stack slot. - + // If the operand is a float, integer, or vector constant, spill to a // constant pool entry to get its address. Value *OpVal = OpInfo.CallOperandVal; @@ -4959,46 +4960,46 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { Chain = DAG.getStore(Chain, OpInfo.CallOperand, StackSlot, NULL, 0); OpInfo.CallOperand = StackSlot; } - + // There is no longer a Value* corresponding to this operand. OpInfo.CallOperandVal = 0; // It is now an indirect operand. OpInfo.isIndirect = true; } - + // If this constraint is for a specific register, allocate it before // anything else. if (OpInfo.ConstraintType == TargetLowering::C_Register) GetRegistersForValue(OpInfo, OutputRegs, InputRegs); } ConstraintInfos.clear(); - - + + // Second pass - Loop over all of the operands, assigning virtual or physregs // to register class operands. for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) { SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i]; - + // C_Register operands have already been allocated, Other/Memory don't need // to be. if (OpInfo.ConstraintType == TargetLowering::C_RegisterClass) GetRegistersForValue(OpInfo, OutputRegs, InputRegs); - } - + } + // AsmNodeOperands - The operands for the ISD::INLINEASM node. std::vector AsmNodeOperands; AsmNodeOperands.push_back(SDValue()); // reserve space for input chain AsmNodeOperands.push_back( DAG.getTargetExternalSymbol(IA->getAsmString().c_str(), MVT::Other)); - - + + // Loop over all of the inputs, copying the operand values into the // appropriate registers and processing the output regs. RegsForValue RetValRegs; - + // IndirectStoresToEmit - The set of stores to emit after the inline asm node. std::vector > IndirectStoresToEmit; - + for (unsigned i = 0, e = ConstraintOperands.size(); i != e; ++i) { SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i]; @@ -5038,7 +5039,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { // Concatenate this output onto the outputs list. RetValRegs.append(OpInfo.AssignedRegs); } - + // Add information to the INLINEASM node to know that this register is // set. OpInfo.AssignedRegs.AddInlineAsmOperands(OpInfo.isEarlyClobber ? @@ -5049,18 +5050,18 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { } case InlineAsm::isInput: { SDValue InOperandVal = OpInfo.CallOperand; - + if (OpInfo.isMatchingInputConstraint()) { // Matching constraint? // If this is required to match an output register we have already set, // just use its register. unsigned OperandNo = OpInfo.getMatchedOperand(); - + // Scan until we find the definition we already emitted of this operand. // When we find it, create a RegsForValue operand. unsigned CurOp = 2; // The first operand. for (; OperandNo; --OperandNo) { // Advance to the next operand. - unsigned NumOps = + unsigned NumOps = cast(AsmNodeOperands[CurOp])->getZExtValue(); assert(((NumOps & 7) == 2 /*REGDEF*/ || (NumOps & 7) == 6 /*EARLYCLOBBER REGDEF*/ || @@ -5069,9 +5070,9 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { CurOp += (NumOps>>3)+1; } - unsigned NumOps = + unsigned NumOps = cast(AsmNodeOperands[CurOp])->getZExtValue(); - if ((NumOps & 7) == 2 /*REGDEF*/ + if ((NumOps & 7) == 2 /*REGDEF*/ || (NumOps & 7) == 6 /* EARLYCLOBBER REGDEF */) { // Add NumOps>>3 registers to MatchedRegs. RegsForValue MatchedRegs; @@ -5083,14 +5084,14 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { cast(AsmNodeOperands[++CurOp])->getReg(); MatchedRegs.Regs.push_back(Reg); } - - // Use the produced MatchedRegs object to + + // Use the produced MatchedRegs object to MatchedRegs.getCopyToRegs(InOperandVal, DAG, Chain, &Flag); MatchedRegs.AddInlineAsmOperands(1 /*REGUSE*/, DAG, AsmNodeOperands); break; } else { assert(((NumOps & 7) == 4) && "Unknown matching constraint!"); - assert((NumOps >> 3) == 1 && "Unexpected number of operands"); + assert((NumOps >> 3) == 1 && "Unexpected number of operands"); // Add information to the INLINEASM node to know about this input. AsmNodeOperands.push_back(DAG.getTargetConstant(NumOps, TLI.getPointerTy())); @@ -5098,11 +5099,11 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { break; } } - + if (OpInfo.ConstraintType == TargetLowering::C_Other) { - assert(!OpInfo.isIndirect && + assert(!OpInfo.isIndirect && "Don't know how to handle indirect other inputs yet!"); - + std::vector Ops; TLI.LowerAsmOperandForConstraint(InOperandVal, OpInfo.ConstraintCode[0], hasMemory, Ops, DAG); @@ -5111,10 +5112,10 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { << OpInfo.ConstraintCode << "'!\n"; exit(1); } - + // Add information to the INLINEASM node to know about this input. unsigned ResOpType = 3 /*IMM*/ | (Ops.size() << 3); - AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, + AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, TLI.getPointerTy())); AsmNodeOperands.insert(AsmNodeOperands.end(), Ops.begin(), Ops.end()); break; @@ -5122,7 +5123,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { assert(OpInfo.isIndirect && "Operand must be indirect to be a mem!"); assert(InOperandVal.getValueType() == TLI.getPointerTy() && "Memory operands expect pointer values"); - + // Add information to the INLINEASM node to know about this input. unsigned ResOpType = 4/*MEM*/ | (1<<3); AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, @@ -5130,11 +5131,11 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { AsmNodeOperands.push_back(InOperandVal); break; } - + assert((OpInfo.ConstraintType == TargetLowering::C_RegisterClass || OpInfo.ConstraintType == TargetLowering::C_Register) && "Unknown constraint type!"); - assert(!OpInfo.isIndirect && + assert(!OpInfo.isIndirect && "Don't know how to handle indirect register inputs yet!"); // Copy the input into the appropriate registers. @@ -5145,7 +5146,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { } OpInfo.AssignedRegs.getCopyToRegs(InOperandVal, DAG, Chain, &Flag); - + OpInfo.AssignedRegs.AddInlineAsmOperands(1/*REGUSE*/, DAG, AsmNodeOperands); break; @@ -5160,12 +5161,12 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { } } } - + // Finish up input operands. AsmNodeOperands[0] = Chain; if (Flag.getNode()) AsmNodeOperands.push_back(Flag); - - Chain = DAG.getNode(ISD::INLINEASM, + + Chain = DAG.getNode(ISD::INLINEASM, DAG.getNodeValueTypes(MVT::Other, MVT::Flag), 2, &AsmNodeOperands[0], AsmNodeOperands.size()); Flag = Chain.getValue(1); @@ -5174,11 +5175,11 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { // and set it as the value of the call. if (!RetValRegs.Regs.empty()) { SDValue Val = RetValRegs.getCopyFromRegs(DAG, Chain, &Flag); - + // FIXME: Why don't we do this for inline asms with MRVs? if (CS.getType()->isSingleValueType() && CS.getType()->isSized()) { MVT ResultType = TLI.getValueType(CS.getType()); - + // If any of the results of the inline asm is a vector, it may have the // wrong width/num elts. This can happen for register classes that can // contain multiple different value types. The preg or vreg allocated may @@ -5187,22 +5188,22 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { if (ResultType != Val.getValueType() && Val.getValueType().isVector()) { Val = DAG.getNode(ISD::BIT_CONVERT, ResultType, Val); - } else if (ResultType != Val.getValueType() && + } else if (ResultType != Val.getValueType() && ResultType.isInteger() && Val.getValueType().isInteger()) { // If a result value was tied to an input value, the computed result may // have a wider width than the expected result. Extract the relevant // portion. Val = DAG.getNode(ISD::TRUNCATE, ResultType, Val); } - + assert(ResultType == Val.getValueType() && "Asm result value mismatch!"); } setValue(CS.getInstruction(), Val); } - + std::vector > StoresToEmit; - + // Process indirect outputs, first output all of the flagged copies out of // physregs. for (unsigned i = 0, e = IndirectStoresToEmit.size(); i != e; ++i) { @@ -5211,7 +5212,7 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { SDValue OutVal = OutRegs.getCopyFromRegs(DAG, Chain, &Flag); StoresToEmit.push_back(std::make_pair(OutVal, Ptr)); } - + // Emit the non-flagged stores from the physregs. SmallVector OutChains; for (unsigned i = 0, e = StoresToEmit.size(); i != e; ++i) @@ -5248,7 +5249,7 @@ void SelectionDAGLowering::visitMalloc(MallocInst &I) { std::pair Result = TLI.LowerCallTo(getRoot(), I.getType(), false, false, false, false, - CallingConv::C, PerformTailCallOpt, + CallingConv::C, PerformTailCallOpt, DAG.getExternalSymbol("malloc", IntPtr), Args, DAG); setValue(&I, Result.first); // Pointers always fit in registers @@ -5270,8 +5271,8 @@ void SelectionDAGLowering::visitFree(FreeInst &I) { } void SelectionDAGLowering::visitVAStart(CallInst &I) { - DAG.setRoot(DAG.getNode(ISD::VASTART, MVT::Other, getRoot(), - getValue(I.getOperand(1)), + DAG.setRoot(DAG.getNode(ISD::VASTART, MVT::Other, getRoot(), + getValue(I.getOperand(1)), DAG.getSrcValue(I.getOperand(1)))); } @@ -5285,13 +5286,13 @@ void SelectionDAGLowering::visitVAArg(VAArgInst &I) { void SelectionDAGLowering::visitVAEnd(CallInst &I) { DAG.setRoot(DAG.getNode(ISD::VAEND, MVT::Other, getRoot(), - getValue(I.getOperand(1)), + getValue(I.getOperand(1)), DAG.getSrcValue(I.getOperand(1)))); } void SelectionDAGLowering::visitVACopy(CallInst &I) { - DAG.setRoot(DAG.getNode(ISD::VACOPY, MVT::Other, getRoot(), - getValue(I.getOperand(1)), + DAG.setRoot(DAG.getNode(ISD::VACOPY, MVT::Other, getRoot(), + getValue(I.getOperand(1)), getValue(I.getOperand(2)), DAG.getSrcValue(I.getOperand(1)), DAG.getSrcValue(I.getOperand(2)))); @@ -5299,7 +5300,7 @@ void SelectionDAGLowering::visitVACopy(CallInst &I) { /// TargetLowering::LowerArguments - This is the default LowerArguments /// implementation, which just inserts a FORMAL_ARGUMENTS node. FIXME: When all -/// targets are migrated to using FORMAL_ARGUMENTS, this hook should be +/// targets are migrated to using FORMAL_ARGUMENTS, this hook should be /// integrated into SDISel. void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, SmallVectorImpl &ArgValues) { @@ -5365,17 +5366,17 @@ void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, } RetVals.push_back(MVT::Other); - + // Create the node. SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS, DAG.getVTList(&RetVals[0], RetVals.size()), &Ops[0], Ops.size()).getNode(); - + // Prelower FORMAL_ARGUMENTS. This isn't required for functionality, but // allows exposing the loads that may be part of the argument access to the // first DAGCombiner pass. SDValue TmpRes = LowerOperation(SDValue(Result, 0), DAG); - + // The number of results should match up, except that the lowered one may have // an extra flag result. assert((Result->getNumValues() == TmpRes.getNode()->getNumValues() || @@ -5390,14 +5391,14 @@ void TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, } Result = TmpRes.getNode(); - + unsigned NumArgRegs = Result->getNumValues() - 1; DAG.setRoot(SDValue(Result, NumArgRegs)); // Set up the return result vector. unsigned i = 0; unsigned Idx = 1; - for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; + for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++Idx) { SmallVector ValueVTs; ComputeValueVTs(*this, I->getType(), ValueVTs); @@ -5442,7 +5443,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy, SmallVector Ops; Ops.push_back(Chain); // Op#0 - Chain Ops.push_back(Callee); - + // Handle all of the outgoing arguments. for (unsigned i = 0, e = Args.size(); i != e; ++i) { SmallVector ValueVTs; @@ -5507,7 +5508,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy, } } } - + // Figure out the result value types. We start by making a list of // the potentially illegal return value types. SmallVector LoweredRetTys; @@ -5522,9 +5523,9 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy, for (unsigned i = 0; i != NumRegs; ++i) LoweredRetTys.push_back(RegisterVT); } - + LoweredRetTys.push_back(MVT::Other); // Always has a chain. - + // Create the CALL node. SDValue Res = DAG.getCall(CallingConv, isVarArg, isTailCall, isInreg, DAG.getVTList(&LoweredRetTys[0], @@ -5637,11 +5638,11 @@ SelectionDAGISel::HandlePHINodesInSuccessorBlocks(BasicBlock *LLVMBB) { BasicBlock *SuccBB = TI->getSuccessor(succ); if (!isa(SuccBB->begin())) continue; MachineBasicBlock *SuccMBB = FuncInfo->MBBMap[SuccBB]; - + // If this terminator has multiple identical successors (common for // switches), only handle each succ once. if (!SuccsHandled.insert(SuccMBB)) continue; - + MachineBasicBlock::iterator MBBI = SuccMBB->begin(); PHINode *PN; @@ -5708,11 +5709,11 @@ SelectionDAGISel::HandlePHINodesInSuccessorBlocksFast(BasicBlock *LLVMBB, BasicBlock *SuccBB = TI->getSuccessor(succ); if (!isa(SuccBB->begin())) continue; MachineBasicBlock *SuccMBB = FuncInfo->MBBMap[SuccBB]; - + // If this terminator has multiple identical successors (common for // switches), only handle each succ once. if (!SuccsHandled.insert(SuccMBB)) continue; - + MachineBasicBlock::iterator MBBI = SuccMBB->begin(); PHINode *PN; diff --git a/lib/CodeGen/ShadowStackGC.cpp b/lib/CodeGen/ShadowStackGC.cpp index 0576228..5a55760 100644 --- a/lib/CodeGen/ShadowStackGC.cpp +++ b/lib/CodeGen/ShadowStackGC.cpp @@ -31,31 +31,32 @@ #include "llvm/CodeGen/GCStrategy.h" #include "llvm/IntrinsicInst.h" #include "llvm/Module.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/IRBuilder.h" using namespace llvm; namespace { - + class VISIBILITY_HIDDEN ShadowStackGC : public GCStrategy { /// RootChain - This is the global linked-list that contains the chain of GC /// roots. GlobalVariable *Head; - + /// StackEntryTy - Abstract type of a link in the shadow stack. - /// + /// const StructType *StackEntryTy; - + /// Roots - GC roots in the current function. Each is a pair of the /// intrinsic call and its corresponding alloca. std::vector > Roots; - + public: ShadowStackGC(); - + bool initializeCustomLowering(Module &M); bool performCustomLowering(Function &F); - + private: bool IsNullValue(Value *V); Constant *GetFrameMap(Function &F); @@ -68,58 +69,58 @@ namespace { }; } - + static GCRegistry::Add X("shadow-stack", "Very portable GC for uncooperative code generators"); - + namespace { /// EscapeEnumerator - This is a little algorithm to find all escape points /// from a function so that "finally"-style code can be inserted. In addition /// to finding the existing return and unwind instructions, it also (if /// necessary) transforms any call instructions into invokes and sends them to /// a landing pad. - /// + /// /// It's wrapped up in a state machine using the same transform C# uses for /// 'yield return' enumerators, This transform allows it to be non-allocating. class VISIBILITY_HIDDEN EscapeEnumerator { Function &F; const char *CleanupBBName; - + // State. int State; Function::iterator StateBB, StateE; IRBuilder<> Builder; - + public: EscapeEnumerator(Function &F, const char *N = "cleanup") : F(F), CleanupBBName(N), State(0) {} - + IRBuilder<> *Next() { switch (State) { default: return 0; - + case 0: StateBB = F.begin(); StateE = F.end(); State = 1; - + case 1: // Find all 'return' and 'unwind' instructions. while (StateBB != StateE) { BasicBlock *CurBB = StateBB++; - + // Branches and invokes do not escape, only unwind and return do. TerminatorInst *TI = CurBB->getTerminator(); if (!isa(TI) && !isa(TI)) continue; - + Builder.SetInsertPoint(TI->getParent(), TI); return &Builder; } - + State = 2; - + // Find all 'call' instructions. SmallVector Calls; for (Function::iterator BB = F.begin(), @@ -130,33 +131,33 @@ namespace { if (!CI->getCalledFunction() || !CI->getCalledFunction()->getIntrinsicID()) Calls.push_back(CI); - + if (Calls.empty()) return 0; - + // Create a cleanup block. BasicBlock *CleanupBB = BasicBlock::Create(CleanupBBName, &F); UnwindInst *UI = new UnwindInst(CleanupBB); - + // Transform the 'call' instructions into 'invoke's branching to the // cleanup block. Go in reverse order to make prettier BB names. SmallVector Args; for (unsigned I = Calls.size(); I != 0; ) { CallInst *CI = cast(Calls[--I]); - + // Split the basic block containing the function call. BasicBlock *CallBB = CI->getParent(); BasicBlock *NewBB = CallBB->splitBasicBlock(CI, CallBB->getName() + ".cont"); - + // Remove the unconditional branch inserted at the end of CallBB. CallBB->getInstList().pop_back(); NewBB->getInstList().remove(CI); - + // Create a new invoke instruction. Args.clear(); Args.append(CI->op_begin() + 1, CI->op_end()); - + InvokeInst *II = InvokeInst::Create(CI->getOperand(0), NewBB, CleanupBB, Args.begin(), Args.end(), @@ -166,7 +167,7 @@ namespace { CI->replaceAllUsesWith(II); delete CI; } - + Builder.SetInsertPoint(UI->getParent(), UI); return &Builder; } @@ -185,9 +186,9 @@ ShadowStackGC::ShadowStackGC() : Head(0), StackEntryTy(0) { Constant *ShadowStackGC::GetFrameMap(Function &F) { // doInitialization creates the abstract type of this value. - + Type *VoidPtr = PointerType::getUnqual(Type::Int8Ty); - + // Truncate the ShadowStackDescriptor if some metadata is null. unsigned NumMeta = 0; SmallVector Metadata; @@ -197,33 +198,33 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) { NumMeta = I + 1; Metadata.push_back(ConstantExpr::getBitCast(C, VoidPtr)); } - + Constant *BaseElts[] = { ConstantInt::get(Type::Int32Ty, Roots.size(), false), ConstantInt::get(Type::Int32Ty, NumMeta, false), }; - + Constant *DescriptorElts[] = { ConstantStruct::get(BaseElts, 2), ConstantArray::get(ArrayType::get(VoidPtr, NumMeta), Metadata.begin(), NumMeta) }; - + Constant *FrameMap = ConstantStruct::get(DescriptorElts, 2); - + std::string TypeName("gc_map."); TypeName += utostr(NumMeta); F.getParent()->addTypeName(TypeName, FrameMap->getType()); - + // FIXME: Is this actually dangerous as WritingAnLLVMPass.html claims? Seems // that, short of multithreaded LLVM, it should be safe; all that is // necessary is that a simple Module::iterator loop not be invalidated. // Appending to the GlobalVariable list is safe in that sense. - // + // // All of the output passes emit globals last. The ExecutionEngine // explicitly supports adding globals to the module after // initialization. - // + // // Still, if it isn't deemed acceptable, then this transformation needs // to be a ModulePass (which means it cannot be in the 'llc' pipeline // (which uses a FunctionPassManager (which segfaults (not asserts) if @@ -232,7 +233,7 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) { GlobalVariable::InternalLinkage, FrameMap, "__gc_" + F.getName(), F.getParent()); - + Constant *GEPIndices[2] = { ConstantInt::get(Type::Int32Ty, 0), ConstantInt::get(Type::Int32Ty, 0) }; return ConstantExpr::getGetElementPtr(GV, GEPIndices, 2); @@ -245,11 +246,11 @@ const Type* ShadowStackGC::GetConcreteStackEntryType(Function &F) { for (size_t I = 0; I != Roots.size(); I++) EltTys.push_back(Roots[I].second->getAllocatedType()); Type *Ty = StructType::get(EltTys); - + std::string TypeName("gc_stackentry."); TypeName += F.getName(); F.getParent()->addTypeName(TypeName, Ty); - + return Ty; } @@ -267,25 +268,25 @@ bool ShadowStackGC::initializeCustomLowering(Module &M) { StructType *FrameMapTy = StructType::get(EltTys); M.addTypeName("gc_map", FrameMapTy); PointerType *FrameMapPtrTy = PointerType::getUnqual(FrameMapTy); - + // struct StackEntry { // ShadowStackEntry *Next; // Caller's stack entry. // FrameMap *Map; // Pointer to constant FrameMap. // void *Roots[]; // Stack roots (in-place array, so we pretend). // }; OpaqueType *RecursiveTy = OpaqueType::get(); - + EltTys.clear(); EltTys.push_back(PointerType::getUnqual(RecursiveTy)); EltTys.push_back(FrameMapPtrTy); PATypeHolder LinkTyH = StructType::get(EltTys); - + RecursiveTy->refineAbstractTypeTo(LinkTyH.get()); StackEntryTy = cast(LinkTyH.get()); const PointerType *StackEntryPtrTy = PointerType::getUnqual(StackEntryTy); M.addTypeName("gc_stackentry", LinkTyH.get()); // FIXME: Is this safe from // a FunctionPass? - + // Get the root chain if it already exists. Head = M.getGlobalVariable("llvm_gc_root_chain"); if (!Head) { @@ -299,7 +300,7 @@ bool ShadowStackGC::initializeCustomLowering(Module &M) { Head->setInitializer(Constant::getNullValue(StackEntryPtrTy)); Head->setLinkage(GlobalValue::LinkOnceLinkage); } - + return true; } @@ -313,11 +314,11 @@ void ShadowStackGC::CollectRoots(Function &F) { // FIXME: Account for original alignment. Could fragment the root array. // Approach 1: Null initialize empty slots at runtime. Yuck. // Approach 2: Emit a map of the array instead of just a count. - + assert(Roots.empty() && "Not cleaned up?"); - + SmallVector,16> MetaRoots; - + for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E;) if (IntrinsicInst *CI = dyn_cast(II++)) @@ -330,7 +331,7 @@ void ShadowStackGC::CollectRoots(Function &F) { else MetaRoots.push_back(Pair); } - + // Number roots with metadata (usually empty) at the beginning, so that the // FrameMap::Meta array can be elided. Roots.insert(Roots.begin(), MetaRoots.begin(), MetaRoots.end()); @@ -343,9 +344,9 @@ ShadowStackGC::CreateGEP(IRBuilder<> &B, Value *BasePtr, ConstantInt::get(Type::Int32Ty, Idx), ConstantInt::get(Type::Int32Ty, Idx2) }; Value* Val = B.CreateGEP(BasePtr, Indices, Indices + 3, Name); - + assert(isa(Val) && "Unexpected folded constant"); - + return dyn_cast(Val); } @@ -355,7 +356,7 @@ ShadowStackGC::CreateGEP(IRBuilder<> &B, Value *BasePtr, Value *Indices[] = { ConstantInt::get(Type::Int32Ty, 0), ConstantInt::get(Type::Int32Ty, Idx) }; Value *Val = B.CreateGEP(BasePtr, Indices, Indices + 2, Name); - + assert(isa(Val) && "Unexpected folded constant"); return dyn_cast(Val); @@ -365,55 +366,55 @@ ShadowStackGC::CreateGEP(IRBuilder<> &B, Value *BasePtr, bool ShadowStackGC::performCustomLowering(Function &F) { // Find calls to llvm.gcroot. CollectRoots(F); - + // If there are no roots in this function, then there is no need to add a // stack map entry for it. if (Roots.empty()) return false; - + // Build the constant map and figure the type of the shadow stack entry. Value *FrameMap = GetFrameMap(F); const Type *ConcreteStackEntryTy = GetConcreteStackEntryType(F); - + // Build the shadow stack entry at the very start of the function. BasicBlock::iterator IP = F.getEntryBlock().begin(); IRBuilder<> AtEntry(IP->getParent(), IP); - + Instruction *StackEntry = AtEntry.CreateAlloca(ConcreteStackEntryTy, 0, "gc_frame"); - + while (isa(IP)) ++IP; AtEntry.SetInsertPoint(IP->getParent(), IP); - + // Initialize the map pointer and load the current head of the shadow stack. Instruction *CurrentHead = AtEntry.CreateLoad(Head, "gc_currhead"); Instruction *EntryMapPtr = CreateGEP(AtEntry, StackEntry,0,1,"gc_frame.map"); AtEntry.CreateStore(FrameMap, EntryMapPtr); - + // After all the allocas... for (unsigned I = 0, E = Roots.size(); I != E; ++I) { // For each root, find the corresponding slot in the aggregate... Value *SlotPtr = CreateGEP(AtEntry, StackEntry, 1 + I, "gc_root"); - + // And use it in lieu of the alloca. AllocaInst *OriginalAlloca = Roots[I].second; SlotPtr->takeName(OriginalAlloca); OriginalAlloca->replaceAllUsesWith(SlotPtr); } - + // Move past the original stores inserted by GCStrategy::InitRoots. This isn't // really necessary (the collector would never see the intermediate state at // runtime), but it's nicer not to push the half-initialized entry onto the // shadow stack. while (isa(IP)) ++IP; AtEntry.SetInsertPoint(IP->getParent(), IP); - + // Push the entry onto the shadow stack. Instruction *EntryNextPtr = CreateGEP(AtEntry,StackEntry,0,0,"gc_frame.next"); Instruction *NewHeadVal = CreateGEP(AtEntry,StackEntry, 0, "gc_newhead"); AtEntry.CreateStore(CurrentHead, EntryNextPtr); AtEntry.CreateStore(NewHeadVal, Head); - + // For each instruction that escapes... EscapeEnumerator EE(F, "gc_cleanup"); while (IRBuilder<> *AtExit = EE.Next()) { @@ -424,7 +425,7 @@ bool ShadowStackGC::performCustomLowering(Function &F) { Value *SavedHead = AtExit->CreateLoad(EntryNextPtr2, "gc_savedhead"); AtExit->CreateStore(SavedHead, Head); } - + // Delete the original allocas (which are no longer used) and the intrinsic // calls (which are no longer valid). Doing this last avoids invalidating // iterators. @@ -432,7 +433,7 @@ bool ShadowStackGC::performCustomLowering(Function &F) { Roots[I].first->eraseFromParent(); Roots[I].second->eraseFromParent(); } - + Roots.clear(); return true; } diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp index 5402085..98819c1 100644 --- a/lib/ExecutionEngine/JIT/TargetSelect.cpp +++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp @@ -15,6 +15,7 @@ #include "JIT.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" +#include "llvm/Support/RegistryParser.h" #include "llvm/Support/Streams.h" #include "llvm/Target/SubtargetFeature.h" #include "llvm/Target/TargetMachine.h" @@ -22,17 +23,17 @@ using namespace llvm; static cl::opt + RegistryParser > MArch("march", cl::desc("Architecture to generate assembly for:")); static cl::opt -MCPU("mcpu", +MCPU("mcpu", cl::desc("Target a specific cpu type (-mcpu=help for details)"), cl::value_desc("cpu-name"), cl::init("")); static cl::list -MAttrs("mattr", +MAttrs("mattr", cl::CommaSeparated, cl::desc("Target specific attributes (-mattr=help for details)"), cl::value_desc("a1,+a2,-a3,...")); diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 29ebe5c..087a770 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -27,10 +27,11 @@ #include "llvm/PassManager.h" #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileUtilities.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PluginLoader.h" -#include "llvm/Support/FileUtilities.h" +#include "llvm/Support/RegistryParser.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Analysis/Verifier.h" #include "llvm/System/Signals.h" @@ -53,24 +54,24 @@ OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename")); static cl::opt Force("f", cl::desc("Overwrite output files")); -static cl::opt Fast("fast", +static cl::opt Fast("fast", cl::desc("Generate code quickly, potentially sacrificing code quality")); static cl::opt TargetTriple("mtriple", cl::desc("Override target triple for module")); static cl::opt + RegistryParser > MArch("march", cl::desc("Architecture to generate code for:")); static cl::opt -MCPU("mcpu", +MCPU("mcpu", cl::desc("Target a specific cpu type (-mcpu=help for details)"), cl::value_desc("cpu-name"), cl::init("")); static cl::list -MAttrs("mattr", +MAttrs("mattr", cl::CommaSeparated, cl::desc("Target specific attributes (-mattr=help for details)"), cl::value_desc("a1,+a2,-a3,...")); @@ -134,14 +135,14 @@ static raw_ostream *GetOutputStream(const char *ProgName) { return Out; } - + if (InputFilename == "-") { OutputFilename = "-"; return &outs(); } OutputFilename = GetFileNameRoot(InputFilename); - + bool Binary = false; switch (FileType) { case TargetMachine::AssemblyFile: @@ -164,7 +165,7 @@ static raw_ostream *GetOutputStream(const char *ProgName) { Binary = true; break; } - + if (!Force && std::ifstream(OutputFilename.c_str())) { // If force is not specified, make sure not to overwrite a file! std::cerr << ProgName << ": error opening '" << OutputFilename @@ -172,11 +173,11 @@ static raw_ostream *GetOutputStream(const char *ProgName) { << "Use -f command line argument to force output\n"; return 0; } - + // Make sure that the Out file gets unlinked from the disk if we get a // SIGINT sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - + std::string error; raw_ostream *Out = new raw_fd_ostream(OutputFilename.c_str(), Binary, error); if (!error.empty()) { @@ -184,7 +185,7 @@ static raw_ostream *GetOutputStream(const char *ProgName) { delete Out; return 0; } - + return Out; } @@ -198,7 +199,7 @@ int main(int argc, char **argv) { // Load the module to be compiled... std::string ErrorMessage; std::auto_ptr M; - + std::auto_ptr Buffer( MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)); if (Buffer.get()) @@ -209,11 +210,11 @@ int main(int argc, char **argv) { return 1; } Module &mod = *M.get(); - + // If we are supposed to override the target triple, do so now. if (!TargetTriple.empty()) mod.setTargetTriple(TargetTriple); - + // Allocate target machine. First, check whether the user has // explicitly specified an architecture to compile for. if (MArch == 0) { @@ -236,7 +237,7 @@ int main(int argc, char **argv) { Features.AddFeature(MAttrs[i]); FeaturesStr = Features.getString(); } - + std::auto_ptr target(MArch->CtorFn(mod, FeaturesStr)); assert(target.get() && "Could not allocate target machine!"); TargetMachine &Target = *target.get(); @@ -244,7 +245,7 @@ int main(int argc, char **argv) { // Figure out where we are going to send the output... raw_ostream *Out = GetOutputStream(argv[0]); if (Out == 0) return 1; - + // If this target requires addPassesToEmitWholeFile, do it now. This is // used by strange things like the C backend. if (Target.WantsWholeFile()) { @@ -252,7 +253,7 @@ int main(int argc, char **argv) { PM.add(new TargetData(*Target.getTargetData())); if (!NoVerify) PM.add(createVerifierPass()); - + // Ask the target to add backend passes as necessary. if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, Fast)) { std::cerr << argv[0] << ": target does not support generation of this" @@ -268,12 +269,12 @@ int main(int argc, char **argv) { ExistingModuleProvider Provider(M.release()); FunctionPassManager Passes(&Provider); Passes.add(new TargetData(*Target.getTargetData())); - + #ifndef NDEBUG if (!NoVerify) Passes.add(createVerifierPass()); #endif - + // Ask the target to add backend passes as necessary. MachineCodeEmitter *MCE = 0; @@ -306,18 +307,18 @@ int main(int argc, char **argv) { sys::Path(OutputFilename).eraseFromDisk(); return 1; } - + Passes.doInitialization(); - + // Run our queue of passes all at once now, efficiently. // TODO: this could lazily stream functions out of the module. for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I) if (!I->isDeclaration()) Passes.run(*I); - + Passes.doFinalization(); } - + // Delete the ostream if it's not a stdout stream if (Out != &outs()) delete Out; -- 1.6.1 From Sanjiv.Gupta at microchip.com Thu Jan 15 22:25:01 2009 From: Sanjiv.Gupta at microchip.com (Sanjiv.Gupta at microchip.com) Date: Thu, 15 Jan 2009 21:25:01 -0700 Subject: [llvm-commits] [llvm] r62301 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h In-Reply-To: <8DBC6A64-C6AC-4516-BDD6-2B202099D82A@apple.com> References: <200901160245.n0G2jkji012932@zion.cs.uiuc.edu> <8DBC6A64-C6AC-4516-BDD6-2B202099D82A@apple.com> Message-ID: > > > > URL: http://llvm.org/viewvc/llvm-project?rev=62301&view=rev > > Log: > > Few targets do not have a single directive to emit global constants. > > For example, PIC16 needs to break a long or int constant into > > mulitple parts and emit multiple directives. So Allow targets to > > overried EmitConstantValueOnly(). > > Hi Sanjiv, > > I don't think this is the right approach. EmitConstantValueOnly > should handle this case directly by checking to see if you have a > directive to emit a 32-bit integer value. This is how we handle "lack > of i64 emission" on 32-bit targets. > > -Chris > (Size > 4) is hard coded in EmitGlobalConstant(). } else if (const ConstantInt *CI = dyn_cast(CV)) { // Small integers are handled below; large integers are handled here. if (Size > 4) { EmitGlobalConstantLargeInt(CI); return; } This needs to be fixed to check if the target has a directive to print that Size. The other thing is that if these constants are going to exist in rom address space we need to emit them in a different way. I am not sure if we have this functionality available in the generic code. Currently we are handling these cases in a target specific manner, but I agree that the AsmPrinter framework should be enhanced/fixed to handle such things. We will probably take that up after 2.5 if you guys agree. - Sanjiv > > > > > > Modified: > > llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > > > > Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > > URL: http://llvm.org/viewvc/llvm- > project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62301&r1=62300& r2 > =62301&view=diff > > > > = > > = > > = > > = > > = > > = > > = > > = > > ====================================================================== > > --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) > > +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Jan 15 20:45:46 > > 2009 > > @@ -317,7 +317,7 @@ > > > > /// EmitConstantValueOnly - Print out the specified constant, > > without a > > /// storage class. Only constants of first-class type are > > allowed here. > > - void EmitConstantValueOnly(const Constant *CV); > > + virtual void EmitConstantValueOnly(const Constant *CV); > > > > /// EmitGlobalConstant - Print a general LLVM constant to the .s > > file. > > void EmitGlobalConstant(const Constant* CV); > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From foldr at codedgers.com Thu Jan 15 22:52:13 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 16 Jan 2009 04:52:13 +0000 (UTC) Subject: [llvm-commits] [PATCH] Registry.h should not depend on CommandLine.h. References: <1232079115-2683-1-git-send-email-foldr@codedgers.com> Message-ID: Mikhail Glushenkov writes: > > Split Support/Registry.h into two files so that we have less to > recompile every time CommandLine.h is changed. In case the patch is considered too large, I've run the testsuite twice for patched and unpatched versions and found no differences. There is really nothing fancy going on. From clattner at apple.com Thu Jan 15 22:53:27 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 15 Jan 2009 20:53:27 -0800 Subject: [llvm-commits] [llvm] r62301 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h In-Reply-To: References: <200901160245.n0G2jkji012932@zion.cs.uiuc.edu> <8DBC6A64-C6AC-4516-BDD6-2B202099D82A@apple.com> Message-ID: <879C4167-B53C-4946-98E8-14BBDBB3E19A@apple.com> On Jan 15, 2009, at 8:25 PM, Sanjiv.Gupta at microchip.com wrote: >> I don't think this is the right approach. EmitConstantValueOnly >> should handle this case directly by checking to see if you have a >> directive to emit a 32-bit integer value. This is how we handle >> "lack >> of i64 emission" on 32-bit targets. >> >> -Chris >> > (Size > 4) is hard coded in EmitGlobalConstant(). > > } else if (const ConstantInt *CI = dyn_cast(CV)) { > // Small integers are handled below; large integers are handled > here. > if (Size > 4) { > EmitGlobalConstantLargeInt(CI); > return; > } > > This needs to be fixed to check if the target has a directive to print > that Size. Sure, absolutely. > The other thing is that if these constants are going to exist > in rom address space we need to emit them in a different way. I am not > sure if we have this functionality available in the generic code. I'd suggest adding a hook for emitting non-default address space globals that is separate. This is not the right place to overload these. > > Currently we are handling these cases in a target specific manner, > but I > agree that the AsmPrinter framework should be enhanced/fixed to handle > such things. We will probably take that up after 2.5 if you guys > agree. Sure, sounds great. For 2.5, can we keep the method non-virtual? -Chris From sanjiv.gupta at microchip.com Thu Jan 15 23:06:37 2009 From: sanjiv.gupta at microchip.com (Sanjiv Gupta) Date: Fri, 16 Jan 2009 05:06:37 -0000 Subject: [llvm-commits] [llvm] r62304 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200901160506.n0G56bKX017028@zion.cs.uiuc.edu> Author: sgupta Date: Thu Jan 15 23:06:35 2009 New Revision: 62304 URL: http://llvm.org/viewvc/llvm-project?rev=62304&view=rev Log: Reverting back 62301. Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62304&r1=62303&r2=62304&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Jan 15 23:06:35 2009 @@ -317,7 +317,7 @@ /// EmitConstantValueOnly - Print out the specified constant, without a /// storage class. Only constants of first-class type are allowed here. - virtual void EmitConstantValueOnly(const Constant *CV); + void EmitConstantValueOnly(const Constant *CV); /// EmitGlobalConstant - Print a general LLVM constant to the .s file. void EmitGlobalConstant(const Constant* CV); From clattner at apple.com Thu Jan 15 23:12:43 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 15 Jan 2009 21:12:43 -0800 Subject: [llvm-commits] [llvm] r62304 - /llvm/trunk/include/llvm/CodeGen/AsmPrinter.h In-Reply-To: <200901160506.n0G56bKX017028@zion.cs.uiuc.edu> References: <200901160506.n0G56bKX017028@zion.cs.uiuc.edu> Message-ID: <97CE4612-EDBD-42AB-8BBE-015367393664@apple.com> Thanks! On Jan 15, 2009, at 9:06 PM, Sanjiv Gupta wrote: > Author: sgupta > Date: Thu Jan 15 23:06:35 2009 > New Revision: 62304 > > URL: http://llvm.org/viewvc/llvm-project?rev=62304&view=rev > Log: > Reverting back 62301. > > Modified: > llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > > Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=62304&r1=62303&r2=62304&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original) > +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Thu Jan 15 23:06:35 > 2009 > @@ -317,7 +317,7 @@ > > /// EmitConstantValueOnly - Print out the specified constant, > without a > /// storage class. Only constants of first-class type are > allowed here. > - virtual void EmitConstantValueOnly(const Constant *CV); > + void EmitConstantValueOnly(const Constant *CV); > > /// EmitGlobalConstant - Print a general LLVM constant to the .s > file. > void EmitGlobalConstant(const Constant* CV); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Thu Jan 15 23:14:04 2009 From: clattner at apple.com (Chris Lattner) Date: Thu, 15 Jan 2009 21:14:04 -0800 Subject: [llvm-commits] [PATCH] Registry.h should not depend on CommandLine.h. In-Reply-To: References: <1232079115-2683-1-git-send-email-foldr@codedgers.com> Message-ID: On Jan 15, 2009, at 8:52 PM, Mikhail Glushenkov wrote: > Mikhail Glushenkov writes: > >> >> Split Support/Registry.h into two files so that we have less to >> recompile every time CommandLine.h is changed. > > In case the patch is considered too large, I've run the testsuite > twice for patched and unpatched versions and found no > differences. There is really nothing fancy going on. Hi Mikhail, It is almost impossible to review the patch because it contains a ton of random diffs for whitespace changes. Please do functionality changes separately from whitespace changes. Can you resend the diff without the whitespace changes? -Chris From evan.cheng at apple.com Fri Jan 16 00:09:05 2009 From: evan.cheng at apple.com (Evan Cheng) Date: Fri, 16 Jan 2009 06:09:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r62305 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200901160609.n0G6961V018760@zion.cs.uiuc.edu> Author: evancheng Date: Fri Jan 16 00:09:05 2009 New Revision: 62305 URL: http://llvm.org/viewvc/llvm-project?rev=62305&view=rev Log: Re-apply r62076 with fixes. 1. ARRAY_REF - If array type is not ARRAY_TYPE, conservatively return a LValue with alignment 1. 2. If input of VIEW_CONVERT_EXPR is a scalar, return LValue with alignment 1. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=62305&r1=62304&r2=62305&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Jan 16 00:09:05 2009 @@ -1150,9 +1150,18 @@ case IMAGPART_EXPR: return EmitLV_XXXXPART_EXPR(exp, 1); // Constants. - case LABEL_DECL: return TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); - case COMPLEX_CST: return LValue(TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp)); - case STRING_CST: return LValue(TreeConstantToLLVM::EmitLV_STRING_CST(exp)); + case LABEL_DECL: { + Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); + return LValue(Ptr, DECL_ALIGN(exp) / 8); + } + case COMPLEX_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } + case STRING_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } // Type Conversion. case VIEW_CONVERT_EXPR: return EmitLV_VIEW_CONVERT_EXPR(exp); @@ -1165,9 +1174,11 @@ case WITH_SIZE_EXPR: // The address is the address of the operand. return EmitLV(TREE_OPERAND(exp, 0)); - case INDIRECT_REF: + case INDIRECT_REF: { // The lvalue is just the address. - return Emit(TREE_OPERAND(exp, 0), 0); + tree Op = TREE_OPERAND(exp, 0); + return LValue(Emit(Op, 0), expr_align(Op) / 8); + } } } @@ -2290,7 +2301,7 @@ LValue LV = EmitLV(exp); bool isVolatile = TREE_THIS_VOLATILE(exp); const Type *Ty = ConvertType(TREE_TYPE(exp)); - unsigned Alignment = expr_align(exp) / 8; + unsigned Alignment = LV.getAlignment(); if (TREE_CODE(exp) == COMPONENT_REF) if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(exp, 0))))) @@ -2963,7 +2974,7 @@ LValue LV = EmitLV(lhs); bool isVolatile = TREE_THIS_VOLATILE(lhs); - unsigned Alignment = expr_align(lhs) / 8; + unsigned Alignment = LV.getAlignment(); if (TREE_CODE(lhs) == COMPONENT_REF) if (const StructType *STy = dyn_cast(ConvertType(TREE_TYPE(TREE_OPERAND(lhs, 0))))) @@ -3157,7 +3168,7 @@ LValue LV = EmitLV(Op); assert(!LV.isBitfield() && "Expected an aggregate operand!"); bool isVolatile = TREE_THIS_VOLATILE(Op); - unsigned Alignment = expr_align(Op) / 8; + unsigned Alignment = LV.getAlignment(); EmitAggregateCopy(Target, MemRef(LV.Ptr, Alignment, isVolatile), TREE_TYPE(exp)); @@ -5885,9 +5896,10 @@ Value *Decl = DECL_LLVM(exp); if (Decl == 0) { if (errorcount || sorrycount) { - const PointerType *Ty = - PointerType::getUnqual(ConvertType(TREE_TYPE(exp))); - return ConstantPointerNull::get(Ty); + const Type *Ty = ConvertType(TREE_TYPE(exp)); + const PointerType *PTy = PointerType::getUnqual(Ty); + LValue LV(ConstantPointerNull::get(PTy), 1); + return LV; } assert(0 && "INTERNAL ERROR: Referencing decl that hasn't been laid out"); abort(); @@ -5924,7 +5936,13 @@ // type void. if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL); const PointerType *PTy = PointerType::getUnqual(Ty); - return BitCastToType(Decl, PTy); + unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1; + if (DECL_ALIGN_UNIT(exp)) { + if (DECL_USER_ALIGN(exp) || Alignment < (unsigned)DECL_ALIGN_UNIT(exp)) + Alignment = DECL_ALIGN_UNIT(exp); + } + + return LValue(BitCastToType(Decl, PTy), Alignment); } LValue TreeToLLVM::EmitLV_ARRAY_REF(tree exp) { @@ -5932,22 +5950,23 @@ // of ElementTy in the case of ARRAY_RANGE_REF. tree Array = TREE_OPERAND(exp, 0); - tree ArrayType = TREE_TYPE(Array); + tree ArrayTreeType = TREE_TYPE(Array); tree Index = TREE_OPERAND(exp, 1); tree IndexType = TREE_TYPE(Index); - tree ElementType = TREE_TYPE(ArrayType); + tree ElementType = TREE_TYPE(ArrayTreeType); - assert((TREE_CODE (ArrayType) == ARRAY_TYPE || - TREE_CODE (ArrayType) == POINTER_TYPE || - TREE_CODE (ArrayType) == REFERENCE_TYPE || - TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) && + assert((TREE_CODE (ArrayTreeType) == ARRAY_TYPE || + TREE_CODE (ArrayTreeType) == POINTER_TYPE || + TREE_CODE (ArrayTreeType) == REFERENCE_TYPE || + TREE_CODE (ArrayTreeType) == BLOCK_POINTER_TYPE) && "Unknown ARRAY_REF!"); // As an LLVM extension, we allow ARRAY_REF with a pointer as the first // operand. This construct maps directly to a getelementptr instruction. Value *ArrayAddr; + unsigned ArrayAlign; - if (TREE_CODE(ArrayType) == ARRAY_TYPE) { + if (TREE_CODE(ArrayTreeType) == ARRAY_TYPE) { // First subtract the lower bound, if any, in the type of the index. tree LowerBound = array_ref_low_bound(exp); if (!integer_zerop(LowerBound)) @@ -5956,8 +5975,13 @@ LValue ArrayAddrLV = EmitLV(Array); assert(!ArrayAddrLV.isBitfield() && "Arrays cannot be bitfields!"); ArrayAddr = ArrayAddrLV.Ptr; + ArrayAlign = ArrayAddrLV.Alignment; } else { ArrayAddr = Emit(Array, 0); + if (TREE_CODE (ArrayTreeType) == POINTER_TYPE) + ArrayAlign = getPointerAlignment(Array); + else + ArrayAlign = 1; } Value *IndexVal = Emit(Index, 0); @@ -5971,20 +5995,27 @@ IndexVal = CastToSIntType(IndexVal, IntPtrTy); // If this is an index into an LLVM array, codegen as a GEP. - if (isArrayCompatible(ArrayType)) { + if (isArrayCompatible(ArrayTreeType)) { Value *Idxs[2] = { ConstantInt::get(Type::Int32Ty, 0), IndexVal }; Value *Ptr = Builder.CreateGEP(ArrayAddr, Idxs, Idxs + 2); - return BitCastToType(Ptr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + const Type *ATy = cast(ArrayAddr->getType())->getElementType(); + const Type *ElementTy = cast(ATy)->getElementType(); + unsigned Alignment = MinAlign(ArrayAlign, TD.getTypePaddedSize(ElementTy)); + return LValue(BitCastToType(Ptr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), + Alignment); } // If we are indexing over a fixed-size type, just use a GEP. - if (isSequentialCompatible(ArrayType)) { - const Type *PtrElementTy = PointerType::getUnqual(ConvertType(ElementType)); + if (isSequentialCompatible(ArrayTreeType)) { + const Type *ElementTy = ConvertType(ElementType); + const Type *PtrElementTy = PointerType::getUnqual(ElementTy); ArrayAddr = BitCastToType(ArrayAddr, PtrElementTy); Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal); - return BitCastToType(Ptr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + unsigned Alignment = MinAlign(ArrayAlign, TD.getABITypeAlignment(ElementTy)); + return LValue(BitCastToType(Ptr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), + Alignment); } // Otherwise, just do raw, low-level pointer arithmetic. FIXME: this could be @@ -5992,14 +6023,20 @@ // float foo(int w, float A[][w], int g) { return A[g][0]; } ArrayAddr = BitCastToType(ArrayAddr, PointerType::getUnqual(Type::Int8Ty)); - if (VOID_TYPE_P(TREE_TYPE(ArrayType))) - return Builder.CreateGEP(ArrayAddr, IndexVal); + if (VOID_TYPE_P(TREE_TYPE(ArrayTreeType))) + return LValue(Builder.CreateGEP(ArrayAddr, IndexVal), 1); Value *TypeSize = Emit(array_ref_element_size(exp), 0); TypeSize = CastToUIntType(TypeSize, IntPtrTy); IndexVal = Builder.CreateMul(IndexVal, TypeSize); + unsigned Alignment = 1; + if (isa(IndexVal)) + Alignment = MinAlign(ArrayAlign, + cast(IndexVal)->getZExtValue()); Value *Ptr = Builder.CreateGEP(ArrayAddr, IndexVal); - return BitCastToType(Ptr,PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + return LValue(BitCastToType(Ptr, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), + Alignment); } /// getFieldOffsetInBits - Return the offset (in bits) of a FIELD_DECL in a @@ -6028,8 +6065,9 @@ LValue TreeToLLVM::EmitLV_COMPONENT_REF(tree exp) { LValue StructAddrLV = EmitLV(TREE_OPERAND(exp, 0)); - tree FieldDecl = TREE_OPERAND(exp, 1); - + tree FieldDecl = TREE_OPERAND(exp, 1); + unsigned LVAlign = DECL_PACKED(FieldDecl) ? 1 : StructAddrLV.Alignment; + assert((TREE_CODE(DECL_CONTEXT(FieldDecl)) == RECORD_TYPE || TREE_CODE(DECL_CONTEXT(FieldDecl)) == UNION_TYPE || TREE_CODE(DECL_CONTEXT(FieldDecl)) == QUAL_UNION_TYPE)); @@ -6064,7 +6102,9 @@ // the offset from BitStart. if (MemberIndex) { const StructLayout *SL = TD.getStructLayout(cast(StructTy)); - BitStart -= SL->getElementOffset(MemberIndex) * 8; + unsigned Offset = SL->getElementOffset(MemberIndex); + BitStart -= Offset * 8; + LVAlign = MinAlign(LVAlign, Offset); } // If the FIELD_DECL has an annotate attribute on it, emit it. @@ -6150,6 +6190,7 @@ Offset = Builder.CreateAdd(Offset, ConstantInt::get(Offset->getType(), ByteOffset)); BitStart -= ByteOffset*8; + LVAlign = MinAlign(LVAlign, ByteOffset); } Value *Ptr = CastToType(Instruction::PtrToInt, StructAddrLV.Ptr, @@ -6221,6 +6262,7 @@ // Compute the byte offset, and add it to the pointer. unsigned ByteOffset = NumAlignmentUnits*ByteAlignment; + LVAlign = MinAlign(LVAlign, ByteOffset); Constant *Offset = ConstantInt::get(TD.getIntPtrType(), ByteOffset); FieldPtr = CastToType(Instruction::PtrToInt, FieldPtr, @@ -6242,17 +6284,18 @@ // Okay, everything is good. Return this as a bitfield if we can't // return it as a normal l-value. (e.g. "struct X { int X : 32 };" ). + // Conservatively return LValue with alignment 1. if (BitfieldSize != LLVMValueBitSize || BitStart != 0) - return LValue(FieldPtr, BitStart, BitfieldSize); + return LValue(FieldPtr, 1, BitStart, BitfieldSize); } else { // Make sure we return a pointer to the right type. - FieldPtr = BitCastToType(FieldPtr, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + const Type *EltTy = ConvertType(TREE_TYPE(exp)); + FieldPtr = BitCastToType(FieldPtr, PointerType::getUnqual(EltTy)); } assert(BitStart == 0 && "It's a bitfield reference or we didn't get to the field!"); - return LValue(FieldPtr); + return LValue(FieldPtr, LVAlign); } LValue TreeToLLVM::EmitLV_BIT_FIELD_REF(tree exp) { @@ -6284,17 +6327,28 @@ } // If this is referring to the whole field, return the whole thing. - if (BitStart == 0 && BitSize == ValueSizeInBits) - return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy))); + if (BitStart == 0 && BitSize == ValueSizeInBits) { + return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), + Ptr.Alignment); + } - return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), BitStart, - BitSize); + return LValue(BitCastToType(Ptr.Ptr, PointerType::getUnqual(ValTy)), 1, + BitStart, BitSize); } LValue TreeToLLVM::EmitLV_XXXXPART_EXPR(tree exp, unsigned Idx) { LValue Ptr = EmitLV(TREE_OPERAND(exp, 0)); - assert(!Ptr.isBitfield() && "BIT_FIELD_REF operands cannot be bitfields!"); - return LValue(Builder.CreateStructGEP(Ptr.Ptr, Idx)); + assert(!Ptr.isBitfield() && + "REALPART_EXPR / IMAGPART_EXPR operands cannot be bitfields!"); + unsigned Alignment; + if (Idx == 0) + // REALPART alignment is same as the complex operand. + Alignment = Ptr.Alignment; + else + // IMAGPART alignment = MinAlign(Ptr.Alignment, sizeof field); + Alignment = MinAlign(Ptr.Alignment, + TD.getTypePaddedSize(Ptr.Ptr->getType())); + return LValue(Builder.CreateStructGEP(Ptr.Ptr, Idx), Alignment); } LValue TreeToLLVM::EmitLV_VIEW_CONVERT_EXPR(tree exp) { @@ -6310,24 +6364,30 @@ } else { // If the input is a scalar, emit to a temporary. Value *Dest = CreateTemporary(ConvertType(TREE_TYPE(Op))); - Builder.CreateStore(Emit(Op, 0), Dest); + StoreInst *S = Builder.CreateStore(Emit(Op, 0), Dest); // The type is the type of the expression. Dest = BitCastToType(Dest, PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); - return LValue(Dest); + return LValue(Dest, 1); } } LValue TreeToLLVM::EmitLV_EXC_PTR_EXPR(tree exp) { CreateExceptionValues(); // Cast the address pointer to the expected type. - return BitCastToType(ExceptionValue, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + unsigned Alignment = TD.getABITypeAlignment(cast(ExceptionValue-> + getType())->getElementType()); + return LValue(BitCastToType(ExceptionValue, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))), + Alignment); } LValue TreeToLLVM::EmitLV_FILTER_EXPR(tree exp) { CreateExceptionValues(); - return ExceptionSelectorValue; + unsigned Alignment = + TD.getABITypeAlignment(cast(ExceptionSelectorValue-> + getType())->getElementType()); + return LValue(ExceptionSelectorValue, Alignment); } //===----------------------------------------------------------------------===// Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=62305&r1=62304&r2=62305&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Fri Jan 16 00:09:05 2009 @@ -251,23 +251,30 @@ }; /// LValue - This struct represents an lvalue in the program. In particular, -/// the Ptr member indicates the memory that the lvalue lives in. If this is -/// a bitfield reference, BitStart indicates the first bit in the memory that -/// is part of the field and BitSize indicates the extent. +/// the Ptr member indicates the memory that the lvalue lives in. Alignment +/// is the alignment of the memory (in bytes).If this is a bitfield reference, +/// BitStart indicates the first bit in the memory that is part of the field +/// and BitSize indicates the extent. /// /// "LValue" is intended to be a light-weight object passed around by-value. struct LValue { Value *Ptr; + unsigned char Alignment; unsigned char BitStart; unsigned char BitSize; - LValue(Value *P) : Ptr(P), BitStart(255), BitSize(255) {} - LValue(Value *P, unsigned BSt, unsigned BSi) - : Ptr(P), BitStart(BSt), BitSize(BSi) { + LValue(Value *P, unsigned Align) + : Ptr(P), Alignment(Align), BitStart(255), BitSize(255) {} + LValue(Value *P, unsigned Align, unsigned BSt, unsigned BSi) + : Ptr(P), Alignment(Align), BitStart(BSt), BitSize(BSi) { assert(BitStart == BSt && BitSize == BSi && "Bit values larger than 256?"); - } + } + unsigned getAlignment() const { + assert(Alignment && "LValue alignment cannot be zero!"); + return Alignment; + } bool isBitfield() const { return BitStart != 255; } }; From nicholas at mxc.ca Fri Jan 16 00:36:14 2009 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 15 Jan 2009 22:36:14 -0800 Subject: [llvm-commits] [llvm] r62279 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/Analysis/IPA/ lib/Archive/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/JIT/ lib/Linker/ lib/Target/ lib/Target/ARM/ lib/Target/ARM/AsmPrinter/ lib/Target/Alpha/ lib/Target/Alpha/AsmPrinter/ lib/Target/CBackend/ lib/Target/CellSPU/AsmPrinter/ lib/Target/CppBackend/ lib/Target/IA64/ lib/Target/MSIL/ lib/Target/Mips/ ... In-Reply-To: <200901152018.n0FKIjTg031777@zion.cs.uiuc.edu> References: <200901152018.n0FKIjTg031777@zion.cs.uiuc.edu> Message-ID: <49702ADE.7060604@mxc.ca> Do we need to make any changes to libLTO? If I understand right, we don't create any symbols for privates, so we should just skip over all private globals when listing them in libLTO? Rafael Espindola wrote: > Author: rafael > Date: Thu Jan 15 14:18:42 2009 > New Revision: 62279 > > URL: http://llvm.org/viewvc/llvm-project?rev=62279&view=rev > Log: > Add the private linkage. > > > Added: > llvm/trunk/test/Assembler/private.ll > llvm/trunk/test/CodeGen/ARM/private.ll > llvm/trunk/test/CodeGen/Alpha/private.ll > llvm/trunk/test/CodeGen/CellSPU/private.ll > llvm/trunk/test/CodeGen/IA64/private.ll > llvm/trunk/test/CodeGen/Mips/private.ll > llvm/trunk/test/CodeGen/PowerPC/private.ll > llvm/trunk/test/CodeGen/SPARC/private.ll > llvm/trunk/test/CodeGen/X86/private.ll > llvm/trunk/test/CodeGen/XCore/private.ll > Modified: > llvm/trunk/docs/LangRef.html > llvm/trunk/include/llvm/GlobalValue.h > llvm/trunk/include/llvm/Module.h > llvm/trunk/include/llvm/Support/Mangler.h > llvm/trunk/lib/Analysis/IPA/Andersens.cpp > llvm/trunk/lib/Analysis/IPA/CallGraph.cpp > llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp > llvm/trunk/lib/Archive/Archive.cpp > llvm/trunk/lib/AsmParser/LLLexer.cpp > llvm/trunk/lib/AsmParser/LLParser.cpp > llvm/trunk/lib/AsmParser/LLToken.h > llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp > llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp > llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > llvm/trunk/lib/CodeGen/ELFWriter.cpp > llvm/trunk/lib/CodeGen/MachOWriter.cpp > llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp > llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp > llvm/trunk/lib/Linker/LinkArchives.cpp > llvm/trunk/lib/Linker/LinkModules.cpp > llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp > llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp > llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp > llvm/trunk/lib/Target/CBackend/CBackend.cpp > llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp > llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp > llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp > llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp > llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp > llvm/trunk/lib/Target/MSIL/MSILWriter.cpp > llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp > llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp > llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp > llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp > llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp > llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp > llvm/trunk/lib/Target/X86/X86Subtarget.cpp > llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp > llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp > llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp > llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp > llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp > llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp > llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp > llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp > llvm/trunk/lib/Transforms/IPO/Inliner.cpp > llvm/trunk/lib/Transforms/IPO/Internalize.cpp > llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp > llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp > llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp > llvm/trunk/lib/Transforms/Scalar/SCCP.cpp > llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp > llvm/trunk/lib/Transforms/Utils/InlineCost.cpp > llvm/trunk/lib/VMCore/AsmWriter.cpp > llvm/trunk/lib/VMCore/Mangler.cpp > llvm/trunk/lib/VMCore/Module.cpp > llvm/trunk/lib/VMCore/Verifier.cpp > llvm/trunk/tools/bugpoint/ExtractFunction.cpp > llvm/trunk/tools/llvm-nm/llvm-nm.cpp > > Modified: llvm/trunk/docs/LangRef.html > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/docs/LangRef.html (original) > +++ llvm/trunk/docs/LangRef.html Thu Jan 15 14:18:42 2009 > @@ -480,13 +480,20 @@ > >
    > > -
    internal:
    > +
    private:
    > > -
    Global values with internal linkage are only directly accessible by > +
    Global values with private linkage are only directly accessible by > objects in the current module. In particular, linking code into a module with > - an internal global value may cause the internal to be renamed as necessary to > - avoid collisions. Because the symbol is internal to the module, all > - references can be updated. This corresponds to the notion of the > + an private global value may cause the private to be renamed as necessary to "a private". Nick > + avoid collisions. Because the symbol is private to the module, all > + references can be updated. This doesn't show up in any symbol table in the > + object file. > +
    > + > +
    internal:
    > + > +
    Similar to private, but the value show as a local symbol (STB_LOCAL in > + the case of ELF) in the object file. This corresponds to the notion of the > 'static' keyword in C. >
    > > > Modified: llvm/trunk/include/llvm/GlobalValue.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/GlobalValue.h (original) > +++ llvm/trunk/include/llvm/GlobalValue.h Thu Jan 15 14:18:42 2009 > @@ -35,6 +35,7 @@ > WeakLinkage, ///< Keep one copy of named function when linking (weak) > AppendingLinkage, ///< Special purpose, only applies to global arrays > InternalLinkage, ///< Rename collisions when linking (static functions) > + PrivateLinkage, ///< Like Internal, but omit from symbol table > DLLImportLinkage, ///< Function to be imported from DLL > DLLExportLinkage, ///< Function to be accessible from DLL > ExternalWeakLinkage,///< ExternalWeak linkage description > @@ -104,6 +105,10 @@ > bool hasCommonLinkage() const { return Linkage == CommonLinkage; } > bool hasAppendingLinkage() const { return Linkage == AppendingLinkage; } > bool hasInternalLinkage() const { return Linkage == InternalLinkage; } > + bool hasPrivateLinkage() const { return Linkage == PrivateLinkage; } > + bool hasLocalLinkage() const { > + return Linkage == InternalLinkage || Linkage == PrivateLinkage; > + } > bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; } > bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; } > bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; } > > Modified: llvm/trunk/include/llvm/Module.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Module.h (original) > +++ llvm/trunk/include/llvm/Module.h Thu Jan 15 14:18:42 2009 > @@ -188,7 +188,7 @@ > /// getOrInsertFunction - Look up the specified function in the module symbol > /// table. Four possibilities: > /// 1. If it does not exist, add a prototype for the function and return it. > - /// 2. If it exists, and has internal linkage, the existing function is > + /// 2. If it exists, and has a local linkage, the existing function is > /// renamed and a new one is inserted. > /// 3. Otherwise, if the existing function has the correct prototype, return > /// the existing function. > > Modified: llvm/trunk/include/llvm/Support/Mangler.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Mangler.h?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/Support/Mangler.h (original) > +++ llvm/trunk/include/llvm/Support/Mangler.h Thu Jan 15 14:18:42 2009 > @@ -29,6 +29,7 @@ > /// symbol is marked as not needing this prefix. > const char *Prefix; > > + const char *PrivatePrefix; > /// UseQuotes - If this is set, the target accepts global names in quotes, > /// e.g. "foo bar" is a legal name. This syntax is used instead of escaping > /// the space character. By default, this is false. > @@ -58,7 +59,7 @@ > > // Mangler ctor - if a prefix is specified, it will be prepended onto all > // symbols. > - Mangler(Module &M, const char *Prefix = ""); > + Mangler(Module &M, const char *Prefix = "", const char *privatePrefix = ""); > > /// setUseQuotes - If UseQuotes is set to true, this target accepts quoted > /// strings for assembler labels. > > Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original) > +++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Thu Jan 15 14:18:42 2009 > @@ -1084,7 +1084,7 @@ > // At some point we should just add constraints for the escaping functions > // at solve time, but this slows down solving. For now, we simply mark > // address taken functions as escaping and treat them as external. > - if (!F->hasInternalLinkage() || AnalyzeUsesOfFunction(F)) > + if (!F->hasLocalLinkage() || AnalyzeUsesOfFunction(F)) > AddConstraintsForNonInternalLinkage(F); > > if (!F->isDeclaration()) { > > Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original) > +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Thu Jan 15 14:18:42 2009 > @@ -112,7 +112,7 @@ > CallGraphNode *Node = getOrInsertFunction(F); > > // If this function has external linkage, anything could call it. > - if (!F->hasInternalLinkage()) { > + if (!F->hasLocalLinkage()) { > ExternalCallingNode->addCalledFunction(CallSite(), Node); > > // Found the entry point? > > Modified: llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp (original) > +++ llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp Thu Jan 15 14:18:42 2009 > @@ -164,7 +164,7 @@ > void GlobalsModRef::AnalyzeGlobals(Module &M) { > std::vector Readers, Writers; > for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) > - if (I->hasInternalLinkage()) { > + if (I->hasLocalLinkage()) { > if (!AnalyzeUsesOfPointer(I, Readers, Writers)) { > // Remember that we are tracking this global. > NonAddressTakenGlobals.insert(I); > @@ -175,7 +175,7 @@ > > for (Module::global_iterator I = M.global_begin(), E = M.global_end(); > I != E; ++I) > - if (I->hasInternalLinkage()) { > + if (I->hasLocalLinkage()) { > if (!AnalyzeUsesOfPointer(I, Readers, Writers)) { > // Remember that we are tracking this global, and the mod/ref fns > NonAddressTakenGlobals.insert(I); > @@ -504,7 +504,7 @@ > // If we are asking for mod/ref info of a direct call with a pointer to a > // global we are tracking, return information if we have it. > if (GlobalValue *GV = dyn_cast(P->getUnderlyingObject())) > - if (GV->hasInternalLinkage()) > + if (GV->hasLocalLinkage()) > if (Function *F = CS.getCalledFunction()) > if (NonAddressTakenGlobals.count(GV)) > if (FunctionRecord *FR = getFunctionInfo(F)) > > Modified: llvm/trunk/lib/Archive/Archive.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/Archive.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Archive/Archive.cpp (original) > +++ llvm/trunk/lib/Archive/Archive.cpp Thu Jan 15 14:18:42 2009 > @@ -188,13 +188,13 @@ > static void getSymbols(Module*M, std::vector& symbols) { > // Loop over global variables > for (Module::global_iterator GI = M->global_begin(), GE=M->global_end(); GI != GE; ++GI) > - if (!GI->isDeclaration() && !GI->hasInternalLinkage()) > + if (!GI->isDeclaration() && !GI->hasLocalLinkage()) > if (!GI->getName().empty()) > symbols.push_back(GI->getName()); > > // Loop over functions > for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI) > - if (!FI->isDeclaration() && !FI->hasInternalLinkage()) > + if (!FI->isDeclaration() && !FI->hasLocalLinkage()) > if (!FI->getName().empty()) > symbols.push_back(FI->getName()); > > > Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) > +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Thu Jan 15 14:18:42 2009 > @@ -453,6 +453,7 @@ > KEYWORD(declare); KEYWORD(define); > KEYWORD(global); KEYWORD(constant); > > + KEYWORD(private); > KEYWORD(internal); > KEYWORD(linkonce); > KEYWORD(weak); > > Modified: llvm/trunk/lib/AsmParser/LLParser.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/AsmParser/LLParser.cpp (original) > +++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Jan 15 14:18:42 2009 > @@ -113,6 +113,7 @@ > // optional leading prefixes, the production is: > // GlobalVar ::= OptionalLinkage OptionalVisibility OptionalThreadLocal > // OptionalAddrSpace ('constant'|'global') ... > + case lltok::kw_private: // OptionalLinkage > case lltok::kw_internal: // OptionalLinkage > case lltok::kw_weak: // OptionalLinkage > case lltok::kw_linkonce: // OptionalLinkage > @@ -375,7 +376,8 @@ > > if (Linkage != GlobalValue::ExternalLinkage && > Linkage != GlobalValue::WeakLinkage && > - Linkage != GlobalValue::InternalLinkage) > + Linkage != GlobalValue::InternalLinkage && > + Linkage != GlobalValue::PrivateLinkage) > return Error(LinkageLoc, "invalid linkage type for alias"); > > Constant *Aliasee; > @@ -738,6 +740,7 @@ > > /// ParseOptionalLinkage > /// ::= /*empty*/ > +/// ::= 'private' > /// ::= 'internal' > /// ::= 'weak' > /// ::= 'linkonce' > @@ -751,6 +754,7 @@ > HasLinkage = false; > switch (Lex.getKind()) { > default: Res = GlobalValue::ExternalLinkage; return false; > + case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break; > case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break; > case lltok::kw_weak: Res = GlobalValue::WeakLinkage; break; > case lltok::kw_linkonce: Res = GlobalValue::LinkOnceLinkage; break; > @@ -2065,6 +2069,7 @@ > if (isDefine) > return Error(LinkageLoc, "invalid linkage for function definition"); > break; > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > case GlobalValue::LinkOnceLinkage: > case GlobalValue::WeakLinkage: > > Modified: llvm/trunk/lib/AsmParser/LLToken.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/AsmParser/LLToken.h (original) > +++ llvm/trunk/lib/AsmParser/LLToken.h Thu Jan 15 14:18:42 2009 > @@ -36,7 +36,7 @@ > kw_declare, kw_define, > kw_global, kw_constant, > > - kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, > + kw_private, kw_internal, kw_linkonce, kw_weak, kw_appending, kw_dllimport, > kw_dllexport, kw_common, kw_default, kw_hidden, kw_protected, > kw_extern_weak, > kw_external, kw_thread_local, > > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Thu Jan 15 14:18:42 2009 > @@ -67,6 +67,7 @@ > case 6: return GlobalValue::DLLExportLinkage; > case 7: return GlobalValue::ExternalWeakLinkage; > case 8: return GlobalValue::CommonLinkage; > + case 9: return GlobalValue::PrivateLinkage; > } > } > > > Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) > +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -284,6 +284,7 @@ > case GlobalValue::DLLExportLinkage: return 6; > case GlobalValue::ExternalWeakLinkage: return 7; > case GlobalValue::CommonLinkage: return 8; > + case GlobalValue::PrivateLinkage: return 9; > } > } > > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -139,7 +139,7 @@ > } > > bool AsmPrinter::doInitialization(Module &M) { > - Mang = new Mangler(M, TAI->getGlobalPrefix()); > + Mang = new Mangler(M, TAI->getGlobalPrefix(), TAI->getPrivateGlobalPrefix()); > > GCModuleInfo *MI = getAnalysisToUpdate(); > assert(MI && "AsmPrinter didn't require GCModuleInfo?"); > @@ -199,7 +199,7 @@ > O << "\t.globl\t" << Name << '\n'; > else if (I->hasWeakLinkage()) > O << TAI->getWeakRefDirective() << Name << '\n'; > - else if (!I->hasInternalLinkage()) > + else if (!I->hasLocalLinkage()) > assert(0 && "Invalid alias linkage"); > > printVisibility(Name, I->getVisibility()); > > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -3272,7 +3272,8 @@ > // Externally visible entry into the functions eh frame info. > // If the corresponding function is static, this should not be > // externally visible. > - if (linkage != Function::InternalLinkage) { > + if (linkage != Function::InternalLinkage && > + linkage != Function::PrivateLinkage) { > if (const char *GlobalEHDirective = TAI->getGlobalEHDirective()) > O << GlobalEHDirective << EHFrameInfo.FnName << "\n"; > } > > Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -174,6 +174,8 @@ > case GlobalValue::WeakLinkage: > FnSym.SetBind(ELFWriter::ELFSym::STB_WEAK); > break; > + case GlobalValue::PrivateLinkage: > + assert (0 && "PrivateLinkage should not be in the symbol table."); > case GlobalValue::InternalLinkage: > FnSym.SetBind(ELFWriter::ELFSym::STB_LOCAL); > break; > @@ -329,7 +331,8 @@ > > // Set the idx of the .bss section > BSSSym.SectionIdx = BSSSection.SectionIdx; > - SymbolTable.push_back(BSSSym); > + if (!GV->hasPrivateLinkage()) > + SymbolTable.push_back(BSSSym); > > // Reserve space in the .bss section for this symbol. > BSSSection.Size += Size; > > Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -371,7 +371,7 @@ > SecDataOut.outbyte(0); > } > // Globals without external linkage apparently do not go in the symbol table. > - if (GV->getLinkage() != GlobalValue::InternalLinkage) { > + if (!GV->hasLocalLinkage()) { > MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TM); > Sym.n_value = Sec->size; > SymbolTable.push_back(Sym); > @@ -959,6 +959,9 @@ > GVName = TAI->getGlobalPrefix() + name; > n_type |= GV->hasHiddenVisibility() ? N_PEXT : N_EXT; > break; > + case GlobalValue::PrivateLinkage: > + GVName = TAI->getPrivateGlobalPrefix() + name; > + break; > case GlobalValue::InternalLinkage: > GVName = TAI->getGlobalPrefix() + name; > break; > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Thu Jan 15 14:18:42 2009 > @@ -4276,7 +4276,7 @@ > // Check for well-known libc/libm calls. If the function is internal, it > // can't be a library call. > unsigned NameLen = F->getNameLen(); > - if (!F->hasInternalLinkage() && NameLen) { > + if (!F->hasLocalLinkage() && NameLen) { > const char *NameStr = F->getNameStart(); > if (NameStr[0] == 'c' && > ((NameLen == 8 && !strcmp(NameStr, "copysign")) || > > Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) > +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Thu Jan 15 14:18:42 2009 > @@ -249,7 +249,7 @@ > // an old-style (llvmgcc3) static ctor with __main linked in and in use. If > // this is the case, don't execute any of the global ctors, __main will do > // it. > - if (!GV || GV->isDeclaration() || GV->hasInternalLinkage()) return; > + if (!GV || GV->isDeclaration() || GV->hasLocalLinkage()) return; > > // Should be an array of '{ int, void ()* }' structs. The first value is > // the init priority, which we ignore. > @@ -893,7 +893,7 @@ > for (Module::const_global_iterator I = M.global_begin(), > E = M.global_end(); I != E; ++I) { > const GlobalValue *GV = I; > - if (GV->hasInternalLinkage() || GV->isDeclaration() || > + if (GV->hasLocalLinkage() || GV->isDeclaration() || > GV->hasAppendingLinkage() || !GV->hasName()) > continue;// Ignore external globals and globals with internal linkage. > > > Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) > +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Jan 15 14:18:42 2009 > @@ -554,7 +554,7 @@ > addGlobalMapping(GV, Ptr); > } > } else { > - if (isGVCompilationDisabled() && !GV->hasInternalLinkage()) { > + if (isGVCompilationDisabled() && !GV->hasLocalLinkage()) { > cerr << "Compilation of non-internal GlobalValue is disabled!\n"; > abort(); > } > > Modified: llvm/trunk/lib/Linker/LinkArchives.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkArchives.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Linker/LinkArchives.cpp (original) > +++ llvm/trunk/lib/Linker/LinkArchives.cpp Thu Jan 15 14:18:42 2009 > @@ -50,7 +50,7 @@ > if (I->hasName()) { > if (I->isDeclaration()) > UndefinedSymbols.insert(I->getName()); > - else if (!I->hasInternalLinkage()) { > + else if (!I->hasLocalLinkage()) { > assert(!I->hasDLLImportLinkage() > && "Found dllimported non-external symbol!"); > DefinedSymbols.insert(I->getName()); > @@ -62,7 +62,7 @@ > if (I->hasName()) { > if (I->isDeclaration()) > UndefinedSymbols.insert(I->getName()); > - else if (!I->hasInternalLinkage()) { > + else if (!I->hasLocalLinkage()) { > assert(!I->hasDLLImportLinkage() > && "Found dllimported non-external symbol!"); > DefinedSymbols.insert(I->getName()); > > Modified: llvm/trunk/lib/Linker/LinkModules.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Linker/LinkModules.cpp (original) > +++ llvm/trunk/lib/Linker/LinkModules.cpp Thu Jan 15 14:18:42 2009 > @@ -1,4 +1,4 @@ > -//===- lib/Linker/LinkModules.cpp - Module Linker Implementation ----------===// > + //===- lib/Linker/LinkModules.cpp - Module Linker Implementation ----------===// > // > // The LLVM Compiler Infrastructure > // > @@ -415,7 +415,7 @@ > > // If there is a conflict, rename the conflict. > if (GlobalValue *ConflictGV = cast_or_null(ST.lookup(Name))) { > - assert(ConflictGV->hasInternalLinkage() && > + assert(ConflictGV->hasLocalLinkage() && > "Not conflicting with a static global, should link instead!"); > GV->takeName(ConflictGV); > ConflictGV->setName(Name); // This will cause ConflictGV to get renamed > @@ -444,7 +444,7 @@ > static bool GetLinkageResult(GlobalValue *Dest, const GlobalValue *Src, > GlobalValue::LinkageTypes <, bool &LinkFromSrc, > std::string *Err) { > - assert((!Dest || !Src->hasInternalLinkage()) && > + assert((!Dest || !Src->hasLocalLinkage()) && > "If Src has internal linkage, Dest shouldn't be set!"); > if (!Dest) { > // Linking something to nothing. > @@ -536,13 +536,13 @@ > > // Check to see if may have to link the global with the global, alias or > // function. > - if (SGV->hasName() && !SGV->hasInternalLinkage()) > + if (SGV->hasName() && !SGV->hasLocalLinkage()) > DGV = cast_or_null(DestSymTab.lookup(SGV->getNameStart(), > SGV->getNameEnd())); > > // If we found a global with the same name in the dest module, but it has > // internal linkage, we are really not doing any linkage here. > - if (DGV && DGV->hasInternalLinkage()) > + if (DGV && DGV->hasLocalLinkage()) > DGV = 0; > > // If types don't agree due to opaque types, try to resolve them. > @@ -573,7 +573,7 @@ > // If the LLVM runtime renamed the global, but it is an externally visible > // symbol, DGV must be an existing global with internal linkage. Rename > // it. > - if (!NewDGV->hasInternalLinkage() && NewDGV->getName() != SGV->getName()) > + if (!NewDGV->hasLocalLinkage() && NewDGV->getName() != SGV->getName()) > ForceRenaming(NewDGV, SGV->getName()); > > // Make sure to remember this mapping. > @@ -643,7 +643,7 @@ > > // If the symbol table renamed the global, but it is an externally visible > // symbol, DGV must be an existing global with internal linkage. Rename. > - if (NewDGV->getName() != SGV->getName() && !NewDGV->hasInternalLinkage()) > + if (NewDGV->getName() != SGV->getName() && !NewDGV->hasLocalLinkage()) > ForceRenaming(NewDGV, SGV->getName()); > > // Inherit const as appropriate. > @@ -687,10 +687,12 @@ > return GlobalValue::ExternalLinkage; > else if (SGV->hasWeakLinkage() || DGV->hasWeakLinkage()) > return GlobalValue::WeakLinkage; > - else { > - assert(SGV->hasInternalLinkage() && DGV->hasInternalLinkage() && > - "Unexpected linkage type"); > + else if (SGV->hasInternalLinkage() && DGV->hasInternalLinkage()) > return GlobalValue::InternalLinkage; > + else { > + assert (SGV->hasPrivateLinkage() && DGV->hasPrivateLinkage() && > + "Unexpected linkage type"); > + return GlobalValue::PrivateLinkage; > } > } > > @@ -715,7 +717,7 @@ > GlobalValue* DGV = NULL; > > // Try to find something 'similar' to SGA in destination module. > - if (!DGV && !SGA->hasInternalLinkage()) { > + if (!DGV && !SGA->hasLocalLinkage()) { > DGV = Dest->getNamedAlias(SGA->getName()); > > // If types don't agree due to opaque types, try to resolve them. > @@ -723,7 +725,7 @@ > RecursiveResolveTypes(SGA->getType(), DGV->getType()); > } > > - if (!DGV && !SGA->hasInternalLinkage()) { > + if (!DGV && !SGA->hasLocalLinkage()) { > DGV = Dest->getGlobalVariable(SGA->getName()); > > // If types don't agree due to opaque types, try to resolve them. > @@ -731,7 +733,7 @@ > RecursiveResolveTypes(SGA->getType(), DGV->getType()); > } > > - if (!DGV && !SGA->hasInternalLinkage()) { > + if (!DGV && !SGA->hasLocalLinkage()) { > DGV = Dest->getFunction(SGA->getName()); > > // If types don't agree due to opaque types, try to resolve them. > @@ -740,7 +742,7 @@ > } > > // No linking to be performed on internal stuff. > - if (DGV && DGV->hasInternalLinkage()) > + if (DGV && DGV->hasLocalLinkage()) > DGV = NULL; > > if (GlobalAlias *DGA = dyn_cast_or_null(DGV)) { > @@ -831,7 +833,7 @@ > // If the symbol table renamed the alias, but it is an externally visible > // symbol, DGA must be an global value with internal linkage. Rename it. > if (NewGA->getName() != SGA->getName() && > - !NewGA->hasInternalLinkage()) > + !NewGA->hasLocalLinkage()) > ForceRenaming(NewGA, SGA->getName()); > > // Remember this mapping so uses in the source module get remapped > @@ -912,13 +914,13 @@ > > // Check to see if may have to link the function with the global, alias or > // function. > - if (SF->hasName() && !SF->hasInternalLinkage()) > + if (SF->hasName() && !SF->hasLocalLinkage()) > DGV = cast_or_null(DestSymTab.lookup(SF->getNameStart(), > SF->getNameEnd())); > > // If we found a global with the same name in the dest module, but it has > // internal linkage, we are really not doing any linkage here. > - if (DGV && DGV->hasInternalLinkage()) > + if (DGV && DGV->hasLocalLinkage()) > DGV = 0; > > // If types don't agree due to opaque types, try to resolve them. > @@ -943,7 +945,7 @@ > // If the LLVM runtime renamed the function, but it is an externally > // visible symbol, DF must be an existing function with internal linkage. > // Rename it. > - if (!NewDF->hasInternalLinkage() && NewDF->getName() != SF->getName()) > + if (!NewDF->hasLocalLinkage() && NewDF->getName() != SF->getName()) > ForceRenaming(NewDF, SF->getName()); > > // ... and remember this mapping... > @@ -982,7 +984,7 @@ > // If the symbol table renamed the function, but it is an externally > // visible symbol, DF must be an existing function with internal > // linkage. Rename it. > - if (NewDF->getName() != SF->getName() && !NewDF->hasInternalLinkage()) > + if (NewDF->getName() != SF->getName() && !NewDF->hasLocalLinkage()) > ForceRenaming(NewDF, SF->getName()); > > // Remember this mapping so uses in the source module get remapped > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Jan 15 14:18:42 2009 > @@ -808,7 +808,7 @@ > GlobalValue *GV = cast(Op)->getGlobal(); > Reloc::Model RelocM = getTargetMachine().getRelocationModel(); > if (RelocM == Reloc::PIC_) { > - bool UseGOTOFF = GV->hasInternalLinkage() || GV->hasHiddenVisibility(); > + bool UseGOTOFF = GV->hasLocalLinkage() || GV->hasHiddenVisibility(); > ARMConstantPoolValue *CPV = > new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT"); > SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); > > Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -197,6 +197,7 @@ > const Function *F = MF.getFunction(); > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > + case Function::PrivateLinkage: > case Function::InternalLinkage: > SwitchToTextSection("\t.text", F); > break; > @@ -847,11 +848,11 @@ > } > } > > - if (GVar->hasInternalLinkage() || GVar->mayBeOverridden()) { > + if (GVar->hasLocalLinkage() || GVar->mayBeOverridden()) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > if (isDarwin) { > - if (GVar->hasInternalLinkage()) { > + if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << "," << Size > << ',' << Align; > } else if (GVar->hasCommonLinkage()) { > @@ -869,7 +870,7 @@ > return; > } > } else if (TAI->getLCOMMDirective() != NULL) { > - if (GVar->hasInternalLinkage()) { > + if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << "," << Size; > } else { > O << TAI->getCOMMDirective() << name << "," << Size; > @@ -878,7 +879,7 @@ > } > } else { > SwitchToSection(TAI->SectionForGlobal(GVar)); > - if (GVar->hasInternalLinkage()) > + if (GVar->hasLocalLinkage()) > O << "\t.local\t" << name << "\n"; > O << TAI->getCOMMDirective() << name << "," << Size; > if (TAI->getCOMMDirectiveTakesAlignment()) > @@ -909,6 +910,7 @@ > case GlobalValue::ExternalLinkage: > O << "\t.globl " << name << "\n"; > // FALL THROUGH > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > break; > default: > > Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Thu Jan 15 14:18:42 2009 > @@ -513,7 +513,7 @@ > SDValue GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset()); > > // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { > - if (GV->hasInternalLinkage()) { > + if (GV->hasLocalLinkage()) { > SDValue Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA, > DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); > SDValue Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, GA, Hi); > > Modified: llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -169,6 +169,7 @@ > > O << "\t.ent " << CurrentFnName << "\n"; > > + assert (!F->hasPrivateLinkage() && "add private prefix."); > O << CurrentFnName << ":\n"; > > // Print out code for the function. > > Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) > +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Jan 15 14:18:42 2009 > @@ -1910,7 +1910,7 @@ > if (getGlobalVariableClass(I)) > continue; > > - if (I->hasInternalLinkage()) > + if (I->hasLocalLinkage()) > Out << "static "; > else > Out << "extern "; > @@ -1946,7 +1946,7 @@ > if (getGlobalVariableClass(I)) > continue; > > - if (I->hasInternalLinkage()) > + if (I->hasLocalLinkage()) > Out << "static "; > else if (I->hasDLLImportLinkage()) > Out << "__declspec(dllimport) "; > @@ -2190,7 +2190,7 @@ > /// isStructReturn - Should this function actually return a struct by-value? > bool isStructReturn = F->hasStructRetAttr(); > > - if (F->hasInternalLinkage()) Out << "static "; > + if (F->hasLocalLinkage()) Out << "static "; > if (F->hasDLLImportLinkage()) Out << "__declspec(dllimport) "; > if (F->hasDLLExportLinkage()) Out << "__declspec(dllexport) "; > switch (F->getCallingConv()) { > > Modified: llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -442,6 +442,7 @@ > > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > + case Function::PrivateLinkage: > case Function::InternalLinkage: // Symbols default to internal. > break; > case Function::ExternalLinkage: > @@ -536,7 +537,7 @@ > > if (C->isNullValue() && /* FIXME: Verify correct */ > !GVar->hasSection() && > - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || > + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || > GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > @@ -545,7 +546,7 @@ > O << "\t.type " << name << ", @object\n"; > O << name << ":\n"; > O << "\t.zero " << Size << '\n'; > - } else if (GVar->hasInternalLinkage()) { > + } else if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << ',' << Size; > } else { > O << ".comm " << name << ',' << Size; > @@ -573,6 +574,7 @@ > O << "\t.global " << name << '\n' > << "\t.type " << name << ", @object\n"; > // FALL THROUGH > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > break; > default: > @@ -617,4 +619,3 @@ > SPUTargetMachine &tm) { > return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo()); > } > - > > Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) > +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Jan 15 14:18:42 2009 > @@ -292,6 +292,8 @@ > switch (LT) { > case GlobalValue::InternalLinkage: > Out << "GlobalValue::InternalLinkage"; break; > + case GlobalValue::PrivateLinkage: > + Out << "GlobalValue::PrivateLinkage"; break; > case GlobalValue::LinkOnceLinkage: > Out << "GlobalValue::LinkOnceLinkage "; break; > case GlobalValue::WeakLinkage: > > Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) > +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Thu Jan 15 14:18:42 2009 > @@ -61,7 +61,7 @@ > Mangler *Mang) const { > if (GV==0) > return false; > - if (GV->hasInternalLinkage() && !isa(GV) && > + if (GV->hasLocalLinkage() && !isa(GV) && > ((strlen(getPrivateGlobalPrefix()) != 0 && > Mang->getValueName(GV).substr(0,strlen(getPrivateGlobalPrefix())) == > getPrivateGlobalPrefix()) || > > Modified: llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp (original) > +++ llvm/trunk/lib/Target/ELFTargetAsmInfo.cpp Thu Jan 15 14:18:42 2009 > @@ -44,6 +44,7 @@ > if (const Function *F = dyn_cast(GV)) { > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > + case Function::PrivateLinkage: > case Function::InternalLinkage: > case Function::DLLExportLinkage: > case Function::ExternalLinkage: > @@ -184,4 +185,3 @@ > > return Flags; > } > - > > Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -275,10 +275,10 @@ > > if (C->isNullValue() && !GVar->hasSection()) { > if (!GVar->isThreadLocal() && > - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { > + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > - if (GVar->hasInternalLinkage()) { > + if (GVar->hasLocalLinkage()) { > O << "\t.lcomm " << name << "#," << Size > << ',' << (1 << Align); > O << '\n'; > @@ -307,6 +307,7 @@ > O << TAI->getGlobalDirective() << name << '\n'; > // FALL THROUGH > case GlobalValue::InternalLinkage: > + case GlobalValue::PrivateLinkage: > break; > case GlobalValue::GhostLinkage: > cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n"; > > Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original) > +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -349,10 +349,10 @@ > return ArgumentVT; > // Function > else if (const Function* F = dyn_cast(V)) > - return F->hasInternalLinkage() ? InternalVT : GlobalVT; > + return F->hasLocalLinkage() ? InternalVT : GlobalVT; > // Variable > else if (const GlobalVariable* G = dyn_cast(V)) > - return G->hasInternalLinkage() ? InternalVT : GlobalVT; > + return G->hasLocalLinkage() ? InternalVT : GlobalVT; > // Constant > else if (isa(V)) > return isa(V) ? ConstExprVT : ConstVT; > @@ -1401,7 +1401,7 @@ > void MSILWriter::printFunction(const Function& F) { > bool isSigned = F.paramHasAttr(0, Attribute::SExt); > Out << "\n.method static "; > - Out << (F.hasInternalLinkage() ? "private " : "public "); > + Out << (F.hasLocalLinkage() ? "private " : "public "); > if (F.isVarArg()) Out << "vararg "; > Out << getTypeName(F.getReturnType(),isSigned) << > getConvModopt(F.getCallingConv()) << getValueName(&F) << '\n'; > > Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -275,9 +275,6 @@ > > O << "\n\n"; > > - // What's my mangled name? > - CurrentFnName = Mang->getValueName(MF.getFunction()); > - > // Emit the function start directives > emitFunctionStart(MF); > > @@ -384,7 +381,10 @@ > return; > > case MachineOperand::MO_GlobalAddress: > - O << Mang->getValueName(MO.getGlobal()); > + { > + const GlobalValue *GV = MO.getGlobal(); > + O << Mang->getValueName(GV); > + } > break; > > case MachineOperand::MO_ExternalSymbol: > @@ -449,7 +449,7 @@ > bool MipsAsmPrinter:: > doInitialization(Module &M) > { > - Mang = new Mangler(M); > + Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix()); > > // Tell the assembler which ABI we are using > O << "\t.section .mdebug." << emitCurrentABIString() << '\n'; > @@ -502,10 +502,10 @@ > > if (C->isNullValue() && !GVar->hasSection()) { > if (!GVar->isThreadLocal() && > - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { > + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > - if (GVar->hasInternalLinkage()) > + if (GVar->hasLocalLinkage()) > O << "\t.local\t" << name << '\n'; > > O << TAI->getCOMMDirective() << name << ',' << Size; > @@ -531,6 +531,7 @@ > // If external or appending, declare as a global symbol > O << TAI->getGlobalDirective() << name << '\n'; > // Fall Through > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > if (CVA && CVA->isCString()) > printSizeAndType = false; > > Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Jan 15 14:18:42 2009 > @@ -216,7 +216,7 @@ > > // if this is a internal constant string, there is a special > // section for it, but not in small data/bss. > - if (GVA->hasInitializer() && GV->hasInternalLinkage()) { > + if (GVA->hasInitializer() && GV->hasLocalLinkage()) { > Constant *C = GVA->getInitializer(); > const ConstantArray *CVA = dyn_cast(C); > if (CVA && CVA->isCString()) > @@ -489,7 +489,7 @@ > SDValue ResNode = DAG.getLoad(MVT::i32, DAG.getEntryNode(), GA, NULL, 0); > // On functions and global targets not internal linked only > // a load from got/GP is necessary for PIC to work. > - if (!GV->hasInternalLinkage() || isa(GV)) > + if (!GV->hasLocalLinkage() || isa(GV)) > return ResNode; > SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA); > return DAG.getNode(ISD::ADD, MVT::i32, ResNode, Lo); > > Modified: llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -584,6 +584,7 @@ > > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > + case Function::PrivateLinkage: > case Function::InternalLinkage: // Symbols default to internal. > break; > case Function::ExternalLinkage: > @@ -686,7 +687,7 @@ > > if (C->isNullValue() && /* FIXME: Verify correct */ > !GVar->hasSection() && > - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || > + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || > GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > @@ -695,7 +696,7 @@ > O << "\t.type " << name << ", @object\n"; > O << name << ":\n"; > O << "\t.zero " << Size << '\n'; > - } else if (GVar->hasInternalLinkage()) { > + } else if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << ',' << Size; > } else { > O << ".comm " << name << ',' << Size; > @@ -723,6 +724,7 @@ > << "\t.type " << name << ", @object\n"; > // FALL THROUGH > case GlobalValue::InternalLinkage: > + case GlobalValue::PrivateLinkage: > break; > default: > cerr << "Unknown linkage type!"; > @@ -911,7 +913,7 @@ > > if (C->isNullValue() && /* FIXME: Verify correct */ > !GVar->hasSection() && > - (GVar->hasInternalLinkage() || GVar->hasExternalLinkage() || > + (GVar->hasLocalLinkage() || GVar->hasExternalLinkage() || > GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > @@ -919,7 +921,7 @@ > O << "\t.globl " << name << '\n'; > O << "\t.zerofill __DATA, __common, " << name << ", " > << Size << ", " << Align; > - } else if (GVar->hasInternalLinkage()) { > + } else if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << ',' << Size << ',' << Align; > } else if (!GVar->hasCommonLinkage()) { > O << "\t.globl " << name << '\n' > > Modified: llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -98,8 +98,6 @@ > static unsigned BBNumber = 0; > > O << "\n\n"; > - // What's my mangled name? > - CurrentFnName = Mang->getValueName(MF.getFunction()); > > // Print out the label for the function. > const Function *F = MF.getFunction(); > @@ -168,7 +166,10 @@ > printBasicBlockLabel(MO.getMBB()); > return; > case MachineOperand::MO_GlobalAddress: > - O << Mang->getValueName(MO.getGlobal()); > + { > + const GlobalValue *GV = MO.getGlobal(); > + O << Mang->getValueName(GV); > + } > break; > case MachineOperand::MO_ExternalSymbol: > O << MO.getSymbolName(); > @@ -218,7 +219,7 @@ > } > > bool SparcAsmPrinter::doInitialization(Module &M) { > - Mang = new Mangler(M); > + Mang = new Mangler(M, "", TAI->getPrivateGlobalPrefix()); > return false; // success > } > > @@ -255,10 +256,10 @@ > > if (C->isNullValue() && !GVar->hasSection()) { > if (!GVar->isThreadLocal() && > - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { > + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > - if (GVar->hasInternalLinkage()) > + if (GVar->hasLocalLinkage()) > O << "\t.local " << name << '\n'; > > O << TAI->getCOMMDirective() << name << ',' << Size; > @@ -284,6 +285,7 @@ > // If external or appending, declare as a global symbol > O << TAI->getGlobalDirective() << name << '\n'; > // FALL THROUGH > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > break; > case GlobalValue::GhostLinkage: > > Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -159,6 +159,7 @@ > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > case Function::InternalLinkage: // Symbols default to internal. > + case Function::PrivateLinkage: > EmitAlignment(FnAlign, F); > break; > case Function::DLLExportLinkage: > @@ -188,7 +189,7 @@ > else if (Subtarget->isTargetCygMing()) { > O << "\t.def\t " << CurrentFnName > << ";\t.scl\t" << > - (F->getLinkage() == Function::InternalLinkage ? COFF::C_STAT : COFF::C_EXT) > + (F->hasInternalLinkage() ? COFF::C_STAT : COFF::C_EXT) > << ";\t.type\t" << (COFF::DT_FCN << COFF::N_BTSHFT) > << ";\t.endef\n"; > } > @@ -421,7 +422,7 @@ > if (shouldPrintPLT(TM, Subtarget)) { > // Assemble call via PLT for externally visible symbols > if (!GV->hasHiddenVisibility() && !GV->hasProtectedVisibility() && > - !GV->hasInternalLinkage()) > + !GV->hasLocalLinkage()) > O << "@PLT"; > } > if (Subtarget->isTargetCygMing() && GV->isDeclaration()) > @@ -789,11 +790,11 @@ > } > > if (!GVar->isThreadLocal() && > - (GVar->hasInternalLinkage() || GVar->mayBeOverridden())) { > + (GVar->hasLocalLinkage() || GVar->mayBeOverridden())) { > if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. > > if (TAI->getLCOMMDirective() != NULL) { > - if (GVar->hasInternalLinkage()) { > + if (GVar->hasLocalLinkage()) { > O << TAI->getLCOMMDirective() << name << ',' << Size; > if (Subtarget->isTargetDarwin()) > O << ',' << Align; > @@ -813,7 +814,7 @@ > } > } else { > if (!Subtarget->isTargetCygMing()) { > - if (GVar->hasInternalLinkage()) > + if (GVar->hasLocalLinkage()) > O << "\t.local\t" << name << '\n'; > } > O << TAI->getCOMMDirective() << name << ',' << Size; > @@ -849,6 +850,7 @@ > // If external or appending, declare as a global symbol > O << "\t.globl " << name << '\n'; > // FALL THROUGH > + case GlobalValue::PrivateLinkage: > case GlobalValue::InternalLinkage: > break; > default: > > Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -145,6 +145,7 @@ > FnAlign = 1; > switch (F->getLinkage()) { > default: assert(0 && "Unsupported linkage type!"); > + case Function::PrivateLinkage: > case Function::InternalLinkage: > EmitAlignment(FnAlign); > break; > > Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Thu Jan 15 14:18:42 2009 > @@ -56,7 +56,7 @@ > // Extra load is needed for all externally visible. > if (isDirectCall) > return false; > - if (GV->hasInternalLinkage() || GV->hasHiddenVisibility()) > + if (GV->hasLocalLinkage() || GV->hasHiddenVisibility()) > return false; > return true; > } else if (isTargetCygMing() || isTargetWindows()) { > @@ -79,7 +79,7 @@ > // returns false. > if (TM.getRelocationModel() == Reloc::PIC_) > return !isDirectCall && > - (GV->hasInternalLinkage() || GV->hasExternalLinkage()); > + (GV->hasLocalLinkage() || GV->hasExternalLinkage()); > return false; > } > > > Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Thu Jan 15 14:18:42 2009 > @@ -198,6 +198,7 @@ > } > // FALL THROUGH > case GlobalValue::InternalLinkage: > + case GlobalValue::PrivateLinkage: > break; > case GlobalValue::GhostLinkage: > cerr << "Should not have any unmaterialized functions!\n"; > @@ -259,6 +260,7 @@ > switch (F->getLinkage()) { > default: assert(0 && "Unknown linkage type!"); > case Function::InternalLinkage: // Symbols default to internal. > + case Function::PrivateLinkage: > break; > case Function::ExternalLinkage: > emitGlobalDirective(CurrentFnName); > @@ -299,9 +301,6 @@ > // Print out jump tables referenced by the function > EmitJumpTableInfo(MF.getJumpTableInfo(), MF); > > - // What's my mangled name? > - CurrentFnName = Mang->getValueName(MF.getFunction()); > - > // Emit the function start directives > emitFunctionStart(MF); > > @@ -367,9 +366,12 @@ > printBasicBlockLabel(MO.getMBB()); > break; > case MachineOperand::MO_GlobalAddress: > - O << Mang->getValueName(MO.getGlobal()); > - if (MO.getGlobal()->hasExternalWeakLinkage()) > - ExtWeakSymbols.insert(MO.getGlobal()); > + { > + const GlobalValue *GV = MO.getGlobal(); > + O << Mang->getValueName(GV); > + if (GV->hasExternalWeakLinkage()) > + ExtWeakSymbols.insert(GV); > + } > break; > case MachineOperand::MO_ExternalSymbol: > O << MO.getSymbolName(); > > Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Jan 15 14:18:42 2009 > @@ -114,7 +114,7 @@ > Function *F = CGN->getFunction(); > > // Make sure that it is local to this module. > - if (!F || !F->hasInternalLinkage()) return false; > + if (!F || !F->hasLocalLinkage()) return false; > > // First check: see if there are any pointer arguments! If not, quick exit. > SmallVector, 16> PointerArgs; > > Modified: llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/ConstantMerge.cpp Thu Jan 15 14:18:42 2009 > @@ -72,7 +72,7 @@ > > // If this GV is dead, remove it. > GV->removeDeadConstantUsers(); > - if (GV->use_empty() && GV->hasInternalLinkage()) { > + if (GV->use_empty() && GV->hasLocalLinkage()) { > GV->eraseFromParent(); > continue; > } > @@ -86,7 +86,7 @@ > > if (Slot == 0) { // Nope, add it to the map. > Slot = GV; > - } else if (GV->hasInternalLinkage()) { // Yup, this is a duplicate! > + } else if (GV->hasLocalLinkage()) { // Yup, this is a duplicate! > // Make all uses of the duplicate constant use the canonical version. > Replacements.push_back(std::make_pair(GV, Slot)); > } > > Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Thu Jan 15 14:18:42 2009 > @@ -172,7 +172,7 @@ > /// llvm.vastart is never called, the varargs list is dead for the function. > bool DAE::DeleteDeadVarargs(Function &Fn) { > assert(Fn.getFunctionType()->isVarArg() && "Function isn't varargs!"); > - if (Fn.isDeclaration() || !Fn.hasInternalLinkage()) return false; > + if (Fn.isDeclaration() || !Fn.hasLocalLinkage()) return false; > > // Ensure that the function is only directly called. > for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); I != E; ++I) { > @@ -424,7 +424,7 @@ > return; > } > > - if (!F.hasInternalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) { > + if (!F.hasLocalLinkage() && (!ShouldHackArguments() || F.isIntrinsic())) { > MarkLive(F); > return; > } > > Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Thu Jan 15 14:18:42 2009 > @@ -63,7 +63,7 @@ > I != E; ++I) { > if (CallInst* callInst = dyn_cast(&*I)) { > Function* Callee = callInst->getCalledFunction(); > - if (Callee && Callee->hasInternalLinkage()) > + if (Callee && Callee->hasLocalLinkage()) > Callee->setLinkage(GlobalValue::ExternalLinkage); > } > } > @@ -85,6 +85,7 @@ > > bool isolateGV(Module &M) { > // Mark all globals internal > + // FIXME: what should we do with private linkage? > for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) > if (!I->isDeclaration()) { > I->setLinkage(GlobalValue::InternalLinkage); > > Modified: llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/GlobalDCE.cpp Thu Jan 15 14:18:42 2009 > @@ -63,7 +63,7 @@ > for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { > Changed |= RemoveUnusedGlobalValue(*I); > // Functions with external linkage are needed if they have a body > - if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && > + if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && > !I->isDeclaration()) > GlobalIsNeeded(I); > } > @@ -73,7 +73,7 @@ > Changed |= RemoveUnusedGlobalValue(*I); > // Externally visible & appending globals are needed, if they have an > // initializer. > - if ((!I->hasInternalLinkage() && !I->hasLinkOnceLinkage()) && > + if ((!I->hasLocalLinkage() && !I->hasLinkOnceLinkage()) && > !I->isDeclaration()) > GlobalIsNeeded(I); > } > > Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Thu Jan 15 14:18:42 2009 > @@ -464,7 +464,7 @@ > if (!GlobalUsersSafeToSRA(GV)) > return 0; > > - assert(GV->hasInternalLinkage() && !GV->isConstant()); > + assert(GV->hasLocalLinkage() && !GV->isConstant()); > Constant *Init = GV->getInitializer(); > const Type *Ty = Init->getType(); > > @@ -1808,12 +1808,12 @@ > for (Module::iterator FI = M.begin(), E = M.end(); FI != E; ) { > Function *F = FI++; > F->removeDeadConstantUsers(); > - if (F->use_empty() && (F->hasInternalLinkage() || > + if (F->use_empty() && (F->hasLocalLinkage() || > F->hasLinkOnceLinkage())) { > M.getFunctionList().erase(F); > Changed = true; > ++NumFnDeleted; > - } else if (F->hasInternalLinkage()) { > + } else if (F->hasLocalLinkage()) { > if (F->getCallingConv() == CallingConv::C && !F->isVarArg() && > OnlyCalledDirectly(F)) { > // If this function has C calling conventions, is not a varargs > @@ -1843,7 +1843,7 @@ > for (Module::global_iterator GVI = M.global_begin(), E = M.global_end(); > GVI != E; ) { > GlobalVariable *GV = GVI++; > - if (!GV->isConstant() && GV->hasInternalLinkage() && > + if (!GV->isConstant() && GV->hasLocalLinkage() && > GV->hasInitializer()) > Changed |= ProcessInternalGlobal(GV, GVI); > } > @@ -1982,7 +1982,7 @@ > /// globals. This should be kept up to date with CommitValueTo. > static bool isSimpleEnoughPointerToCommit(Constant *C) { > if (GlobalVariable *GV = dyn_cast(C)) { > - if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage()) > + if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) > return false; // do not allow weak/linkonce/dllimport/dllexport linkage. > return !GV->isDeclaration(); // reject external globals. > } > @@ -1991,7 +1991,7 @@ > if (CE->getOpcode() == Instruction::GetElementPtr && > isa(CE->getOperand(0))) { > GlobalVariable *GV = cast(CE->getOperand(0)); > - if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage()) > + if (!GV->hasExternalLinkage() && !GV->hasLocalLinkage()) > return false; // do not allow weak/linkonce/dllimport/dllexport linkage. > return GV->hasInitializer() && > ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE); > > Modified: llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Jan 15 14:18:42 2009 > @@ -63,7 +63,7 @@ > if (!I->isDeclaration()) { > // Delete any klingons. > I->removeDeadConstantUsers(); > - if (I->hasInternalLinkage()) > + if (I->hasLocalLinkage()) > LocalChange |= PropagateConstantsIntoArguments(*I); > Changed |= PropagateConstantReturn(*I); > } > > Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Thu Jan 15 14:18:42 2009 > @@ -68,7 +68,7 @@ > > // If we inlined the last possible call site to the function, delete the > // function body now. > - if (Callee->use_empty() && Callee->hasInternalLinkage() && > + if (Callee->use_empty() && Callee->hasLocalLinkage() && > !SCCFunctions.count(Callee)) { > DOUT << " -> Deleting dead function: " << Callee->getName() << "\n"; > CallGraphNode *CalleeNode = CG[Callee]; > @@ -240,7 +240,7 @@ > if (DNR && DNR->count(F)) > continue; > > - if ((F->hasLinkOnceLinkage() || F->hasInternalLinkage()) && > + if ((F->hasLinkOnceLinkage() || F->hasLocalLinkage()) && > F->use_empty()) { > > // Remove any call graph edges from the function to its callees. > > Modified: llvm/trunk/lib/Transforms/IPO/Internalize.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Internalize.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/Internalize.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/Internalize.cpp Thu Jan 15 14:18:42 2009 > @@ -121,9 +121,10 @@ > bool Changed = false; > > // Mark all functions not in the api as internal. > + // FIXME: maybe use private linkage? > for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) > if (!I->isDeclaration() && // Function must be defined here > - !I->hasInternalLinkage() && // Can't already have internal linkage > + !I->hasLocalLinkage() && // Can't already have internal linkage > !ExternalNames.count(I->getName())) {// Not marked to keep external? > I->setLinkage(GlobalValue::InternalLinkage); > // Remove a callgraph edge from the external node to this function. > @@ -149,9 +150,10 @@ > > // Mark all global variables with initializers that are not in the api as > // internal as well. > + // FIXME: maybe use private linkage? > for (Module::global_iterator I = M.global_begin(), E = M.global_end(); > I != E; ++I) > - if (!I->isDeclaration() && !I->hasInternalLinkage() && > + if (!I->isDeclaration() && !I->hasLocalLinkage() && > !ExternalNames.count(I->getName())) { > I->setLinkage(GlobalValue::InternalLinkage); > Changed = true; > > Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Thu Jan 15 14:18:42 2009 > @@ -245,7 +245,7 @@ > Function *G = FnVec[j]; > > if (!F->mayBeOverridden()) { > - if (G->hasInternalLinkage()) { > + if (G->hasLocalLinkage()) { > F->setAlignment(std::max(F->getAlignment(), G->getAlignment())); > G->replaceAllUsesWith(F); > G->eraseFromParent(); > @@ -329,7 +329,7 @@ > if (F->isDeclaration() || F->isIntrinsic()) > continue; > > - if (!F->hasInternalLinkage() && !F->hasExternalLinkage() && > + if (!F->hasLocalLinkage() && !F->hasExternalLinkage() && > !F->hasWeakLinkage()) > continue; > > > Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Jan 15 14:18:42 2009 > @@ -95,7 +95,7 @@ > OnlyUsedBy(C->getOperand(i), C)) > Operands.insert(C->getOperand(i)); > if (GlobalVariable *GV = dyn_cast(C)) { > - if (!GV->hasInternalLinkage()) return; // Don't delete non static globals. > + if (!GV->hasLocalLinkage()) return; // Don't delete non static globals. > GV->eraseFromParent(); > } > else if (!isa(C)) > @@ -114,7 +114,7 @@ > for (ValueSymbolTable::iterator VI = ST.begin(), VE = ST.end(); VI != VE; ) { > Value *V = VI->getValue(); > ++VI; > - if (!isa(V) || cast(V)->hasInternalLinkage()) { > + if (!isa(V) || cast(V)->hasLocalLinkage()) { > if (!PreserveDbgInfo || strncmp(V->getNameStart(), "llvm.dbg", 8)) > // Set name to "", removing from symbol table! > V->setName(""); > @@ -162,13 +162,13 @@ > > for (Module::global_iterator I = M.global_begin(), E = M.global_end(); > I != E; ++I) { > - if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0) > + if (I->hasLocalLinkage() && llvmUsedValues.count(I) == 0) > if (!PreserveDbgInfo || strncmp(I->getNameStart(), "llvm.dbg", 8)) > I->setName(""); // Internal symbols can't participate in linkage > } > > for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { > - if (I->hasInternalLinkage() && llvmUsedValues.count(I) == 0) > + if (I->hasLocalLinkage() && llvmUsedValues.count(I) == 0) > if (!PreserveDbgInfo || strncmp(I->getNameStart(), "llvm.dbg", 8)) > I->setName(""); // Internal symbols can't participate in linkage > StripSymtab(I->getValueSymbolTable(), PreserveDbgInfo); > @@ -268,6 +268,7 @@ > > // llvm.dbg.compile_units and llvm.dbg.subprograms are marked as linkonce > // but since we are removing all debug information, make them internal now. > + // FIXME: Use private linkage maybe? > if (Constant *C = M.getNamedGlobal("llvm.dbg.compile_units")) > if (GlobalVariable *GV = dyn_cast(C)) > GV->setLinkage(GlobalValue::InternalLinkage); > @@ -299,7 +300,7 @@ > Constant *C = DeadConstants.back(); > DeadConstants.pop_back(); > if (GlobalVariable *GV = dyn_cast(C)) { > - if (GV->hasInternalLinkage()) > + if (GV->hasLocalLinkage()) > RemoveDeadConstant(GV); > } > else > @@ -329,4 +330,3 @@ > bool StripNonDebugSymbols::runOnModule(Module &M) { > return StripSymbolNames(M, true); > } > - > > Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original) > +++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Thu Jan 15 14:18:42 2009 > @@ -82,7 +82,7 @@ > bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) { > Function *F = CGN->getFunction(); > > - if (!F || F->isDeclaration() || !F->hasInternalLinkage()) > + if (!F || F->isDeclaration() || !F->hasLocalLinkage()) > return false; > > // Make sure that function returns struct. > > Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original) > +++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Thu Jan 15 14:18:42 2009 > @@ -203,7 +203,7 @@ > /// and out of the specified function (which cannot have its address taken), > /// this method must be called. > void AddTrackedFunction(Function *F) { > - assert(F->hasInternalLinkage() && "Can only track internal functions!"); > + assert(F->hasLocalLinkage() && "Can only track internal functions!"); > // Add an entry, F -> undef. > if (const StructType *STy = dyn_cast(F->getReturnType())) { > for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) > @@ -609,7 +609,7 @@ > > Function *F = I.getParent()->getParent(); > // If we are tracking the return value of this function, merge it in. > - if (!F->hasInternalLinkage()) > + if (!F->hasLocalLinkage()) > return; > > if (!TrackedRetVals.empty() && I.getNumOperands() == 1) { > @@ -1170,7 +1170,7 @@ > // The common case is that we aren't tracking the callee, either because we > // are not doing interprocedural analysis or the callee is indirect, or is > // external. Handle these cases first. > - if (F == 0 || !F->hasInternalLinkage()) { > + if (F == 0 || !F->hasLocalLinkage()) { > CallOverdefined: > // Void return and not tracking callee, just bail. > if (I->getType() == Type::VoidTy) return; > @@ -1656,7 +1656,7 @@ > // taken or that are external as overdefined. > // > for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) > - if (!F->hasInternalLinkage() || AddressIsTaken(F)) { > + if (!F->hasLocalLinkage() || AddressIsTaken(F)) { > if (!F->isDeclaration()) > Solver.MarkBlockExecutable(F->begin()); > for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); > @@ -1671,7 +1671,7 @@ > // their addresses taken, we can propagate constants through them. > for (Module::global_iterator G = M.global_begin(), E = M.global_end(); > G != E; ++G) > - if (!G->isConstant() && G->hasInternalLinkage() && !AddressIsTaken(G)) > + if (!G->isConstant() && G->hasLocalLinkage() && !AddressIsTaken(G)) > Solver.TrackValueOfGlobalVariable(G); > > // Solve for constants. > > Modified: llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/BasicInliner.cpp Thu Jan 15 14:18:42 2009 > @@ -130,7 +130,7 @@ > > // Inline > if (InlineFunction(CS, NULL, TD)) { > - if (Callee->use_empty() && Callee->hasInternalLinkage()) > + if (Callee->use_empty() && Callee->hasLocalLinkage()) > DeadFunctions.insert(Callee); > Changed = true; > CallSites.erase(CallSites.begin() + index); > > Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Thu Jan 15 14:18:42 2009 > @@ -199,7 +199,7 @@ > // If there is only one call of the function, and it has internal linkage, > // make it almost guaranteed to be inlined. > // > - if (Callee->hasInternalLinkage() && Callee->hasOneUse()) > + if (Callee->hasLocalLinkage() && Callee->hasOneUse()) > InlineCost -= 15000; > > // If this function uses the coldcc calling convention, prefer not to inline > > Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) > +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Jan 15 14:18:42 2009 > @@ -1149,6 +1149,7 @@ > > static void PrintLinkage(GlobalValue::LinkageTypes LT, raw_ostream &Out) { > switch (LT) { > + case GlobalValue::PrivateLinkage: Out << "private "; break; > case GlobalValue::InternalLinkage: Out << "internal "; break; > case GlobalValue::LinkOnceLinkage: Out << "linkonce "; break; > case GlobalValue::WeakLinkage: Out << "weak "; break; > > Modified: llvm/trunk/lib/VMCore/Mangler.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Mangler.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/VMCore/Mangler.cpp (original) > +++ llvm/trunk/lib/VMCore/Mangler.cpp Thu Jan 15 14:18:42 2009 > @@ -147,14 +147,20 @@ > Name = "__unnamed_" + utostr(TypeUniqueID) + "_" + utostr(GlobalID++); > } else { > Name = makeNameProper(GV->getName() + Suffix, Prefix); > + std::string prefix; > + if (GV->hasPrivateLinkage()) > + prefix = PrivatePrefix; > + else > + prefix = ""; > + Name = prefix + Name; > } > > return Name; > } > > -Mangler::Mangler(Module &M, const char *prefix) > - : Prefix(prefix), UseQuotes(false), PreserveAsmNames(false), > - Count(0), TypeCounter(0) { > +Mangler::Mangler(Module &M, const char *prefix, const char *privatePrefix) > + : Prefix(prefix), PrivatePrefix (privatePrefix), UseQuotes(false), > + PreserveAsmNames(false), Count(0), TypeCounter(0) { > std::fill(AcceptableChars, array_endof(AcceptableChars), 0); > > // Letters and numbers are acceptable. > > Modified: llvm/trunk/lib/VMCore/Module.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/VMCore/Module.cpp (original) > +++ llvm/trunk/lib/VMCore/Module.cpp Thu Jan 15 14:18:42 2009 > @@ -153,7 +153,7 @@ > } > > // Okay, the function exists. Does it have externally visible linkage? > - if (F->hasInternalLinkage()) { > + if (F->hasLocalLinkage()) { > // Clear the function's name. > F->setName(""); > // Retry, now there won't be a conflict. > @@ -238,14 +238,14 @@ > /// symbol table. If it does not exist, return null. The type argument > /// should be the underlying type of the global, i.e., it should not have > /// the top-level PointerType, which represents the address of the global. > -/// If AllowInternal is set to true, this function will return types that > -/// have InternalLinkage. By default, these types are not returned. > +/// If AllowLocal is set to true, this function will return types that > +/// have an local. By default, these types are not returned. > /// > GlobalVariable *Module::getGlobalVariable(const std::string &Name, > - bool AllowInternal) const { > + bool AllowLocal) const { > if (Value *V = ValSymTab->lookup(Name)) { > GlobalVariable *Result = dyn_cast(V); > - if (Result && (AllowInternal || !Result->hasInternalLinkage())) > + if (Result && (AllowLocal || !Result->hasLocalLinkage())) > return Result; > } > return 0; > @@ -376,4 +376,3 @@ > return; > } > } > - > > Modified: llvm/trunk/lib/VMCore/Verifier.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/lib/VMCore/Verifier.cpp (original) > +++ llvm/trunk/lib/VMCore/Verifier.cpp Thu Jan 15 14:18:42 2009 > @@ -350,7 +350,7 @@ > GV.hasExternalWeakLinkage() || > GV.hasGhostLinkage() || > (isa(GV) && > - (GV.hasInternalLinkage() || GV.hasWeakLinkage())), > + (GV.hasLocalLinkage() || GV.hasWeakLinkage())), > "Global is external, but doesn't have external or dllimport or weak linkage!", > &GV); > > @@ -384,7 +384,7 @@ > void Verifier::visitGlobalAlias(GlobalAlias &GA) { > Assert1(!GA.getName().empty(), > "Alias name cannot be empty!", &GA); > - Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() || > + Assert1(GA.hasExternalLinkage() || GA.hasLocalLinkage() || > GA.hasWeakLinkage(), > "Alias should have external or external weak linkage!", &GA); > Assert1(GA.getAliasee(), > > Added: llvm/trunk/test/Assembler/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/Assembler/private.ll (added) > +++ llvm/trunk/test/Assembler/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,9 @@ > +; Test to make sure that the 'private' tag is not lost! > +; > +; RUN: llvm-as < %s | llvm-dis | grep private > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > > Added: llvm/trunk/test/CodeGen/ARM/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/ARM/private.ll (added) > +++ llvm/trunk/test/CodeGen/ARM/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,22 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi > %t > +; RUN: grep .Lfoo: %t > +; RUN: egrep bl.*\.Lfoo %t > +; RUN: grep .Lbaz: %t > +; RUN: grep long.*\.Lbaz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > + > > Added: llvm/trunk/test/CodeGen/Alpha/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/Alpha/private.ll (added) > +++ llvm/trunk/test/CodeGen/Alpha/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc > %t > +; RUN: grep .Lfoo: %t > +; RUN: grep call.*\.Lfoo %t > +; RUN: grep .Lbaz: %t > +; RUN: grep movl.*\.Lbaz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/CellSPU/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/private.ll (added) > +++ llvm/trunk/test/CodeGen/CellSPU/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,22 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -march=cellspu > %t > +; RUN: grep .Lfoo: %t > +; RUN: grep brsl.*\.Lfoo %t > +; RUN: grep .Lbaz: %t > +; RUN: grep ila.*\.Lbaz %t > + > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/IA64/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/IA64/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/IA64/private.ll (added) > +++ llvm/trunk/test/CodeGen/IA64/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -march=ia64 > %t > +; RUN: grep .foo: %t > +; RUN: grep br.call.sptk.*\.foo %t > +; RUN: grep .baz: %t > +; RUN: grep ltoff.*\.baz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/Mips/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/Mips/private.ll (added) > +++ llvm/trunk/test/CodeGen/Mips/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -march=mips > %t > +; RUN: grep \\\$foo: %t > +; RUN: grep call.*\\\$foo %t > +; RUN: grep \\\$baz: %t > +; RUN: grep lw.*\\\$baz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/PowerPC/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/PowerPC/private.ll (added) > +++ llvm/trunk/test/CodeGen/PowerPC/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -mtriple=powerpc-unknown-linux-gnu > %t > +; RUN: grep .Lfoo: %t > +; RUN: grep bl.*\.Lfoo %t > +; RUN: grep .Lbaz: %t > +; RUN: grep lis.*\.Lbaz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/SPARC/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/SPARC/private.ll (added) > +++ llvm/trunk/test/CodeGen/SPARC/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -march=sparc > %t > +; RUN: grep .foo: %t > +; RUN: grep call.*\.foo %t > +; RUN: grep .baz: %t > +; RUN: grep ld.*\.baz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/X86/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/private.ll (added) > +++ llvm/trunk/test/CodeGen/X86/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,20 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep .Lfoo: > +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep call.*\.Lfoo > +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep .Lbaz: > +; RUN: llvm-as < %s | llc -mtriple=x86_64-pc-linux | grep movl.*\.Lbaz > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Added: llvm/trunk/test/CodeGen/XCore/private.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/private.ll?rev=62279&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/XCore/private.ll (added) > +++ llvm/trunk/test/CodeGen/XCore/private.ll Thu Jan 15 14:18:42 2009 > @@ -0,0 +1,21 @@ > +; Test to make sure that the 'private' is used correctly. > +; > +; RUN: llvm-as < %s | llc -march=xcore > %t > +; RUN: grep .Lfoo: %t > +; RUN: grep bl.*\.Lfoo %t > +; RUN: grep .Lbaz: %t > +; RUN: grep ldw.*\.Lbaz %t > + > +declare void @foo() > + > +define private void @foo() { > + ret void > +} > + > + at baz = private global i32 4; > + > +define i32 @bar() { > + call void @foo() > + %1 = load i32* @baz, align 4 > + ret i32 %1 > +} > > Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original) > +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Thu Jan 15 14:18:42 2009 > @@ -199,7 +199,7 @@ > /// prune appropriate entries out of M1s list. > static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2){ > GlobalVariable *GV = M1->getNamedGlobal(GlobalName); > - if (!GV || GV->isDeclaration() || GV->hasInternalLinkage() || > + if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() || > !GV->use_empty()) return; > > std::vector > M1Tors, M2Tors; > > Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=62279&r1=62278&r2=62279&view=diff > > ============================================================================== > --- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original) > +++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Thu Jan 15 14:18:42 2009 > @@ -68,6 +68,7 @@ > } > > static char TypeCharForSymbol(GlobalValue &GV) { > + /* FIXME: what to do with private linkage? */ > if (GV.isDeclaration()) return 'U'; > if (GV.hasLinkOnceLinkage()) return 'C'; > if (GV.hasCommonLinkage()) return 'C'; > @@ -91,7 +92,7 @@ > return; > if ((TypeChar == 'U') && DefinedOnly) > return; > - if (GV.hasInternalLinkage () && ExternalOnly) > + if (GV.hasLocalLinkage () && ExternalOnly) > return; > if (OutputFormat == posix) { > std::cout << GV.getName () << " " << TypeCharForSymbol (GV) << " " > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From foldr at codedgers.com Fri Jan 16 00:42:00 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 16 Jan 2009 07:42:00 +0100 Subject: [llvm-commits] [PATCH 2/2] Registry.h should not depend on CommandLine.h. In-Reply-To: <1232088120-15582-1-git-send-email-foldr@codedgers.com> References: <1232088120-15582-1-git-send-email-foldr@codedgers.com> Message-ID: <1232088120-15582-2-git-send-email-foldr@codedgers.com> Split Support/Registry.h into two files so that we have less to recompile every time CommandLine.h is changed. --- include/llvm/Support/Registry.h | 30 +------------ include/llvm/Support/RegistryParser.h | 55 ++++++++++++++++++++++++ include/llvm/Target/TargetMachineRegistry.h | 1 + lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 1 + lib/CodeGen/OcamlGC.cpp | 1 + lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 1 + lib/CodeGen/ShadowStackGC.cpp | 1 + lib/ExecutionEngine/JIT/TargetSelect.cpp | 3 +- tools/llc/llc.cpp | 5 +- 9 files changed, 66 insertions(+), 32 deletions(-) create mode 100644 include/llvm/Support/RegistryParser.h diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index 5a7d7fa..454679b 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -14,8 +14,6 @@ #ifndef LLVM_SUPPORT_REGISTRY_H #define LLVM_SUPPORT_REGISTRY_H -#include "llvm/Support/CommandLine.h" - namespace llvm { /// A simple registry entry which provides only a name, description, and /// no-argument constructor. @@ -204,33 +202,7 @@ namespace llvm { : Entry(Name, Desc, CtorFn), Node(Entry) {} }; - - /// A command-line parser for a registry. Use like such: - /// - /// static cl::opt::entry, false, - /// Registry::Parser> - /// GCOpt("gc", cl::desc("Garbage collector to use."), - /// cl::value_desc()); - /// - /// To make use of the value: - /// - /// Collector *TheCollector = GCOpt->instantiate(); - /// - class Parser : public cl::parser, public listener{ - typedef U traits; - typedef typename U::entry entry; - - protected: - void registered(const entry &E) { - addLiteralOption(traits::nameof(E), &E, traits::descof(E)); - } - - public: - void initialize(cl::Option &O) { - listener::init(); - cl::parser::initialize(O); - } - }; + /// Registry::Parser now lives in llvm/Support/RegistryParser.h. }; diff --git a/include/llvm/Support/RegistryParser.h b/include/llvm/Support/RegistryParser.h new file mode 100644 index 0000000..2cc5783 --- /dev/null +++ b/include/llvm/Support/RegistryParser.h @@ -0,0 +1,55 @@ +//=== RegistryParser.h - Linker-supported plugin registries -----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Defines a command-line parser for a registry. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_SUPPORT_REGISTRY_PARSER_H +#define LLVM_SUPPORT_REGISTRY_PARSER_H + +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/Registry.h" + +namespace llvm { + + /// A command-line parser for a registry. Use like such: + /// + /// static cl::opt::entry, false, + /// RegistryParser > + /// GCOpt("gc", cl::desc("Garbage collector to use."), + /// cl::value_desc()); + /// + /// To make use of the value: + /// + /// Collector *TheCollector = GCOpt->instantiate(); + /// + template > + class RegistryParser : + public cl::parser, + public Registry::listener { + typedef U traits; + typedef typename U::entry entry; + typedef typename Registry::listener listener; + + protected: + void registered(const entry &E) { + addLiteralOption(traits::nameof(E), &E, traits::descof(E)); + } + + public: + void initialize(cl::Option &O) { + listener::init(); + cl::parser::initialize(O); + } + }; + +} + +#endif // LLVM_SUPPORT_REGISTRY_PARSER_H diff --git a/include/llvm/Target/TargetMachineRegistry.h b/include/llvm/Target/TargetMachineRegistry.h index d143085..b7ea448 100644 --- a/include/llvm/Target/TargetMachineRegistry.h +++ b/include/llvm/Target/TargetMachineRegistry.h @@ -17,6 +17,7 @@ #ifndef LLVM_TARGET_TARGETMACHINEREGISTRY_H #define LLVM_TARGET_TARGETMACHINEREGISTRY_H +#include "llvm/Module.h" #include "llvm/Support/Registry.h" namespace llvm { diff --git a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp index d2e8d00..8ba903a 100644 --- a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -15,6 +15,7 @@ #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/Module.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" diff --git a/lib/CodeGen/OcamlGC.cpp b/lib/CodeGen/OcamlGC.cpp index 5c6e29a..f7bc9f3 100644 --- a/lib/CodeGen/OcamlGC.cpp +++ b/lib/CodeGen/OcamlGC.cpp @@ -16,6 +16,7 @@ #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/GCStrategy.h" +#include "llvm/Support/Compiler.h" using namespace llvm; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 6dc45bd..7dc64e0 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -47,6 +47,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/Compiler.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/CodeGen/ShadowStackGC.cpp b/lib/CodeGen/ShadowStackGC.cpp index 472bd37..5a55760 100644 --- a/lib/CodeGen/ShadowStackGC.cpp +++ b/lib/CodeGen/ShadowStackGC.cpp @@ -31,6 +31,7 @@ #include "llvm/CodeGen/GCStrategy.h" #include "llvm/IntrinsicInst.h" #include "llvm/Module.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/IRBuilder.h" using namespace llvm; diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp index ce646b2..98819c1 100644 --- a/lib/ExecutionEngine/JIT/TargetSelect.cpp +++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp @@ -15,6 +15,7 @@ #include "JIT.h" #include "llvm/Module.h" #include "llvm/ModuleProvider.h" +#include "llvm/Support/RegistryParser.h" #include "llvm/Support/Streams.h" #include "llvm/Target/SubtargetFeature.h" #include "llvm/Target/TargetMachine.h" @@ -22,7 +23,7 @@ using namespace llvm; static cl::opt + RegistryParser > MArch("march", cl::desc("Architecture to generate assembly for:")); static cl::opt diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 60adc83..087a770 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -27,10 +27,11 @@ #include "llvm/PassManager.h" #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileUtilities.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PluginLoader.h" -#include "llvm/Support/FileUtilities.h" +#include "llvm/Support/RegistryParser.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Analysis/Verifier.h" #include "llvm/System/Signals.h" @@ -60,7 +61,7 @@ static cl::opt TargetTriple("mtriple", cl::desc("Override target triple for module")); static cl::opt + RegistryParser > MArch("march", cl::desc("Architecture to generate code for:")); static cl::opt -- 1.6.1 From foldr at codedgers.com Fri Jan 16 00:41:59 2009 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Fri, 16 Jan 2009 07:41:59 +0100 Subject: [llvm-commits] [PATCH 1/2] Delete trailing whitespace. In-Reply-To: References: Message-ID: <1232088120-15582-1-git-send-email-foldr@codedgers.com> --- include/llvm/Support/Registry.h | 132 ++++---- include/llvm/Target/TargetMachineRegistry.h | 16 +- lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 46 ++-- lib/CodeGen/OcamlGC.cpp | 4 +- lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 468 ++++++++++++------------ lib/CodeGen/ShadowStackGC.cpp | 128 ++++---- lib/ExecutionEngine/JIT/TargetSelect.cpp | 4 +- tools/llc/llc.cpp | 42 +- 8 files changed, 420 insertions(+), 420 deletions(-) diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index c9fb0a1..5a7d7fa 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // // Defines a registry template for discovering pluggable modules. -// +// //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_REGISTRY_H @@ -23,34 +23,34 @@ namespace llvm { class SimpleRegistryEntry { const char *Name, *Desc; T *(*Ctor)(); - + public: SimpleRegistryEntry(const char *N, const char *D, T *(*C)()) : Name(N), Desc(D), Ctor(C) {} - + const char *getName() const { return Name; } const char *getDesc() const { return Desc; } T *instantiate() const { return Ctor(); } }; - - + + /// Traits for registry entries. If using other than SimpleRegistryEntry, it /// is necessary to define an alternate traits class. template class RegistryTraits { RegistryTraits(); // Do not implement. - + public: typedef SimpleRegistryEntry entry; - + /// nameof/descof - Accessors for name and description of entries. These are // used to generate help for command-line options. static const char *nameof(const entry &Entry) { return Entry.getName(); } static const char *descof(const entry &Entry) { return Entry.getDesc(); } }; - - + + /// A global registry used in conjunction with static constructors to make /// pluggable components (like targets or garbage collectors) "just work" when /// linked with an executable. @@ -59,37 +59,37 @@ namespace llvm { public: typedef U traits; typedef typename U::entry entry; - + class node; class listener; class iterator; - + private: Registry(); // Do not implement. - + static void Announce(const entry &E) { for (listener *Cur = ListenerHead; Cur; Cur = Cur->Next) Cur->registered(E); } - + friend class node; static node *Head, *Tail; - + friend class listener; static listener *ListenerHead, *ListenerTail; - + public: class iterator; - - + + /// Node in linked list of entries. - /// + /// class node { friend class iterator; - + node *Next; const entry& Val; - + public: node(const entry& V) : Next(0), Val(V) { if (Tail) @@ -97,63 +97,63 @@ namespace llvm { else Head = this; Tail = this; - + Announce(V); } }; - - + + /// Iterators for registry entries. - /// + /// class iterator { const node *Cur; - + public: explicit iterator(const node *N) : Cur(N) {} - + bool operator==(const iterator &That) const { return Cur == That.Cur; } bool operator!=(const iterator &That) const { return Cur != That.Cur; } iterator &operator++() { Cur = Cur->Next; return *this; } const entry &operator*() const { return Cur->Val; } const entry *operator->() const { return &Cur->Val; } }; - + static iterator begin() { return iterator(Head); } static iterator end() { return iterator(0); } - - + + /// Abstract base class for registry listeners, which are informed when new /// entries are added to the registry. Simply subclass and instantiate: - /// + /// /// class CollectorPrinter : public Registry::listener { /// protected: /// void registered(const Registry::entry &e) { /// cerr << "collector now available: " << e->getName() << "\n"; /// } - /// + /// /// public: /// CollectorPrinter() { init(); } // Print those already registered. /// }; - /// + /// /// CollectorPrinter Printer; - /// + /// class listener { listener *Prev, *Next; - + friend void Registry::Announce(const entry &E); - + protected: /// Called when an entry is added to the registry. - /// + /// virtual void registered(const entry &) = 0; - + /// Calls 'registered' for each pre-existing entry. - /// + /// void init() { for (iterator I = begin(), E = end(); I != E; ++I) registered(*I); } - + public: listener() : Prev(ListenerTail), Next(0) { if (Prev) @@ -162,7 +162,7 @@ namespace llvm { ListenerHead = this; ListenerTail = this; } - + virtual ~listener() { if (Next) Next->Prev = Prev; @@ -174,79 +174,79 @@ namespace llvm { ListenerHead = Next; } }; - - + + /// A static registration template. Use like such: - /// + /// /// Registry::Add /// X("fancy-gc", "Newfangled garbage collector."); - /// + /// /// Use of this template requires that: - /// + /// /// 1. The registered subclass has a default constructor. - // + // /// 2. The registry entry type has a constructor compatible with this /// signature: - /// + /// /// entry(const char *Name, const char *ShortDesc, T *(*Ctor)()); - /// + /// /// If you have more elaborate requirements, then copy and modify. - /// + /// template class Add { entry Entry; node Node; - + static T *CtorFn() { return new V(); } - + public: Add(const char *Name, const char *Desc) : Entry(Name, Desc, CtorFn), Node(Entry) {} }; - - + + /// A command-line parser for a registry. Use like such: - /// + /// /// static cl::opt::entry, false, /// Registry::Parser> /// GCOpt("gc", cl::desc("Garbage collector to use."), /// cl::value_desc()); - /// + /// /// To make use of the value: - /// + /// /// Collector *TheCollector = GCOpt->instantiate(); - /// + /// class Parser : public cl::parser, public listener{ typedef U traits; typedef typename U::entry entry; - + protected: void registered(const entry &E) { addLiteralOption(traits::nameof(E), &E, traits::descof(E)); } - + public: void initialize(cl::Option &O) { listener::init(); cl::parser::initialize(O); } }; - + }; - - + + template typename Registry::node *Registry::Head; - + template typename Registry::node *Registry::Tail; - + template typename Registry::listener *Registry::ListenerHead; - + template typename Registry::listener *Registry::ListenerTail; - + } #endif diff --git a/include/llvm/Target/TargetMachineRegistry.h b/include/llvm/Target/TargetMachineRegistry.h index 2607ad5..d143085 100644 --- a/include/llvm/Target/TargetMachineRegistry.h +++ b/include/llvm/Target/TargetMachineRegistry.h @@ -22,14 +22,14 @@ namespace llvm { class Module; class TargetMachine; - + struct TargetMachineRegistryEntry { const char *Name; const char *ShortDesc; TargetMachine *(*CtorFn)(const Module &, const std::string &); unsigned (*ModuleMatchQualityFn)(const Module &M); unsigned (*JITMatchQualityFn)(); - + public: TargetMachineRegistryEntry(const char *N, const char *SD, TargetMachine *(*CF)(const Module &, const std::string &), @@ -38,12 +38,12 @@ namespace llvm { : Name(N), ShortDesc(SD), CtorFn(CF), ModuleMatchQualityFn(MMF), JITMatchQualityFn(JMF) {} }; - + template<> class RegistryTraits { public: typedef TargetMachineRegistryEntry entry; - + static const char *nameof(const entry &Entry) { return Entry.Name; } static const char *descof(const entry &Entry) { return Entry.ShortDesc; } }; @@ -67,12 +67,12 @@ namespace llvm { /// themselves with the tool they are linked. Targets should define an /// instance of this and implement the static methods described in the /// TargetMachine comments. - /// The type 'TargetMachineImpl' should provide a constructor with two + /// The type 'TargetMachineImpl' should provide a constructor with two /// parameters: /// - const Module& M: the module that is being compiled: - /// - const std::string& FS: target-specific string describing target + /// - const std::string& FS: target-specific string describing target /// flavour. - + template struct RegisterTarget { RegisterTarget(const char *Name, const char *ShortDesc) @@ -85,7 +85,7 @@ namespace llvm { private: TargetMachineRegistry::entry Entry; TargetMachineRegistry::node Node; - + static TargetMachine *Allocator(const Module &M, const std::string &FS) { return new TargetMachineImpl(M, FS); } diff --git a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp index 4e42df5..d2e8d00 100644 --- a/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -10,7 +10,7 @@ // This file implements printing the assembly code for an Ocaml frametable. // //===----------------------------------------------------------------------===// - + #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" @@ -28,11 +28,11 @@ namespace { public: void beginAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); - + void finishAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI); }; - + } static GCMetadataPrinterRegistry::Add @@ -43,7 +43,7 @@ void llvm::linkOcamlGCPrinter() { } static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI, const char *Id) { const std::string &MId = M.getModuleIdentifier(); - + std::string Mangled; Mangled += TAI.getGlobalPrefix(); Mangled += "caml"; @@ -51,10 +51,10 @@ static void EmitCamlGlobal(const Module &M, raw_ostream &OS, AsmPrinter &AP, Mangled.append(MId.begin(), std::find(MId.begin(), MId.end(), '.')); Mangled += "__"; Mangled += Id; - + // Capitalize the first letter of the module name. Mangled[Letter] = toupper(Mangled[Letter]); - + if (const char *GlobalDirective = TAI.getGlobalDirective()) OS << GlobalDirective << Mangled << "\n"; OS << Mangled << ":\n"; @@ -64,13 +64,13 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI) { AP.SwitchToSection(TAI.getTextSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_begin"); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "data_begin"); } /// emitAssembly - Print the frametable. The ocaml frametable format is thus: -/// +/// /// extern "C" struct align(sizeof(intptr_t)) { /// uint16_t NumDescriptors; /// struct align(sizeof(intptr_t)) { @@ -80,11 +80,11 @@ void OcamlGCMetadataPrinter::beginAssembly(raw_ostream &OS, AsmPrinter &AP, /// uint16_t LiveOffsets[NumLiveOffsets]; /// } Descriptors[NumDescriptors]; /// } caml${module}__frametable; -/// +/// /// Note that this precludes programs from stack frames larger than 64K /// (FrameSize and LiveOffsets would overflow). FrameTablePrinter will abort if /// either condition is detected in a function which uses the GC. -/// +/// void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, const TargetAsmInfo &TAI) { const char *AddressDirective; @@ -99,19 +99,19 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, AP.SwitchToSection(TAI.getTextSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "code_end"); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "data_end"); - + OS << AddressDirective << 0; // FIXME: Why does ocaml emit this?? AP.EOL(); - + AP.SwitchToSection(TAI.getDataSection()); EmitCamlGlobal(getModule(), OS, AP, TAI, "frametable"); - + for (iterator I = begin(), IE = end(); I != IE; ++I) { GCFunctionInfo &FI = **I; - + uint64_t FrameSize = FI.getFrameSize(); if (FrameSize >= 1<<16) { cerr << "Function '" << FI.getFunction().getNameStart() @@ -120,10 +120,10 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, cerr << "(" << uintptr_t(&FI) << ")\n"; abort(); // Very rude! } - + OS << "\t" << TAI.getCommentString() << " live roots for " << FI.getFunction().getNameStart() << "\n"; - + for (GCFunctionInfo::iterator J = FI.begin(), JE = FI.end(); J != JE; ++J) { size_t LiveCount = FI.live_size(J); if (LiveCount >= 1<<16) { @@ -132,27 +132,27 @@ void OcamlGCMetadataPrinter::finishAssembly(raw_ostream &OS, AsmPrinter &AP, << "Live root count " << LiveCount << " >= 65536.\n"; abort(); // Very rude! } - + OS << AddressDirective << TAI.getPrivateGlobalPrefix() << "label" << J->Num; AP.EOL("call return address"); - + AP.EmitInt16(FrameSize); AP.EOL("stack frame size"); - + AP.EmitInt16(LiveCount); AP.EOL("live root count"); - + for (GCFunctionInfo::live_iterator K = FI.live_begin(J), KE = FI.live_end(J); K != KE; ++K) { assert(K->StackOffset < 1<<16 && "GC root stack offset is outside of fixed stack frame and out " "of range for ocaml GC!"); - + OS << "\t.word\t" << K->StackOffset; AP.EOL("stack offset"); } - + AP.EmitAlignment(AddressAlignLog); } } diff --git a/lib/CodeGen/OcamlGC.cpp b/lib/CodeGen/OcamlGC.cpp index 0b90444..5c6e29a 100644 --- a/lib/CodeGen/OcamlGC.cpp +++ b/lib/CodeGen/OcamlGC.cpp @@ -9,11 +9,11 @@ // // This file implements lowering for the llvm.gc* intrinsics compatible with // Objective Caml 3.10.0, which uses a liveness-accurate static stack map. -// +// // The frametable emitter is in OcamlGCPrinter.cpp. // //===----------------------------------------------------------------------===// - + #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/GCStrategy.h" diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 241ad00..6dc45bd 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -148,7 +148,7 @@ namespace llvm { /// have aggregate-typed registers. The values at this point do not necessarily /// have legal types, so each value may require one or more registers of some /// legal type. - /// + /// struct VISIBILITY_HIDDEN RegsForValue { /// TLI - The TargetLowering object. /// @@ -158,7 +158,7 @@ namespace llvm { /// may need be promoted or synthesized from one or more registers. /// SmallVector ValueVTs; - + /// RegVTs - The value types of the registers. This is the same size as /// ValueVTs and it records, for each value, what the type of the assigned /// register or registers are. (Individual values are never synthesized @@ -169,21 +169,21 @@ namespace llvm { /// it is necessary to have a separate record of the types. /// SmallVector RegVTs; - + /// Regs - This list holds the registers assigned to the values. /// Each legal or promoted value requires one register, and each /// expanded value requires multiple registers. /// SmallVector Regs; - + RegsForValue() : TLI(0) {} - + RegsForValue(const TargetLowering &tli, - const SmallVector ®s, + const SmallVector ®s, MVT regvt, MVT valuevt) : TLI(&tli), ValueVTs(1, valuevt), RegVTs(1, regvt), Regs(regs) {} RegsForValue(const TargetLowering &tli, - const SmallVector ®s, + const SmallVector ®s, const SmallVector ®vts, const SmallVector &valuevts) : TLI(&tli), ValueVTs(valuevts), RegVTs(regvts), Regs(regs) {} @@ -201,7 +201,7 @@ namespace llvm { Reg += NumRegs; } } - + /// append - Add the specified values to this one. void append(const RegsForValue &RHS) { TLI = RHS.TLI; @@ -209,24 +209,24 @@ namespace llvm { RegVTs.append(RHS.RegVTs.begin(), RHS.RegVTs.end()); Regs.append(RHS.Regs.begin(), RHS.Regs.end()); } - - + + /// getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from - /// this value and returns the result as a ValueVTs value. This uses + /// this value and returns the result as a ValueVTs value. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. SDValue getCopyFromRegs(SelectionDAG &DAG, SDValue &Chain, SDValue *Flag) const; /// getCopyToRegs - Emit a series of CopyToReg nodes that copies the - /// specified value into the registers specified by this object. This uses + /// specified value into the registers specified by this object. This uses /// Chain/Flag as the input and updates them for the output Chain/Flag. /// If the Flag pointer is NULL, no flag is used. void getCopyToRegs(SDValue Val, SelectionDAG &DAG, SDValue &Chain, SDValue *Flag) const; - + /// AddInlineAsmOperands - Add this value to the specified inlineasm node - /// operand list. This adds the code marker and includes the number of + /// operand list. This adds the code marker and includes the number of /// values added into it. void AddInlineAsmOperands(unsigned Code, SelectionDAG &DAG, std::vector &Ops) const; @@ -234,7 +234,7 @@ namespace llvm { } /// isUsedOutsideOfDefiningBlock - Return true if this instruction is used by -/// PHI nodes or outside of the basic block that defines it, or used by a +/// PHI nodes or outside of the basic block that defines it, or used by a /// switch or atomic instruction, which may expand to multiple basic blocks. static bool isUsedOutsideOfDefiningBlock(Instruction *I) { if (isa(I)) return true; @@ -291,7 +291,7 @@ void FunctionLoweringInfo::set(Function &fn, MachineFunction &mf, if (Constant