[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp
Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.86 - 1.87 --- Log message: Proper fix for PR1037: http://llvm.org/PR1037 : to determine is a VR is a modref, check 1) whether it is tied to another oeprand, 2) whether is is being tied to by another operand. So the destination operand of a two-address MI can be correctly identified. --- Diffs of the changes: (+4 -2) VirtRegMap.cpp |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.86 llvm/lib/CodeGen/VirtRegMap.cpp:1.87 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.86Thu Dec 7 10:21:19 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Fri Dec 8 02:02:34 2006 @@ -97,7 +97,9 @@ } ModRef MRInfo; - if (TII.getOperandConstraint(OldMI-getOpcode(), OpNo, TOI::TIED_TO)) { + const TargetInstrDescriptor *TID = OldMI-getInstrDescriptor(); + if (TID-getOperandConstraint(OpNo, TOI::TIED_TO) != -1 || + TII.findTiedToSrcOperand(TID, OpNo) != -1) { // Folded a two-address operand. MRInfo = isModRef; } else if (OldMI-getOperand(OpNo).isDef()) { @@ -849,7 +851,7 @@ // If this def is part of a two-address operand, make sure to execute // the store from the correct physical register. unsigned PhysReg; -int TiedOp = TII-findTiedToSrcOperand(MI.getOpcode(), i); +int TiedOp = TII-findTiedToSrcOperand(MI.getInstrDescriptor(), i); if (TiedOp != -1) PhysReg = MI.getOperand(TiedOp).getReg(); else { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocSimple.cpp
Changes in directory llvm/lib/CodeGen: RegAllocSimple.cpp updated: 1.79 - 1.80 --- Log message: findTiedToSrcOperand() changed. --- Diffs of the changes: (+2 -2) RegAllocSimple.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.79 llvm/lib/CodeGen/RegAllocSimple.cpp:1.80 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.79Thu Dec 7 14:28:15 2006 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Fri Dec 8 01:59:51 2006 @@ -198,8 +198,8 @@ unsigned physReg = Virt2PhysRegMap[virtualReg]; if (physReg == 0) { if (op.isDef()) { -int TiedOp = TM-getInstrInfo() - -findTiedToSrcOperand(MI-getOpcode(), i); +int TiedOp = TM-getInstrInfo()- + findTiedToSrcOperand(MI-getInstrDescriptor(), i); if (TiedOp == -1) { physReg = getFreeReg(virtualReg); } else { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/TEST.fourway.Makefile TEST.fourway.report
Changes in directory llvm-test: TEST.fourway.Makefile added (r1.1) TEST.fourway.report added (r1.1) --- Log message: Add a report for comparing time and size of gcc vs llvm-gcc. --- Diffs of the changes: (+147 -0) TEST.fourway.Makefile | 83 ++ TEST.fourway.report | 64 ++ 2 files changed, 147 insertions(+) Index: llvm-test/TEST.fourway.Makefile diff -c /dev/null llvm-test/TEST.fourway.Makefile:1.1 *** /dev/null Fri Dec 8 10:12:25 2006 --- llvm-test/TEST.fourway.Makefile Fri Dec 8 10:12:15 2006 *** *** 0 --- 1,83 + ##===- TEST.fourway.Makefile ---*- Makefile -*-===## + # + # This test tries running the compiler on all of the programs and + # reports on detailed compile time and resulting sizes. + # + ##===--===## + + Output/%.report.$(TEST).txt: + @echo --- + @echo = '$*' Program + @echo --- + + $(PROGRAMS_TO_TEST:%=test.$(TEST).%): \ + test.$(TEST).%: $(LLVMGCC) $(LLVMGXX) $(CC) $(CXX) \ + Output/%.report.$(TEST).txt \ + Output/%.$(TEST).gcc.nodebug \ + Output/%.$(TEST).gcc.debug \ + Output/%.$(TEST).llvmgcc.nodebug \ + Output/%.$(TEST).llvmgcc.debug + @-cat Output/$*.$(TEST).gcc.nodebug + @-cat Output/$*.$(TEST).gcc.debug + @-cat Output/$*.$(TEST).llvmgcc.nodebug + @-cat Output/$*.$(TEST).llvmgcc.debug + + %.cpp: + + %.c: + + Output/%.$(TEST).gcc.nodebug: %.cpp $(CXX) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(CXX) $*.cpp -O0 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/gcc.nodebug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).gcc.debug: %.cpp $(CXX) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(CXX) $*.cpp -O0 -gdwarf-2 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/gcc.debug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).llvmgcc.nodebug: %.cpp $(LLVMGXX) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(LLVMGXX) $*.cpp -O0 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/llvmgcc.nodebug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).llvmgcc.debug: %.cpp $(LLVMGXX) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(LLVMGXX) $*.cpp -O0 -g -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/llvmgcc.debug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).gcc.nodebug: %.c $(CC) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(CC) $*.c -O0 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/gcc.nodebug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).gcc.debug: %.c $(CC) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(CC) $*.c -O0 -gdwarf-2 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/gcc.debug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).llvmgcc.nodebug: %.c $(LLVMGCC) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(LLVMGCC) $*.c -O0 -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/llvmgcc.nodebug/ [EMAIL PROTECTED]) $@ + + Output/%.$(TEST).llvmgcc.debug: %.c $(LLVMGCC) + @-mkdir -p Output + @echo $@ [EMAIL PROTECTED] + @-(time -p $(LLVMGCC) $*.c -O0 -g -c -o [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(size [EMAIL PROTECTED]) 2 [EMAIL PROTECTED] [EMAIL PROTECTED] + @-(sed -e s/$$/llvmgcc.debug/ [EMAIL PROTECTED]) $@ Index: llvm-test/TEST.fourway.report diff -c /dev/null llvm-test/TEST.fourway.report:1.1 *** /dev/null Fri Dec 8 10:12:30 2006 --- llvm-test/TEST.fourway.report Fri Dec 8 10:12:15 2006 *** *** 0 --- 1,64 + ##=== TEST.fourway.report - Report description for llc tests ---*- perl -*-===## + # + # This file defines a report to be generated for the fourway test. + # + ##===--===## + + # Sort by name + $SortCol = 1; +
[llvm-commits] CVS: llvm-test/Makefile.rules
Changes in directory llvm-test: Makefile.rules updated: 1.19 - 1.20 --- Log message: Only add the path to LLVMGCC and LLVMGXX variables if its version 3. Version 4 doesn't need the path set. --- Diffs of the changes: (+2 -0) Makefile.rules |2 ++ 1 files changed, 2 insertions(+) Index: llvm-test/Makefile.rules diff -u llvm-test/Makefile.rules:1.19 llvm-test/Makefile.rules:1.20 --- llvm-test/Makefile.rules:1.19 Sun Dec 3 15:15:49 2006 +++ llvm-test/Makefile.rulesFri Dec 8 11:11:37 2006 @@ -259,8 +259,10 @@ #-- # The LLVM GCC front-end in C and C++ flavors # +ifeq ($(LLVMGCC_MAJVERS),3) LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCC) LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGXX) +endif #-- # The compiled LLVM tools ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html LangRef.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.56 - 1.57 LangRef.html updated: 1.178 - 1.179 --- Log message: Packed Structure Definitions (docs) --- Diffs of the changes: (+39 -2) BytecodeFormat.html |6 +- LangRef.html| 35 ++- 2 files changed, 39 insertions(+), 2 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.56 llvm/docs/BytecodeFormat.html:1.57 --- llvm/docs/BytecodeFormat.html:1.56 Wed Nov 8 14:07:40 2006 +++ llvm/docs/BytecodeFormat.html Fri Dec 8 11:13:00 2006 @@ -862,6 +862,10 @@ td class=td_leftType ID for structure types (14)/td /tr tr + tda href=#uint32_vbruint32_vbr/a/td + td class=td_leftValue 0 if a normal structure, 1 if a packed structure/td +/tr +tr tda href=#zlistzlist/a(a href=#uint24_vbruint24_vbr/a)/td td class=td_leftSlot number of each of the element's fields./td /tr @@ -2166,7 +2170,7 @@ a href=mailto:[EMAIL PROTECTED]Reid Spencer/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr -Last modified: $Date: 2006/11/08 20:07:40 $ +Last modified: $Date: 2006/12/08 17:13:00 $ /address /body /html Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.178 llvm/docs/LangRef.html:1.179 --- llvm/docs/LangRef.html:1.178Wed Dec 6 01:08:07 2006 +++ llvm/docs/LangRef.html Fri Dec 8 11:13:00 2006 @@ -40,6 +40,7 @@ lia href=#t_functionFunction Type/a/li lia href=#t_pointerPointer Type/a/li lia href=#t_structStructure Type/a/li + lia href=#t_pstructPacked Structure Type/a/li lia href=#t_packedPacked Type/a/li lia href=#t_opaqueOpaque Type/a/li /ol @@ -933,6 +934,38 @@ /div !-- ___ -- +div class=doc_subsubsection a name=t_pstructPacked Structure Type/a +/div +div class=doc_text +h5Overview:/h5 +pThe packed structure type is used to represent a collection of data members +together in memory. There is no padding between fields. Further, the alignment +of a packed structure is 1 byte. The elements of a packed structure may +be any type that has a size./p +pStructures are accessed using 'tta href=#i_loadload/a/tt +and 'tta href=#i_storestore/a/tt' by getting a pointer to a +field with the 'tta href=#i_getelementptrgetelementptr/a/tt' +instruction./p +h5Syntax:/h5 +pre lt; { lt;type listgt; } gt; br/pre +h5Examples:/h5 +table class=layout + tr class=layout +td class=left + tt lt; { int, int, int } gt; /ttbr/ + tt lt; { float, int (int) * } gt; /ttbr/ +/td +td class=left + a triple of three ttint/tt valuesbr/ + A pair, where the first element is a ttfloat/tt and the second element + is a a href=#t_pointerpointer/a to a a href=#t_functionfunction/a + that takes an ttint/tt, returning an ttint/tt.br/ +/td + /tr +/table +/div + +!-- ___ -- div class=doc_subsubsection a name=t_pointerPointer Type/a /div div class=doc_text h5Overview:/h5 @@ -4435,7 +4468,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/06 07:08:07 $ + Last modified: $Date: 2006/12/08 17:13:00 $ /address /body /html ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-08-10-BoolSetCC.ll updated: 1.1 - 1.2 --- Log message: This test needs to be upgraded. --- Diffs of the changes: (+1 -1) 2004-08-10-BoolSetCC.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll diff -u llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.1 llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.2 --- llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll:1.1 Tue Aug 10 19:49:50 2004 +++ llvm/test/Regression/Transforms/InstCombine/2004-08-10-BoolSetCC.ll Fri Dec 8 11:39:49 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as %s| opt -instcombine | llvm-dis | grep 'ret bool false' +; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep 'ret bool false' bool %test(bool %V) { %Y = setlt bool %V, false ret bool %Y ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: 2006-12-08-ICmp-Combining.ll added (r1.1) --- Log message: For PR950: http://llvm.org/PR950 : Add a test for a regression in combining of ICmp instructions. --- Diffs of the changes: (+16 -0) 2006-12-08-ICmp-Combining.ll | 16 1 files changed, 16 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll:1.1 *** /dev/null Fri Dec 8 11:39:06 2006 --- llvm/test/Regression/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll Fri Dec 8 11:38:55 2006 *** *** 0 --- 1,16 + ; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep '%bothcond =' + bool %Doit_bb(int %i.0) { + bb: ; preds = %newFuncRoot + %tmp = setgt int %i.0, 0 ; bool [#uses=1] + %tmp.not = xor bool %tmp, true ; bool [#uses=1] + %tmp2 = setgt int %i.0, 8; bool [#uses=1] + %bothcond = or bool %tmp.not, %tmp2 ; bool [#uses=1] + br bool %bothcond, label %exitTrue, label %exitFalse + + exitTrue: ; preds = %bb + ret bool true + + exitFalse:; preds = %bb + ret bool false + + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.57 - 1.58 --- Log message: A backwards compatible bc format for packed structs --- Diffs of the changes: (+18 -5) BytecodeFormat.html | 23 ++- 1 files changed, 18 insertions(+), 5 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.57 llvm/docs/BytecodeFormat.html:1.58 --- llvm/docs/BytecodeFormat.html:1.57 Fri Dec 8 11:13:00 2006 +++ llvm/docs/BytecodeFormat.html Fri Dec 8 11:50:05 2006 @@ -862,10 +862,6 @@ td class=td_leftType ID for structure types (14)/td /tr tr - tda href=#uint32_vbruint32_vbr/a/td - td class=td_leftValue 0 if a normal structure, 1 if a packed structure/td -/tr -tr tda href=#zlistzlist/a(a href=#uint24_vbruint24_vbr/a)/td td class=td_leftSlot number of each of the element's fields./td /tr @@ -943,6 +939,23 @@ /tr /tbody /table +h3Packed Structure Types/h3 +table + tbody +tr + thbType/b/th + th class=td_leftbDescription/b/th +/tr +tr + tda href=#uint24_vbruint24_vbr/a/td + td class=td_leftType ID for packed structure types (19)/td +/tr +tr + tda href=#zlistzlist/a(a href=#uint24_vbruint24_vbr/a)/td + td class=td_leftSlot number of each of the element's fields./td +/tr + /tbody +/table /div !-- ___ -- div class=doc_subsectiona name=globalinfoModule Global Info/a @@ -2170,7 +2183,7 @@ a href=mailto:[EMAIL PROTECTED]Reid Spencer/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr -Last modified: $Date: 2006/12/08 17:13:00 $ +Last modified: $Date: 2006/12/08 17:50:05 $ /address /body /html ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.211 - 1.212 --- Log message: Packed Structures --- Diffs of the changes: (+12 -1) Reader.cpp | 13 - 1 files changed, 12 insertions(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.211 llvm/lib/Bytecode/Reader/Reader.cpp:1.212 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.211 Sun Dec 3 23:23:49 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Fri Dec 8 12:06:15 2006 @@ -1192,7 +1192,18 @@ Typ = read_vbr_uint(); } -Result = StructType::get(Elements); +Result = StructType::get(Elements, false); +break; + } + case Type::BC_ONLY_PackedStructTyID: { +std::vectorconst Type* Elements; +unsigned Typ = read_vbr_uint(); +while (Typ) { // List is terminated by void/0 typeid + Elements.push_back(getType(Typ)); + Typ = read_vbr_uint(); +} + +Result = StructType::get(Elements, true); break; } case Type::PointerTyID: { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.136 - 1.137 --- Log message: Packed Structures --- Diffs of the changes: (+5 -3) Writer.cpp |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.136 llvm/lib/Bytecode/Writer/Writer.cpp:1.137 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.136 Wed Dec 6 19:30:31 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Fri Dec 8 12:06:15 2006 @@ -197,7 +197,11 @@ //===--===// void BytecodeWriter::outputType(const Type *T) { - output_vbr((unsigned)T-getTypeID()); + const StructType* STy = dyn_castStructType(T); + if(STy STy-isPacked()) +output_vbr((unsigned)Type::BC_ONLY_PackedStructTyID); + else +output_vbr((unsigned)T-getTypeID()); // That's all there is to handling primitive types... if (T-isPrimitiveType()) { @@ -246,10 +250,8 @@ break; } - case Type::StructTyID: { const StructType *ST = castStructType(T); - // Output all of the element types... for (StructType::element_iterator I = ST-element_begin(), E = ST-element_end(); I != E; ++I) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Constants.cpp Type.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.228 - 1.229 Constants.cpp updated: 1.183 - 1.184 Type.cpp updated: 1.151 - 1.152 --- Log message: Packed Structures --- Diffs of the changes: (+32 -12) AsmWriter.cpp |8 Constants.cpp |5 ++--- Type.cpp | 31 ++- 3 files changed, 32 insertions(+), 12 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.228 llvm/lib/VMCore/AsmWriter.cpp:1.229 --- llvm/lib/VMCore/AsmWriter.cpp:1.228 Thu Dec 7 14:04:42 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Fri Dec 8 12:06:15 2006 @@ -287,6 +287,8 @@ } case Type::StructTyID: { const StructType *STy = castStructType(Ty); +if (STy-isPacked()) + Result += ''; Result += { ; for (StructType::element_iterator I = STy-element_begin(), E = STy-element_end(); I != E; ++I) { @@ -295,6 +297,8 @@ calcTypeName(*I, TypeStack, TypeNames, Result); } Result += }; +if (STy-isPacked()) + Result += ''; break; } case Type::PointerTyID: @@ -699,6 +703,8 @@ } Out ')'; } else if (const StructType *STy = dyn_castStructType(Ty)) { +if (STy-isPacked()) + Out ''; Out { ; for (StructType::element_iterator I = STy-element_begin(), E = STy-element_end(); I != E; ++I) { @@ -707,6 +713,8 @@ printType(*I); } Out }; +if (STy-isPacked()) + Out ''; } else if (const PointerType *PTy = dyn_castPointerType(Ty)) { printType(PTy-getElementType()) '*'; } else if (const ArrayType *ATy = dyn_castArrayType(Ty)) { Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.183 llvm/lib/VMCore/Constants.cpp:1.184 --- llvm/lib/VMCore/Constants.cpp:1.183 Wed Dec 6 22:18:31 2006 +++ llvm/lib/VMCore/Constants.cpp Fri Dec 8 12:06:15 2006 @@ -1150,12 +1150,12 @@ return ConstantAggregateZero::get(Ty); } -Constant *ConstantStruct::get(const std::vectorConstant* V) { +Constant *ConstantStruct::get(const std::vectorConstant* V, bool packed) { std::vectorconst Type* StructEls; StructEls.reserve(V.size()); for (unsigned i = 0, e = V.size(); i != e; ++i) StructEls.push_back(V[i]-getType()); - return get(StructType::get(StructEls), V); + return get(StructType::get(StructEls, packed), V); } // destroyConstant - Remove the constant from the constant table... @@ -2183,4 +2183,3 @@ } return ; } - Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.151 llvm/lib/VMCore/Type.cpp:1.152 --- llvm/lib/VMCore/Type.cpp:1.151 Sun Nov 26 19:05:10 2006 +++ llvm/lib/VMCore/Type.cppFri Dec 8 12:06:16 2006 @@ -22,6 +22,7 @@ #include llvm/Support/MathExtras.h #include llvm/Support/Compiler.h #include llvm/Support/ManagedStatic.h +#include llvm/Support/Debug.h #include algorithm using namespace llvm; @@ -29,7 +30,7 @@ // created and later destroyed, all in an effort to make sure that there is only // a single canonical version of a type. // -//#define DEBUG_MERGE_TYPES 1 +// #define DEBUG_MERGE_TYPES 1 AbstractTypeUser::~AbstractTypeUser() {} @@ -318,7 +319,10 @@ } case Type::StructTyID: { const StructType *STy = castStructType(Ty); -Result = { ; +if (STy-isPacked()) + Result = { ; +else + Result = { ; for (StructType::element_iterator I = STy-element_begin(), E = STy-element_end(); I != E; ++I) { if (I != STy-element_begin()) @@ -326,6 +330,8 @@ Result += getTypeDescription(*I, TypeStack); } Result += }; +if (STy-isPacked()) + Result += ; break; } case Type::PointerTyID: { @@ -454,8 +460,9 @@ setAbstract(isAbstract); } -StructType::StructType(const std::vectorconst Type* Types) +StructType::StructType(const std::vectorconst Type* Types, bool isPacked) : CompositeType(StructTyID) { + setSubclassData(isPacked); ContainedTys.reserve(Types.size()); bool isAbstract = false; for (unsigned i = 0; i Types.size(); ++i) { @@ -630,6 +637,7 @@ } else if (const StructType *STy = dyn_castStructType(Ty)) { const StructType *STy2 = castStructType(Ty2); if (STy-getNumElements() != STy2-getNumElements()) return false; +if (STy-isPacked() != STy2-isPacked()) return false; for (unsigned i = 0, e = STy2-getNumElements(); i != e; ++i) if (!TypesEqual(STy-getElementType(i), STy2-getElementType(i), EqTypes)) return false; @@ -1137,8 +1145,10 @@ // class StructValType { std::vectorconst Type* ElTypes; + bool packed; public: - StructValType(const std::vectorconst Type* args) : ElTypes(args) {} + StructValType(const std::vectorconst Type* args, bool isPacked) +: ElTypes(args), packed(isPacked) {} static StructValType get(const StructType *ST) { std::vectorconst Type * ElTypes; @@ -1146,7 +1156,7 @@ for (unsigned i = 0, e = ST-getNumElements(); i != e; ++i)
[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.288 - 1.289 --- Log message: Packed Structures --- Diffs of the changes: (+14 -0) llvmAsmParser.y | 14 ++ 1 files changed, 14 insertions(+) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.288 llvm/lib/AsmParser/llvmAsmParser.y:1.289 --- llvm/lib/AsmParser/llvmAsmParser.y:1.288Wed Dec 6 19:30:31 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Dec 8 12:06:15 2006 @@ -1209,6 +1209,20 @@ $$ = new PATypeHolder(StructType::get(std::vectorconst Type*())); CHECK_FOR_ERROR } + | '' '{' TypeListI '}' '' { +std::vectorconst Type* Elements; +for (std::listllvm::PATypeHolder::iterator I = $3-begin(), + E = $3-end(); I != E; ++I) + Elements.push_back(*I); + +$$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); +delete $3; +CHECK_FOR_ERROR + } + | '' '{' '}' '' { // Empty structure type? +$$ = new PATypeHolder(StructType::get(std::vectorconst Type*(), true)); +CHECK_FOR_ERROR + } | UpRTypes '*' { // Pointer type? if (*$1 == Type::LabelTy) GEN_ERROR(Cannot form a pointer to a basic block); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Andrew, It looks like you haven't accounted for global constants of packed structure type here. Reid. On Fri, 2006-12-08 at 12:07 -0600, Andrew Lenharth wrote: Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.288 - 1.289 --- Log message: Packed Structures --- Diffs of the changes: (+14 -0) llvmAsmParser.y | 14 ++ 1 files changed, 14 insertions(+) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.288 llvm/lib/AsmParser/llvmAsmParser.y:1.289 --- llvm/lib/AsmParser/llvmAsmParser.y:1.288 Wed Dec 6 19:30:31 2006 +++ llvm/lib/AsmParser/llvmAsmParser.yFri Dec 8 12:06:15 2006 @@ -1209,6 +1209,20 @@ $$ = new PATypeHolder(StructType::get(std::vectorconst Type*())); CHECK_FOR_ERROR } + | '' '{' TypeListI '}' '' { +std::vectorconst Type* Elements; +for (std::listllvm::PATypeHolder::iterator I = $3-begin(), + E = $3-end(); I != E; ++I) + Elements.push_back(*I); + +$$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); +delete $3; +CHECK_FOR_ERROR + } + | '' '{' '}' '' { // Empty structure type? +$$ = new PATypeHolder(StructType::get(std::vectorconst Type*(), true)); +CHECK_FOR_ERROR + } | UpRTypes '*' { // Pointer type? if (*$1 == Type::LabelTy) GEN_ERROR(Cannot form a pointer to a basic block); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/packed_struct.ll
Changes in directory llvm/test/Feature: packed_struct.ll added (r1.1) --- Log message: feature test for packed structs --- Diffs of the changes: (+29 -0) packed_struct.ll | 29 + 1 files changed, 29 insertions(+) Index: llvm/test/Feature/packed_struct.ll diff -c /dev/null llvm/test/Feature/packed_struct.ll:1.1 *** /dev/null Fri Dec 8 12:36:35 2006 --- llvm/test/Feature/packed_struct.ll Fri Dec 8 12:36:24 2006 *** *** 0 --- 1,29 + ; RUN: llvm-as %s | llvm-dis %t1.ll + ; RUN: llvm-as %t1.ll -o - | llvm-dis %t2.ll + ; RUN: diff %t1.ll %t2.ll + ; RUN: not grep cast %t2.ll + ; RUN: grep { %t2.ll + + %struct.anon = type { sbyte, int, int, int } + %foos = external global %struct.anon + %bara = external global [2 x { int, sbyte }] + + implementation ; Functions: + + int %main() + { + %tmp = load int* getelementptr (%struct.anon* %foos, int 0, uint 1) ; int [#uses=1] + %tmp3 = load int* getelementptr (%struct.anon* %foos, int 0, uint 2) ; int [#uses=1] + %tmp6 = load int* getelementptr (%struct.anon* %foos, int 0, uint 3) ; int [#uses=1] + %tmp4 = add int %tmp3, %tmp ; int [#uses=1] + %tmp7 = add int %tmp4, %tmp6; int [#uses=1] + ret int %tmp7 + } + + int %bar() { + entry: + %tmp = load int* getelementptr([2 x { int, sbyte }]* %bara, int 0, int 0, uint 0 ); int [#uses=1] + %tmp4 = load int* getelementptr ([2 x { int, sbyte }]* %bara, int 0, int 1, uint 0) ; int [#uses=1] + %tmp5 = add int %tmp4, %tmp ; int [#uses=1] + ret int %tmp5 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.td
Changes in directory llvm/lib/Target/ARM: ARMInstrInfo.td updated: 1.75 - 1.76 --- Log message: fix truncstorei1 --- Diffs of the changes: (+1 -3) ARMInstrInfo.td |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.75 llvm/lib/Target/ARM/ARMInstrInfo.td:1.76 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.75Thu Nov 9 07:58:55 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Fri Dec 8 12:41:21 2006 @@ -342,6 +342,4 @@ // truncstore bool - truncstore byte. def : Pat(truncstorei1 IntRegs:$src, IntRegs:$addr), - (STRB IntRegs:$addr, IntRegs:$src); -def : Pat(truncstorei1 IntRegs:$src, IntRegs:$addr), - (STRB IntRegs:$addr, IntRegs:$src); + (STRB IntRegs:$src, IntRegs:$addr); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.108 - 1.109 --- Log message: Move findTiedToSrcOperand to TargetInstrDescriptor. --- Diffs of the changes: (+4 -5) TargetInstrInfo.h |9 - 1 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.108 llvm/include/llvm/Target/TargetInstrInfo.h:1.109 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.108Fri Dec 8 01:56:02 2006 +++ llvm/include/llvm/Target/TargetInstrInfo.h Fri Dec 8 12:44:26 2006 @@ -139,6 +139,10 @@ } return -1; } + + /// findTiedToSrcOperand - Returns the operand that is tied to the specified + /// dest operand. Returns -1 if there isn't one. + int findTiedToSrcOperand(unsigned OpNum) const; }; @@ -257,11 +261,6 @@ return get(Opcode).getOperandConstraint(OpNum, Constraint); } - /// findTiedToSrcOperand - Returns the operand that is tied to the specified - /// dest operand. Returns -1 if there isn't one. - int findTiedToSrcOperand(const TargetInstrDescriptor *TID, - unsigned OpNum) const; - /// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL /// instruction if it has one. This is used by codegen passes that update /// DWARF line number info as they modify the code. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/packed_struct.ll
Changes in directory llvm/test/Feature: packed_struct.ll updated: 1.1 - 1.2 --- Log message: packed initializers too in the test --- Diffs of the changes: (+4 -0) packed_struct.ll |4 1 files changed, 4 insertions(+) Index: llvm/test/Feature/packed_struct.ll diff -u llvm/test/Feature/packed_struct.ll:1.1 llvm/test/Feature/packed_struct.ll:1.2 --- llvm/test/Feature/packed_struct.ll:1.1 Fri Dec 8 12:36:24 2006 +++ llvm/test/Feature/packed_struct.ll Fri Dec 8 12:45:38 2006 @@ -8,6 +8,10 @@ %foos = external global %struct.anon %bara = external global [2 x { int, sbyte }] +;initializers should work for packed and non-packed the same way +%E1 = global {sbyte, int, int} {sbyte 1, int 2, int 3} +%E2 = global {sbyte, int, int} {sbyte 4, int 5, int 6} + implementation ; Functions: int %main() ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetInstrInfo.cpp
Changes in directory llvm/lib/Target: TargetInstrInfo.cpp updated: 1.25 - 1.26 --- Log message: Move findTiedToSrcOperand to TargetInstrDescriptor. --- Diffs of the changes: (+11 -12) TargetInstrInfo.cpp | 23 +++ 1 files changed, 11 insertions(+), 12 deletions(-) Index: llvm/lib/Target/TargetInstrInfo.cpp diff -u llvm/lib/Target/TargetInstrInfo.cpp:1.25 llvm/lib/Target/TargetInstrInfo.cpp:1.26 --- llvm/lib/Target/TargetInstrInfo.cpp:1.25Fri Dec 8 01:57:56 2006 +++ llvm/lib/Target/TargetInstrInfo.cpp Fri Dec 8 12:45:14 2006 @@ -17,28 +17,27 @@ #include llvm/DerivedTypes.h using namespace llvm; -TargetInstrInfo::TargetInstrInfo(const TargetInstrDescriptor* Desc, - unsigned numOpcodes) - : desc(Desc), NumOpcodes(numOpcodes) { -} - -TargetInstrInfo::~TargetInstrInfo() { -} - /// findTiedToSrcOperand - Returns the operand that is tied to the specified /// dest operand. Returns -1 if there isn't one. -int TargetInstrInfo::findTiedToSrcOperand(const TargetInstrDescriptor *TID, - unsigned OpNum) const { - for (unsigned i = 0, e = TID-numOperands; i != e; ++i) { +int TargetInstrDescriptor::findTiedToSrcOperand(unsigned OpNum) const { + for (unsigned i = 0, e = numOperands; i != e; ++i) { if (i == OpNum) continue; -if (TID-getOperandConstraint(i, TOI::TIED_TO) == (int)OpNum) +if (getOperandConstraint(i, TOI::TIED_TO) == (int)OpNum) return i; } return -1; } +TargetInstrInfo::TargetInstrInfo(const TargetInstrDescriptor* Desc, + unsigned numOpcodes) + : desc(Desc), NumOpcodes(numOpcodes) { +} + +TargetInstrInfo::~TargetInstrInfo() { +} + // commuteInstruction - The default implementation of this method just exchanges // operand 1 and 2. MachineInstr *TargetInstrInfo::commuteInstruction(MachineInstr *MI) const { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
On 12/8/06, Reid Spencer [EMAIL PROTECTED] wrote: Andrew, It looks like you haven't accounted for global constants of packed structure type here. They are. structure initializers are structure initializers, whether they are initializing a packed struct or a normal struct. e.g.: %E1 = global { sbyte, int, int } { sbyte 1, int 2, int 3 } ; { sbyte, int, int }* [#uses=0] %E2 = global { sbyte, int, int } { sbyte 4, int 5, int 6 } ; { sbyte, int, int }* [#uses=0] Since the type is embedded before the constant, I don't think it makes sense to have two types of initializer. Or were you taking about something else? Andrew Reid. On Fri, 2006-12-08 at 12:07 -0600, Andrew Lenharth wrote: Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.288 - 1.289 --- Log message: Packed Structures --- Diffs of the changes: (+14 -0) llvmAsmParser.y | 14 ++ 1 files changed, 14 insertions(+) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.288 llvm/lib/AsmParser/llvmAsmParser.y:1.289 --- llvm/lib/AsmParser/llvmAsmParser.y:1.288 Wed Dec 6 19:30:31 2006 +++ llvm/lib/AsmParser/llvmAsmParser.yFri Dec 8 12:06:15 2006 @@ -1209,6 +1209,20 @@ $$ = new PATypeHolder(StructType::get(std::vectorconst Type*())); CHECK_FOR_ERROR } + | '' '{' TypeListI '}' '' { +std::vectorconst Type* Elements; +for (std::listllvm::PATypeHolder::iterator I = $3-begin(), + E = $3-end(); I != E; ++I) + Elements.push_back(*I); + +$$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); +delete $3; +CHECK_FOR_ERROR + } + | '' '{' '}' '' { // Empty structure type? +$$ = new PATypeHolder(StructType::get(std::vectorconst Type*(), true)); +CHECK_FOR_ERROR + } | UpRTypes '*' { // Pointer type? if (*$1 == Type::LabelTy) GEN_ERROR(Cannot form a pointer to a basic block); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocSimple.cpp VirtRegMap.cpp
Changes in directory llvm/lib/CodeGen: RegAllocSimple.cpp updated: 1.80 - 1.81 VirtRegMap.cpp updated: 1.87 - 1.88 --- Log message: Move findTiedToSrcOperand to TargetInstrDescriptor. --- Diffs of the changes: (+3 -4) RegAllocSimple.cpp |3 +-- VirtRegMap.cpp |4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/RegAllocSimple.cpp diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.80 llvm/lib/CodeGen/RegAllocSimple.cpp:1.81 --- llvm/lib/CodeGen/RegAllocSimple.cpp:1.80Fri Dec 8 01:59:51 2006 +++ llvm/lib/CodeGen/RegAllocSimple.cpp Fri Dec 8 12:45:48 2006 @@ -198,8 +198,7 @@ unsigned physReg = Virt2PhysRegMap[virtualReg]; if (physReg == 0) { if (op.isDef()) { -int TiedOp = TM-getInstrInfo()- - findTiedToSrcOperand(MI-getInstrDescriptor(), i); +int TiedOp = MI-getInstrDescriptor()-findTiedToSrcOperand(i); if (TiedOp == -1) { physReg = getFreeReg(virtualReg); } else { Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.87 llvm/lib/CodeGen/VirtRegMap.cpp:1.88 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.87Fri Dec 8 02:02:34 2006 +++ llvm/lib/CodeGen/VirtRegMap.cpp Fri Dec 8 12:45:48 2006 @@ -99,7 +99,7 @@ ModRef MRInfo; const TargetInstrDescriptor *TID = OldMI-getInstrDescriptor(); if (TID-getOperandConstraint(OpNo, TOI::TIED_TO) != -1 || - TII.findTiedToSrcOperand(TID, OpNo) != -1) { + TID-findTiedToSrcOperand(OpNo) != -1) { // Folded a two-address operand. MRInfo = isModRef; } else if (OldMI-getOperand(OpNo).isDef()) { @@ -851,7 +851,7 @@ // If this def is part of a two-address operand, make sure to execute // the store from the correct physical register. unsigned PhysReg; -int TiedOp = TII-findTiedToSrcOperand(MI.getInstrDescriptor(), i); +int TiedOp = MI.getInstrDescriptor()-findTiedToSrcOperand(i); if (TiedOp != -1) PhysReg = MI.getOperand(TiedOp).getReg(); else { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassManager.h
Changes in directory llvm/include/llvm: PassManager.h updated: 1.32 - 1.33 --- Log message: Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P) --- Diffs of the changes: (+1 -1) PassManager.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/PassManager.h diff -u llvm/include/llvm/PassManager.h:1.32 llvm/include/llvm/PassManager.h:1.33 --- llvm/include/llvm/PassManager.h:1.32Wed Nov 15 13:39:54 2006 +++ llvm/include/llvm/PassManager.h Fri Dec 8 12:57:16 2006 @@ -119,7 +119,7 @@ /// FunctionPassManager_New manages FunctionPasses and BasicBlockPassManagers. class FunctionPassManager_New { public: - FunctionPassManager_New(ModuleProvider *P) { /* TODO */ } + FunctionPassManager_New(ModuleProvider *P); FunctionPassManager_New(); ~FunctionPassManager_New() { /* TODO */ }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/packed_struct.ll
Changes in directory llvm/test/Regression/CodeGen/X86: packed_struct.ll added (r1.1) --- Log message: test packed struct codegen on x86 --- Diffs of the changes: (+38 -0) packed_struct.ll | 38 ++ 1 files changed, 38 insertions(+) Index: llvm/test/Regression/CodeGen/X86/packed_struct.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/packed_struct.ll:1.1 *** /dev/null Fri Dec 8 12:54:26 2006 --- llvm/test/Regression/CodeGen/X86/packed_struct.ll Fri Dec 8 12:54:15 2006 *** *** 0 --- 1,38 + ; RUN: llvm-as %s | llc -march=x86 |grep foos+5 + ; RUN: llvm-as %s | llc -march=x86 |grep foos+1 + ; RUN: llvm-as %s | llc -march=x86 |grep foos+9 + ; RUN: llvm-as %s | llc -march=x86 |grep bara+19 + ; RUN: llvm-as %s | llc -march=x86 |grep bara+4 + + ; make sure we compute the correct offset for a packed structure + + ;Note: codegen for this could change rendering the above checks wrong + + ; ModuleID = 'foo.c' + target datalayout = e-p:32:32 + target endian = little + target pointersize = 32 + target triple = i686-pc-linux-gnu + %struct.anon = type { sbyte, int, int, int } + %foos = external global %struct.anon + %bara = weak global [4 x { int, sbyte }] zeroinitializer + + implementation ; Functions: + + int %foo() { + entry: + %tmp = load int* getelementptr (%struct.anon* %foos, int 0, uint 1) + %tmp3 = load int* getelementptr (%struct.anon* %foos, int 0, uint 2) + %tmp6 = load int* getelementptr (%struct.anon* %foos, int 0, uint 3) + %tmp4 = add int %tmp3, %tmp + %tmp7 = add int %tmp4, %tmp6 + ret int %tmp7 + } + + sbyte %bar() { + entry: + %tmp = load sbyte* getelementptr([4 x { int, sbyte }]* %bara, int 0, int 0, uint 1 ) + %tmp4 = load sbyte* getelementptr ([4 x { int, sbyte }]* %bara, int 0, int 3, uint 1) + %tmp5 = add sbyte %tmp4, %tmp + ret sbyte %tmp5 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.61 - 1.62 --- Log message: Reuse code. Directly use runOnFunction(). --- Diffs of the changes: (+2 -10) PassManager.cpp | 12 ++-- 1 files changed, 2 insertions(+), 10 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.61 llvm/lib/VMCore/PassManager.cpp:1.62 --- llvm/lib/VMCore/PassManager.cpp:1.61Fri Dec 8 12:57:16 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 13:03:05 2006 @@ -844,16 +844,8 @@ initializeAnalysisInfo(); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) -for (std::vectorPass *::iterator itr = passVectorBegin(), - e = passVectorEnd(); itr != e; ++itr) { - Pass *P = *itr; - - FunctionPass *FP = dynamic_castFunctionPass*(P); - Changed |= FP-runOnFunction(*I); - removeNotPreservedAnalysis(P); - recordAvailableAnalysis(P); - removeDeadPasses(P); -} +this-runOnFunction(*I); + return Changed; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.60 - 1.61 --- Log message: Implement FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P) --- Diffs of the changes: (+5 -0) PassManager.cpp |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.60 llvm/lib/VMCore/PassManager.cpp:1.61 --- llvm/lib/VMCore/PassManager.cpp:1.60Thu Dec 7 19:38:28 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 12:57:16 2006 @@ -734,6 +734,11 @@ FPM = new FunctionPassManagerImpl_New(0); } +FunctionPassManager_New::FunctionPassManager_New(ModuleProvider *P) { + FPM = new FunctionPassManagerImpl_New(0); + MP = P; +} + /// add - Add a pass to the queue of passes to run. This passes /// ownership of the Pass to the PassManager. When the /// PassManager_X is destroyed, the pass will be destroyed as well, so ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.62 - 1.63 --- Log message: During runOnModule() do initialization and finalization. --- Diffs of the changes: (+2 -2) PassManager.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.62 llvm/lib/VMCore/PassManager.cpp:1.63 --- llvm/lib/VMCore/PassManager.cpp:1.62Fri Dec 8 13:03:05 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 13:04:09 2006 @@ -840,13 +840,13 @@ /// the function, and if so, return true. bool FunctionPassManagerImpl_New::runOnModule(Module M) { - bool Changed = false; + bool Changed = doInitialization(M); initializeAnalysisInfo(); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) this-runOnFunction(*I); - return Changed; + return Changed | doFinalization(M); } /// Execute all of the passes scheduled for execution by invoking ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt updated: 1.9 - 1.10 --- Log message: Add the -ldl library option. --- Diffs of the changes: (+3 -2) findmisopt |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.9 llvm/utils/findmisopt:1.10 --- llvm/utils/findmisopt:1.9 Fri Nov 24 22:07:06 2006 +++ llvm/utils/findmisopt Fri Dec 8 12:58:38 2006 @@ -61,6 +61,7 @@ opts=$outdir/${name}.opt.s optprog=$outdir/${name}.opt optout=$outdir/${name}.opt.out +ldflags=-lstdc++ -lm -ldl -lc echo Test Name: $name echo Unoptimized program: $prog @@ -81,7 +82,7 @@ # Generate the non-optimized program llc $bcfile -o $s -f || exit 1 -gcc $s -o $prog -lstdc++ -lc -lm || exit 1 +gcc $s -o $prog $ldflags || exit 1 # Define the list of optimizations to run. This comprises the same set of # optimizations that gccas and gccld run, in the same order. @@ -96,7 +97,7 @@ opt $switches_to_use $bcfile -o $optbc -f || exit llvm-dis $optbc -o $optll -f || exit llc $optbc -o $opts -f || exit - gcc $opts -o $optprog -lstdc++ -lc -lm || exit + gcc $opts -o $optprog $ldflags || exit $prog $args $out 21 ex1=$? $optprog $args $optout 21 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.72 - 1.73 --- Log message: Packed Structures --- Diffs of the changes: (+1 -1) TargetData.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.72 llvm/lib/Target/TargetData.cpp:1.73 --- llvm/lib/Target/TargetData.cpp:1.72 Tue Oct 24 15:32:14 2006 +++ llvm/lib/Target/TargetData.cpp Fri Dec 8 12:06:15 2006 @@ -53,7 +53,7 @@ unsigned TyAlign; uint64_t TySize; getTypeInfo(Ty, TD, TySize, A); -TyAlign = A; +TyAlign = ST-isPacked() ? 1 : A; // Add padding if necessary to make the data element aligned properly... if (StructSize % TyAlign != 0) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Constants.h DerivedTypes.h Type.h
Changes in directory llvm/include/llvm: Constants.h updated: 1.104 - 1.105 DerivedTypes.h updated: 1.72 - 1.73 Type.h updated: 1.94 - 1.95 --- Log message: Packed Structures --- Diffs of the changes: (+11 -3) Constants.h|2 +- DerivedTypes.h |7 +-- Type.h |5 + 3 files changed, 11 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.104 llvm/include/llvm/Constants.h:1.105 --- llvm/include/llvm/Constants.h:1.104 Wed Dec 6 14:30:17 2006 +++ llvm/include/llvm/Constants.h Fri Dec 8 12:06:14 2006 @@ -370,7 +370,7 @@ /// get() - Static factory methods - Return objects of the specified value /// static Constant *get(const StructType *T, const std::vectorConstant* V); - static Constant *get(const std::vectorConstant* V); + static Constant *get(const std::vectorConstant* V, bool packed = false); /// getType() specialization - Reduce amount of casting... /// Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.72 llvm/include/llvm/DerivedTypes.h:1.73 --- llvm/include/llvm/DerivedTypes.h:1.72 Tue Nov 14 21:02:41 2006 +++ llvm/include/llvm/DerivedTypes.hFri Dec 8 12:06:14 2006 @@ -163,13 +163,14 @@ /// /// Private ctor - Only can be created by a static member... /// - StructType(const std::vectorconst Type* Types); + StructType(const std::vectorconst Type* Types, bool isPacked); public: /// StructType::get - This static method is the primary way to create a /// StructType. /// - static StructType *get(const std::vectorconst Type* Params); + static StructType *get(const std::vectorconst Type* Params, + bool isPacked=false); // Iterator access to the elements typedef std::vectorPATypeHandle::const_iterator element_iterator; @@ -198,6 +199,8 @@ static inline bool classof(const Type *T) { return T-getTypeID() == StructTyID; } + + bool isPacked() const { return getSubclassData(); } }; Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.94 llvm/include/llvm/Type.h:1.95 --- llvm/include/llvm/Type.h:1.94 Wed Dec 6 19:30:30 2006 +++ llvm/include/llvm/Type.hFri Dec 8 12:06:14 2006 @@ -85,6 +85,7 @@ ArrayTyID , PointerTyID,// Array... pointer... OpaqueTyID, // Opaque type instances... PackedTyID, // SIMD 'packed' format... +BC_ONLY_PackedStructTyID, // packed struct, for BC rep only //... NumTypeIDs, // Must remain as last defined ID @@ -95,6 +96,7 @@ private: TypeID ID : 8;// The current base type of this type. bool Abstract : 1; // True if type contains an OpaqueType + bool SubclassData : 1; //Space for subclasses to store a flag /// RefCount - This counts the number of PATypeHolders that are pointing to /// this type. When this number falls to zero, if the type is abstract and @@ -117,6 +119,9 @@ unsigned getRefCount() const { return RefCount; } + bool getSubclassData() const { return SubclassData; } + void setSubclassData(bool b) { SubclassData = b; } + /// ForwardType - This field is used to implement the union find scheme for /// abstract types. When types are refined to other types, this field is set /// to the more refined type. Only abstract types can be forwarded. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/ADT/Statistic.h
Changes in directory llvm/include/llvm/ADT: Statistic.h updated: 1.19 - 1.20 --- Log message: Change the implementation of statistic to not need destructors at all. Instead, the stat info is printed when llvm_shutdown() is called. These also don't need static ctors, but getting rid of them is uglier: still investigating. This reduces the number of static dtors in llvm from ~1400 to ~750. --- Diffs of the changes: (+24 -17) Statistic.h | 41 - 1 files changed, 24 insertions(+), 17 deletions(-) Index: llvm/include/llvm/ADT/Statistic.h diff -u llvm/include/llvm/ADT/Statistic.h:1.19 llvm/include/llvm/ADT/Statistic.h:1.20 --- llvm/include/llvm/ADT/Statistic.h:1.19 Wed Dec 6 12:20:44 2006 +++ llvm/include/llvm/ADT/Statistic.h Fri Dec 8 14:00:42 2006 @@ -31,29 +31,36 @@ class Statistic { const char *Name; const char *Desc; - unsigned Value; - static unsigned NumStats; + unsigned Value : 31; + bool Initialized : 1; public: // Normal constructor, default initialize data item... Statistic(const char *name, const char *desc) -: Name(name), Desc(desc), Value(0) { -++NumStats; // Keep track of how many stats are created... +: Name(name), Desc(desc), Value(0), Initialized(0) { } - // Print information when destroyed, iff command line option is specified - ~Statistic(); - - // Allow use of this class as the value itself... + unsigned getValue() const { return Value; } + const char *getName() const { return Name; } + const char *getDesc() const { return Desc; } + + // Allow use of this class as the value itself. operator unsigned() const { return Value; } - const Statistic operator=(unsigned Val) { Value = Val; return *this; } - const Statistic operator++() { ++Value; return *this; } - unsigned operator++(int) { return Value++; } - const Statistic operator--() { --Value; return *this; } - unsigned operator--(int) { return Value--; } - const Statistic operator+=(const unsigned V) { Value += V; return *this; } - const Statistic operator-=(const unsigned V) { Value -= V; return *this; } - const Statistic operator*=(const unsigned V) { Value *= V; return *this; } - const Statistic operator/=(const unsigned V) { Value /= V; return *this; } + const Statistic operator=(unsigned Val) { Value = Val; return init(); } + const Statistic operator++() { ++Value; return init(); } + unsigned operator++(int) { init(); return Value++; } + const Statistic operator--() { --Value; return init(); } + unsigned operator--(int) { init(); return Value--; } + const Statistic operator+=(const unsigned V) { Value += V; return init(); } + const Statistic operator-=(const unsigned V) { Value -= V; return init(); } + const Statistic operator*=(const unsigned V) { Value *= V; return init(); } + const Statistic operator/=(const unsigned V) { Value /= V; return init(); } + +private: + Statistic init() { +if (!Initialized) RegisterStatistic(); +return *this; + } + void RegisterStatistic(); }; } // End llvm namespace ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/Statistic.cpp
Changes in directory llvm/lib/Support: Statistic.cpp updated: 1.22 - 1.23 --- Log message: Change the implementation of statistic to not need destructors at all. Instead, the stat info is printed when llvm_shutdown() is called. These also don't need static ctors, but getting rid of them is uglier: still investigating. This reduces the number of static dtors in llvm from ~1400 to ~750. --- Diffs of the changes: (+76 -61) Statistic.cpp | 137 -- 1 files changed, 76 insertions(+), 61 deletions(-) Index: llvm/lib/Support/Statistic.cpp diff -u llvm/lib/Support/Statistic.cpp:1.22 llvm/lib/Support/Statistic.cpp:1.23 --- llvm/lib/Support/Statistic.cpp:1.22 Thu Dec 7 17:41:45 2006 +++ llvm/lib/Support/Statistic.cpp Fri Dec 8 14:00:42 2006 @@ -15,7 +15,7 @@ // This is useful for reporting information like the number of instructions // simplified, optimized or removed by various transformations, like this: // -// static Statistic NumInstEliminated(GCSE - Number of instructions killed); +// static Statistic NumInstEliminated(GCSE, Number of instructions killed); // // Later, in the code: ++NumInstEliminated; // @@ -23,84 +23,99 @@ #include llvm/ADT/Statistic.h #include llvm/Support/CommandLine.h +#include llvm/Support/ManagedStatic.h #include llvm/Support/Streams.h #include llvm/ADT/StringExtras.h #include algorithm #include ostream using namespace llvm; -// GetLibSupportInfoOutputFile - Return a file stream to print our output on... +// GetLibSupportInfoOutputFile - Return a file stream to print our output on. namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); } -unsigned Statistic::NumStats = 0; - -// -stats - Command line option to cause transformations to emit stats about -// what they did. -// +/// -stats - Command line option to cause transformations to emit stats about +/// what they did. +/// static cl::optbool Enabled(stats, cl::desc(Enable statistics output from program)); -struct StatRecord { - std::string Value; - const char *Name, *Desc; - - StatRecord(const std::string V, const char *N, const char *D) -: Value(V), Name(N), Desc(D) {} - bool operator(const StatRecord SR) const { -return std::strcmp(Name, SR.Name) 0; - } - - void print(unsigned ValFieldSize, unsigned NameFieldSize, - std::ostream OS) { -OS std::string(ValFieldSize-Value.length(), ' ') -Value Name -std::string(NameFieldSize-std::strlen(Name), ' ') - - Desc \n; +namespace { +/// StatisticInfo - This class is used in a ManagedStatic so that it is created +/// on demand (when the first statistic is bumped) and destroyed only when +/// llvm_shutdown is called. We print statistics from the destructor. +class StatisticInfo { + std::vectorconst Statistic* Stats; +public: + ~StatisticInfo(); + + void addStatistic(const Statistic *S) { +Stats.push_back(S); } }; +} -static std::vectorStatRecord *AccumStats = 0; +static ManagedStaticStatisticInfo StatInfo; -// Print information when destroyed, iff command line option is specified -Statistic::~Statistic() { - if (Enabled Value != 0) { -if (AccumStats == 0) - AccumStats = new std::vectorStatRecord(); -AccumStats-push_back(StatRecord(utostr(Value), Name, Desc)); - } +/// RegisterStatistic - The first time a statistic is bumped, this method is +/// called. +void Statistic::RegisterStatistic() { + // If stats are enabled, inform StatInfo that this statistic should be + // printed. + if (Enabled) +StatInfo-addStatistic(this); + // Remember we have been registered. + Initialized = true; +} - if (--NumStats == 0 AccumStats) { -std::ostream *OutStream = GetLibSupportInfoOutputFile(); +struct NameCompare { + bool operator()(const Statistic *LHS, const Statistic *RHS) const { +int Cmp = std::strcmp(LHS-getName(), RHS-getName()); +if (Cmp != 0) return Cmp 0; + +// Secondary key is the description. +return std::strcmp(LHS-getDesc(), RHS-getDesc()) 0; + } +}; -// Figure out how long the biggest Value and Name fields are... -unsigned MaxNameLen = 0, MaxValLen = 0; -for (unsigned i = 0, e = AccumStats-size(); i != e; ++i) { - MaxValLen = std::max(MaxValLen, - (unsigned)(*AccumStats)[i].Value.length()); - MaxNameLen = std::max(MaxNameLen, -(unsigned)std::strlen((*AccumStats)[i].Name)); -} - -// Sort the fields... -std::stable_sort(AccumStats-begin(), AccumStats-end()); - -// Print out the statistics header... -*OutStream === std::string(73, '-') ===\n - ... Statistics Collected ...\n -=== std::string(73, '-') ===\n\n; - -// Print all of the statistics accumulated... -for (unsigned i = 0, e = AccumStats-size(); i != e; ++i) - (*AccumStats)[i].print(MaxValLen, MaxNameLen, *OutStream); - -
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/section.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: section.ll updated: 1.1 - 1.2 --- Log message: add \aw\,@progbits to ctors and dtors --- Diffs of the changes: (+1 -0) section.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CodeGen/ARM/section.ll diff -u llvm/test/Regression/CodeGen/ARM/section.ll:1.1 llvm/test/Regression/CodeGen/ARM/section.ll:1.2 --- llvm/test/Regression/CodeGen/ARM/section.ll:1.1 Thu Dec 7 12:33:58 2006 +++ llvm/test/Regression/CodeGen/ARM/section.ll Fri Dec 8 15:24:58 2006 @@ -1,4 +1,5 @@ ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep __DTOR_END__: +; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep .section .dtors,\aw\,@progbits %__DTOR_END__ = internal global [1 x int] zeroinitializer, section .dtors ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.36 - 1.37 --- Log message: add \aw\,@progbits to ctors and dtors --- Diffs of the changes: (+11 -4) ARMAsmPrinter.cpp | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.36 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.37 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.36 Thu Dec 7 16:38:06 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Fri Dec 8 15:24:58 2006 @@ -317,10 +317,17 @@ break; } - if (C-isNullValue()) -SwitchToDataSection(.bss, I); - else -SwitchToDataSection(.data, I); + if (I-hasSection() + (I-getSection() == .ctors || + I-getSection() == .dtors)) { +std::string SectionName = .section + I-getSection(); + +SectionName += ,\aw\,@progbits; + +SwitchToDataSection(SectionName.c_str()); + } else { +SwitchToDataSection(TAI-getDataSection(), I); + } EmitAlignment(Align, I); O \t.type name , %object\n; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/section.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: section.ll updated: 1.2 - 1.3 --- Log message: add missing --- Diffs of the changes: (+1 -1) section.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/section.ll diff -u llvm/test/Regression/CodeGen/ARM/section.ll:1.2 llvm/test/Regression/CodeGen/ARM/section.ll:1.3 --- llvm/test/Regression/CodeGen/ARM/section.ll:1.2 Fri Dec 8 15:24:58 2006 +++ llvm/test/Regression/CodeGen/ARM/section.ll Fri Dec 8 15:43:02 2006 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm -; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep __DTOR_END__: +; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep __DTOR_END__: ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep .section .dtors,\aw\,@progbits %__DTOR_END__ = internal global [1 x int] zeroinitializer, section .dtors ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp
Changes in directory llvm/lib/Transforms/Scalar: SimplifyCFG.cpp updated: 1.16 - 1.17 --- Log message: Incorporate any changes in the successor blocks into the result of MarkAliveBlocks. --- Diffs of the changes: (+1 -1) SimplifyCFG.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.16 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.17 --- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.16 Wed Dec 6 11:46:33 2006 +++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp Fri Dec 8 15:52:01 2006 @@ -73,7 +73,7 @@ bool Changed = ConstantFoldTerminator(BB); for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB); SI != SE; ++SI) -MarkAliveBlocks(*SI, Reachable); +Changed |= MarkAliveBlocks(*SI, Reachable); return Changed; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.37 - 1.38 --- Log message: %progbits not @progbits --- Diffs of the changes: (+1 -1) ARMAsmPrinter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.37 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.38 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.37 Fri Dec 8 15:24:58 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Fri Dec 8 16:06:02 2006 @@ -322,7 +322,7 @@ I-getSection() == .dtors)) { std::string SectionName = .section + I-getSection(); -SectionName += ,\aw\,@progbits; +SectionName += ,\aw\,%progbits; SwitchToDataSection(SectionName.c_str()); } else { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/section.ll
Changes in directory llvm/test/Regression/CodeGen/ARM: section.ll updated: 1.3 - 1.4 --- Log message: %progbits not @progbits --- Diffs of the changes: (+1 -1) section.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/ARM/section.ll diff -u llvm/test/Regression/CodeGen/ARM/section.ll:1.3 llvm/test/Regression/CodeGen/ARM/section.ll:1.4 --- llvm/test/Regression/CodeGen/ARM/section.ll:1.3 Fri Dec 8 15:43:02 2006 +++ llvm/test/Regression/CodeGen/ARM/section.ll Fri Dec 8 16:06:02 2006 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm ; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep __DTOR_END__: -; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep .section .dtors,\aw\,@progbits +; RUN: llvm-upgrade %s | llvm-as | llc -march=arm | grep .section .dtors,\aw\,%progbits %__DTOR_END__ = internal global [1 x int] zeroinitializer, section .dtors ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.63 - 1.64 --- Log message: Implement PMTopLevel::findAnalysisPass() and PMDataManager::findAnalysisPass() --- Diffs of the changes: (+71 -6) PassManager.cpp | 77 +++- 1 files changed, 71 insertions(+), 6 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.63 llvm/lib/VMCore/PassManager.cpp:1.64 --- llvm/lib/VMCore/PassManager.cpp:1.63Fri Dec 8 13:04:09 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 16:30:11 2006 @@ -118,6 +118,11 @@ /// Collect passes whose last user is P void collectLastUses(std::vectorPass * LastUses, Pass *P); + /// Find the pass that implements Analysis AID. Search immutable + /// passes and all pass managers. If desired pass is not found + /// then return NULL. + Pass *findAnalysisPass(AnalysisID AID); + virtual ~PMTopLevelManager() { PassManagers.clear(); } @@ -187,7 +192,7 @@ for (std::vectorAnalysisID::const_iterator I = RequiredSet.begin(), E = RequiredSet.end(); I != E; ++I) { -Pass *AnalysisPass = NULL; // FIXME PM-getAnalysisPass(*I, true); +Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { // Schedule this analysis run first. AnalysisPass = (*I)-createPass(); @@ -199,6 +204,40 @@ addTopLevelPass(P); } +/// Find the pass that implements Analysis AID. Search immutable +/// passes and all pass managers. If desired pass is not found +/// then return NULL. +Pass *PMTopLevelManager::findAnalysisPass(AnalysisID AID) { + + Pass *P = NULL; + for (std::vectorImmutablePass *::iterator I = ImmutablePasses.begin(), + E = ImmutablePasses.end(); P == NULL I != E; ++I) { +const PassInfo *PI = (*I)-getPassInfo(); +if (PI == AID) + P = *I; + +// If Pass not found then check the interfaces implemented by Immutable Pass +if (!P) { + const std::vectorconst PassInfo* ImmPI = +PI-getInterfacesImplemented(); + for (unsigned Index = 0, End = ImmPI.size(); + P == NULL Index != End; ++Index) +if (ImmPI[Index] == AID) + P = *I; +} + } + + if (P) +return P; + + // Check pass managers; + for (std::vectorPass *::iterator I = PassManagers.begin(), + E = PassManagers.end(); P == NULL I != E; ++I) +P = NULL; // FIXME: (*I)-findAnalysisPass(AID, false /* Search downward */); + + return P; +} + //===--===// // PMDataManager @@ -263,6 +302,10 @@ /// implementations it needs. void initializeAnalysisImpl(Pass *P); + /// Find the pass that implements Analysis AID. If desired pass is not found + /// then return NULL. + Pass *findAnalysisPass(AnalysisID AID, bool Direction); + inline std::vectorPass *::iterator passVectorBegin() { return PassVector.begin(); } @@ -596,7 +639,7 @@ for (std::vectorAnalysisID::const_iterator I = RequiredSet.begin(), E = RequiredSet.end(); I != E; ++I) { -Pass *AnalysisPass = NULL; //FIXME findAnalysisPass(*I,true); +Pass *AnalysisPass = findAnalysisPass(*I, true); assert (AnalysisPass Analysis pass is not available); RP.push_back(AnalysisPass); } @@ -614,13 +657,37 @@ for (std::vectorconst PassInfo *::const_iterator I = AnUsage.getRequiredSet().begin(), E = AnUsage.getRequiredSet().end(); I != E; ++I) { -Pass *Impl = getAnalysisPass(*I); +Pass *Impl = findAnalysisPass(*I, true); if (Impl == 0) assert(0 Analysis used but not available!); // TODO: P-AnalysisImpls.push_back(std::make_pair(*I, Impl)); } } +/// Find the pass that implements Analysis AID. If desired pass is not found +/// then return NULL. +Pass *PMDataManager::findAnalysisPass(AnalysisID AID, bool SearchParent) { + + // Check if AvailableAnalysis map has one entry. + std::mapAnalysisID, Pass*::const_iterator I = AvailableAnalysis.find(AID); + + if (I != AvailableAnalysis.end()) +return I-second; + + // Search Parents through TopLevelManager + if (SearchParent) +return TPM-findAnalysisPass(AID); + + // FIXME : This is expensive and requires. Need to check only managers not all passes. + // One solution is to collect managers in advance at TPM level. + Pass *P = NULL; + for(std::vectorPass *::iterator I = passVectorBegin(), +E = passVectorEnd(); P == NULL I!= E; ++I ) +P = NULL; // FIXME : P = (*I)-getResolver()-getAnalysisToUpdate(AID, false /* Do not search parents again */); + + return P; +} + //===--===// // BasicBlockPassManager_New implementation @@ -912,7 +979,6 @@ Changed |= FP-doFinalization(M); } - return Changed; } @@ -928,8 +994,7 @@ // If P is FunctionPass then use function pass maanager. if (FunctionPass *FP =
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.64 - 1.65 --- Log message: Remove unused getAnalysisPass and getAnalysisPassFromManager --- Diffs of the changes: (+0 -76) PassManager.cpp | 76 1 files changed, 76 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.64 llvm/lib/VMCore/PassManager.cpp:1.65 --- llvm/lib/VMCore/PassManager.cpp:1.64Fri Dec 8 16:30:11 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 16:32:32 2006 @@ -255,17 +255,6 @@ /// manager. bool manageablePass(Pass *P); - Pass *getAnalysisPass(AnalysisID AID) const { - -std::mapAnalysisID, Pass*::const_iterator I = - AvailableAnalysis.find(AID); - -if (I != AvailableAnalysis.end()) - return NULL; -else - return I-second; - } - /// Augment AvailableAnalysis by adding analysis made available by pass P. void recordAvailableAnalysis(Pass *P); @@ -360,10 +349,6 @@ /// whether any of the passes modifies the function, and if so, return true. bool runOnFunction(Function F); - /// Return true IFF AnalysisID AID is currently available. - /// TODO : Replace this method with getAnalysisPass() - Pass *getAnalysisPassFromManager(AnalysisID AID); - /// Pass Manager itself does not invalidate any analysis info. void getAnalysisUsage(AnalysisUsage Info) const { Info.setPreservesAll(); @@ -413,10 +398,6 @@ bool runOnModule(Module M); bool runOnFunction(Function F); - /// Return true IFF AnalysisID AID is currently available. - /// TODO : Replace this method with getAnalysisPass() - Pass *getAnalysisPassFromManager(AnalysisID AID); - /// doInitialization - Run all of the initializers for the function passes. /// bool doInitialization(Module M); @@ -453,10 +434,6 @@ /// whether any of the passes modifies the module, and if so, return true. bool runOnModule(Module M); - /// Return true IFF AnalysisID AID is currently available. - /// TODO : Replace this method with getAnalysisPass() - Pass *getAnalysisPassFromManager(AnalysisID AID); - /// Pass Manager itself does not invalidate any analysis info. void getAnalysisUsage(AnalysisUsage Info) const { Info.setPreservesAll(); @@ -488,10 +465,6 @@ /// whether any of the passes modifies the module, and if so, return true. bool run(Module M); - /// Return true IFF AnalysisID AID is currently available. - /// TODO : Replace this method with getAnalysisPass() - Pass *getAnalysisPassFromManager(AnalysisID AID); - /// Pass Manager itself does not invalidate any analysis info. void getAnalysisUsage(AnalysisUsage Info) const { Info.setPreservesAll(); @@ -733,12 +706,6 @@ return Changed | doFinalization(F); } -/// Return true IFF AnalysisID AID is currently available. -/// TODO : Replace this method with getAnalysisPass() -Pass * BasicBlockPassManager_New::getAnalysisPassFromManager(AnalysisID AID) { - return getAnalysisPass(AID); -} - // Implement doInitialization and doFinalization inline bool BasicBlockPassManager_New::doInitialization(Module M) { bool Changed = false; @@ -938,22 +905,6 @@ } -/// Return true IFF AnalysisID AID is currently available. -/// TODO : Replace this method with getAnalysisPass() -Pass *FunctionPassManagerImpl_New::getAnalysisPassFromManager(AnalysisID AID) { - - Pass *P = getAnalysisPass(AID); - if (P) -return P; - - if (activeBBPassManager - activeBBPassManager-getAnalysisPass(AID) != 0) -return activeBBPassManager-getAnalysisPass(AID); - - // TODO : Check inactive managers - return NULL; -} - inline bool FunctionPassManagerImpl_New::doInitialization(Module M) { bool Changed = false; @@ -1057,36 +1008,9 @@ return Changed; } -/// Return true IFF AnalysisID AID is currently available. -/// TODO : Replace this method with getAnalysisPass() -Pass *ModulePassManager_New::getAnalysisPassFromManager(AnalysisID AID) { - - Pass *P = getAnalysisPass(AID); - if (P) -return P; - - if (activeFunctionPassManager - activeFunctionPassManager-getAnalysisPass(AID) != 0) -return activeFunctionPassManager-getAnalysisPass(AID); - - // TODO : Check inactive managers - return NULL; -} - //===--===// // PassManagerImpl implementation -/// Return true IFF AnalysisID AID is currently available. -/// TODO : Replace this method with getAnalysisPass() -Pass *PassManagerImpl_New::getAnalysisPassFromManager(AnalysisID AID) { - - Pass *P = NULL; - for (std::vectorModulePassManager_New *::iterator itr = PassManagers.begin(), - e = PassManagers.end(); !P itr != e; ++itr) -P = (*itr)-getAnalysisPassFromManager(AID); - return P; -} - // PassManager_New implementation /// Add P into active pass manager or use new module pass manager to /// manage it. ___
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.65 - 1.66 --- Log message: Remove unused schedulePass() parameter. --- Diffs of the changes: (+5 -5) PassManager.cpp | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.65 llvm/lib/VMCore/PassManager.cpp:1.66 --- llvm/lib/VMCore/PassManager.cpp:1.65Fri Dec 8 16:32:32 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 16:34:02 2006 @@ -106,7 +106,7 @@ /// Schedule pass P for execution. Make sure that passes required by /// P are run before P is run. Update analysis info maintained by /// the manager. Remove dead passes. This is a recursive function. - void schedulePass(Pass *P, Pass *PM); + void schedulePass(Pass *P); /// This is implemented by top level pass manager and used by /// schedulePass() to add analysis info passes that are not available. @@ -181,7 +181,7 @@ /// Schedule pass P for execution. Make sure that passes required by /// P are run before P is run. Update analysis info maintained by /// the manager. Remove dead passes. This is a recursive function. -void PMTopLevelManager::schedulePass(Pass *P, Pass *PM) { +void PMTopLevelManager::schedulePass(Pass *P) { // TODO : Allocate function manager for this pass, other wise required set // may be inserted into previous function manager @@ -196,7 +196,7 @@ if (!AnalysisPass) { // Schedule this analysis run first. AnalysisPass = (*I)-createPass(); - schedulePass(AnalysisPass, PM); + schedulePass(AnalysisPass); } } @@ -386,7 +386,7 @@ /// there is no need to delete the pass. (TODO delete passes.) /// This implies that all passes MUST be allocated with 'new'. void add(Pass *P) { -schedulePass(P, this); +schedulePass(P); } /// Add pass into the pass manager queue. @@ -458,7 +458,7 @@ /// will be destroyed as well, so there is no need to delete the pass. This /// implies that all passes MUST be allocated with 'new'. void add(Pass *P) { -schedulePass(P, this); +schedulePass(P); } /// run - Execute all of the passes scheduled for execution. Keep track of ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.66 - 1.67 --- Log message: Do not keep yet another list of pass managers in PassManagerImpl_New. Use one provided by toplevel manager. --- Diffs of the changes: (+9 -8) PassManager.cpp | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.66 llvm/lib/VMCore/PassManager.cpp:1.67 --- llvm/lib/VMCore/PassManager.cpp:1.66Fri Dec 8 16:34:02 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 16:47:25 2006 @@ -137,6 +137,10 @@ return ImmutablePasses; } + void addPassManager(Pass *Manager) { +PassManagers.push_back(Manager); + } + private: /// Collection of pass managers @@ -479,9 +483,6 @@ /// Add a pass into a passmanager queue. bool addPass(Pass *p); - // Collection of pass managers - std::vectorModulePassManager_New * PassManagers; - // Active Pass Manager ModulePassManager_New *activeManager; }; @@ -1018,7 +1019,7 @@ if (!activeManager || !activeManager-addPass(P)) { activeManager = new ModulePassManager_New(getDepth() + 1); -PassManagers.push_back(activeManager); +addPassManager(activeManager); return activeManager-addPass(P); } return true; @@ -1029,10 +1030,10 @@ bool PassManagerImpl_New::run(Module M) { bool Changed = false; - for (std::vectorModulePassManager_New *::iterator itr = PassManagers.begin(), - e = PassManagers.end(); itr != e; ++itr) { -ModulePassManager_New *pm = *itr; -Changed |= pm-runOnModule(M); + for (std::vectorPass *::iterator I = passManagersBegin(), + E = passManagersEnd(); I != E; ++I) { +ModulePassManager_New *MP = dynamic_castModulePassManager_New *(*I); +Changed |= MP-runOnModule(M); } return Changed; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.67 - 1.68 --- Log message: Implement top level FunctionPassManager::run(Function F) --- Diffs of the changes: (+15 -1) PassManager.cpp | 16 +++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.67 llvm/lib/VMCore/PassManager.cpp:1.68 --- llvm/lib/VMCore/PassManager.cpp:1.67Fri Dec 8 16:47:25 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 16:57:48 2006 @@ -401,6 +401,7 @@ /// so, return true. bool runOnModule(Module M); bool runOnFunction(Function F); + bool run(Function F); /// doInitialization - Run all of the initializers for the function passes. /// @@ -800,7 +801,7 @@ cerr Error reading bytecode file: errstr \n; abort(); } - return FPM-runOnFunction(F); + return FPM-run(F); } @@ -934,6 +935,19 @@ return Changed; } +// Execute all the passes managed by this top level manager. +// Return true if any function is modified by a pass. +bool FunctionPassManagerImpl_New::run(Function F) { + + bool Changed = false; + for (std::vectorPass *::iterator I = passManagersBegin(), + E = passManagersEnd(); I != E; ++I) { +FunctionPass *FP = dynamic_castFunctionPass *(*I); +Changed |= FP-runOnFunction(F); + } + return Changed; +} + //===--===// // ModulePassManager implementation ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.68 - 1.69 --- Log message: Keep track of other pass managers, that are not directly managed by top level manager. Use this info to findAnalysisPass. --- Diffs of the changes: (+19 -5) PassManager.cpp | 24 +++- 1 files changed, 19 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.68 llvm/lib/VMCore/PassManager.cpp:1.69 --- llvm/lib/VMCore/PassManager.cpp:1.68Fri Dec 8 16:57:48 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 17:11:43 2006 @@ -141,11 +141,21 @@ PassManagers.push_back(Manager); } + // Add Manager into the list of managers that are not directly + // maintained by this top level pass manager + void addOtherPassManager(Pass *Manager) { +OtherPassManagers.push_back(Manager); + } + private: /// Collection of pass managers std::vectorPass * PassManagers; + /// Collection of pass managers that are not directly maintained + /// by this pass manager + std::vectorPass * OtherPassManagers; + // Map to keep track of last user of the analysis pass. // LastUser-second is the last user of Lastuser-first. std::mapPass *, Pass * LastUser; @@ -231,14 +241,16 @@ } } - if (P) -return P; - - // Check pass managers; + // Check pass managers for (std::vectorPass *::iterator I = PassManagers.begin(), E = PassManagers.end(); P == NULL I != E; ++I) P = NULL; // FIXME: (*I)-findAnalysisPass(AID, false /* Search downward */); + // Check other pass managers + for (std::vectorPass *::iterator I = OtherPassManagers.begin(), + E = OtherPassManagers.end(); P == NULL I != E; ++I) +P = NULL; // FIXME: (*I)-findAnalysisPass(AID, false /* Search downward */); + return P; } @@ -839,6 +851,7 @@ activeBBPassManager = new BasicBlockPassManager_New(getDepth() + 1); addPassToManager(activeBBPassManager, false); + TPM-addOtherPassManager(activeBBPassManager); // Add pass into new manager. This time it must succeed. if (!activeBBPassManager-addPass(BP)) @@ -970,7 +983,8 @@ activeFunctionPassManager = new FunctionPassManagerImpl_New(getDepth() + 1); addPassToManager(activeFunctionPassManager, false); - + TPM-addOtherPassManager(activeFunctionPassManager); + // Add pass into new manager. This time it must succeed. if (!activeFunctionPassManager-addPass(FP)) assert(0 Unable to add pass); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassAnalysisSupport.h
Changes in directory llvm/include/llvm: PassAnalysisSupport.h updated: 1.22 - 1.23 --- Log message: Add AnalysisResolver_New. It is a replacement for existing AnalysisResolver. --- Diffs of the changes: (+44 -0) PassAnalysisSupport.h | 44 1 files changed, 44 insertions(+) Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.22 llvm/include/llvm/PassAnalysisSupport.h:1.23 --- llvm/include/llvm/PassAnalysisSupport.h:1.22Wed Feb 22 10:23:42 2006 +++ llvm/include/llvm/PassAnalysisSupport.h Fri Dec 8 17:28:54 2006 @@ -100,7 +100,51 @@ const std::vectorAnalysisID getPreservedSet() const { return Preserved; } }; +//===--===// +// AnalysisResolver - Simple interface used by Pass objects to pull all +// analysis information out of pass manager that is responsible to manage +// the pass. +// +class PMDataManager; +class AnalysisResolver_New { +private: + AnalysisResolver_New(); // DO NOT IMPLEMENT + +public: + AnalysisResolver_New(PMDataManager P) : PM(P) { } + + inline PMDataManager getPMDataManager() { return PM; } + + // Find pass that is implementing PI. + Pass *findImplPass(const PassInfo *PI) { +Pass *ResultPass = 0; +for (unsigned i = 0; i AnalysisImpls.size() ; ++i) { + if (AnalysisImpls[i].first == PI) { +ResultPass = AnalysisImpls[i].second; +break; + } +} +return ResultPass; + } + + void addAnalysisImplsPair(const PassInfo *PI, Pass *P) { +std::pairconst PassInfo*, Pass* pir = std::make_pair(PI,P); +AnalysisImpls.push_back(pir); + } + + // getAnalysisToUpdate - Return an analysis result or null if it doesn't exist + Pass *getAnalysisToUpdate(AnalysisID ID, bool Direction) const; + // AnalysisImpls - This keeps track of which passes implements the interfaces + // that are required by the current pass (to implement getAnalysis()). + // NOTE : Remove AnalysisImpls from class Pass, when AnalysisResolver_New + // replaces AnalysisResolver + std::vectorstd::pairconst PassInfo*, Pass* AnalysisImpls; + +private: + // PassManager that is used to resolve analysis info + PMDataManager PM; +}; //===--===// // AnalysisResolver - Simple interface implemented by PassManager objects that ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.69 - 1.70 --- Log message: Add AnalysisResolver_New. It is a replacement for existing AnalysisResolver. --- Diffs of the changes: (+8 -0) PassManager.cpp |8 1 files changed, 8 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.69 llvm/lib/VMCore/PassManager.cpp:1.70 --- llvm/lib/VMCore/PassManager.cpp:1.69Fri Dec 8 17:11:43 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 17:28:54 2006 @@ -675,6 +675,14 @@ return P; } + +//===--===// +// NOTE: Is this the right place to define this method ? +// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist +Pass *AnalysisResolver_New::getAnalysisToUpdate(AnalysisID ID, bool dir) const { + return PM.findAnalysisPass(ID, dir); +} + //===--===// // BasicBlockPassManager_New implementation ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Pass.h
Changes in directory llvm/include/llvm: Pass.h updated: 1.56 - 1.57 --- Log message: Add AnalysisResolver_New. --- Diffs of the changes: (+6 -1) Pass.h |7 ++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.56 llvm/include/llvm/Pass.h:1.57 --- llvm/include/llvm/Pass.h:1.56 Wed Dec 6 19:30:30 2006 +++ llvm/include/llvm/Pass.hFri Dec 8 17:52:04 2006 @@ -50,6 +50,7 @@ class FunctionPassManagerT; class ModulePassManager; struct AnalysisResolver; +class AnalysisResolver_New; // AnalysisID - Use the PassInfo to identify a pass... typedef const PassInfo* AnalysisID; @@ -62,6 +63,7 @@ class Pass { friend struct AnalysisResolver; AnalysisResolver *Resolver; // AnalysisResolver this pass is owned by... + AnalysisResolver_New *Resolver_New; // Used to resolve analysis const PassInfo *PassInfoCache; // AnalysisImpls - This keeps track of which passes implement the interfaces @@ -72,7 +74,7 @@ void operator=(const Pass); // DO NOT IMPLEMENT Pass(const Pass ); // DO NOT IMPLEMENT public: - Pass() : Resolver(0), PassInfoCache(0) {} + Pass() : Resolver(0), Resolver_New(0), PassInfoCache(0) {} virtual ~Pass() {} // Destructor is virtual so we can be subclassed /// getPassName - Return a nice clean name for a pass. This usually @@ -107,6 +109,9 @@ virtual void print(std::ostream O, const Module *M) const; void dump() const; // dump - call print(std::cerr, 0); + // Access AnalysisResolver_New + inline void setResolver(AnalysisResolver_New *AR) { Resolver_New = AR; } + inline AnalysisResolver_New *getResolver() { return Resolver_New; } /// getAnalysisUsage - This function should be overriden by passes that need /// analysis information to do their job. If a pass specifies that it uses a ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.70 - 1.71 --- Log message: Set AnalysisResolver for the passes when they are inserted into pass manager queuer. --- Diffs of the changes: (+29 -0) PassManager.cpp | 29 + 1 files changed, 29 insertions(+) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.70 llvm/lib/VMCore/PassManager.cpp:1.71 --- llvm/lib/VMCore/PassManager.cpp:1.70Fri Dec 8 17:28:54 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 17:53:00 2006 @@ -393,6 +393,15 @@ ~FunctionPassManagerImpl_New() { /* TODO */ }; inline void addTopLevelPass(Pass *P) { + +if (dynamic_castImmutablePass * (P)) { + + // P is a immutable pass then it will be managed by this + // top level manager. Set up analysis resolver to connect them. + AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + P-setResolver(AR); +} + addPass(P); } @@ -488,6 +497,15 @@ } inline void addTopLevelPass(Pass *P) { + +if (dynamic_castImmutablePass * (P)) { + + // P is a immutable pass and it will be managed by this + // top level manager. Set up analysis resolver to connect them. + AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + P-setResolver(AR); +} + addPass(P); } @@ -577,6 +595,11 @@ void PMDataManager::addPassToManager(Pass *P, bool ProcessAnalysis) { + // This manager is going to manage pass P. Set up analysis resolver + // to connect them. + AnalysisResolver_New *AR = new AnalysisResolver_New(*this); + P-setResolver(AR); + if (ProcessAnalysis) { // At the moment, this pass is the last user of all required passes. @@ -1055,6 +1078,12 @@ if (!activeManager || !activeManager-addPass(P)) { activeManager = new ModulePassManager_New(getDepth() + 1); + +// This top level manager is going to manage activeManager. +// Set up analysis resolver to connect them. +AnalysisResolver_New *AR = new AnalysisResolver_New(*this); +activeManager-setResolver(AR); + addPassManager(activeManager); return activeManager-addPass(P); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.72 - 1.73 --- Log message: Use analysis resolver to find the info. --- Diffs of the changes: (+11 -8) PassManager.cpp | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.72 llvm/lib/VMCore/PassManager.cpp:1.73 --- llvm/lib/VMCore/PassManager.cpp:1.72Fri Dec 8 17:57:43 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 18:07:38 2006 @@ -243,13 +243,13 @@ // Check pass managers for (std::vectorPass *::iterator I = PassManagers.begin(), - E = PassManagers.end(); P == NULL I != E; ++I) -P = NULL; // FIXME: (*I)-findAnalysisPass(AID, false /* Search downward */); + E = PassManagers.end(); P == NULL I != E; ++I) +P = (*I)-getResolver()-getAnalysisToUpdate(AID, false); // Check other pass managers for (std::vectorPass *::iterator I = OtherPassManagers.begin(), - E = OtherPassManagers.end(); P == NULL I != E; ++I) -P = NULL; // FIXME: (*I)-findAnalysisPass(AID, false /* Search downward */); + E = OtherPassManagers.end(); P == NULL I != E; ++I) +P = (*I)-getResolver()-getAnalysisToUpdate(AID, false); return P; } @@ -614,7 +614,10 @@ E = RequiredPasses.end(); I != E; ++I) { Pass *PRequired = *I; unsigned RDepth = 0; - //FIXME: RDepth = PRequired-getResolver()-getDepth(); + + PMDataManager DM = PRequired-getResolver()-getPMDataManager(); + RDepth = DM.getDepth(); + if (PDepth == RDepth) LastUses.push_back(PRequired); else if (PDepth RDepth) { @@ -694,9 +697,9 @@ // One solution is to collect managers in advance at TPM level. Pass *P = NULL; for(std::vectorPass *::iterator I = passVectorBegin(), -E = passVectorEnd(); P == NULL I!= E; ++I ) -P = NULL; // FIXME : P = (*I)-getResolver()-getAnalysisToUpdate(AID, false /* Do not search parents again */); - +E = passVectorEnd(); P == NULL I!= E; ++I ) { +P = (*I)-getResolver()-getAnalysisToUpdate(AID, false /* Do not search parents again */); + } return P; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.73 - 1.74 --- Log message: Top level pass manager keeps track of other managers, so this can be removed now. --- Diffs of the changes: (+1 -8) PassManager.cpp |9 + 1 files changed, 1 insertion(+), 8 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.73 llvm/lib/VMCore/PassManager.cpp:1.74 --- llvm/lib/VMCore/PassManager.cpp:1.73Fri Dec 8 18:07:38 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 18:09:12 2006 @@ -693,14 +693,7 @@ if (SearchParent) return TPM-findAnalysisPass(AID); - // FIXME : This is expensive and requires. Need to check only managers not all passes. - // One solution is to collect managers in advance at TPM level. - Pass *P = NULL; - for(std::vectorPass *::iterator I = passVectorBegin(), -E = passVectorEnd(); P == NULL I!= E; ++I ) { -P = (*I)-getResolver()-getAnalysisToUpdate(AID, false /* Do not search parents again */); - } - return P; + return NULL; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.74 - 1.75 --- Log message: Analysis resolver now manages AnalysisImpls for the given patch. --- Diffs of the changes: (+2 -1) PassManager.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.74 llvm/lib/VMCore/PassManager.cpp:1.75 --- llvm/lib/VMCore/PassManager.cpp:1.74Fri Dec 8 18:09:12 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 8 19:11:34 2006 @@ -675,7 +675,8 @@ Pass *Impl = findAnalysisPass(*I, true); if (Impl == 0) assert(0 Analysis used but not available!); -// TODO: P-AnalysisImpls.push_back(std::make_pair(*I, Impl)); +AnalysisResolver_New *AR = P-getResolver(); +AR-addAnalysisImplsPair(*I, Impl); } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/CodingStandards.html
Changes in directory llvm/docs: CodingStandards.html updated: 1.29 - 1.30 --- Log message: Add documentation for how to use the new LLVM streams. --- Diffs of the changes: (+75 -3) CodingStandards.html | 78 +-- 1 files changed, 75 insertions(+), 3 deletions(-) Index: llvm/docs/CodingStandards.html diff -u llvm/docs/CodingStandards.html:1.29 llvm/docs/CodingStandards.html:1.30 --- llvm/docs/CodingStandards.html:1.29 Mon Jul 31 15:18:48 2006 +++ llvm/docs/CodingStandards.html Fri Dec 8 19:20:34 2006 @@ -41,12 +41,15 @@ lia href=#hl_dontinclude#include as Little as Possible/a/li lia href=#hl_privateheadersKeep internal Headers Private/a/li + lia href=#ll_iostreamtt#include lt;iostreamgt;/tt is + emforbidden/em/a/li /ol/li lia href=#microThe Low Level Issues/a ol lia href=#ll_assertAssert Liberally/a/li lia href=#ll_ns_stdDo not use 'using namespace std'/a/li - lia href=#ll_virtual_anchProvide a virtual method anchor for clases in headers/a/li + lia href=#ll_virtual_anchProvide a virtual method anchor for + clases in headers/a/li lia href=#ll_preincrementPrefer Preincrement/a/li lia href=#ll_avoidendlAvoid ttstd::endl/tt/a/li /ol/li @@ -55,7 +58,8 @@ /ol div class=doc_author - pWritten by a href=mailto:[EMAIL PROTECTED]Chris Lattner/a/p + pWritten by a href=mailto:[EMAIL PROTECTED]Chris Lattner/a and + a href=mailto:[EMAIL PROTECTED]Bill Wendling/a/p /div @@ -482,6 +486,73 @@ /div +!-- ___ -- +div class=doc_subsubsection + a name=ll_iostreamtt#include lt;iostreamgt;/tt is forbidden/a +/div + +div class=doc_text + +pThe use of tt#include lt;iostreamgt;/tt in library files is +hereby bemforbidden/em/b. The primary reason for doing this is to +support clients using LLVM libraries as part of larger systems. In particular, +we statically link LLVM into some dynamic libraries. Even if LLVM isn't used, +the static c'tors are run whenever an application start up that uses the dynamic +library. There are two problems with this:/p + +ol + liThe time to run the static c'tors impacts startup time of + applicationsmdash;a critical time for gui apps./li + liThe static c'tors cause the app to pull many extra pages of memory off the + disk: both the code for the static c'tors in each .o file and the small + amount of data that gets touched. In addition, touched/dirty pages put + more pressure on the VM system on low-memory machines./li +/ol + +table + tbody +tr + thOld Way/th + thNew Way/th +/tr +tr + td align=leftpre#include lt;iostreamgt;/pre/td + td align=leftpre#include llvm/Support/Streams.h/pre/td +/tr +tr + td align=leftpreDEBUG(std::cerr lt;lt; ...);/pre/td + td align=leftpreDOUT lt;lt; ...;/pre/td +/tr +tr + td align=leftprestd::cerr lt;lt; Hello world\n;/pre/td + td align=leftprellvm::cerr lt;lt; Hello world\n;/pre/td +/tr +tr + td align=leftprestd::cout lt;lt; Hello world\n;/pre/td + td align=leftprellvm::cout lt;lt; Hello world\n;/pre/td +/tr +tr + td align=leftprestd::cin gt;gt; Var;/pre/td + td align=leftprellvm::cin gt;gt; Var;/pre/td +/tr +tr + td align=leftprestd::ostream/pre/td + td align=leftprellvm::OStream/pre/td +/tr +tr + td align=leftprestd::istream/pre/td + td align=leftprellvm::IStream/pre/td +/tr +tr + td align=leftprestd::stringstream/pre/td + td align=leftprellvm::StringStream/pre/td +/tr + /tbody +/table + +/div + + !-- === -- div class=doc_subsection a name=microThe Low Level Issues/a @@ -631,6 +702,7 @@ /div + !-- *** -- div class=doc_section a name=seealsoSee Also/a @@ -672,7 +744,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/07/31 20:18:48 $ + Last modified: $Date: 2006/12/09 01:20:34 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/CodingStandards.html
Changes in directory llvm/docs: CodingStandards.html updated: 1.30 - 1.31 --- Log message: Another example of using the llvm IO streams. --- Diffs of the changes: (+8 -1) CodingStandards.html |9 - 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/docs/CodingStandards.html diff -u llvm/docs/CodingStandards.html:1.30 llvm/docs/CodingStandards.html:1.31 --- llvm/docs/CodingStandards.html:1.30 Fri Dec 8 19:20:34 2006 +++ llvm/docs/CodingStandards.html Fri Dec 8 19:27:51 2006 @@ -547,6 +547,13 @@ td align=leftprestd::stringstream/pre/td td align=leftprellvm::StringStream/pre/td /tr +tr + td align=leftprevoid print(std::ostream Out); +// ... +print(std::cerr);/pre/td + td align=leftprevoid print(std::ostream Out); +// ... +print(*llvm::cerr.stream());/pre/td /tbody /table @@ -744,7 +751,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/09 01:20:34 $ + Last modified: $Date: 2006/12/09 01:27:51 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/CodingStandards.html
Changes in directory llvm/docs: CodingStandards.html updated: 1.31 - 1.32 --- Log message: Fixed some formatting. --- Diffs of the changes: (+29 -28) CodingStandards.html | 57 +-- 1 files changed, 29 insertions(+), 28 deletions(-) Index: llvm/docs/CodingStandards.html diff -u llvm/docs/CodingStandards.html:1.31 llvm/docs/CodingStandards.html:1.32 --- llvm/docs/CodingStandards.html:1.31 Fri Dec 8 19:27:51 2006 +++ llvm/docs/CodingStandards.html Fri Dec 8 19:35:43 2006 @@ -49,7 +49,7 @@ lia href=#ll_assertAssert Liberally/a/li lia href=#ll_ns_stdDo not use 'using namespace std'/a/li lia href=#ll_virtual_anchProvide a virtual method anchor for - clases in headers/a/li + classes in headers/a/li lia href=#ll_preincrementPrefer Preincrement/a/li lia href=#ll_avoidendlAvoid ttstd::endl/tt/a/li /ol/li @@ -616,42 +616,43 @@ !-- ___ -- div class=doc_subsubsection - a name=ll_ns_stdDo not use 'using namespace std'/a + a name=ll_ns_stdDo not use 'ttusing namespace std/tt'/a /div div class=doc_text pIn LLVM, we prefer to explicitly prefix all identifiers from the standard -namespace with an std:: prefix, rather than rely on using namespace std;. -/p +namespace with an ttstd::/tt prefix, rather than rely on +ttusing namespace std;/tt./p -p In header files, adding a 'using namespace XXX' directive pollutes the -namespace of any source file that includes the header. This is clearly a bad -thing./p - -pIn implementation files (e.g. .cpp files) the rule is more of a stylistic -rule, but is still important. Basically, using explicit namespace prefixes -makes -the code bmore clear/b - because it is immediately obvious what facilities -are being used and where they are coming from - and bmore portable/b - -because namespace clashes cannot occur between LLVM code and other namespaces. -The portability rule is important because different standard library -implementations expose different symbols (potentially ones they shouldn't) and -future revisions to the C++ standard will add more symbols to the std -namespace. As such, we never 'using namespace std;' in LLVM./p - -pThe exception to the general rule (i.e. it's not an exception for the std -namespace) is for implementation files. For example, all of the code in the -LLVM project implements code that lives in the 'llvm' namespace. As such, it -is ok, and actually more clear, for the .cpp files to have a 'using namespace -llvm' directive at their top, after the #includes. The general form of this -rule is that any .cpp file that implements code in any namespace may use that -namespace (and its parents), but should not use any others./p +p In header files, adding a 'ttusing namespace XXX/tt' directive pollutes +the namespace of any source file that includes the header. This is clearly a +bad thing./p + +pIn implementation files (e.g. .cpp files), the rule is more of a stylistic +rule, but is still important. Basically, using explicit namespace prefixes +makes the code bclearer/b, because it is immediately obvious what facilities +are being used and where they are coming from, and bmore portable/b, because +namespace clashes cannot occur between LLVM code and other namespaces. The +portability rule is important because different standard library implementations +expose different symbols (potentially ones they shouldn't), and future revisions +to the C++ standard will add more symbols to the ttstd/tt namespace. As +such, we never use 'ttusing namespace std;/tt' in LLVM./p + +pThe exception to the general rule (i.e. it's not an exception for +the ttstd/tt namespace) is for implementation files. For example, all of +the code in the LLVM project implements code that lives in the 'llvm' namespace. +As such, it is ok, and actually clearer, for the .cpp files to have a 'ttusing +namespace llvm/tt' directive at their top, after the tt#include/tts. The +general form of this rule is that any .cpp file that implements code in any +namespace may use that namespace (and its parents'), but should not use any +others./p /div !-- ___ -- div class=doc_subsubsection - a name=ll_virtual_anchProvide a virtual method anchor for clases in headers/a + a name=ll_virtual_anchProvide a virtual method anchor for classes + in headers/a /div div class=doc_text @@ -751,7 +752,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/09 01:27:51 $ + Last modified: $Date: 2006/12/09 01:35:43 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetOptions.h
Changes in directory llvm/include/llvm/Target: TargetOptions.h updated: 1.10 - 1.11 --- Log message: Added option -soft-float to generate SW fp library calls instead of fp instructions. --- Diffs of the changes: (+6 -0) TargetOptions.h |6 ++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Target/TargetOptions.h diff -u llvm/include/llvm/Target/TargetOptions.h:1.10 llvm/include/llvm/Target/TargetOptions.h:1.11 --- llvm/include/llvm/Target/TargetOptions.h:1.10 Tue May 23 13:18:46 2006 +++ llvm/include/llvm/Target/TargetOptions.hFri Dec 8 20:41:05 2006 @@ -48,6 +48,12 @@ /// and results are never NaNs or +-Infs. extern bool FiniteOnlyFPMathOption; extern bool FiniteOnlyFPMath(); + + /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified + /// on the command line. When this flag is on, the code generator will + /// generate libcalls to the software floating point library instead of + /// target FP instructions. + extern bool UseSoftFloat; } // End llvm namespace #endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp
Changes in directory llvm/lib/Target: TargetMachine.cpp updated: 1.55 - 1.56 --- Log message: Added option -soft-float to generate SW fp library calls instead of fp instructions. --- Diffs of the changes: (+7 -0) TargetMachine.cpp |7 +++ 1 files changed, 7 insertions(+) Index: llvm/lib/Target/TargetMachine.cpp diff -u llvm/lib/Target/TargetMachine.cpp:1.55 llvm/lib/Target/TargetMachine.cpp:1.56 --- llvm/lib/Target/TargetMachine.cpp:1.55 Thu Sep 7 18:39:26 2006 +++ llvm/lib/Target/TargetMachine.cpp Fri Dec 8 20:41:30 2006 @@ -27,6 +27,7 @@ bool NoExcessFPPrecision; bool UnsafeFPMath; bool FiniteOnlyFPMathOption; + bool UseSoftFloat; Reloc::Model RelocationModel; CodeModel::Model CMModel; } @@ -55,6 +56,12 @@ cl::desc(Enable optimizations that assumes non- NaNs / +-Infs), cl::location(FiniteOnlyFPMathOption), cl::init(false)); + cl::optbool, true + GenerateSoftFloatCalls(soft-float, + cl::desc(Generate software floating point library calls), + cl::location(UseSoftFloat), + cl::init(false)); + cl::optllvm::Reloc::Model, true DefRelocationModel( relocation-model, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp TargetLowering.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.422 - 1.423 SelectionDAGISel.cpp updated: 1.325 - 1.326 TargetLowering.cpp updated: 1.81 - 1.82 --- Log message: Preliminary soft float support. --- Diffs of the changes: (+74 -19) LegalizeDAG.cpp | 35 +++ SelectionDAGISel.cpp | 15 --- TargetLowering.cpp | 43 +++ 3 files changed, 74 insertions(+), 19 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.422 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.423 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.422 Thu Dec 7 14:04:42 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 8 20:42:38 2006 @@ -4351,9 +4351,8 @@ MVT::ValueType NVT = TLI.getTypeToTransformTo(VT); SDNode *Node = Op.Val; assert(getTypeAction(VT) == Expand Not an expanded type!); - assert((MVT::isInteger(VT) || VT == MVT::Vector) - Cannot expand FP values!); - assert(((MVT::isInteger(NVT) NVT VT) || VT == MVT::Vector) + assert(((MVT::isInteger(NVT) NVT VT) || MVT::isFloatingPoint(VT) || + VT == MVT::Vector) Cannot expand to FP value or to larger int value!); // See if we already expanded it. @@ -4583,9 +4582,18 @@ Tmp = TLI.LowerOperation(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp), DAG); } +MVT::ValueType NVT = Node-getValueType(0); +// f32 / f64 must be expanded to i32 / i64. +if (NVT == MVT::f32 || NVT == MVT::f64) { + Lo = DAG.getNode(ISD::BIT_CONVERT, TLI.getTypeToTransformTo(NVT), + Node-getOperand(0)); + Hi = DAG.getConstant(0, TLI.getTypeToTransformTo(NVT)); + break; +} + // Turn this into a load/store pair by default. if (Tmp.Val == 0) - Tmp = ExpandBIT_CONVERT(Node-getValueType(0), Node-getOperand(0)); + Tmp = ExpandBIT_CONVERT(NVT, Node-getOperand(0)); ExpandOp(Tmp, Lo, Hi); break; @@ -4858,6 +4866,25 @@ case ISD::UDIV: Lo = ExpandLibCall(__udivdi3, Node, Hi); break; case ISD::SREM: Lo = ExpandLibCall(__moddi3 , Node, Hi); break; case ISD::UREM: Lo = ExpandLibCall(__umoddi3, Node, Hi); break; + + case ISD::FADD: +Lo = ExpandLibCall(((VT == MVT::f32) ? __addsf3 : __adddf3), Node, Hi); +break; + case ISD::FSUB: +Lo = ExpandLibCall(((VT == MVT::f32) ? __subsf3 : __subdf3), Node, Hi); +break; + case ISD::FMUL: +Lo = ExpandLibCall(((VT == MVT::f32) ? __mulsf3 : __muldf3), Node, Hi); +break; + case ISD::FDIV: +Lo = ExpandLibCall(((VT == MVT::f32) ? __divsf3 : __divdf3), Node, Hi); +break; + case ISD::FP_EXTEND: +Lo = ExpandLibCall(__extendsfdf2, Node, Hi); +break; + case ISD::FP_ROUND: +Lo = ExpandLibCall(__truncdfsf2, Node, Hi); +break; } // Make sure the resultant values have been legalized themselves, unless this Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.325 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.326 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.325Thu Dec 7 14:04:42 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Dec 8 20:42:38 2006 @@ -2954,7 +2954,10 @@ // integers it is. MVT::ValueType NVT = getTypeToTransformTo(VT); unsigned NumVals = MVT::getSizeInBits(VT)/MVT::getSizeInBits(NVT); -if (NumVals == 2) { +if (NumVals == 1) { + SDOperand Tmp = SDOperand(Result, i++); + Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, VT, Tmp)); +} else if (NumVals == 2) { SDOperand Lo = SDOperand(Result, i++); SDOperand Hi = SDOperand(Result, i++); @@ -3040,7 +3043,10 @@ // integers it is. MVT::ValueType NVT = getTypeToTransformTo(VT); unsigned NumVals = MVT::getSizeInBits(VT)/MVT::getSizeInBits(NVT); -if (NumVals == 2) { +if (NumVals == 1) { + Ops.push_back(DAG.getNode(ISD::BIT_CONVERT, VT, Op)); + Ops.push_back(DAG.getConstant(isSigned, MVT::i32)); +} else if (NumVals == 2) { SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Op, DAG.getConstant(0, getPointerTy())); SDOperand Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, NVT, Op, @@ -3166,7 +3172,10 @@ ResVal = DAG.getNode(ISD::TRUNCATE, VT, ResVal); } else { assert(MVT::isFloatingPoint(VT)); - ResVal = DAG.getNode(ISD::FP_ROUND, VT, ResVal); + if (getTypeAction(VT) == Expand) +ResVal = DAG.getNode(ISD::BIT_CONVERT, VT, ResVal); + else +ResVal = DAG.getNode(ISD::FP_ROUND, VT, ResVal); } } } else if (RetTys.size() == 3) { Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u
[llvm-commits] CVS: llvm/utils/findmisopt
Changes in directory llvm/utils: findmisopt updated: 1.10 - 1.11 --- Log message: Allow the input of the test program to be specified. Don't generate the reference output for each comparison. --- Diffs of the changes: (+11 -5) findmisopt | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) Index: llvm/utils/findmisopt diff -u llvm/utils/findmisopt:1.10 llvm/utils/findmisopt:1.11 --- llvm/utils/findmisopt:1.10 Fri Dec 8 12:58:38 2006 +++ llvm/utils/findmisopt Fri Dec 8 22:42:33 2006 @@ -26,6 +26,8 @@ # is a directory into which intermediate results are placed # progargs # is a single argument containing all the arguments the program needs +# proginput +# is a file name from which stdin should be directed # match # if specified to any value causes the result code of the program to # be used to determine success/fail. If not specified success/fail is @@ -50,7 +52,11 @@ bcfile=$1 outdir=$2 args=$3 -match=$4 +input=$4 +if [ ! -f $input ] ; then + input=/dev/null +fi +match=$5 name=`basename $bcfile .bc` ll=$outdir/${name}.ll s=$outdir/${name}.s @@ -80,9 +86,11 @@ # Generate the disassembly llvm-dis $bcfile -o $ll -f || exit 1 -# Generate the non-optimized program +# Generate the non-optimized program and its output llc $bcfile -o $s -f || exit 1 gcc $s -o $prog $ldflags || exit 1 +$prog $args $out 21 $input +ex1=$? # Define the list of optimizations to run. This comprises the same set of # optimizations that gccas and gccld run, in the same order. @@ -98,9 +106,7 @@ llvm-dis $optbc -o $optll -f || exit llc $optbc -o $opts -f || exit gcc $opts -o $optprog $ldflags || exit - $prog $args $out 21 - ex1=$? - $optprog $args $optout 21 + $optprog $args $optout 21 $input ex2=$? if [ -n $match ] ; then ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll 2006-12-08-Select-ICmp.ll JavaCompare.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: 2006-12-08-Phi-ICmp-Op-Fold.ll added (r1.1) 2006-12-08-Select-ICmp.ll added (r1.1) JavaCompare.ll updated: 1.2 - 1.3 --- Log message: New test cases for regressions in the SetCC - ICmp patch. --- Diffs of the changes: (+97 -1) 2006-12-08-Phi-ICmp-Op-Fold.ll | 54 + 2006-12-08-Select-ICmp.ll | 42 +++ JavaCompare.ll |2 - 3 files changed, 97 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll:1.1 *** /dev/null Fri Dec 8 23:13:11 2006 --- llvm/test/Regression/Transforms/InstCombine/2006-12-08-Phi-ICmp-Op-Fold.ll Fri Dec 8 23:13:01 2006 *** *** 0 --- 1,54 + ; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep 'setlt' + ; ModuleID = 'visible.bc' + target datalayout = e-p:32:32 + target endian = little + target pointersize = 32 + target triple = i686-pc-linux-gnu + %struct.point = type { int, int } + + implementation ; Functions: + + int %visible(int %direction, long %p1.0, long %p2.0, long %p3.0) { + entry: + %p1_addr = alloca %struct.point ; %struct.point* [#uses=2] + %p2_addr = alloca %struct.point ; %struct.point* [#uses=2] + %p3_addr = alloca %struct.point ; %struct.point* [#uses=2] + alloca point = bitcast int 0 to int ; int [#uses=0] + %tmp = bitcast %struct.point* %p1_addr to { long }* ; { long }* [#uses=1] + %tmp = getelementptr { long }* %tmp, uint 0, uint 0 ; long* [#uses=1] + store long %p1.0, long* %tmp + %tmp1 = bitcast %struct.point* %p2_addr to { long }*; { long }* [#uses=1] + %tmp2 = getelementptr { long }* %tmp1, uint 0, uint 0 ; long* [#uses=1] + store long %p2.0, long* %tmp2 + %tmp3 = bitcast %struct.point* %p3_addr to { long }*; { long }* [#uses=1] + %tmp4 = getelementptr { long }* %tmp3, uint 0, uint 0 ; long* [#uses=1] + store long %p3.0, long* %tmp4 + %tmp = seteq int %direction, 0 ; bool [#uses=1] + %tmp5 = bitcast %struct.point* %p1_addr to { long }*; { long }* [#uses=1] + %tmp6 = getelementptr { long }* %tmp5, uint 0, uint 0 ; long* [#uses=1] + %tmp = load long* %tmp6 ; long [#uses=1] + %tmp7 = bitcast %struct.point* %p2_addr to { long }*; { long }* [#uses=1] + %tmp8 = getelementptr { long }* %tmp7, uint 0, uint 0 ; long* [#uses=1] + %tmp9 = load long* %tmp8; long [#uses=1] + %tmp10 = bitcast %struct.point* %p3_addr to { long }* ; { long }* [#uses=1] + %tmp11 = getelementptr { long }* %tmp10, uint 0, uint 0 ; long* [#uses=1] + %tmp12 = load long* %tmp11 ; long [#uses=1] + %tmp13 = call int %determinant( long %tmp, long %tmp9, long %tmp12 ) ; int [#uses=2] + br bool %tmp, label %cond_true, label %cond_false + + cond_true:; preds = %entry + %tmp14 = setlt int %tmp13, 0; bool [#uses=1] + %tmp14 = zext bool %tmp14 to int; int [#uses=1] + br label %return + + cond_false: ; preds = %entry + %tmp26 = setgt int %tmp13, 0; bool [#uses=1] + %tmp26 = zext bool %tmp26 to int; int [#uses=1] + br label %return + + return: ; preds = %cond_false, %cond_true + %retval.0 = phi int [ %tmp14, %cond_true ], [ %tmp26, %cond_false ] ; int [#uses=1] + ret int %retval.0 + } + + declare int %determinant(long, long, long) Index: llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll:1.1 *** /dev/null Fri Dec 8 23:13:16 2006 --- llvm/test/Regression/Transforms/InstCombine/2006-12-08-Select-ICmp.ll Fri Dec 8 23:13:01 2006 *** *** 0 --- 1,42 + ; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep select + target datalayout = e-p:32:32 + target endian = little + target pointersize = 32 + target triple = i686-pc-linux-gnu + %struct.point = type { int, int } + + implementation ; Functions: + + int %visible(int %direction, long %p1.0, long %p2.0, long %p3.0) { + entry: + %p1_addr = alloca %struct.point ; %struct.point* [#uses=2] + %p2_addr = alloca %struct.point ; %struct.point* [#uses=2] + %p3_addr = alloca %struct.point ; %struct.point* [#uses=2] + %tmp = bitcast %struct.point* %p1_addr to { long }* ; { long }* [#uses=1] + %tmp = getelementptr { long }* %tmp, int 0, uint 0
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: JavaCompare.ll updated: 1.3 - 1.4 --- Log message: Too soon to commit, revert. --- Diffs of the changes: (+1 -1) JavaCompare.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll diff -u llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.3 llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.4 --- llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll:1.3 Fri Dec 8 23:13:01 2006 +++ llvm/test/Regression/Transforms/InstCombine/JavaCompare.ll Fri Dec 8 23:13:50 2006 @@ -1,7 +1,7 @@ ; This is the sequence of stuff that the Java front-end expands for a single ; = comparison. Check to make sure we turn it into a = (only) -; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'icmp sle'| not grep '#uses' +; RUN: llvm-upgrade %s | llvm-as | opt -instcombine | llvm-dis | grep -v 'setle'| not grep '#uses' bool %le(int %A, int %B) { %c1 = setgt int %A, %B; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits