From baldrick at free.fr Mon Oct 6 03:14:19 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 06 Oct 2008 08:14:19 -0000 Subject: [llvm-commits] [llvm] r57166 - /llvm/trunk/docs/LangRef.html Message-ID: <200810060814.m968EJud018902@zion.cs.uiuc.edu> Author: baldrick Date: Mon Oct 6 03:14:18 2008 New Revision: 57166 URL: http://llvm.org/viewvc/llvm-project?rev=57166&view=rev Log: Clarify the relationship between byval and readonly/ readnone. Make clearer that readnone functions do not dereference pointer arguments. Do not use the highly ambiguous "side-effects" in the readonly description (since such functions can have control flow side-effects, such as throwing an exception, or looping for ever). Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57166&r1=57165&r2=57166&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Oct 6 03:14:18 2008 @@ -852,13 +852,16 @@ to memory, though some targets use it to distinguish between two different kinds of registers). Use of this attribute is target-specific. -
byval
+
byval
This indicates that the pointer parameter should really be passed by value to the function. The attribute implies that a hidden copy of the pointee is made between the caller and the callee, so the callee is unable to modify the value in the callee. This attribute is only valid on LLVM pointer arguments. It is generally used to pass structs and arrays by - value, but is also valid on pointers to scalars.
+ value, but is also valid on pointers to scalars. The copy is considered to + belong to the caller not the callee (for example, + readonly functions should not write to + byval parameters).
sret
This indicates that the pointer parameter specifies the address of a @@ -948,19 +951,21 @@ behavior is undefined.
readnone
-
This attribute indicates that the function computes its result (or its -thrown exception) based strictly on its arguments. It does not read any global -mutable state (e.g. memory, control registers, etc) visible to caller functions. -Furthermore, readnone functions never change any state visible to their -caller. - -
readonly
-
This function attribute indicates that the function has no side-effects on -the calling function, but that it depends on state (memory state, control -register state, etc) that may be set in the caller. A readonly function always -returns the same value (or throws the same exception) whenever it is called with -a particular set of arguments and global state.
- +
This attribute indicates that the function computes its result (or the +exception it throws) based strictly on its arguments, without dereferencing any +pointer arguments or otherwise accessing any mutable state (e.g. memory, control +registers, etc) visible to caller functions. It does not write through any +pointer arguments (including byval arguments) and +never changes any state visible to callers.
+ +
readonly
+
This attribute indicates that the function does not write through any +pointer arguments (including byval arguments) +or otherwise modify any state (e.g. memory, control registers, etc) visible to +caller functions. It may dereference pointer arguments and read state that may +be set in the caller. A readonly function always returns the same value (or +throws the same exception) when called with the same set of arguments and global +state.
From baldrick at free.fr Mon Oct 6 05:31:29 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 06 Oct 2008 10:31:29 -0000 Subject: [llvm-commits] [llvm] r57167 - in /llvm/trunk: configure test/FrontendObjC++/dg.exp test/lib/llvm.exp Message-ID: <200810061031.m96AVU4e024330@zion.cs.uiuc.edu> Author: baldrick Date: Mon Oct 6 05:31:21 2008 New Revision: 57167 URL: http://llvm.org/viewvc/llvm-project?rev=57167&view=rev Log: Actually run Obj-C++ tests if llvm-gcc supports. Before there were two problems: (1) configure turned "obj-c++" into "obj" in the langs line; (2) the dejagnu library called it objc++ not obj-c++. Now the problem is that some of these tests don't pass! Modified: llvm/trunk/configure llvm/trunk/test/FrontendObjC++/dg.exp llvm/trunk/test/lib/llvm.exp Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=57167&r1=57166&r2=57167&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Mon Oct 6 05:31:21 2008 @@ -34242,7 +34242,7 @@ LLVMGCC_MAJVERS=$llvmgccmajvers - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` LLVMGCC_LANGS=$llvmgcclangs { echo "$as_me:$LINENO: result: ok" >&5 Modified: llvm/trunk/test/FrontendObjC++/dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/dg.exp?rev=57167&r1=57166&r2=57167&view=diff ============================================================================== --- llvm/trunk/test/FrontendObjC++/dg.exp (original) +++ llvm/trunk/test/FrontendObjC++/dg.exp Mon Oct 6 05:31:21 2008 @@ -1,5 +1,5 @@ load_lib llvm.exp -if [ llvm_gcc_supports objc++ ] then { +if [ llvm_gcc_supports obj-c++ ] then { RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]] } Modified: llvm/trunk/test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm.exp?rev=57167&r1=57166&r2=57167&view=diff ============================================================================== --- llvm/trunk/test/lib/llvm.exp (original) +++ llvm/trunk/test/lib/llvm.exp Mon Oct 6 05:31:21 2008 @@ -237,7 +237,7 @@ c { set file cc1 } c++ { set file cc1plus } objc { set file cc1obj } - objc++ { set file cc1objplus } + obj-c++ { set file cc1objplus } fortran { set file f951 } default { return 0 } } From baldrick at free.fr Mon Oct 6 05:33:24 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 6 Oct 2008 12:33:24 +0200 Subject: [llvm-commits] [llvm] r57023 - /llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm In-Reply-To: <200810031812.m93ICxxF007306@zion.cs.uiuc.edu> References: <200810031812.m93ICxxF007306@zion.cs.uiuc.edu> Message-ID: <200810061233.24739.baldrick@free.fr> Hi Evan, > Added: > llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm this test fails for me (x86-32 linux) with test/FrontendObjC++/2008-10-3-EhValue.mm:25: error: invalid conversion from 'void*' to 'Frob*' test/FrontendObjC++/2008-10-3-EhValue.mm: In function 'void test(Object*)': test/FrontendObjC++/2008-10-3-EhValue.mm:32: error: invalid conversion from 'void*' to 'Frob*' test/FrontendObjC++/2008-10-3-EhValue.mm:37: error: invalid conversion from 'void*' to 'Frob*' test/FrontendObjC++/2008-10-3-EhValue.mm:38: error: invalid conversion from 'void*' to 'Object*' so I was unable to reproduce the problem you fixed (I want to fix it differently). Ciao, Duncan. PS: Maybe it fails for you too now I fixed the testsuite to actually run Obj-C++ tests :) From baldrick at free.fr Mon Oct 6 07:37:56 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 6 Oct 2008 14:37:56 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r57022 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200810031805.m93I5gFh007073@zion.cs.uiuc.edu> References: <200810031805.m93I5gFh007073@zion.cs.uiuc.edu> Message-ID: <200810061437.57014.baldrick@free.fr> Hi Evan, > Fix a bug in EmitCallOf which shows up only with assertion turned on. When it's processing a call argument that corresponds to eh_value or eh_select, grab the type of special variables ExceptionValue or ExceptionSelectorValue instead or it won't match the expected type. > > With assertion turned off, this bug doesn't cause any miscompilation because pointer types are *compatible*. But it's a bug anyway. I think the reason for this is while the generic code builds EXC_PTR_EXPR as a void*: tree-eh.c: x = build0 (EXC_PTR_EXPR, ptr_type_node); the objc (not obj-c++) front-end builds it as an objc_object_type: objc-act.c: return build0 (EXC_PTR_EXPR, objc_object_type); So the thing to do is simply bitcast to the right type in llvm-convert. Based on this theory, can you please test the attached patch for me (the testcase doesn't compile here, even though I built with obj-c++ support...). Thanks, Duncan. PS: There shouldn't be any issue with FILTER_EXPR as far as I can see. -------------- next part -------------- A non-text attachment was scrubbed... Name: evan.diff Type: text/x-patch Size: 1986 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081006/7ac90b17/attachment.bin From matthijs at stdin.nl Mon Oct 6 09:07:06 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Mon, 6 Oct 2008 16:07:06 +0200 Subject: [llvm-commits] Patch to update available analysis correctly Message-ID: <20081006140706.GA6091@katherina.student.utwente.nl> Hi All, please find a patch attached, which fixes the removeDeadPasses method of PMDataManager. This method removes any passes that are no longer used from the AvailableAnalysis map. This map maps PassInfo* to Pass*. In this map, a pass can appear multiple times, one time for its own PassInfo, and one for each analysis interface it implements. This is handled by recordAvailableAnalysis, which calls the getInterfacesImplemented method on the pass being added, and adds the pass to the map for each interface implemented. The removeDeadPasses method, however, does not do this iteration. It only removes the entry for the Pass itself from the map, leaving the entries for the interfaces the pass implements. This results in a pass that is no longer available (in particular, it has its releaseMemory method called) to be listed as the available pass for all the interfaces it implements. I can't find anything that caused this recently, it seems that this bug has been present for quite some time. Since this seems like quite a fundamental bug and I find it unlikely that is was not noticed before, I slightly doubt my analysis. However, the attached patch, which teaches removeDeadPasses to also remove the entries for interfaces a Pass implements, fixes my problems. As to those problems. I've noticed these problems first in our custom frontend. Fortunately, they turn out to be easily reproduced by pulling the following program through opt -inline -internalize: define void @foo() nounwind { ret void } define void @main(...) nounwind { call void @foo() ret void } The -inline option causes a callgraph to be constructed, and released immediately after inlining. The internalize pass knows how to update a call graph, but assumes that the callgraph is consistent with the code, so it crashes with the following assertion: opt: /home/kooijman/src/llvm-trunk/include/llvm/Analysis/CallGraph.h:103: llvm::CallGraphNode* llvm::CallGraph::operator[](const llvm::Function*): Assertion `I != FunctionMap.end() && "Function not in callgraph!"' failed. It seems that internalize updating CallGraph was only added in r56996 three days ago, which would explain this particular case from breaking now. Possibly all other analysis updating code is more robust and does not assume that the analysises they update are consistent (though this robustness is probably accidental), or there are no cases where analysises are updated after they got freed in the standard pass orderings. In any case, I think this is good to fix, and probably to get into 2.4 as well. I won't be able to commit this until next monday, so please commit the patch if you think it is correct. Gr. Matthijs -------------- next part -------------- Index: lib/VMCore/PassManager.cpp =================================================================== --- lib/VMCore/PassManager.cpp (revision 57166) +++ lib/VMCore/PassManager.cpp (working copy) @@ -779,13 +779,23 @@ if (TheTimeInfo) TheTimeInfo->passStarted(*I); (*I)->releaseMemory(); if (TheTimeInfo) TheTimeInfo->passEnded(*I); + if (const PassInfo *PI = (*I)->getPassInfo()) { + std::map::iterator Pos = + AvailableAnalysis.find(PI); - std::map::iterator Pos = - AvailableAnalysis.find((*I)->getPassInfo()); - - // It is possible that pass is already removed from the AvailableAnalysis - if (Pos != AvailableAnalysis.end()) - AvailableAnalysis.erase(Pos); + // It is possible that pass is already removed from the AvailableAnalysis + if (Pos != AvailableAnalysis.end()) + AvailableAnalysis.erase(Pos); + + // Remove all interfaces this pass implements, for which it is also + // listed as the available implementation. + const std::vector &II = PI->getInterfacesImplemented(); + for (unsigned i = 0, e = II.size(); i != e; ++i) { + Pos = AvailableAnalysis.find(II[i]); + if (Pos != AvailableAnalysis.end() && Pos->second == *I) + AvailableAnalysis.erase(Pos); + } + } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081006/d85c2d59/attachment.bin From baldrick at free.fr Mon Oct 6 09:11:26 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 6 Oct 2008 16:11:26 +0200 Subject: [llvm-commits] r55638 - /llvm/trunk/include/llvm/Function.h In-Reply-To: <654D6FA9-0471-414F-B2E2-E2BD21A37BF9@apple.com> References: <200809231027.53858.baldrick@free.fr> <654D6FA9-0471-414F-B2E2-E2BD21A37BF9@apple.com> Message-ID: <200810061611.26937.baldrick@free.fr> > I don't think we want the passes that make use function notes to guess > why one function is marked no-see and another is marked sse. It could > be for performance reason or for correctness reason. And these notes > don't really tell whether using sse is more efficient or not. > > I'd prefer just keeping it simple. If these target function notes > don't match, do not try to inline one into another. That was my suggestion too. More precisely, I proposed having three possibilities for a function: sse, no-see, "don't care" (which would mean that the function wasn't marked either sse or no-sse). The inliner would refuse to inline an sse function into a no-sse one and vice-versa. However a "don't care" can be inlined into any, while anything can be inlined into a "don't care" (the function would would then pick up any sse or no-sse attribute from the inlinee). For example, if a "don't care" function A calls a "no-sse" function B, and the callsite is inlined, then afterwards A would be marked "no-sse" too. The invariant that this scheme preserves is that any instruction that starts its life in an sse/no-sse function always finishes up in an sse/no-sse function. On the other hand, an instruction that starts in a "don't care" function may end up in a "don't care" function or a sse or a no-sse function. Ciao, Duncan. From kremenek at apple.com Mon Oct 6 10:23:51 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 06 Oct 2008 15:23:51 -0000 Subject: [llvm-commits] [llvm] r57168 - /llvm/tags/checker/checker-108/ Message-ID: <200810061523.m96FNpDT001249@zion.cs.uiuc.edu> Author: kremenek Date: Mon Oct 6 10:23:49 2008 New Revision: 57168 URL: http://llvm.org/viewvc/llvm-project?rev=57168&view=rev Log: Tagging checker-108. Added: llvm/tags/checker/checker-108/ - copied from r57167, llvm/trunk/ From matthijs at stdin.nl Mon Oct 6 11:23:31 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Mon, 06 Oct 2008 16:23:31 -0000 Subject: [llvm-commits] [llvm] r57177 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll Message-ID: <200810061623.m96GNWAu003214@zion.cs.uiuc.edu> Author: matthijs Date: Mon Oct 6 11:23:31 2008 New Revision: 57177 URL: http://llvm.org/viewvc/llvm-project?rev=57177&view=rev Log: Allow scalarrepl to treat an all-zero GEP just as bitcast. This includes not marking a GEP involving a vector as unsafe, but only when it has all zero indices. This allows scalarrepl to work in a few more cases. Added: llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=57177&r1=57176&r2=57177&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Oct 6 11:23:31 2008 @@ -530,7 +530,8 @@ return MarkUnsafe(Info); } } - + + bool hasVector = false; // Walk through the GEP type indices, checking the types that this indexes // into. @@ -539,22 +540,30 @@ if (isa(*I)) continue; - // Don't SROA pointers into vectors. - if (isa(*I)) - return MarkUnsafe(Info); - - // Otherwise, we must have an index into an array type. Verify that this is - // an in-range constant integer. Specifically, consider A[0][i]. We - // cannot know that the user isn't doing invalid things like allowing i to - // index an out-of-range subscript that accesses A[1]. Because of this, we - // have to reject SROA of any accesses into structs where any of the - // components are variables. ConstantInt *IdxVal = dyn_cast(I.getOperand()); if (!IdxVal) return MarkUnsafe(Info); - if (IdxVal->getZExtValue() >= cast(*I)->getNumElements()) - return MarkUnsafe(Info); - + + // Are all indices still zero? IsAllZeroIndices &= IdxVal->isZero(); + + if (const ArrayType *AT = dyn_cast(*I)) { + // This GEP indexes an array. Verify that this is an in-range constant + // integer. Specifically, consider A[0][i]. We cannot know that the user + // isn't doing invalid things like allowing i to index an out-of-range + // subscript that accesses A[1]. Because of this, we have to reject SROA + // of any accesses into structs where any of the components are variables. + if (IdxVal->getZExtValue() >= AT->getNumElements()) + return MarkUnsafe(Info); + } + + // Note if we've seen a vector type yet + hasVector |= isa(*I); + + // Don't SROA pointers into vectors, unless all indices are zero. When all + // indices are zero, we only consider this GEP as a bitcast, but will still + // not consider breaking up the vector. + if (hasVector && !IsAllZeroIndices) + return MarkUnsafe(Info); } // If there are any non-simple uses of this getelementptr, make sure to reject @@ -661,6 +670,11 @@ // It is likely that OtherPtr is a bitcast, if so, remove it. if (BitCastInst *BC = dyn_cast(OtherPtr)) OtherPtr = BC->getOperand(0); + // All zero GEPs are effectively casts + if (GetElementPtrInst *GEP = dyn_cast(OtherPtr)) + if (GEP->hasAllZeroIndices()) + OtherPtr = GEP->getOperand(0); + if (ConstantExpr *BCE = dyn_cast(OtherPtr)) if (BCE->getOpcode() == Instruction::BitCast) OtherPtr = BCE->getOperand(0); Added: llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll?rev=57177&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll (added) +++ llvm/trunk/test/Transforms/ScalarRepl/2008-09-22-vector-gep.ll Mon Oct 6 11:23:31 2008 @@ -0,0 +1,24 @@ +; This test checks to see if scalarrepl also works when a gep with all zeroes is +; used instead of a bitcast to prepare a memmove pointer argument. Previously, +; this would not work when there was a vector involved in the struct, preventing +; scalarrepl from removing the alloca below. + +; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis > %t +; RUN: cat %t | not grep alloca + +%struct.two = type <{ < 2 x i8 >, i16 }> + +define void @main(%struct.two* %D, i16 %V) { +entry: + %S = alloca %struct.two + %S.2 = getelementptr %struct.two* %S, i32 0, i32 1 + store i16 %V, i16* %S.2 + ; This gep is effectively a bitcast to i8*, but is sometimes generated + ; because the type of the first element in %struct.two is i8. + %tmpS = getelementptr %struct.two* %S, i32 0, i32 0, i32 0 + %tmpD = bitcast %struct.two* %D to i8* + call void @llvm.memmove.i32(i8* %tmpD, i8* %tmpS, i32 4, i32 1) + ret void +} + +declare void @llvm.memmove.i32(i8*, i8*, i32, i32) nounwind From matthijs at stdin.nl Mon Oct 6 11:25:37 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Mon, 6 Oct 2008 18:25:37 +0200 Subject: [llvm-commits] Struct-handling patches In-Reply-To: <4CFFB147-BF73-4B69-887D-A25FA9B6A629@apple.com> References: <20080928190454.GG15228@katherina.student.utwente.nl> <4CFFB147-BF73-4B69-887D-A25FA9B6A629@apple.com> Message-ID: <20081006162537.GH6091@katherina.student.utwente.nl> Hi Chris, > Since there has already been significant iteration on these, can you > please post the updated patches again, preferable one per email? I've commited the vector-gep patch, with the trivial improvements mentioned. As for the other patches, I'm not 100% sure on how to update them. The discussions have so far pointed out that the frontend might need change instead of the changes I've proposed. I'll see if I can summarize the discussion somewhere during the next days (but no time now). Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081006/996d39e7/attachment.bin From dpatel at apple.com Mon Oct 6 11:58:46 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 6 Oct 2008 09:58:46 -0700 Subject: [llvm-commits] [llvm] r56704 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> References: <200809262253.m8QMr8A4018093@zion.cs.uiuc.edu> <200809290925.32325.baldrick@free.fr> <42DB07A3-81AA-4D6B-AF5F-040D0673D431@apple.com> <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> Message-ID: On Oct 4, 2008, at 11:33 AM, Dan Gohman wrote: > Hi Devang, > > Something in the recent attribute changes is breaking > backwards compatibility with bitcocde files produced by > LLVM 2.2, and perhaps other versions, but that's what > I have handy at the moment. I'll investigate this. We want to fix this in 2.4. - Devang > > > If I take this testcase: > > > define i32 @foo() { > %t = call i32 @bar() nounwind readonly > ret i32 %t > } > > declare i32 @bar() nounwind readonly > > > Compiling with an LLVM 2.2 llvm-as and disassembling with a TOT > llvm-dis, I get this: > > > define i32 @foo() { > %t = call nounwind readonly i32 @bar() nounwind readonly > ret i32 %t > } > > > declare nounwind readonly i32 @bar() nounwind readonly > > > TOT llvm-as doesn't like that: > llvm-as: new.ll:4,0: new.ll:4: error: syntax error, unexpected > NOUNWIND > while reading token: 'nounwind' > > > Also, TOT llvm-ld similarly doesn't like 2.2-produced bitcode files, > and gives this error: > Attribute nounwind only applies to return values! > %tmp7 = call nounwind i32 (...)* @atoi(i8* %tmp6) nounwind > ; [#uses=1] > > Dan > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits - Devang From gohman at apple.com Mon Oct 6 12:03:38 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 6 Oct 2008 10:03:38 -0700 Subject: [llvm-commits] [llvm] r56704 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: References: <200809262253.m8QMr8A4018093@zion.cs.uiuc.edu> <200809290925.32325.baldrick@free.fr> <42DB07A3-81AA-4D6B-AF5F-040D0673D431@apple.com> <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> <3464ECD2-2B8B-4504-BB6B-07149D49026B@apple.com> Message-ID: <96643871-F034-4F14-A16B-CED0DBF54DC0@apple.com> On Oct 5, 2008, at 11:25 AM, Chris Lattner wrote: > > On Oct 4, 2008, at 12:07 PM, Chris Lattner wrote: > >> On Oct 4, 2008, at 11:33 AM, Dan Gohman wrote: >>> Hi Devang, >>> >>> Something in the recent attribute changes is breaking >>> backwards compatibility with bitcocde files produced by >>> LLVM 2.2, and perhaps other versions, but that's what >>> I have handy at the moment. >> >> Devang, please make this a high priority to address. This must be >> fixed before 2.4 is released. > > Dan, please reverify that this is still broken. I just fixed some > problems in the bcreader to make progress on other bugs. LLVM TOT now successfully reads the LLVM 2.2 bitcode form of my testcase. Thanks, Dan From dpatel at apple.com Mon Oct 6 12:30:08 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 17:30:08 -0000 Subject: [llvm-commits] [llvm] r57179 - in /llvm/trunk/lib: CodeGen/LoopAligner.cpp Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Message-ID: <200810061730.m96HU9FR005514@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 12:30:07 2008 New Revision: 57179 URL: http://llvm.org/viewvc/llvm-project?rev=57179&view=rev Log: Remove unncessary isDeclaration() checks. Modified: llvm/trunk/lib/CodeGen/LoopAligner.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/LoopAligner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LoopAligner.cpp?rev=57179&r1=57178&r2=57179&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LoopAligner.cpp (original) +++ llvm/trunk/lib/CodeGen/LoopAligner.cpp Mon Oct 6 12:30:07 2008 @@ -59,7 +59,7 @@ return false; // Don't care about loop alignment. const Function *F = MF.getFunction(); - if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize)) + if (F->hasFnAttr(Attribute::OptimizeForSize)) return false; for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) { Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=57179&r1=57178&r2=57179&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Mon Oct 6 12:30:07 2008 @@ -154,7 +154,7 @@ SwitchToSection(TAI->SectionForGlobal(F)); unsigned FnAlign = 4; - if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize)) + if (F->hasFnAttr(Attribute::OptimizeForSize)) FnAlign = 1; switch (F->getLinkage()) { default: assert(0 && "Unknown linkage type!"); Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp?rev=57179&r1=57178&r2=57179&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Mon Oct 6 12:30:07 2008 @@ -141,7 +141,7 @@ SwitchToTextSection("_text", F); unsigned FnAlign = 4; - if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize)) + if (F->hasFnAttr(Attribute::OptimizeForSize)) FnAlign = 1; switch (F->getLinkage()) { default: assert(0 && "Unsupported linkage type!"); From dpatel at apple.com Mon Oct 6 12:31:12 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 6 Oct 2008 10:31:12 -0700 Subject: [llvm-commits] [llvm] r56937 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/LoopAligner.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/TargetMachine.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/vec_shuffle-23.ll test/CodeGen/X86/vec_shuffle-24.ll In-Reply-To: <1B27645D-235F-4AA6-9C4F-99B14C15777D@apple.com> References: <200810012318.m91NIdJn001426@zion.cs.uiuc.edu> <1B27645D-235F-4AA6-9C4F-99B14C15777D@apple.com> Message-ID: On Oct 4, 2008, at 1:21 PM, Chris Lattner wrote: > On Oct 1, 2008, at 4:18 PM, Devang Patel wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=56937&view=rev >> Log: >> Remove OptimizeForSize global. Use function attribute optsize. > > Cool. > >> +++ llvm/trunk/lib/CodeGen/LoopAligner.cpp Wed Oct 1 18:18:38 2008 >> @@ -58,6 +58,10 @@ >> if (!Align) >> return false; // Don't care about loop alignment. >> >> + const Function *F = MF.getFunction(); >> + if (!F->isDeclaration() && F- >> >hasFnAttr(Attribute::OptimizeForSize)) >> + return false; > > Please remove the check for isDeclaration, F can never be a > declaration. Done > > >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp >> (original) >> +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Wed >> Oct 1 18:18:38 2008 >> @@ -153,7 +153,7 @@ >> >> SwitchToSection(TAI->SectionForGlobal(F)); >> >> - unsigned FnAlign = OptimizeForSize ? 1 : 4; >> + unsigned FnAlign = 4; >> if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize)) >> FnAlign = 1; > > Likewise. Done > > >> +++ llvm/trunk/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp Wed >> Oct 1 18:18:38 2008 >> @@ -140,7 +140,7 @@ >> >> SwitchToTextSection("_text", F); >> >> - unsigned FnAlign = OptimizeForSize ? 1 : 4; >> + unsigned FnAlign = 4; >> if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize)) >> FnAlign = 1; > > Likewise. Done > > >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) >> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Oct 1 >> 18:18:38 2008 >> @@ -137,7 +137,7 @@ >> ContainsFPCode(false), TM(tm), >> X86Lowering(*TM.getTargetLowering()), >> Subtarget(&TM.getSubtarget()), >> - OptForSize(OptimizeForSize) {} >> + OptForSize(false) {} > > Is OptForSize dead now? Please remove it. Yes, OptForSize is used by X86 instrction selector for SelectionDAG. - Devang From clattner at apple.com Mon Oct 6 12:32:47 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Oct 2008 10:32:47 -0700 Subject: [llvm-commits] [llvm] r56959 - in /llvm/trunk: include/llvm/CodeGen/LinkAllCodegenComponents.h include/llvm/CodeGen/Passes.h lib/CodeGen/PBQP.cpp lib/CodeGen/PBQP.h lib/CodeGen/RegAllocPBQP.cpp In-Reply-To: <91f7231a0810060333i4b1bac58v9a971537c9dadf6d@mail.gmail.com> References: <200810021829.m92ITS8x014885@zion.cs.uiuc.edu> <728927c70810041648q6d5fb95dj26d17910ee963a4e@mail.gmail.com> <91f7231a0810060333i4b1bac58v9a971537c9dadf6d@mail.gmail.com> Message-ID: <26D37754-4A4A-417C-B559-5F3A561060DD@apple.com> On Oct 6, 2008, at 3:33 AM, Bernhard Scholz wrote: > Dear Chris, > > Lang (and I) has been working on the heuristic register allocator in > the last few weeks. Note > that the submitted PBQP solver is not the latest PBQP library that > includes branch > and bound and other heuristics to solve PBQP problems. It contains a > heuristic solver > that was specifically changed for register allocation (see JMLC'06 > paper). Lang plans > to further change the solver so that it becomes more compliant with > C++ and the LLVM > project. > > Herewith, I confirm that we contribute the PBQP solver for register > allocation to the > LLVM project under the Illinois license. Excellent, many thanks Bernhard! It sounds like a very interesting project, thank you for contributing it to LLVM. -Chris > > > Regards, > Bernhard. > > On Mon, Oct 6, 2008 at 2:56 PM, Chris Lattner > wrote: >> >> On Oct 4, 2008, at 4:48 PM, Lang Hames wrote: >> >>> Hi Chris, >>> >>> I have spoken to Bernhard (he's my Supervisor at the University of >>> Sydney) - he has okay'd the switch to the Illinois license for the >>> solver, and is happy to see it in LLVM. >> >> That's great Lang, thanks! >> >> Bernhard, can you please confirm that it is ok to relicense your >> code until >> the UIUC license (which is basically a BSD license)? Thanks, >> >> -Chris >> >>> >>> >>> Bernhard - any comment? >>> >>> Cheers, >>> Lang. >>> >>> On Sun, Oct 5, 2008 at 7:35 AM, Chris Lattner >>> wrote: >>>> >>>> On Oct 2, 2008, at 11:29 AM, Evan Cheng wrote: >>>>> >>>>> URL: http://llvm.org/viewvc/llvm-project?rev=56959&view=rev >>>>> Log: >>>>> A Partitioned Boolean Quadratic Programming (PBQP) based register >>>>> allocator. >>>>> >>>>> Contributed by Lang Hames. >>>> >>>> Nice! Lang and Evan, >>>> >>>> What is the copyright and license of Bernhard Scholz PBQP >>>> solver? Did >>>> you >>>> contact Bernhard and ask him if it would be okay to change the >>>> copyright/license of his library to the Illinois license and the >>>> terms of >>>> the llvm developer policy? >>>> >>>> -Chris >>>> >>>> >> >> From clattner at apple.com Mon Oct 6 12:36:23 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Oct 2008 10:36:23 -0700 Subject: [llvm-commits] [llvm] r56937 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/LoopAligner.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/TargetMachine.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/vec_shuffle-23.ll test/CodeGen/X86/vec_shuffle-24.ll In-Reply-To: References: <200810012318.m91NIdJn001426@zion.cs.uiuc.edu> <1B27645D-235F-4AA6-9C4F-99B14C15777D@apple.com> Message-ID: <9E51EB2C-7AAD-4FF7-B761-0374C4AF061C@apple.com> On Oct 6, 2008, at 10:31 AM, Devang Patel wrote: >> On Oct 1, 2008, at 4:18 PM, Devang Patel wrote: >>> URL: http://llvm.org/viewvc/llvm-project?rev=56937&view=rev >>> Log: >>> Remove OptimizeForSize global. Use function attribute optsize. >> >> Cool. >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) >>> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Oct 1 >>> 18:18:38 2008 >>> @@ -137,7 +137,7 @@ >>> ContainsFPCode(false), TM(tm), >>> X86Lowering(*TM.getTargetLowering()), >>> Subtarget(&TM.getSubtarget()), >>> - OptForSize(OptimizeForSize) {} >>> + OptForSize(false) {} >> >> Is OptForSize dead now? Please remove it. > > Yes, OptForSize is used by X86 instrction selector for SelectionDAG. Aha, I see, thanks Devang. Isn't this a bug though? void X86DAGToDAGISel::InstructionSelect() { CurBB = BB; // BB can change as result of isel. if (!OptForSize) { const Function *F = CurDAG->getMachineFunction().getFunction(); OptForSize = !F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize); } If you have two functions in a module and the first one is marked opt- for-size, they will both be optimized for size. Plus the declaration check is dead. I'd go with unconditional code: const Function *F = CurDAG->getMachineFunction().getFunction(); OptForSize = F->hasFnAttr(Attribute::OptimizeForSize); -Chris From dpatel at apple.com Mon Oct 6 12:53:52 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 6 Oct 2008 10:53:52 -0700 Subject: [llvm-commits] [llvm] r56704 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> References: <200809262253.m8QMr8A4018093@zion.cs.uiuc.edu> <200809290925.32325.baldrick@free.fr> <42DB07A3-81AA-4D6B-AF5F-040D0673D431@apple.com> <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> Message-ID: On Oct 4, 2008, at 11:33 AM, Dan Gohman wrote: > Hi Devang, > > Something in the recent attribute changes is breaking > backwards compatibility with bitcocde files produced by > LLVM 2.2, and perhaps other versions, but that's what > I have handy at the moment. > > If I take this testcase: > > > define i32 @foo() { > %t = call i32 @bar() nounwind readonly > ret i32 %t > } > > declare i32 @bar() nounwind readonly > > > Compiling with an LLVM 2.2 llvm-as and disassembling with a TOT > llvm-dis, I get this: > > > define i32 @foo() { > %t = call nounwind readonly i32 @bar() nounwind readonly > ret i32 %t > } > > declare nounwind readonly i32 @bar() nounwind readonly > > TOT llvm-as doesn't like that: > llvm-as: new.ll:4,0: new.ll:4: error: syntax error, unexpected > NOUNWIND > while reading token: 'nounwind' > > Also, TOT llvm-ld similarly doesn't like 2.2-produced bitcode files, > and gives this error: > Attribute nounwind only applies to return values! > %tmp7 = call nounwind i32 (...)* @atoi(i8* %tmp6) nounwind > ; [#uses=1] Chris fixed these issues. Thanks Chris! Note, if TOT assembled bc file is disassembled by 2.2 llvm-dis then call instruction will lose nounwind and readonly attributes, as expected. - Devang From clattner at apple.com Mon Oct 6 12:56:08 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Oct 2008 10:56:08 -0700 Subject: [llvm-commits] [llvm] r56704 - in /llvm/trunk: include/llvm/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: References: <200809262253.m8QMr8A4018093@zion.cs.uiuc.edu> <200809290925.32325.baldrick@free.fr> <42DB07A3-81AA-4D6B-AF5F-040D0673D431@apple.com> <36647.76.220.41.203.1223145232.squirrel@webmail.apple.com> Message-ID: <15ECDA0B-1B5A-4A45-BE73-017E26620C77@apple.com> On Oct 6, 2008, at 10:53 AM, Devang Patel wrote: > Chris fixed these issues. Thanks Chris! np > Note, if TOT assembled bc file is disassembled by 2.2 llvm-dis then > call instruction will lose nounwind and readonly attributes, as > expected. Right, we don't expect old tools to be able to read new files. New tools should read old files. -Chris From gohman at apple.com Mon Oct 6 12:56:52 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 6 Oct 2008 10:56:52 -0700 Subject: [llvm-commits] [llvm] r57049 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Transforms/IndVarsSimplify/2008-10-03-CouldNotCompute.ll In-Reply-To: <200810041119.m94BJ7Lo019402@zion.cs.uiuc.edu> References: <200810041119.m94BJ7Lo019402@zion.cs.uiuc.edu> Message-ID: <0AF89826-5395-4C39-854F-62BEAB4A039A@apple.com> Hi Nick, Is this the right approach? It would be much simpler to just fix evaluateAtIteration to check for return value of BinomialCoefficient for CNC and stop trying to do further computation. Or, are you envisioning someday adding code that would want to take advantage of being able to keep going after getting a CNC, because it's simpler to do so, or in hopes that it might be cancelled out later? Also, in the patch, there are several instances of code like this: > + if (isa(Op)) > + return new SCEVCouldNotCompute(); Instead of creating a new SCEV object, code like this can just return Op. Dan On Oct 4, 2008, at 4:19 AM, Nick Lewycky wrote: > Author: nicholas > Date: Sat Oct 4 06:19:07 2008 > New Revision: 57049 > > URL: http://llvm.org/viewvc/llvm-project?rev=57049&view=rev > Log: > Allow the construction of SCEVs with SCEVCouldNotCompute operands, by > implementing folding. Fixes PR2857. > > Added: > llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- > CouldNotCompute.ll > Modified: > llvm/trunk/lib/Analysis/ScalarEvolution.cpp > > Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=57049&r1=57048&r2=57049&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) > +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Oct 4 06:19:07 > 2008 > @@ -676,6 +676,9 @@ > return getAddRecExpr(Operands, AddRec->getLoop()); > } > > + if (isa(Op)) > + return new SCEVCouldNotCompute(); > + > SCEVTruncateExpr *&Result = (*SCEVTruncates)[std::make_pair(Op, > Ty)]; > if (Result == 0) Result = new SCEVTruncateExpr(Op, Ty); > return Result; > @@ -691,6 +694,9 @@ > // operands (often constants). This would allow analysis of > something like > // this: for (unsigned char X = 0; X < 100; ++X) { int Y = X; } > > + if (isa(Op)) > + return new SCEVCouldNotCompute(); > + > SCEVZeroExtendExpr *&Result = (*SCEVZeroExtends) > [std::make_pair(Op, Ty)]; > if (Result == 0) Result = new SCEVZeroExtendExpr(Op, Ty); > return Result; > @@ -706,6 +712,9 @@ > // operands (often constants). This would allow analysis of > something like > // this: for (signed char X = 0; X < 100; ++X) { int Y = X; } > > + if (isa(Op)) > + return new SCEVCouldNotCompute(); > + > SCEVSignExtendExpr *&Result = (*SCEVSignExtends) > [std::make_pair(Op, Ty)]; > if (Result == 0) Result = new SCEVSignExtendExpr(Op, Ty); > return Result; > @@ -734,6 +743,10 @@ > // Sort by complexity, this groups all similar expression types > together. > GroupByComplexity(Ops); > > + // Could not compute plus anything equals could not compute. > + if (isa(Ops.back())) > + return new SCEVCouldNotCompute(); > + > // If there are any constants, fold them together. > unsigned Idx = 0; > if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { > @@ -959,6 +972,21 @@ > // Sort by complexity, this groups all similar expression types > together. > GroupByComplexity(Ops); > > + if (isa(Ops.back())) { > + // CNC * 0 = 0 > + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { > + if (Ops[i]->getSCEVType() != scConstant) > + break; > + > + SCEVConstant *SC = cast(Ops[i]); > + if (SC->getValue()->isMinValue(false)) > + return SC; > + } > + > + // Otherwise, we can't compute it. > + return new SCEVCouldNotCompute(); > + } > + > // If there are any constants, fold them together. > unsigned Idx = 0; > if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { > @@ -1124,6 +1152,9 @@ > > // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't > overflow. > > + if (isa(LHS) || isa(RHS)) > + return new SCEVCouldNotCompute(); > + > SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)]; > if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS); > return Result; > @@ -1171,6 +1202,12 @@ > } > } > > + // Refuse to build an AddRec out of SCEVCouldNotCompute. > + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { > + if (isa(Operands[i])) > + return new SCEVCouldNotCompute(); > + } > + > SCEVAddRecExpr *&Result = > (*SCEVAddRecExprs)[std::make_pair(L, > std::vector(Operands.begin(), > > Operands.end()))]; > @@ -1193,6 +1230,21 @@ > // Sort by complexity, this groups all similar expression types > together. > GroupByComplexity(Ops); > > + if (isa(Ops.back())) { > + // CNC smax +inf = +inf. > + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { > + if (Ops[i]->getSCEVType() != scConstant) > + break; > + > + SCEVConstant *SC = cast(Ops[i]); > + if (SC->getValue()->isMaxValue(true)) > + return SC; > + } > + > + // Otherwise, we can't compute it. > + return new SCEVCouldNotCompute(); > + } > + > // If there are any constants, fold them together. > unsigned Idx = 0; > if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { > @@ -1273,6 +1325,21 @@ > // Sort by complexity, this groups all similar expression types > together. > GroupByComplexity(Ops); > > + if (isa(Ops[0])) { > + // CNC umax inf = inf. > + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { > + if (Ops[i]->getSCEVType() != scConstant) > + break; > + > + SCEVConstant *SC = cast(Ops[i]); > + if (SC->getValue()->isMaxValue(false)) > + return SC; > + } > + > + // Otherwise, we can't compute it. > + return new SCEVCouldNotCompute(); > + } > + > // If there are any constants, fold them together. > unsigned Idx = 0; > if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { > > Added: llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- > CouldNotCompute.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03-CouldNotCompute.ll?rev=57049&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- > CouldNotCompute.ll (added) > +++ llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- > CouldNotCompute.ll Sat Oct 4 06:19:07 2008 > @@ -0,0 +1,32 @@ > +; RUN: llvm-as < %s | opt -indvars > +; PR2857 > + > + at foo = external global i32 ; [#uses=1] > + > +define void @test(i32 %n, i32 %arg) { > +entry: > + br i1 false, label %bb.nph, label %return > + > +bb.nph: ; preds = %entry > + %0 = load i32* @foo, align 4 ; [#uses=1] > + %1 = sext i32 %0 to i64 ; [#uses=1] > + br label %bb > + > +bb: ; preds = %bb, %bb.nph > + %.in = phi i32 [ %2, %bb ], [ %n, %bb.nph ] ; [#uses=1] > + %val.02 = phi i64 [ %5, %bb ], [ 0, %bb.nph ] ; [#uses=2] > + %result.01 = phi i64 [ %4, %bb ], [ 0, %bb.nph ] ; [#uses=1] > + %2 = add i32 %.in, -1 ; [#uses=2] > + %3 = mul i64 %1, %val.02 ; [#uses=1] > + %4 = add i64 %3, %result.01 ; [#uses=2] > + %5 = add i64 %val.02, 1 ; [#uses=1] > + %6 = icmp sgt i32 %2, 0 ; [#uses=1] > + br i1 %6, label %bb, label %bb3.bb4_crit_edge > + > +bb3.bb4_crit_edge: ; preds = %bb > + %.lcssa = phi i64 [ %4, %bb ] ; [#uses=0] > + ret void > + > +return: ; preds = %entry > + ret void > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Mon Oct 6 12:56:52 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 6 Oct 2008 10:56:52 -0700 Subject: [llvm-commits] [llvm] r56937 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/LoopAligner.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp lib/Target/TargetMachine.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp lib/Target/X86/X86ISelDAGToDAG.cpp test/CodeGen/X86/vec_shuffle-23.ll test/CodeGen/X86/vec_shuffle-24.ll In-Reply-To: <9E51EB2C-7AAD-4FF7-B761-0374C4AF061C@apple.com> References: <200810012318.m91NIdJn001426@zion.cs.uiuc.edu> <1B27645D-235F-4AA6-9C4F-99B14C15777D@apple.com> <9E51EB2C-7AAD-4FF7-B761-0374C4AF061C@apple.com> Message-ID: On Oct 6, 2008, at 10:36 AM, Chris Lattner wrote: >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) >>>> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Oct 1 >>>> 18:18:38 2008 >>>> @@ -137,7 +137,7 @@ >>>> ContainsFPCode(false), TM(tm), >>>> X86Lowering(*TM.getTargetLowering()), >>>> Subtarget(&TM.getSubtarget()), >>>> - OptForSize(OptimizeForSize) {} >>>> + OptForSize(false) {} >>> >>> Is OptForSize dead now? Please remove it. >> >> Yes, OptForSize is used by X86 instrction selector for SelectionDAG. > > Aha, I see, thanks Devang. Isn't this a bug though? > void X86DAGToDAGISel::InstructionSelect() { > CurBB = BB; // BB can change as result of isel. > if (!OptForSize) { > const Function *F = CurDAG->getMachineFunction().getFunction(); > OptForSize = !F->isDeclaration() && > F->hasFnAttr(Attribute::OptimizeForSize); > } > > > If you have two functions in a module and the first one is marked > opt-for-size, they will both be optimized for size. Yes, this is a bug. > Plus the declaration check is dead. I'd go with unconditional code: > > const Function *F = CurDAG->getMachineFunction().getFunction(); > OptForSize = F->hasFnAttr(Attribute::OptimizeForSize); Makes sense. - Devang From gohman at apple.com Mon Oct 6 13:00:08 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 06 Oct 2008 18:00:08 -0000 Subject: [llvm-commits] [llvm] r57181 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp Message-ID: <200810061800.m96I09do006512@zion.cs.uiuc.edu> Author: djg Date: Mon Oct 6 13:00:07 2008 New Revision: 57181 URL: http://llvm.org/viewvc/llvm-project?rev=57181&view=rev Log: Don't dereference the end() iterator. Thanks to ENABLE_EXPENSIVE_CHECKS for finding this. Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=57181&r1=57180&r2=57181&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original) +++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Mon Oct 6 13:00:07 2008 @@ -143,7 +143,7 @@ LowSpillSlot = SS; if (HighSpillSlot == NO_STACK_SLOT || SS > HighSpillSlot) HighSpillSlot = SS; - I->second = SS; + EmergencySpillSlots[RC] = SS; return SS; } From dpatel at apple.com Mon Oct 6 13:03:39 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 18:03:39 -0000 Subject: [llvm-commits] [llvm] r57182 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200810061803.m96I3d7t006623@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 13:03:39 2008 New Revision: 57182 URL: http://llvm.org/viewvc/llvm-project?rev=57182&view=rev Log: It is possible that all functions in one module are not being optimized for size. Set OptForSize for each function separately. Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=57182&r1=57181&r2=57182&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Oct 6 13:03:39 2008 @@ -642,11 +642,8 @@ /// when it has created a SelectionDAG for us to codegen. void X86DAGToDAGISel::InstructionSelect() { CurBB = BB; // BB can change as result of isel. - if (!OptForSize) { - const Function *F = CurDAG->getMachineFunction().getFunction(); - OptForSize = !F->isDeclaration() && - F->hasFnAttr(Attribute::OptimizeForSize); - } + const Function *F = CurDAG->getMachineFunction().getFunction(); + OptForSize = F->hasFnAttr(Attribute::OptimizeForSize); DEBUG(BB->dump()); if (!Fast) From evan.cheng at apple.com Mon Oct 6 13:16:03 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 06 Oct 2008 18:16:03 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57183 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200810061816.m96IG3qH007040@zion.cs.uiuc.edu> Author: evancheng Date: Mon Oct 6 13:16:02 2008 New Revision: 57183 URL: http://llvm.org/viewvc/llvm-project?rev=57183&view=rev Log: Further simplify code per Duncan's feedback. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=57183&r1=57182&r2=57183&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Oct 6 13:16:02 2008 @@ -3271,13 +3271,10 @@ if (const VectorType *VTy = dyn_cast(Ty)) { unsigned NumElements = VTy->getNumElements(); const Type *EltTy = VTy->getElementType(); - if (EltTy == Type::FloatTy) - return VectorType::get(Type::Int32Ty, NumElements); - else if (EltTy == Type::DoubleTy) - return VectorType::get(Type::Int64Ty, NumElements); - } else - return IntegerType::get(Ty->getPrimitiveSizeInBits()); - return NULL; + return VectorType::get(IntegerType::get(EltTy->getPrimitiveSizeInBits()), + NumElements); + } + return IntegerType::get(Ty->getPrimitiveSizeInBits()); } Value *TreeToLLVM::EmitBIT_NOT_EXPR(tree exp) { From alenhar2 at cs.uiuc.edu Mon Oct 6 13:17:18 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 06 Oct 2008 18:17:18 -0000 Subject: [llvm-commits] [poolalloc] r57184 - in /poolalloc/trunk/test: TEST.poolalloc.Makefile TEST.poolalloc.report Message-ID: <200810061817.m96IHIVj007087@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Oct 6 13:17:18 2008 New Revision: 57184 URL: http://llvm.org/viewvc/llvm-project?rev=57184&view=rev Log: fix test script Modified: poolalloc/trunk/test/TEST.poolalloc.Makefile poolalloc/trunk/test/TEST.poolalloc.report Modified: poolalloc/trunk/test/TEST.poolalloc.Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.poolalloc.Makefile?rev=57184&r1=57183&r2=57184&view=diff ============================================================================== --- poolalloc/trunk/test/TEST.poolalloc.Makefile (original) +++ poolalloc/trunk/test/TEST.poolalloc.Makefile Mon Oct 6 13:17:18 2008 @@ -186,28 +186,28 @@ # This rule diffs the post-poolallocated version to make sure we didn't break # the program! -$(PROGRAMS_TO_TEST:%=Output/%.poolalloc.diff): \ -Output/%.poolalloc.diff: Output/%.out-nat Output/%.poolalloc.out +$(PROGRAMS_TO_TEST:%=Output/%.poolalloc.diff-nat): \ +Output/%.poolalloc.diff-nat: Output/%.out-nat Output/%.poolalloc.out @cp Output/$*.out-nat Output/$*.poolalloc.out-nat -$(DIFFPROG) nat $*.poolalloc $(HIDEDIFF) -$(PROGRAMS_TO_TEST:%=Output/%.basepa.diff): \ -Output/%.basepa.diff: Output/%.out-nat Output/%.basepa.out +$(PROGRAMS_TO_TEST:%=Output/%.basepa.diff-nat): \ +Output/%.basepa.diff-nat: Output/%.out-nat Output/%.basepa.out @cp Output/$*.out-nat Output/$*.basepa.out-nat -$(DIFFPROG) nat $*.basepa $(HIDEDIFF) -$(PROGRAMS_TO_TEST:%=Output/%.mallocrepl.diff): \ -Output/%.mallocrepl.diff: Output/%.out-nat Output/%.mallocrepl.out +$(PROGRAMS_TO_TEST:%=Output/%.mallocrepl.diff-nat): \ +Output/%.mallocrepl.diff-nat: Output/%.out-nat Output/%.mallocrepl.out @cp Output/$*.out-nat Output/$*.mallocrepl.out-nat -$(DIFFPROG) nat $*.mallocrepl $(HIDEDIFF) -$(PROGRAMS_TO_TEST:%=Output/%.onlyoverhead.diff): \ -Output/%.onlyoverhead.diff: Output/%.out-nat Output/%.onlyoverhead.out +$(PROGRAMS_TO_TEST:%=Output/%.onlyoverhead.diff-nat): \ +Output/%.onlyoverhead.diff-nat: Output/%.out-nat Output/%.onlyoverhead.out @cp Output/$*.out-nat Output/$*.onlyoverhead.out-nat -$(DIFFPROG) nat $*.onlyoverhead $(HIDEDIFF) -$(PROGRAMS_TO_TEST:%=Output/%.nonpa.diff): \ -Output/%.nonpa.diff: Output/%.out-nat Output/%.nonpa.out +$(PROGRAMS_TO_TEST:%=Output/%.nonpa.diff-nat): \ +Output/%.nonpa.diff-nat: Output/%.out-nat Output/%.nonpa.out @cp Output/$*.out-nat Output/$*.nonpa.out-nat -$(DIFFPROG) nat $*.nonpa $(HIDEDIFF) @@ -216,34 +216,34 @@ # generated from. $(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \ Output/%.$(TEST).report.txt: Output/%.out-nat \ - Output/%.nonpa.diff \ - Output/%.poolalloc.diff \ - Output/%.basepa.diff \ - Output/%.mallocrepl.diff \ - Output/%.onlyoverhead.diff \ + Output/%.nonpa.diff-nat \ + Output/%.poolalloc.diff-nat \ + Output/%.basepa.diff-nat \ + Output/%.mallocrepl.diff-nat \ + Output/%.onlyoverhead.diff-nat \ Output/%.LOC.txt @echo > $@ - @-if test -f Output/$*.nonpa.diff; then \ + @-if test -f Output/$*.nonpa.diff-nat; then \ printf "GCC-RUN-TIME: " >> $@;\ grep "^program" Output/$*.out-nat.time >> $@;\ fi - @-if test -f Output/$*.nonpa.diff; then \ + @-if test -f Output/$*.nonpa.diff-nat; then \ printf "RUN-TIME-NORMAL: " >> $@;\ grep "^program" Output/$*.nonpa.out.time >> $@;\ fi - @-if test -f Output/$*.mallocrepl.diff; then \ + @-if test -f Output/$*.mallocrepl.diff-nat; then \ printf "RUN-TIME-MALLOCREPL: " >> $@;\ grep "^program" Output/$*.mallocrepl.out.time >> $@;\ fi - @-if test -f Output/$*.onlyoverhead.diff; then \ + @-if test -f Output/$*.onlyoverhead.diff-nat; then \ printf "RUN-TIME-ONLYOVERHEAD: " >> $@;\ grep "^program" Output/$*.onlyoverhead.out.time >> $@;\ fi - @-if test -f Output/$*.basepa.diff; then \ + @-if test -f Output/$*.basepa.diff-nat; then \ printf "RUN-TIME-BASEPA: " >> $@;\ grep "^program" Output/$*.basepa.out.time >> $@;\ fi - @-if test -f Output/$*.poolalloc.diff; then \ + @-if test -f Output/$*.poolalloc.diff-nat; then \ printf "RUN-TIME-POOLALLOC: " >> $@;\ grep "^program" Output/$*.poolalloc.out.time >> $@;\ fi Modified: poolalloc/trunk/test/TEST.poolalloc.report URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.poolalloc.report?rev=57184&r1=57183&r2=57184&view=diff ============================================================================== --- poolalloc/trunk/test/TEST.poolalloc.report (original) +++ poolalloc/trunk/test/TEST.poolalloc.report Mon Oct 6 13:17:18 2008 @@ -80,18 +80,18 @@ [], # Times ["GCC", 'GCC-RUN-TIME: program\s*([.0-9m:]+)', \&FormatTime], - ["NonPATime", 'CBE-RUN-TIME-NORMAL: program\s*([.0-9m:]+)', \&FormatTime], + ["NonPATime", 'RUN-TIME-NORMAL: program\s*([.0-9m:]+)', \&FormatTime], [], - ["OnlyOHTime", 'CBE-RUN-TIME-ONLYOVERHEAD: program\s*([.0-9m:]+)', \&FormatTime], + ["OnlyOHTime", 'RUN-TIME-ONLYOVERHEAD: program\s*([.0-9m:]+)', \&FormatTime], ["OO run%", \&RuntimePercent], [], - ["ReplTime", 'CBE-RUN-TIME-MALLOCREPL: program\s*([.0-9m:]+)', \&FormatTime], + ["ReplTime", 'RUN-TIME-MALLOCREPL: program\s*([.0-9m:]+)', \&FormatTime], ["MR run%", \&RuntimePercent], [], - ["PA Time", 'CBE-RUN-TIME-POOLALLOC: program\s*([.0-9m:]+)', \&FormatTime], + ["PA Time", 'RUN-TIME-POOLALLOC: program\s*([.0-9m:]+)', \&FormatTime], ["PA run%", \&RuntimePercent], [], - ["Basepa", 'CBE-RUN-TIME-BASEPA: program\s*([.0-9m:]+)', \&FormatTime], + ["Basepa", 'RUN-TIME-BASEPA: program\s*([.0-9m:]+)', \&FormatTime], ["Base run%", \&RuntimePercent], [], ["NumPools", '([0-9]+).*Number of pools allocated'], From evan.cheng at apple.com Mon Oct 6 13:18:36 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 6 Oct 2008 11:18:36 -0700 Subject: [llvm-commits] [llvm] r57048 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll In-Reply-To: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> References: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> Message-ID: Hi Anton, Do you know why it's breaking unwinding? With the patch backed out, it's generating: .text .align 16 .globl test .type test, at function test: .Leh_func_begin1: pushl %ebp .Llabel1: movl %esp, %ebp .Llabel2: pushl %ebp Is the second push of ebp necessary? Evan On Oct 4, 2008, at 4:09 AM, Anton Korobeynikov wrote: > Author: asl > Date: Sat Oct 4 06:09:36 2008 > New Revision: 57048 > > URL: http://llvm.org/viewvc/llvm-project?rev=57048&view=rev > Log: > Revert r56675 - it breaks unwinding runtime everywhere. > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll > llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=57048&r1=57047&r2=57048&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sat Oct 4 06:09:36 > 2008 > @@ -1833,49 +1833,39 @@ > } > > bool X86InstrInfo::spillCalleeSavedRegisters(MachineBasicBlock &MBB, > - > MachineBasicBlock::iterator MI, > + > MachineBasicBlock::iterator MI, > const std::vector > &CSI) const { > if (CSI.empty()) > return false; > > - MachineFunction &MF = *MBB.getParent(); > bool is64Bit = TM.getSubtarget().is64Bit(); > - unsigned FrameReg = is64Bit ? X86::RBP : X86::EBP; > + unsigned SlotSize = is64Bit ? 8 : 4; > + > + MachineFunction &MF = *MBB.getParent(); > + X86MachineFunctionInfo *X86FI = > MF.getInfo(); > + X86FI->setCalleeSavedFrameSize(CSI.size() * SlotSize); > + > unsigned Opc = is64Bit ? X86::PUSH64r : X86::PUSH32r; > - unsigned CSSize = 0; > for (unsigned i = CSI.size(); i != 0; --i) { > unsigned Reg = CSI[i-1].getReg(); > - if (Reg == FrameReg && RI.hasFP(MF)) > - // It will be saved as part of the prologue. > - continue; > // Add the callee-saved register as live-in. It's killed at the > spill. > MBB.addLiveIn(Reg); > BuildMI(MBB, MI, get(Opc)).addReg(Reg); > - ++CSSize; > } > - > - X86MachineFunctionInfo *X86FI = > MF.getInfo(); > - unsigned SlotSize = is64Bit ? 8 : 4; > - X86FI->setCalleeSavedFrameSize(CSSize * SlotSize); > return true; > } > > bool X86InstrInfo::restoreCalleeSavedRegisters(MachineBasicBlock &MBB, > - > MachineBasicBlock::iterator MI, > + > MachineBasicBlock::iterator MI, > const std::vector > &CSI) const { > if (CSI.empty()) > return false; > > - MachineFunction &MF = *MBB.getParent(); > bool is64Bit = TM.getSubtarget().is64Bit(); > - unsigned FrameReg = is64Bit ? X86::RBP : X86::EBP; > > unsigned Opc = is64Bit ? X86::POP64r : X86::POP32r; > for (unsigned i = 0, e = CSI.size(); i != e; ++i) { > unsigned Reg = CSI[i].getReg(); > - if (Reg == FrameReg && RI.hasFP(MF)) > - // It will be restored as part of the epilogue. > - continue; > BuildMI(MBB, MI, get(Opc), Reg); > } > return true; > > Modified: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll?rev=57048&r1=57047&r2=57048&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll (original) > +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN32.ll Sat Oct 4 > 06:09:36 2008 > @@ -1,5 +1,5 @@ > ; Check that eh_return & unwind_init were properly lowered > -; RUN: llvm-as < %s | llc | grep %ebp | count 7 > +; RUN: llvm-as < %s | llc | grep %ebp | count 9 > ; RUN: llvm-as < %s | llc | grep %ecx | count 5 > > target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32- > i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" > > Modified: llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll?rev=57048&r1=57047&r2=57048&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll (original) > +++ llvm/trunk/test/CodeGen/X86/2008-08-31-EH_RETURN64.ll Sat Oct 4 > 06:09:36 2008 > @@ -1,5 +1,5 @@ > ; Check that eh_return & unwind_init were properly lowered > -; RUN: llvm-as < %s | llc | grep %rbp | count 5 > +; RUN: llvm-as < %s | llc | grep %rbp | count 7 > ; RUN: llvm-as < %s | llc | grep %rcx | count 3 > > target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32- > i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64- > s0:64:64-f80:128:128" > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Mon Oct 6 13:22:29 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 06 Oct 2008 18:22:29 -0000 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> Author: johannes Date: Mon Oct 6 13:22:29 2008 New Revision: 57185 URL: http://llvm.org/viewvc/llvm-project?rev=57185&view=rev Log: Mark shortening NaN conversions as Inexact. PR 2856. Improve description of unsupported formats. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57185&r1=57184&r2=57185&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 13:22:29 2008 @@ -1727,11 +1727,12 @@ APInt::tcShiftLeft(significandParts(), newPartCount, shift); else if (shift < 0) APInt::tcShiftRight(significandParts(), newPartCount, -shift); + // If the new size is shorter, we lost information. + fs = (shift < 0) ? opInexact : opOK; // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get // an invalid operation signal at runtime, but nobody does that. - fs = opOK; } else { semantics = &toSemantics; fs = opOK; @@ -2633,11 +2634,13 @@ return api.bitsToDouble(); } -/// Integer bit is explicit in this format. Current Intel book does not -/// define meaning of: -/// exponent = all 1's, integer bit not set. -/// exponent = 0, integer bit set. (formerly "psuedodenormals") -/// exponent!=0 nor all 1's, integer bit not set. (formerly "unnormals") +/// Integer bit is explicit in this format. Intel hardware (387 and later) +/// does not support these bit patterns: +/// exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity") +/// exponent = all 1's, integer bit 0, significand nonzero ("pseudoNaN") +/// exponent = 0, integer bit 1 ("pseudodenormal") +/// exponent!=0 nor all 1's, integer bit 0 ("unnormal") +/// At the moment, the first two are treated as NaNs, the second two as Normal. void APFloat::initFromF80LongDoubleAPInt(const APInt &api) { From evan.cheng at apple.com Mon Oct 6 13:42:48 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 06 Oct 2008 18:42:48 -0000 Subject: [llvm-commits] [llvm] r57193 - in /llvm/trunk/test: FrontendObjC++/2008-10-3-EhValue.mm FrontendObjC/2008-10-3-EhValue.mm Message-ID: <200810061842.m96IgmVs008233@zion.cs.uiuc.edu> Author: evancheng Date: Mon Oct 6 13:42:48 2008 New Revision: 57193 URL: http://llvm.org/viewvc/llvm-project?rev=57193&view=rev Log: This is an objective-c test, not an objective-c++ one. Added: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm Removed: llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm Removed: llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/2008-10-3-EhValue.mm?rev=57192&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm (original) +++ llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm (removed) @@ -1,50 +0,0 @@ -// RUN: %llvmgcc -w -x objective-c++ -c %s -o /dev/null - - at interface Object { - at public - Class isa; -} -+initialize; -+alloc; -+new; -+free; --free; -+(Class)class; --(Class)class; --init; --superclass; --(const char *)name; - at end - - at interface Frob: Object - at end - - at implementation Frob: Object - at end - -static Frob* _connection = ((void *)0); - -extern void abort(void); - -void test (Object* sendPort) -{ - int cleanupPorts = 1; - Frob* receivePort = ((void *)0); - - @try { - receivePort = (Frob *) -1; - _connection = (Frob *) -1; - receivePort = ((void *)0); - sendPort = ((void *)0); - cleanupPorts = 0; - @throw [Object new]; - } - @catch(Frob *obj) { - if(!(0)) abort(); - } - @catch(id exc) { - if(!(!receivePort)) abort(); - if(!(!sendPort)) abort(); - if(!(!cleanupPorts)) abort(); - } -} Added: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm?rev=57193&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm (added) +++ llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm Mon Oct 6 13:42:48 2008 @@ -0,0 +1,50 @@ +// RUN: %llvmgcc -w -x objective-c -c %s -o /dev/null + + at interface Object { + at public + Class isa; +} ++initialize; ++alloc; ++new; ++free; +-free; ++(Class)class; +-(Class)class; +-init; +-superclass; +-(const char *)name; + at end + + at interface Frob: Object + at end + + at implementation Frob: Object + at end + +static Frob* _connection = ((void *)0); + +extern void abort(void); + +void test (Object* sendPort) +{ + int cleanupPorts = 1; + Frob* receivePort = ((void *)0); + + @try { + receivePort = (Frob *) -1; + _connection = (Frob *) -1; + receivePort = ((void *)0); + sendPort = ((void *)0); + cleanupPorts = 0; + @throw [Object new]; + } + @catch(Frob *obj) { + if(!(0)) abort(); + } + @catch(id exc) { + if(!(!receivePort)) abort(); + if(!(!sendPort)) abort(); + if(!(!cleanupPorts)) abort(); + } +} From dpatel at apple.com Mon Oct 6 13:50:38 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 18:50:38 -0000 Subject: [llvm-commits] [llvm] r57197 - /llvm/trunk/docs/LangRef.html Message-ID: <200810061850.m96Ioc1e008536@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 13:50:38 2008 New Revision: 57197 URL: http://llvm.org/viewvc/llvm-project?rev=57197&view=rev Log: Update function attributes docs. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57197&r1=57196&r2=57197&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Oct 6 13:50:38 2008 @@ -749,8 +749,9 @@ calling convention, a return type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list (each with optional -parameter attributes), an optional section, an -optional alignment, an optional garbage collector name, +parameter attributes), optional +function attributes, an optional section, +an optional alignment, an optional garbage collector name, an opening curly brace, a list of basic blocks, and a closing curly brace. LLVM function declarations consist of the "declare" keyword, an @@ -861,23 +862,27 @@ value, but is also valid on pointers to scalars. The copy is considered to belong to the caller not the callee (for example, readonly functions should not write to - byval parameters). + byval parameters). This is not a valid attribute for return + values.
sret
This indicates that the pointer parameter specifies the address of a structure that is the return value of the function in the source program. This pointer must be guaranteed by the caller to be valid: loads and stores to the structure may be assumed by the callee to not to trap. This may only - be applied to the first parameter.
+ be applied to the first parameter. This is not a valid attribute for + return values.
noalias
This indicates that the parameter does not alias any global or any other parameter. The caller is responsible for ensuring that this is the case, - usually by placing the value in a stack allocation.
+ usually by placing the value in a stack allocation. This is not a valid + attribute for return values.
nest
This indicates that the pointer parameter can be excised using the - trampoline intrinsics.
+ trampoline intrinsics. This is not a valid + attribute for return values. @@ -2041,7 +2046,8 @@
Syntax:
-  <result> = invoke [cconv] <ptr to function ty> <function ptr val>(<function args>) 
+  <result> = invoke [cconv] [RetAttrs] <ptr to function ty> <function ptr val>(<function args>) 
                 to label <normal label> unwind label <exception label>
 
@@ -2066,6 +2072,11 @@ convention the call should use. If none is specified, the call defaults to using C calling conventions. + +
  • The optional Parameter Attributes list for + return values. Only 'zeroext', 'signext', + and 'inreg' attributes are valid here.
  • +
  • 'ptr to function ty': shall be the signature of the pointer to function value being invoked. In most cases, this is a direct function invocation, but indirect invokes are just as possible, branching off @@ -2086,6 +2097,9 @@
  • 'exception label': the label reached when a callee returns with the unwind instruction.
  • +
  • The optional function attributes list. Only + 'noreturn', 'nounwind', 'readonly' and + 'readnone' attributes are valid here.
  • Semantics:
    @@ -4235,7 +4249,7 @@
    Syntax:
    -  <result> = [tail] call [cconv] <ty> [<fnty>*] <fnptrval>(<param list>)
    +  <result> = [tail] call [cconv] [RetAttrs] <ty> [<fnty>*] <fnptrval>(<param list>)
     
    Overview:
    @@ -4259,6 +4273,13 @@ convention the call should use. If none is specified, the call defaults to using C calling conventions. + +
  • +

    The optional Parameter Attributes list for + return values. Only 'zeroext', 'signext', + and 'inreg' attributes are valid here.

    +
  • +
  • 'ty': the type of the call instruction itself which is also the type of the return value. Functions that return no value are marked @@ -4283,6 +4304,11 @@ indicates the function accepts a variable number of arguments, the extra arguments can be specified.

  • +
  • +

    The optional function attributes list. Only + 'noreturn', 'nounwind', 'readonly' and + 'readnone' attributes are valid here.

    +
  • Semantics:
    @@ -4304,9 +4330,11 @@ call void %foo(i8 97 signext) %struct.A = type { i32, i8 } - %r = call %struct.A @foo() ; yields { 32, i8 } + %r = call %struct.A @foo() ; yields { 32, i8 } %gr = extractvalue %struct.A %r, 0 ; yields i32 %gr1 = extractvalue %struct.A %r, 1 ; yields i8 + %Z = call void @foo() noreturn ; indicates that foo never returns nomrally + %ZZ = call zeroext i32 @bar() ; Return value is zero extended From gohman at apple.com Mon Oct 6 13:51:23 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 6 Oct 2008 11:51:23 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> Message-ID: On Oct 6, 2008, at 11:22 AM, Dale Johannesen wrote: > Author: johannes > Date: Mon Oct 6 13:22:29 2008 > New Revision: 57185 > > URL: http://llvm.org/viewvc/llvm-project?rev=57185&view=rev > Log: > Mark shortening NaN conversions as Inexact. PR 2856. > Improve description of unsupported formats. > > > Modified: > llvm/trunk/lib/Support/APFloat.cpp > > Modified: llvm/trunk/lib/Support/APFloat.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57185&r1=57184&r2=57185&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Support/APFloat.cpp (original) > +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 13:22:29 2008 > @@ -1727,11 +1727,12 @@ > APInt::tcShiftLeft(significandParts(), newPartCount, shift); > else if (shift < 0) > APInt::tcShiftRight(significandParts(), newPartCount, -shift); > + // If the new size is shorter, we lost information. > + fs = (shift < 0) ? opInexact : opOK; > // gcc forces the Quiet bit on, which means (float)(double) > (float_sNan) > // does not give you back the same bits. This is dubious, and we > // don't currently do it. You're really supposed to get > // an invalid operation signal at runtime, but nobody does that. > - fs = opOK; Shouldn't converting a NaN set the opInvalidOp flag? Dan From anton at korobeynikov.info Mon Oct 6 13:58:07 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 6 Oct 2008 22:58:07 +0400 Subject: [llvm-commits] [llvm] r57048 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll In-Reply-To: References: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> Message-ID: Hi, Evan > Is the second push of ebp necessary? Surely, no. I didn't dig into problem deep enough for now. Maybe some information about callee-saved registers and their offsets are not updated properly? And this makes unwinding runtime unhappy somehow... -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Mon Oct 6 14:10:04 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 6 Oct 2008 21:10:04 +0200 Subject: [llvm-commits] [llvm] r57048 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll In-Reply-To: References: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> Message-ID: <200810062110.04381.baldrick@free.fr> Hi Evan, > Do you know why it's breaking unwinding? With the patch backed out, > it's generating: in the testcase where I saw breakage, the problem was due to a miscompilation of llvm-gcc's libgcc (shared version). In fact the application itself (which did a lot of throwing and catching) worked fine when compiled with llvm-gcc as long as it was linked with the system libgcc, not llvm-gcc's libgcc. So it looks like your patch works fine almost always, only there's something subtle in libgcc which it breaks. Ciao, Duncan. From anton at korobeynikov.info Mon Oct 6 14:21:27 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Mon, 6 Oct 2008 23:21:27 +0400 Subject: [llvm-commits] [llvm] r57048 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll In-Reply-To: <200810062110.04381.baldrick@free.fr> References: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> <200810062110.04381.baldrick@free.fr> Message-ID: Hi, Duncan > in the testcase where I saw breakage, the problem was due to > a miscompilation of llvm-gcc's libgcc (shared version). In Same for me. However, static one was also miscompiled. > So it looks like your patch works fine almost always, only > there's something subtle in libgcc which it breaks. Yep. I saw a segfault inside _Unwind_Resume, due to access to invalid address. AFAIR, ebp was not restored properly after unwind or something like this. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From evan.cheng at apple.com Mon Oct 6 15:06:05 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 06 Oct 2008 20:06:05 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57199 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200810062006.m96K656I011430@zion.cs.uiuc.edu> Author: evancheng Date: Mon Oct 6 15:06:02 2008 New Revision: 57199 URL: http://llvm.org/viewvc/llvm-project?rev=57199&view=rev Log: Apply Duncan's patch which does what r57022 does but in a much cleaner way. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=57199&r1=57198&r2=57199&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Oct 6 15:06:02 2008 @@ -2746,19 +2746,8 @@ } Attributes Attrs = Attribute::None; - // See EmitEXC_PTR_EXPR and EmitFILTER_EXPR. Rather than handle the - // arguments themselves, process eh_value and eh_select. - if (TREE_CODE(TREE_VALUE(arg)) == EXC_PTR_EXPR) { - const Type *Ty = ExceptionValue->getType(); - Ty = cast(Ty)->getElementType(); - Client.HandleScalarArgument(Ty, 0); - } else if (TREE_CODE(TREE_VALUE(arg)) == FILTER_EXPR) { - const Type *Ty = ExceptionSelectorValue->getType(); - Ty = cast(Ty)->getElementType(); - Client.HandleScalarArgument(Ty, 0); - } else - ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg)), ScalarArgs, - &Attrs); + ABIConverter.HandleArgument(TREE_TYPE(TREE_VALUE(arg)), ScalarArgs, + &Attrs); if (Attrs != Attribute::None) PAL = PAL.addAttr(CallOperands.size(), Attrs); @@ -3749,14 +3738,18 @@ Value *TreeToLLVM::EmitEXC_PTR_EXPR(tree exp) { CreateExceptionValues(); // Load exception address. - return Builder.CreateLoad(ExceptionValue, "eh_value"); + Value *V = Builder.CreateLoad(ExceptionValue, "eh_value"); + // Cast the address to the right pointer type. + return BitCastToType(V, ConvertType(TREE_TYPE(exp))); } /// EmitFILTER_EXPR - Handle FILTER_EXPR. Value *TreeToLLVM::EmitFILTER_EXPR(tree exp) { CreateExceptionValues(); // Load exception selector. - return Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); + Value *V = Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); + // Cast the address to the right pointer type. + return BitCastToType(V, ConvertType(TREE_TYPE(exp))); } /// EmitRESX_EXPR - Handle RESX_EXPR. @@ -6190,12 +6183,15 @@ LValue TreeToLLVM::EmitLV_EXC_PTR_EXPR(tree exp) { CreateExceptionValues(); - return ExceptionValue; + // Cast the address pointer to the expected type. + return BitCastToType(ExceptionValue, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } LValue TreeToLLVM::EmitLV_FILTER_EXPR(tree exp) { CreateExceptionValues(); - return ExceptionSelectorValue; + return BitCastToType(ExceptionSelectorValue, + PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); } //===----------------------------------------------------------------------===// From evan.cheng at apple.com Mon Oct 6 15:06:34 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 6 Oct 2008 13:06:34 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r57022 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200810061437.57014.baldrick@free.fr> References: <200810031805.m93I5gFh007073@zion.cs.uiuc.edu> <200810061437.57014.baldrick@free.fr> Message-ID: <17B43EAC-EFCA-4919-8DDF-9D5D21C33810@apple.com> Thanks. It works. I've applied the patch, along with changes for FILTER_EXPR. Evan On Oct 6, 2008, at 5:37 AM, Duncan Sands wrote: > Hi Evan, > >> Fix a bug in EmitCallOf which shows up only with assertion turned >> on. When it's processing a call argument that corresponds to >> eh_value or eh_select, grab the type of special variables >> ExceptionValue or ExceptionSelectorValue instead or it won't match >> the expected type. >> >> With assertion turned off, this bug doesn't cause any >> miscompilation because pointer types are *compatible*. But it's a >> bug anyway. > > I think the reason for this is while the generic code builds > EXC_PTR_EXPR as a void*: > > tree-eh.c: x = build0 (EXC_PTR_EXPR, ptr_type_node); > > the objc (not obj-c++) front-end builds it as an objc_object_type: > > objc-act.c: return build0 (EXC_PTR_EXPR, objc_object_type); > > So the thing to do is simply bitcast to the right type in > llvm-convert. Based on this theory, can you please test the > attached patch for me (the testcase doesn't compile here, even > though I built with obj-c++ support...). > > Thanks, > > Duncan. > > PS: There shouldn't be any issue with FILTER_EXPR as far as I can see. > From evan.cheng at apple.com Mon Oct 6 15:10:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 6 Oct 2008 13:10:44 -0700 Subject: [llvm-commits] [llvm] r57023 - /llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm In-Reply-To: <200810061233.24739.baldrick@free.fr> References: <200810031812.m93ICxxF007306@zion.cs.uiuc.edu> <200810061233.24739.baldrick@free.fr> Message-ID: <633E2B90-31A3-4C9C-86A5-109440BA11CD@apple.com> Fixed. Thanks. Evan On Oct 6, 2008, at 3:33 AM, Duncan Sands wrote: > Hi Evan, > >> Added: >> llvm/trunk/test/FrontendObjC++/2008-10-3-EhValue.mm > > this test fails for me (x86-32 linux) with > test/FrontendObjC++/2008-10-3-EhValue.mm:25: error: invalid > conversion from 'void*' to 'Frob*' > test/FrontendObjC++/2008-10-3-EhValue.mm: In function 'void > test(Object*)': > test/FrontendObjC++/2008-10-3-EhValue.mm:32: error: invalid > conversion from 'void*' to 'Frob*' > test/FrontendObjC++/2008-10-3-EhValue.mm:37: error: invalid > conversion from 'void*' to 'Frob*' > test/FrontendObjC++/2008-10-3-EhValue.mm:38: error: invalid > conversion from 'void*' to 'Object*' > so I was unable to reproduce the problem you fixed (I want to > fix it differently). > > Ciao, > > Duncan. > > PS: Maybe it fails for you too now I fixed the testsuite to actually > run Obj-C++ tests :) > From evan.cheng at apple.com Mon Oct 6 15:14:36 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 6 Oct 2008 13:14:36 -0700 Subject: [llvm-commits] [llvm] r57048 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/2008-08-31-EH_RETURN32.ll test/CodeGen/X86/2008-08-31-EH_RETURN64.ll In-Reply-To: <200810062110.04381.baldrick@free.fr> References: <200810041109.m94B9dL9019148@zion.cs.uiuc.edu> <200810062110.04381.baldrick@free.fr> Message-ID: Ok. Can you guys look into this? I don't have the unwinding expertise. I think it's fine to ignore the performance issue for this release. Thanks, Evan On Oct 6, 2008, at 12:10 PM, Duncan Sands wrote: > Hi Evan, > >> Do you know why it's breaking unwinding? With the patch backed out, >> it's generating: > > in the testcase where I saw breakage, the problem was due to > a miscompilation of llvm-gcc's libgcc (shared version). In > fact the application itself (which did a lot of throwing and > catching) worked fine when compiled with llvm-gcc as long as > it was linked with the system libgcc, not llvm-gcc's libgcc. > So it looks like your patch works fine almost always, only > there's something subtle in libgcc which it breaks. > > Ciao, > > Duncan. From dalej at apple.com Mon Oct 6 15:23:29 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 6 Oct 2008 13:23:29 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> Message-ID: <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> On Oct 6, 2008, at 11:51 AMPDT, Dan Gohman wrote: >> >> + fs = (shift < 0) ? opInexact : opOK; >> // gcc forces the Quiet bit on, which means (float)(double) >> (float_sNan) >> // does not give you back the same bits. This is dubious, and we >> // don't currently do it. You're really supposed to get >> // an invalid operation signal at runtime, but nobody does that. >> - fs = opOK; > > Shouldn't converting a NaN set the opInvalidOp flag? According to IEEE754, converting a SNan sets opInvalid, but we aren't really trying for an accurate implementation of SNan's (nor does the OS). For converting a QNan, what it says is: "Every operation involving one or two input NaNs, none of them signaling, shall signal no exception but, if a FP result is to be delivered, shall deliver as its result a QNaN, which should be one of the input NaNs. Note that format conversions might be unable to deliver the same NaN." The last sentence applies here, and I'm not sure of its intent. At face value it's a statement that it may be impossible to implement the standard in this case, which seems unlikely. IMO an Inexact result seems compatible with the way things work otherwise. To confuse things further, the value in the PR is not even an IEEE NaN, but a pseudo-NaN in Intel jargon. It is outside all standards. From gohman at apple.com Mon Oct 6 15:20:23 2008 From: gohman at apple.com (Dan Gohman) Date: Mon, 6 Oct 2008 13:20:23 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> Message-ID: <19EA1798-D3FB-4365-B537-0A2ABA3F72F6@apple.com> Hi Dale, This is causing these tests: CodeGen/X86/all-ones-vector.ll CodeGen/CBackend/2003-10-12-NANGlobalInits.ll to fail with error message "Floating point constant invalid for type" from llvm-as. Can you investigate? Thanks, Dan On Oct 6, 2008, at 11:22 AM, Dale Johannesen wrote: > Author: johannes > Date: Mon Oct 6 13:22:29 2008 > New Revision: 57185 > > URL: http://llvm.org/viewvc/llvm-project?rev=57185&view=rev > Log: > Mark shortening NaN conversions as Inexact. PR 2856. > Improve description of unsupported formats. > > > Modified: > llvm/trunk/lib/Support/APFloat.cpp > > Modified: llvm/trunk/lib/Support/APFloat.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57185&r1=57184&r2=57185&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Support/APFloat.cpp (original) > +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 13:22:29 2008 > @@ -1727,11 +1727,12 @@ > APInt::tcShiftLeft(significandParts(), newPartCount, shift); > else if (shift < 0) > APInt::tcShiftRight(significandParts(), newPartCount, -shift); > + // If the new size is shorter, we lost information. > + fs = (shift < 0) ? opInexact : opOK; > // gcc forces the Quiet bit on, which means (float)(double) > (float_sNan) > // does not give you back the same bits. This is dubious, and we > // don't currently do it. You're really supposed to get > // an invalid operation signal at runtime, but nobody does that. > - fs = opOK; > } else { > semantics = &toSemantics; > fs = opOK; > @@ -2633,11 +2634,13 @@ > return api.bitsToDouble(); > } > > -/// Integer bit is explicit in this format. Current Intel book > does not > -/// define meaning of: > -/// exponent = all 1's, integer bit not set. > -/// exponent = 0, integer bit set. (formerly "psuedodenormals") > -/// exponent!=0 nor all 1's, integer bit not set. (formerly > "unnormals") > +/// Integer bit is explicit in this format. Intel hardware (387 > and later) > +/// does not support these bit patterns: > +/// exponent = all 1's, integer bit 0, significand 0 > ("pseudoinfinity") > +/// exponent = all 1's, integer bit 0, significand nonzero > ("pseudoNaN") > +/// exponent = 0, integer bit 1 ("pseudodenormal") > +/// exponent!=0 nor all 1's, integer bit 0 ("unnormal") > +/// At the moment, the first two are treated as NaNs, the second > two as Normal. > void > APFloat::initFromF80LongDoubleAPInt(const APInt &api) > { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Mon Oct 6 15:30:25 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 6 Oct 2008 13:30:25 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <19EA1798-D3FB-4365-B537-0A2ABA3F72F6@apple.com> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <19EA1798-D3FB-4365-B537-0A2ABA3F72F6@apple.com> Message-ID: <01B61E2A-DAF6-49A3-B6A2-7CC208E7B0D3@apple.com> On Oct 6, 2008, at 1:20 PMPDT, Dan Gohman wrote: > Hi Dale, > > This is causing these tests: > > CodeGen/X86/all-ones-vector.ll > CodeGen/CBackend/2003-10-12-NANGlobalInits.ll > > to fail with error message "Floating point constant invalid for type" > from llvm-as. Can you investigate? OK. > > Thanks, > > Dan > > On Oct 6, 2008, at 11:22 AM, Dale Johannesen wrote: > >> Author: johannes >> Date: Mon Oct 6 13:22:29 2008 >> New Revision: 57185 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57185&view=rev >> Log: >> Mark shortening NaN conversions as Inexact. PR 2856. >> Improve description of unsupported formats. >> >> >> Modified: >> llvm/trunk/lib/Support/APFloat.cpp >> >> Modified: llvm/trunk/lib/Support/APFloat.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57185&r1=57184&r2=57185&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Support/APFloat.cpp (original) >> +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 13:22:29 2008 >> @@ -1727,11 +1727,12 @@ >> APInt::tcShiftLeft(significandParts(), newPartCount, shift); >> else if (shift < 0) >> APInt::tcShiftRight(significandParts(), newPartCount, -shift); >> + // If the new size is shorter, we lost information. >> + fs = (shift < 0) ? opInexact : opOK; >> // gcc forces the Quiet bit on, which means (float)(double) >> (float_sNan) >> // does not give you back the same bits. This is dubious, and we >> // don't currently do it. You're really supposed to get >> // an invalid operation signal at runtime, but nobody does that. >> - fs = opOK; >> } else { >> semantics = &toSemantics; >> fs = opOK; >> @@ -2633,11 +2634,13 @@ >> return api.bitsToDouble(); >> } >> >> -/// Integer bit is explicit in this format. Current Intel book >> does not >> -/// define meaning of: >> -/// exponent = all 1's, integer bit not set. >> -/// exponent = 0, integer bit set. (formerly "psuedodenormals") >> -/// exponent!=0 nor all 1's, integer bit not set. (formerly >> "unnormals") >> +/// Integer bit is explicit in this format. Intel hardware (387 >> and later) >> +/// does not support these bit patterns: >> +/// exponent = all 1's, integer bit 0, significand 0 >> ("pseudoinfinity") >> +/// exponent = all 1's, integer bit 0, significand nonzero >> ("pseudoNaN") >> +/// exponent = 0, integer bit 1 ("pseudodenormal") >> +/// exponent!=0 nor all 1's, integer bit 0 ("unnormal") >> +/// At the moment, the first two are treated as NaNs, the second >> two as Normal. >> void >> APFloat::initFromF80LongDoubleAPInt(const APInt &api) >> { >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Mon Oct 6 15:33:03 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 06 Oct 2008 20:33:03 -0000 Subject: [llvm-commits] [llvm] r57200 - /llvm/trunk/include/llvm/Instruction.def Message-ID: <200810062033.m96KX3nv012471@zion.cs.uiuc.edu> Author: evancheng Date: Mon Oct 6 15:33:02 2008 New Revision: 57200 URL: http://llvm.org/viewvc/llvm-project?rev=57200&view=rev Log: Cosmetic. Modified: llvm/trunk/include/llvm/Instruction.def Modified: llvm/trunk/include/llvm/Instruction.def URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.def?rev=57200&r1=57199&r2=57200&view=diff ============================================================================== --- llvm/trunk/include/llvm/Instruction.def (original) +++ llvm/trunk/include/llvm/Instruction.def Mon Oct 6 15:33:02 2008 @@ -117,7 +117,7 @@ // Logical operators (integer operands) HANDLE_BINARY_INST(16, Shl , BinaryOperator) // Shift left (logical) HANDLE_BINARY_INST(17, LShr , BinaryOperator) // Shift right (logical) -HANDLE_BINARY_INST(18, AShr , BinaryOperator) // shift right (arithmetic) +HANDLE_BINARY_INST(18, AShr , BinaryOperator) // Shift right (arithmetic) HANDLE_BINARY_INST(19, And , BinaryOperator) HANDLE_BINARY_INST(20, Or , BinaryOperator) HANDLE_BINARY_INST(21, Xor , BinaryOperator) From dpatel at apple.com Mon Oct 6 15:36:36 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 20:36:36 -0000 Subject: [llvm-commits] [llvm] r57202 - in /llvm/trunk: lib/VMCore/PassManager.cpp test/Other/2008-10-06-RemoveDeadPass.ll Message-ID: <200810062036.m96KaapP012605@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 15:36:36 2008 New Revision: 57202 URL: http://llvm.org/viewvc/llvm-project?rev=57202&view=rev Log: Remove interfaces implemented by dead pass from the list of available passes. Patch By Matthijs Kooijman. Added: llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll Modified: llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=57202&r1=57201&r2=57202&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Oct 6 15:36:36 2008 @@ -779,13 +779,23 @@ if (TheTimeInfo) TheTimeInfo->passStarted(*I); (*I)->releaseMemory(); if (TheTimeInfo) TheTimeInfo->passEnded(*I); - - std::map::iterator Pos = - AvailableAnalysis.find((*I)->getPassInfo()); - - // It is possible that pass is already removed from the AvailableAnalysis - if (Pos != AvailableAnalysis.end()) - AvailableAnalysis.erase(Pos); + if (const PassInfo *PI = (*I)->getPassInfo()) { + std::map::iterator Pos = + AvailableAnalysis.find(PI); + + // It is possible that pass is already removed from the AvailableAnalysis + if (Pos != AvailableAnalysis.end()) + AvailableAnalysis.erase(Pos); + + // Remove all interfaces this pass implements, for which it is also + // listed as the available implementation. + const std::vector &II = PI->getInterfacesImplemented(); + for (unsigned i = 0, e = II.size(); i != e; ++i) { + Pos = AvailableAnalysis.find(II[i]); + if (Pos != AvailableAnalysis.end() && Pos->second == *I) + AvailableAnalysis.erase(Pos); + } + } } } Added: llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll?rev=57202&view=auto ============================================================================== --- llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll (added) +++ llvm/trunk/test/Other/2008-10-06-RemoveDeadPass.ll Mon Oct 6 15:36:36 2008 @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | opt -inline -internalize -disable-output +define void @foo() nounwind { + ret void +} + +define void @main(...) nounwind { + call void @foo() + ret void +} + + From dpatel at apple.com Mon Oct 6 15:36:42 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 6 Oct 2008 13:36:42 -0700 Subject: [llvm-commits] Patch to update available analysis correctly In-Reply-To: <20081006140706.GA6091@katherina.student.utwente.nl> References: <20081006140706.GA6091@katherina.student.utwente.nl> Message-ID: <210A0DC3-A7E8-4653-B135-0290BC43157B@apple.com> Hi Matthijs, On Oct 6, 2008, at 7:07 AM, Matthijs Kooijman wrote: > In any case, I think this is good to fix, and probably to get into > 2.4 as > well. I won't be able to commit this until next monday, so please > commit the > patch if you think it is correct. > > Gr. Your patch looks good. Applied. Thanks! - Devang From dalej at apple.com Mon Oct 6 15:43:48 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 06 Oct 2008 20:43:48 -0000 Subject: [llvm-commits] [llvm] r57203 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <200810062043.m96KhmKh012859@zion.cs.uiuc.edu> Author: johannes Date: Mon Oct 6 15:43:48 2008 New Revision: 57203 URL: http://llvm.org/viewvc/llvm-project?rev=57203&view=rev Log: Temporarily revert functionality change from my previous patch; it is too aggressive. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57203&r1=57202&r2=57203&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 15:43:48 2008 @@ -1727,12 +1727,11 @@ APInt::tcShiftLeft(significandParts(), newPartCount, shift); else if (shift < 0) APInt::tcShiftRight(significandParts(), newPartCount, -shift); - // If the new size is shorter, we lost information. - fs = (shift < 0) ? opInexact : opOK; // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get // an invalid operation signal at runtime, but nobody does that. + fs = opOK; } else { semantics = &toSemantics; fs = opOK; From evan.cheng at apple.com Mon Oct 6 16:13:09 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 06 Oct 2008 21:13:09 -0000 Subject: [llvm-commits] [llvm] r57210 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2008-10-06-MMXISelBug.ll Message-ID: <200810062113.m96LD9FB014314@zion.cs.uiuc.edu> Author: evancheng Date: Mon Oct 6 16:13:08 2008 New Revision: 57210 URL: http://llvm.org/viewvc/llvm-project?rev=57210&view=rev Log: Fix PR2850 and PR2863. Only generate movddup for 128-bit SSE vector shuffles. Added: llvm/trunk/test/CodeGen/X86/2008-10-06-MMXISelBug.ll Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=57210&r1=57209&r2=57210&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Oct 6 16:13:08 2008 @@ -3954,6 +3954,7 @@ // Canonicalize movddup shuffles. if (V2IsUndef && Subtarget->hasSSE2() && + VT.getSizeInBits() == 128 && X86::isMOVDDUPMask(PermMask.getNode())) return CanonicalizeMovddup(Op, V1, PermMask, DAG, Subtarget->hasSSE3()); Added: llvm/trunk/test/CodeGen/X86/2008-10-06-MMXISelBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-06-MMXISelBug.ll?rev=57210&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-06-MMXISelBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-10-06-MMXISelBug.ll Mon Oct 6 16:13:08 2008 @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx,+sse2 +; PR2850 + + at tmp_V2i = common global <2 x i32> zeroinitializer ; <<2 x i32>*> [#uses=2] + +define void @f0() nounwind { +entry: + %0 = load <2 x i32>* @tmp_V2i, align 8 ; <<2 x i32>> [#uses=1] + %1 = shufflevector <2 x i32> %0, <2 x i32> undef, <2 x i32> zeroinitializer ; <<2 x i32>> [#uses=1] + store <2 x i32> %1, <2 x i32>* @tmp_V2i, align 8 + ret void +} From dpatel at apple.com Mon Oct 6 16:24:49 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 21:24:49 -0000 Subject: [llvm-commits] [llvm] r57211 - /llvm/trunk/utils/buildit/build_llvm Message-ID: <200810062124.m96LOnAW014903@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 16:24:48 2008 New Revision: 57211 URL: http://llvm.org/viewvc/llvm-project?rev=57211&view=rev Log: Set UNIVERSAL_ARCH value. Fixes build failure when target is i386. Modified: llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=57211&r1=57210&r2=57211&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Mon Oct 6 16:24:48 2008 @@ -157,7 +157,8 @@ cd $DIR/obj-llvm || exit 1 # Install the tree into the destination directory. -make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install +make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \ + OPTIMIZE_OPTION='-O2' install if ! test $? == 0 ; then echo "error: LLVM 'make install' failed!" From alenhar2 at cs.uiuc.edu Mon Oct 6 17:29:49 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 06 Oct 2008 22:29:49 -0000 Subject: [llvm-commits] [poolalloc] r57214 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Oct 6 17:29:47 2008 New Revision: 57214 URL: http://llvm.org/viewvc/llvm-project?rev=57214&view=rev Log: Preserve calling convention when rewriting a callsite Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=57214&r1=57213&r2=57214&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Mon Oct 6 17:29:47 2008 @@ -804,6 +804,8 @@ UpdateNewToOldValueMap(TheCall, NewCall); } + CallSite(NewCall).setCallingConv(CallSite(TheCall).getCallingConv()); + TheCall->eraseFromParent(); visitInstruction(*NewCall); } From dalej at apple.com Mon Oct 6 17:59:10 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 06 Oct 2008 22:59:10 -0000 Subject: [llvm-commits] [llvm] r57218 - in /llvm/trunk: lib/Support/APFloat.cpp test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll Message-ID: <200810062259.m96MxAhe018585@zion.cs.uiuc.edu> Author: johannes Date: Mon Oct 6 17:59:10 2008 New Revision: 57218 URL: http://llvm.org/viewvc/llvm-project?rev=57218&view=rev Log: Be more precise about which conversions of NaNs are Inexact. (These are not Inexact as defined by IEEE754, but that seems like a reasonable way to abstract what happens: information is lost.) Added: llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57218&r1=57217&r2=57218&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 17:59:10 2008 @@ -1721,17 +1721,32 @@ } else if (category == fcNaN) { int shift = toSemantics.precision - semantics->precision; // Do this now so significandParts gets the right answer + const fltSemantics *oldSemantics = semantics; semantics = &toSemantics; + fs = opOK; // No normalization here, just truncate if (shift>0) APInt::tcShiftLeft(significandParts(), newPartCount, shift); - else if (shift < 0) - APInt::tcShiftRight(significandParts(), newPartCount, -shift); + else if (shift < 0) { + unsigned ushift = -shift; + // We mark this as Inexact if we are losing information. This happens + // if are shifting out something other than 0s, or if the x87 long + // double input did not have its integer bit set (pseudo-NaN), or if the + // x87 long double input did not have its QNan bit set (because the x87 + // hardware sets this bit when converting a lower-precision NaN to + // x87 long double). + if (APInt::tcLSB(significandParts(), newPartCount) < ushift) + fs = opInexact; + if (oldSemantics == &APFloat::x87DoubleExtended && + (!(*significandParts() & 0x8000000000000000ULL) || + !(*significandParts() & 0x4000000000000000ULL))) + fs = opInexact; + APInt::tcShiftRight(significandParts(), newPartCount, ushift); + } // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get // an invalid operation signal at runtime, but nobody does that. - fs = opOK; } else { semantics = &toSemantics; fs = opOK; Added: llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll?rev=57218&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-1.ll Mon Oct 6 17:59:10 2008 @@ -0,0 +1,13 @@ +; ModuleID = 'nan.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "i686-apple-darwin8" +; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3,-sse | grep fldl +; This NaN should be shortened to a double (not a float). + +declare x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 %f) + +define i32 @main() { +entry_nan.main: + call x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 0xK7FFFC001234000000800) + ret i32 0 +} Added: llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll?rev=57218&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-10-06-x87ld-nan-2.ll Mon Oct 6 17:59:10 2008 @@ -0,0 +1,18 @@ +; ModuleID = 'nan.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64" +target triple = "i686-apple-darwin8" +; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3,-sse | grep fldt | count 3 +; it is not safe to shorten any of these NaNs. + +declare x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 %f) + + at _D3nan4rvale = global x86_fp80 0xK7FFF8001234000000000 ; [#uses=1] + +define i32 @main() { +entry_nan.main: + %tmp = load x86_fp80* @_D3nan4rvale ; [#uses=1] + call x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 %tmp) + call x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 0xK7FFF8001234000000000) + call x86_stdcallcc void @_D3nan5printFeZv(x86_fp80 0xK7FFFC001234000000400) + ret i32 0 +} From dpatel at apple.com Mon Oct 6 18:22:54 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 06 Oct 2008 23:22:54 -0000 Subject: [llvm-commits] [llvm] r57221 - in /llvm/trunk: lib/Transforms/Scalar/LoopIndexSplit.cpp test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll Message-ID: <200810062322.m96NMsxQ019645@zion.cs.uiuc.edu> Author: dpatel Date: Mon Oct 6 18:22:54 2008 New Revision: 57221 URL: http://llvm.org/viewvc/llvm-project?rev=57221&view=rev Log: Fix typo, fix PR 2865. Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=57221&r1=57220&r2=57221&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Oct 6 18:22:54 2008 @@ -940,8 +940,8 @@ if (Op0->getPredicate() == ICmpInst::ICMP_EQ || Op0->getPredicate() == ICmpInst::ICMP_NE - || Op0->getPredicate() == ICmpInst::ICMP_EQ - || Op0->getPredicate() == ICmpInst::ICMP_NE) + || Op1->getPredicate() == ICmpInst::ICMP_EQ + || Op1->getPredicate() == ICmpInst::ICMP_NE) return false; // Check if SplitCondition dominates entire loop body Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll?rev=57221&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll (added) +++ llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-06-Crash.ll Mon Oct 6 18:22:54 2008 @@ -0,0 +1,31 @@ +; RUN: llvm-as < %s | opt -loop-index-split -disable-output + %struct.RExC_state_t = type { i32, i8*, %struct.regexp*, i8*, i8*, i8*, i32, %struct.regnode*, %struct.regnode*, i32, i32, i32, i32, i32, i32, i32, i32, i32 } + %struct.SV = type { i8*, i32, i32 } + %struct.reg_data = type { i32, i8*, [1 x i8*] } + %struct.reg_substr_data = type { [3 x %struct.reg_substr_datum] } + %struct.reg_substr_datum = type { i32, i32, %struct.SV*, %struct.SV* } + %struct.regexp = type { i32*, i32*, %struct.regnode*, %struct.reg_substr_data*, i8*, %struct.reg_data*, i8*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, [1 x %struct.regnode] } + %struct.regnode = type { i8, i8, i16 } + +define fastcc %struct.regnode* @S_regclass(%struct.RExC_state_t* %pRExC_state) nounwind { +entry: + br label %bb439 + +bb439: ; preds = %bb444, %entry + %value23.16.reg2mem.0 = phi i32 [ %3, %bb444 ], [ 0, %entry ] ; [#uses=3] + %0 = icmp ugt i32 %value23.16.reg2mem.0, 31 ; [#uses=1] + %1 = icmp ne i32 %value23.16.reg2mem.0, 127 ; [#uses=1] + %2 = and i1 %0, %1 ; [#uses=1] + br i1 %2, label %bb443, label %bb444 + +bb443: ; preds = %bb439 + br label %bb444 + +bb444: ; preds = %bb443, %bb439 + %3 = add i32 %value23.16.reg2mem.0, 1 ; [#uses=2] + %4 = icmp ugt i32 %3, 255 ; [#uses=1] + br i1 %4, label %bb675, label %bb439 + +bb675: ; preds = %bb444 + unreachable +} From gohman at apple.com Mon Oct 6 19:12:38 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 00:12:38 -0000 Subject: [llvm-commits] [llvm] r57223 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200810070012.m970CcNs021347@zion.cs.uiuc.edu> Author: djg Date: Mon Oct 6 19:12:37 2008 New Revision: 57223 URL: http://llvm.org/viewvc/llvm-project?rev=57223&view=rev Log: Correctly handle calls with no return values. This fixes 2006-01-23-UnionInit on x86-64 when inlining is not enabled. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=57223&r1=57222&r2=57223&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Mon Oct 6 19:12:37 2008 @@ -5337,7 +5337,7 @@ Chain = Res.getValue(LoweredRetTys.size() - 1); // Gather up the call result into a single value. - if (RetTy != Type::VoidTy) { + if (RetTy != Type::VoidTy && !RetTys.empty()) { ISD::NodeType AssertOp = ISD::DELETED_NODE; if (RetSExt) From dalej at apple.com Mon Oct 6 19:40:03 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 07 Oct 2008 00:40:03 -0000 Subject: [llvm-commits] [llvm] r57224 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <200810070040.m970e3G9022211@zion.cs.uiuc.edu> Author: johannes Date: Mon Oct 6 19:40:01 2008 New Revision: 57224 URL: http://llvm.org/viewvc/llvm-project?rev=57224&view=rev Log: Mark negative-zero-to-int conversion as Inexact, since -0.0 can't be represented as an int. This prevents llvm from reducing -0.0 to a load-and-convert of int 0. Fixes ieee.exp/mzero[2356].c in gcc testsuite. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57224&r1=57223&r2=57224&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 19:40:01 2008 @@ -1784,7 +1784,8 @@ if(category == fcZero) { APInt::tcSet(parts, 0, dstPartsCount); - return opOK; + // Negative zero can't be represented as an int. + return sign ? opInexact : opOK; } src = significandParts(); From alenhar2 at cs.uiuc.edu Mon Oct 6 21:10:29 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 02:10:29 -0000 Subject: [llvm-commits] [llvm] r57226 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsAlpha.td lib/Target/Alpha/AlphaISelDAGToDAG.cpp lib/Target/Alpha/AlphaISelLowering.cpp Message-ID: <200810070210.m972AUxl026421@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Oct 6 21:10:26 2008 New Revision: 57226 URL: http://llvm.org/viewvc/llvm-project?rev=57226&view=rev Log: Note that ADDC and company don't actually expand yet (missing in legalize Added: llvm/trunk/include/llvm/IntrinsicsAlpha.td Modified: llvm/trunk/include/llvm/Intrinsics.td llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=57226&r1=57225&r2=57226&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Mon Oct 6 21:10:26 2008 @@ -360,3 +360,4 @@ include "llvm/IntrinsicsX86.td" include "llvm/IntrinsicsARM.td" include "llvm/IntrinsicsCellSPU.td" +include "llvm/IntrinsicsAlpha.td" Added: llvm/trunk/include/llvm/IntrinsicsAlpha.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsAlpha.td?rev=57226&view=auto ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsAlpha.td (added) +++ llvm/trunk/include/llvm/IntrinsicsAlpha.td Mon Oct 6 21:10:26 2008 @@ -0,0 +1,19 @@ +//===- IntrinsicsAlpha.td - Defines Alpha intrinsics -------*- tablegen -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines all of the Alpha-specific intrinsics. +// +//===----------------------------------------------------------------------===// + + +let TargetPrefix = "alpha" in { // All intrinsics start with "llvm.alpha.". + def int_alpha_umulh : GCCBuiltin<"__builtin_alpha_umulh">, + Intrinsic<[llvm_i64_ty, llvm_i64_ty, llvm_i64_ty], [IntrNoMem]>; + +} Modified: llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp?rev=57226&r1=57225&r2=57226&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Mon Oct 6 21:10:26 2008 @@ -323,7 +323,8 @@ return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, CPI, SDValue(Tmp, 0), CurDAG->getEntryNode()); } - case ISD::TargetConstantFP: { + case ISD::TargetConstantFP: + case ISD::ConstantFP: { ConstantFPSDNode *CN = cast(N); bool isDouble = N->getValueType(0) == MVT::f64; MVT T = isDouble ? MVT::f64 : MVT::f32; Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=57226&r1=57225&r2=57226&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Mon Oct 6 21:10:26 2008 @@ -22,6 +22,7 @@ #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Module.h" +#include "llvm/Intrinsics.h" #include "llvm/Support/CommandLine.h" using namespace llvm; @@ -47,7 +48,10 @@ addRegisterClass(MVT::i64, Alpha::GPRCRegisterClass); addRegisterClass(MVT::f64, Alpha::F8RCRegisterClass); addRegisterClass(MVT::f32, Alpha::F4RCRegisterClass); - + + // We want to custom lower some of our intrinsics. + setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom); + setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote); setLoadXAction(ISD::EXTLOAD, MVT::f32, Expand); @@ -87,6 +91,12 @@ setOperationAction(ISD::SDIV , MVT::i64, Custom); setOperationAction(ISD::UDIV , MVT::i64, Custom); + setOperationAction(ISD::ADDC , MVT::i64, Expand); + setOperationAction(ISD::ADDE , MVT::i64, Expand); + setOperationAction(ISD::SUBC , MVT::i64, Expand); + setOperationAction(ISD::SUBE , MVT::i64, Expand); + + // We don't support sin/cos/sqrt/pow setOperationAction(ISD::FSIN , MVT::f64, Expand); setOperationAction(ISD::FCOS , MVT::f64, Expand); @@ -311,6 +321,29 @@ DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg); break; } + case 5: { + MVT ArgVT = Op.getOperand(1).getValueType(); + unsigned ArgReg1, ArgReg2; + if (ArgVT.isInteger()) { + ArgReg1 = Alpha::R0; + ArgReg2 = Alpha::R1; + } else { + assert(ArgVT.isFloatingPoint()); + ArgReg1 = Alpha::F0; + ArgReg2 = Alpha::F1; + } + Copy = DAG.getCopyToReg(Copy, ArgReg1, Op.getOperand(1), Copy.getValue(1)); + if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(), + DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg1) + == DAG.getMachineFunction().getRegInfo().liveout_end()) + DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg1); + Copy = DAG.getCopyToReg(Copy, ArgReg2, Op.getOperand(3), Copy.getValue(1)); + if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(), + DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg2) + == DAG.getMachineFunction().getRegInfo().liveout_end()) + DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg2); + break; + } } return DAG.getNode(AlphaISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1)); } @@ -432,6 +465,15 @@ case ISD::RET: return LowerRET(Op,DAG); case ISD::JumpTable: return LowerJumpTable(Op, DAG); + case ISD::INTRINSIC_WO_CHAIN: { + unsigned IntNo = cast(Op.getOperand(0))->getZExtValue(); + switch (IntNo) { + default: break; // Don't custom lower most intrinsics. + case Intrinsic::alpha_umulh: + return DAG.getNode(ISD::MULHU, MVT::i64, Op.getOperand(1), Op.getOperand(2)); + } + } + case ISD::SINT_TO_FP: { assert(Op.getOperand(0).getValueType() == MVT::i64 && "Unhandled SINT_TO_FP type in custom expander!"); From alenhar2 at cs.uiuc.edu Mon Oct 6 21:11:11 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 02:11:11 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57227 - in /llvm-gcc-4.2/trunk/gcc: config.gcc config/alpha/alpha.h config/alpha/llvm-alpha.cpp Message-ID: <200810070211.m972BCB7026456@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Oct 6 21:11:11 2008 New Revision: 57227 URL: http://llvm.org/viewvc/llvm-project?rev=57227&view=rev Log: Get alpha closer to building libgcc2 Added: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Modified: llvm-gcc-4.2/trunk/gcc/config.gcc llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h Modified: llvm-gcc-4.2/trunk/gcc/config.gcc URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config.gcc?rev=57227&r1=57226&r2=57227&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config.gcc (original) +++ llvm-gcc-4.2/trunk/gcc/config.gcc Mon Oct 6 21:11:11 2008 @@ -248,6 +248,9 @@ alpha*-*-*) cpu_type=alpha need_64bit_hwint=yes +# LLVM LOCAL begin + out_cxx_file=alpha/llvm-alpha.cpp +# LLVM LOCAL end ;; am33_2.0-*-linux*) cpu_type=mn10300 Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h?rev=57227&r1=57226&r2=57227&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/alpha.h Mon Oct 6 21:11:11 2008 @@ -1591,3 +1591,22 @@ /* The system headers under Alpha systems are generally C++-aware. */ #define NO_IMPLICIT_EXTERN_C + +/* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM + +/* LLVM_TARGET_INTRINSIC_PREFIX - Specify what prefix this target uses for its + * intrinsics. + */ +#define LLVM_TARGET_INTRINSIC_PREFIX "alpha" + +/* LLVM_TARGET_INTRINSIC_LOWER - To handle builtins, we want to expand the + * invocation into normal LLVM code. If the target can handle the builtin, this + * macro should call the target TreeToLLVM::TargetIntrinsicLower method and + * return true.This macro is invoked from a method in the TreeToLLVM class. + */ +#define LLVM_TARGET_INTRINSIC_LOWER(EXP, BUILTIN_CODE, DESTLOC, RESULT, \ + DESTTY, OPS) \ + TargetIntrinsicLower(EXP, BUILTIN_CODE, DESTLOC, RESULT, DESTTY, OPS); +#endif /* ENABLE_LLVM */ +/* LLVM LOCAL end */ Added: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=57227&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (added) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Mon Oct 6 21:11:11 2008 @@ -0,0 +1,121 @@ +/* LLVM LOCAL begin (ENTIRE FILE!) */ +/* High-level LLVM backend interface +Copyright (C) 2005 Free Software Foundation, Inc. +Contributed by Evan Cheng (evan.cheng at apple.com) + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +//===----------------------------------------------------------------------===// +// This is a C++ source file that implements specific llvm alpha ABI. +//===----------------------------------------------------------------------===// + +#include "llvm-abi.h" +#include "llvm-internal.h" +#include "llvm/DerivedTypes.h" +#include "llvm/Instructions.h" +#include "llvm/Intrinsics.h" +#include "llvm/Module.h" + +extern "C" { +#include "toplev.h" +} + +enum alpha_builtin +{ + ALPHA_BUILTIN_CMPBGE, + ALPHA_BUILTIN_EXTBL, + ALPHA_BUILTIN_EXTWL, + ALPHA_BUILTIN_EXTLL, + ALPHA_BUILTIN_EXTQL, + ALPHA_BUILTIN_EXTWH, + ALPHA_BUILTIN_EXTLH, + ALPHA_BUILTIN_EXTQH, + ALPHA_BUILTIN_INSBL, + ALPHA_BUILTIN_INSWL, + ALPHA_BUILTIN_INSLL, + ALPHA_BUILTIN_INSQL, + ALPHA_BUILTIN_INSWH, + ALPHA_BUILTIN_INSLH, + ALPHA_BUILTIN_INSQH, + ALPHA_BUILTIN_MSKBL, + ALPHA_BUILTIN_MSKWL, + ALPHA_BUILTIN_MSKLL, + ALPHA_BUILTIN_MSKQL, + ALPHA_BUILTIN_MSKWH, + ALPHA_BUILTIN_MSKLH, + ALPHA_BUILTIN_MSKQH, + ALPHA_BUILTIN_UMULH, + ALPHA_BUILTIN_ZAP, + ALPHA_BUILTIN_ZAPNOT, + ALPHA_BUILTIN_AMASK, + ALPHA_BUILTIN_IMPLVER, + ALPHA_BUILTIN_RPCC, + ALPHA_BUILTIN_THREAD_POINTER, + ALPHA_BUILTIN_SET_THREAD_POINTER, + + /* TARGET_MAX */ + ALPHA_BUILTIN_MINUB8, + ALPHA_BUILTIN_MINSB8, + ALPHA_BUILTIN_MINUW4, + ALPHA_BUILTIN_MINSW4, + ALPHA_BUILTIN_MAXUB8, + ALPHA_BUILTIN_MAXSB8, + ALPHA_BUILTIN_MAXUW4, + ALPHA_BUILTIN_MAXSW4, + ALPHA_BUILTIN_PERR, + ALPHA_BUILTIN_PKLB, + ALPHA_BUILTIN_PKWB, + ALPHA_BUILTIN_UNPKBL, + ALPHA_BUILTIN_UNPKBW, + + /* TARGET_CIX */ + ALPHA_BUILTIN_CTTZ, + ALPHA_BUILTIN_CTLZ, + ALPHA_BUILTIN_CTPOP, + + ALPHA_BUILTIN_max +}; + +/* TargetIntrinsicLower - For builtins that we want to expand to normal LLVM + * code, emit the code now. If we can handle the code, this macro should emit + * the code, return true. + */ +bool TreeToLLVM::TargetIntrinsicLower(tree exp, + unsigned FnCode, + const MemRef *DestLoc, + Value *&Result, + const Type *ResultType, + std::vector &Ops) { + switch (FnCode) { + case ALPHA_BUILTIN_UMULH: { + Function *f = + Intrinsic::getDeclaration(TheModule, Intrinsic::alpha_umulh); + Value *Arg0 = Ops[0]; + Value *Arg1 = Ops[1]; + Value *CallOps[2] = { Arg0, Arg1}; + Result = Builder.CreateCall(f, CallOps, CallOps+2, "tmp"); + Result = Builder.CreateBitCast(Result, ResultType, "tmp"); + return true; + } + default: break; + } + + return false; +} + +/* LLVM LOCAL end (ENTIRE FILE!) */ From alenhar2 at cs.uiuc.edu Mon Oct 6 21:30:14 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 02:30:14 -0000 Subject: [llvm-commits] [llvm] r57228 - /llvm/trunk/test/CodeGen/Alpha/add128.ll Message-ID: <200810070230.m972UEpV026995@zion.cs.uiuc.edu> Author: alenhar2 Date: Mon Oct 6 21:30:13 2008 New Revision: 57228 URL: http://llvm.org/viewvc/llvm-project?rev=57228&view=rev Log: Add test case for ADDC ADDE expansion Added: llvm/trunk/test/CodeGen/Alpha/add128.ll Added: llvm/trunk/test/CodeGen/Alpha/add128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/add128.ll?rev=57228&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/add128.ll (added) +++ llvm/trunk/test/CodeGen/Alpha/add128.ll Mon Oct 6 21:30:13 2008 @@ -0,0 +1,10 @@ +;test for ADDC and ADDE expansion +; +; RUN: llvm-as < %s | llc -march=alpha -o %t.s -f +; XFAIL: * + +define i128 @add128(i128 %x, i128 %y) { +entry: + %tmp = add i128 %y, %x + ret i128 %tmp +} From clattner at apple.com Mon Oct 6 23:04:17 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Oct 2008 21:04:17 -0700 Subject: [llvm-commits] [llvm] r57226 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsAlpha.td lib/Target/Alpha/AlphaISelDAGToDAG.cpp lib/Target/Alpha/AlphaISelLowering.cpp In-Reply-To: <200810070210.m972AUxl026421@zion.cs.uiuc.edu> References: <200810070210.m972AUxl026421@zion.cs.uiuc.edu> Message-ID: <1589FB2C-9155-4943-9BEB-B775B11DFCB8@apple.com> On Oct 6, 2008, at 7:10 PM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Mon Oct 6 21:10:26 2008 > New Revision: 57226 > > URL: http://llvm.org/viewvc/llvm-project?rev=57226&view=rev > Log: > Note that ADDC and company don't actually expand yet (missing in > legalize Hi Andrew, __builtin_alpha_umulh can be represented with generic LLVM IR (zext to i128, multiply, shr by 64, truncate to i64). You should get good code for that sequence already, if not, that's a bug. Can you just have llvm-gcc expand the builtin like we do for other builtins supported by LLVM IR? -Chris From clattner at apple.com Mon Oct 6 23:05:37 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 6 Oct 2008 21:05:37 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r57227 - in /llvm-gcc-4.2/trunk/gcc: config.gcc config/alpha/alpha.h config/alpha/llvm-alpha.cpp In-Reply-To: <200810070211.m972BCB7026456@zion.cs.uiuc.edu> References: <200810070211.m972BCB7026456@zion.cs.uiuc.edu> Message-ID: <818DB8E0-A0D9-4F07-9EE6-EF85EB2E9EBE@apple.com> On Oct 6, 2008, at 7:11 PM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Mon Oct 6 21:11:11 2008 > New Revision: 57227 > > URL: http://llvm.org/viewvc/llvm-project?rev=57227&view=rev > Log: > Get alpha closer to building libgcc2 Ok +bool TreeToLLVM::TargetIntrinsicLower(tree exp, > + unsigned FnCode, > + const MemRef *DestLoc, > + Value *&Result, > + const Type *ResultType, > + std::vector &Ops) { If you make an llvm intrinsic that maps 1-1 with a GCC builtin, you generally don't have to do lowering like this. This would be a great place to lower it to llvm ir though :) -Chris > > + switch (FnCode) { > + case ALPHA_BUILTIN_UMULH: { > + Function *f = > + Intrinsic::getDeclaration(TheModule, Intrinsic::alpha_umulh); > + Value *Arg0 = Ops[0]; > + Value *Arg1 = Ops[1]; > + Value *CallOps[2] = { Arg0, Arg1}; > + Result = Builder.CreateCall(f, CallOps, CallOps+2, "tmp"); > + Result = Builder.CreateBitCast(Result, ResultType, "tmp"); > + return true; > + } > + default: break; > + } > + > + return false; > +} > + > +/* LLVM LOCAL end (ENTIRE FILE!) */ > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From tonic at nondot.org Mon Oct 6 23:06:02 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:06:02 -0000 Subject: [llvm-commits] [llvm] r57229 - /llvm/branches/release_24/ Message-ID: <200810070406.m97463Q7030040@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:06:01 2008 New Revision: 57229 URL: http://llvm.org/viewvc/llvm-project?rev=57229&view=rev Log: Create 2.4 release branch. Added: llvm/branches/release_24/ - copied from r57228, llvm/trunk/ From tonic at nondot.org Mon Oct 6 23:06:26 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:06:26 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57230 - /llvm-gcc-4.2/branches/release_24/ Message-ID: <200810070406.m9746QcV030065@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:06:26 2008 New Revision: 57230 URL: http://llvm.org/viewvc/llvm-project?rev=57230&view=rev Log: Create 2.4 release branch. Added: llvm-gcc-4.2/branches/release_24/ - copied from r57229, llvm-gcc-4.2/trunk/ From tonic at nondot.org Mon Oct 6 23:06:50 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:06:50 -0000 Subject: [llvm-commits] [test-suite] r57231 - /test-suite/branches/release_24/ Message-ID: <200810070406.m9746oIj030085@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:06:50 2008 New Revision: 57231 URL: http://llvm.org/viewvc/llvm-project?rev=57231&view=rev Log: Create 2.4 release branch. Added: test-suite/branches/release_24/ - copied from r57230, test-suite/trunk/ From sabre at nondot.org Mon Oct 6 23:06:55 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 07 Oct 2008 04:06:55 -0000 Subject: [llvm-commits] [llvm] r57232 - /llvm/trunk/test/CodeGen/Alpha/add128.ll Message-ID: <200810070406.m9746tIB030100@zion.cs.uiuc.edu> Author: lattner Date: Mon Oct 6 23:06:55 2008 New Revision: 57232 URL: http://llvm.org/viewvc/llvm-project?rev=57232&view=rev Log: no need to write the output to the disk Modified: llvm/trunk/test/CodeGen/Alpha/add128.ll Modified: llvm/trunk/test/CodeGen/Alpha/add128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/add128.ll?rev=57232&r1=57231&r2=57232&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/add128.ll (original) +++ llvm/trunk/test/CodeGen/Alpha/add128.ll Mon Oct 6 23:06:55 2008 @@ -1,6 +1,6 @@ ;test for ADDC and ADDE expansion ; -; RUN: llvm-as < %s | llc -march=alpha -o %t.s -f +; RUN: llvm-as < %s | llc -march=alpha ; XFAIL: * define i128 @add128(i128 %x, i128 %y) { From tonic at nondot.org Mon Oct 6 23:35:09 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:35:09 -0000 Subject: [llvm-commits] [llvm] r57233 - in /llvm/trunk: autoconf/configure.ac configure Message-ID: <200810070435.m974ZAwd031588@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:35:08 2008 New Revision: 57233 URL: http://llvm.org/viewvc/llvm-project?rev=57233&view=rev Log: Advance version to 2.5 Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=57233&r1=57232&r2=57233&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Mon Oct 6 23:35:08 2008 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.4svn]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.5svn]],[llvmbugs at cs.uiuc.edu]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=57233&r1=57232&r2=57233&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Mon Oct 6 23:35:08 2008 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.4svn. +# Generated by GNU Autoconf 2.60 for llvm 2.5svn. # # Report bugs to . # @@ -715,8 +715,8 @@ # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.4svn' -PACKAGE_STRING='llvm 2.4svn' +PACKAGE_VERSION='2.5svn' +PACKAGE_STRING='llvm 2.5svn' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -1462,7 +1462,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures llvm 2.4svn to adapt to many kinds of systems. +\`configure' configures llvm 2.5svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1528,7 +1528,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.4svn:";; + short | recursive ) echo "Configuration of llvm 2.5svn:";; esac cat <<\_ACEOF @@ -1663,7 +1663,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -llvm configure 2.4svn +llvm configure 2.5svn generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1679,7 +1679,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by llvm $as_me 2.4svn, which was +It was created by llvm $as_me 2.5svn, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -9002,7 +9002,9 @@ fi - if test x"${enable_ltdl_install-no}" != xno; then + + +if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else @@ -9010,7 +9012,9 @@ INSTALL_LTDL_FALSE= fi - if test x"${enable_ltdl_convenience-no}" != xno; then + + +if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else @@ -10777,7 +10781,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12928 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14639,11 +14643,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14642: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14646: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14646: \$? = $ac_status" >&5 + echo "$as_me:14650: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14907,11 +14911,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14910: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14914: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14914: \$? = $ac_status" >&5 + echo "$as_me:14918: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15011,11 +15015,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15014: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15018: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15018: \$? = $ac_status" >&5 + echo "$as_me:15022: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17463,7 +17467,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:19938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19938: \$? = $ac_status" >&5 + echo "$as_me:19942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -20035,11 +20039,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20038: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20042: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:20042: \$? = $ac_status" >&5 + echo "$as_me:20046: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21605,11 +21609,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21608: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21612: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21612: \$? = $ac_status" >&5 + echo "$as_me:21616: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -21709,11 +21713,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21712: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21716: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21716: \$? = $ac_status" >&5 + echo "$as_me:21720: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23944,11 +23948,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23947: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23951: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23951: \$? = $ac_status" >&5 + echo "$as_me:23955: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24212,11 +24216,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24215: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24219: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:24219: \$? = $ac_status" >&5 + echo "$as_me:24223: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24316,11 +24320,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24319: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24323: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:24323: \$? = $ac_status" >&5 + echo "$as_me:24327: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -34242,7 +34246,7 @@ LLVMGCC_MAJVERS=$llvmgccmajvers - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` LLVMGCC_LANGS=$llvmgcclangs { echo "$as_me:$LINENO: result: ok" >&5 @@ -34947,7 +34951,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by llvm $as_me 2.4svn, which was +This file was extended by llvm $as_me 2.5svn, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -35000,7 +35004,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 2.4svn +llvm config.status 2.5svn configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From lattner at apple.com Mon Oct 6 23:35:38 2008 From: lattner at apple.com (Tanya Lattner) Date: Mon, 6 Oct 2008 21:35:38 -0700 Subject: [llvm-commits] [llvm] r57167 - in /llvm/trunk: configure test/FrontendObjC++/dg.exp test/lib/llvm.exp In-Reply-To: <200810061031.m96AVU4e024330@zion.cs.uiuc.edu> References: <200810061031.m96AVU4e024330@zion.cs.uiuc.edu> Message-ID: <2A7F209F-0677-40E9-AFF4-EADE5D94AB44@apple.com> Duncan, Did you forget to check in autoconf/configure.ac? This is going to be reverted with my checkin of the new configure script. It is also not going to the release. Please send me a patch. Thanks, Tanya On Oct 6, 2008, at 3:31 AM, Duncan Sands wrote: > Author: baldrick > Date: Mon Oct 6 05:31:21 2008 > New Revision: 57167 > > URL: http://llvm.org/viewvc/llvm-project?rev=57167&view=rev > Log: > Actually run Obj-C++ tests if llvm-gcc supports. > Before there were two problems: (1) configure > turned "obj-c++" into "obj" in the langs line; > (2) the dejagnu library called it objc++ not > obj-c++. > Now the problem is that some of these tests don't > pass! > > Modified: > llvm/trunk/configure > llvm/trunk/test/FrontendObjC++/dg.exp > llvm/trunk/test/lib/llvm.exp > > Modified: llvm/trunk/configure > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=57167&r1=57166&r2=57167&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/configure (original) > +++ llvm/trunk/configure Mon Oct 6 05:31:21 2008 > @@ -34242,7 +34242,7 @@ > > LLVMGCC_MAJVERS=$llvmgccmajvers > > - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured > with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` > + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured > with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` > LLVMGCC_LANGS=$llvmgcclangs > > { echo "$as_me:$LINENO: result: ok" >&5 > > Modified: llvm/trunk/test/FrontendObjC++/dg.exp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC%2B%2B/dg.exp?rev=57167&r1=57166&r2=57167&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/FrontendObjC++/dg.exp (original) > +++ llvm/trunk/test/FrontendObjC++/dg.exp Mon Oct 6 05:31:21 2008 > @@ -1,5 +1,5 @@ > load_lib llvm.exp > > -if [ llvm_gcc_supports objc++ ] then { > +if [ llvm_gcc_supports obj-c++ ] then { > RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{mm}]] > } > > Modified: llvm/trunk/test/lib/llvm.exp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm.exp?rev=57167&r1=57166&r2=57167&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/lib/llvm.exp (original) > +++ llvm/trunk/test/lib/llvm.exp Mon Oct 6 05:31:21 2008 > @@ -237,7 +237,7 @@ > c { set file cc1 } > c++ { set file cc1plus } > objc { set file cc1obj } > - objc++ { set file cc1objplus } > + obj-c++ { set file cc1objplus } > fortran { set file f951 } > default { return 0 } > } > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From tonic at nondot.org Mon Oct 6 23:41:14 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:41:14 -0000 Subject: [llvm-commits] [test-suite] r57234 - in /test-suite/trunk: autoconf/configure.ac configure Message-ID: <200810070441.m974fELQ031977@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:41:14 2008 New Revision: 57234 URL: http://llvm.org/viewvc/llvm-project?rev=57234&view=rev Log: Advance to 2.5 Modified: test-suite/trunk/autoconf/configure.ac test-suite/trunk/configure Modified: test-suite/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/autoconf/configure.ac?rev=57234&r1=57233&r2=57234&view=diff ============================================================================== --- test-suite/trunk/autoconf/configure.ac (original) +++ test-suite/trunk/autoconf/configure.ac Mon Oct 6 23:41:14 2008 @@ -1,5 +1,5 @@ dnl Initialize autoconf -AC_INIT([[LLVM-TEST]],[[2.4svn]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[LLVM-TEST]],[[2.5svn]],[llvmbugs at cs.uiuc.edu]) dnl Place all of the extra autoconf files into the config subdirectory AC_CONFIG_AUX_DIR([autoconf]) Modified: test-suite/trunk/configure URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/configure?rev=57234&r1=57233&r2=57234&view=diff ============================================================================== --- test-suite/trunk/configure (original) +++ test-suite/trunk/configure Mon Oct 6 23:41:14 2008 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for LLVM-TEST 2.4svn. +# Generated by GNU Autoconf 2.60 for LLVM-TEST 2.5svn. # # Report bugs to . # @@ -713,8 +713,8 @@ # Identity of this package. PACKAGE_NAME='LLVM-TEST' PACKAGE_TARNAME='-llvm-test-' -PACKAGE_VERSION='2.4svn' -PACKAGE_STRING='LLVM-TEST 2.4svn' +PACKAGE_VERSION='2.5svn' +PACKAGE_STRING='LLVM-TEST 2.5svn' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="SingleSource/Benchmarks/Makefile" @@ -1389,7 +1389,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LLVM-TEST 2.4svn to adapt to many kinds of systems. +\`configure' configures LLVM-TEST 2.5svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1454,7 +1454,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LLVM-TEST 2.4svn:";; + short | recursive ) echo "Configuration of LLVM-TEST 2.5svn:";; esac cat <<\_ACEOF @@ -1576,7 +1576,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LLVM-TEST configure 2.4svn +LLVM-TEST configure 2.5svn generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1590,7 +1590,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LLVM-TEST $as_me 2.4svn, which was +It was created by LLVM-TEST $as_me 2.5svn, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -21257,7 +21257,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LLVM-TEST $as_me 2.4svn, which was +This file was extended by LLVM-TEST $as_me 2.5svn, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21304,7 +21304,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -LLVM-TEST config.status 2.4svn +LLVM-TEST config.status 2.5svn configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From tonic at nondot.org Mon Oct 6 23:43:29 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:43:29 -0000 Subject: [llvm-commits] [llvm] r57235 - in /llvm/branches/release_24: autoconf/configure.ac configure Message-ID: <200810070443.m974hTFX032300@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:43:28 2008 New Revision: 57235 URL: http://llvm.org/viewvc/llvm-project?rev=57235&view=rev Log: Correct version number. Modified: llvm/branches/release_24/autoconf/configure.ac llvm/branches/release_24/configure Modified: llvm/branches/release_24/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/autoconf/configure.ac?rev=57235&r1=57234&r2=57235&view=diff ============================================================================== --- llvm/branches/release_24/autoconf/configure.ac (original) +++ llvm/branches/release_24/autoconf/configure.ac Mon Oct 6 23:43:28 2008 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.4svn]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[llvm]],[[2.4]],[llvmbugs at cs.uiuc.edu]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. Modified: llvm/branches/release_24/configure URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/configure?rev=57235&r1=57234&r2=57235&view=diff ============================================================================== --- llvm/branches/release_24/configure (original) +++ llvm/branches/release_24/configure Mon Oct 6 23:43:28 2008 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.4svn. +# Generated by GNU Autoconf 2.60 for llvm 2.4. # # Report bugs to . # @@ -715,8 +715,8 @@ # Identity of this package. PACKAGE_NAME='llvm' PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.4svn' -PACKAGE_STRING='llvm 2.4svn' +PACKAGE_VERSION='2.4' +PACKAGE_STRING='llvm 2.4' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="lib/VMCore/Module.cpp" @@ -1462,7 +1462,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures llvm 2.4svn to adapt to many kinds of systems. +\`configure' configures llvm 2.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1528,7 +1528,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.4svn:";; + short | recursive ) echo "Configuration of llvm 2.4:";; esac cat <<\_ACEOF @@ -1663,7 +1663,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -llvm configure 2.4svn +llvm configure 2.4 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1679,7 +1679,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by llvm $as_me 2.4svn, which was +It was created by llvm $as_me 2.4, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -9002,7 +9002,9 @@ fi - if test x"${enable_ltdl_install-no}" != xno; then + + +if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else @@ -9010,7 +9012,9 @@ INSTALL_LTDL_FALSE= fi - if test x"${enable_ltdl_convenience-no}" != xno; then + + +if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else @@ -10777,7 +10781,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 12928 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14639,11 +14643,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14642: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14646: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14646: \$? = $ac_status" >&5 + echo "$as_me:14650: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14907,11 +14911,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14910: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14914: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14914: \$? = $ac_status" >&5 + echo "$as_me:14918: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15011,11 +15015,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15014: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15018: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15018: \$? = $ac_status" >&5 + echo "$as_me:15022: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17463,7 +17467,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:19938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:19938: \$? = $ac_status" >&5 + echo "$as_me:19942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -20035,11 +20039,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20038: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20042: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:20042: \$? = $ac_status" >&5 + echo "$as_me:20046: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21605,11 +21609,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21608: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21612: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21612: \$? = $ac_status" >&5 + echo "$as_me:21616: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -21709,11 +21713,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21712: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21716: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21716: \$? = $ac_status" >&5 + echo "$as_me:21720: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23944,11 +23948,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:23947: $lt_compile\"" >&5) + (eval echo "\"\$as_me:23951: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:23951: \$? = $ac_status" >&5 + echo "$as_me:23955: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24212,11 +24216,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24215: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24219: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:24219: \$? = $ac_status" >&5 + echo "$as_me:24223: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24316,11 +24320,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24319: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24323: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:24323: \$? = $ac_status" >&5 + echo "$as_me:24327: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -34242,7 +34246,7 @@ LLVMGCC_MAJVERS=$llvmgccmajvers - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` LLVMGCC_LANGS=$llvmgcclangs { echo "$as_me:$LINENO: result: ok" >&5 @@ -34947,7 +34951,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by llvm $as_me 2.4svn, which was +This file was extended by llvm $as_me 2.4, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -35000,7 +35004,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -llvm config.status 2.4svn +llvm config.status 2.4 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From tonic at nondot.org Mon Oct 6 23:48:30 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 04:48:30 -0000 Subject: [llvm-commits] [test-suite] r57236 - in /test-suite/branches/release_24: autoconf/configure.ac configure Message-ID: <200810070448.m974mUDr000368@zion.cs.uiuc.edu> Author: tbrethou Date: Mon Oct 6 23:48:29 2008 New Revision: 57236 URL: http://llvm.org/viewvc/llvm-project?rev=57236&view=rev Log: Set version number to 2.4 Modified: test-suite/branches/release_24/autoconf/configure.ac test-suite/branches/release_24/configure Modified: test-suite/branches/release_24/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/test-suite/branches/release_24/autoconf/configure.ac?rev=57236&r1=57235&r2=57236&view=diff ============================================================================== --- test-suite/branches/release_24/autoconf/configure.ac (original) +++ test-suite/branches/release_24/autoconf/configure.ac Mon Oct 6 23:48:29 2008 @@ -1,5 +1,5 @@ dnl Initialize autoconf -AC_INIT([[LLVM-TEST]],[[2.4svn]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[LLVM-TEST]],[[2.4]],[llvmbugs at cs.uiuc.edu]) dnl Place all of the extra autoconf files into the config subdirectory AC_CONFIG_AUX_DIR([autoconf]) Modified: test-suite/branches/release_24/configure URL: http://llvm.org/viewvc/llvm-project/test-suite/branches/release_24/configure?rev=57236&r1=57235&r2=57236&view=diff ============================================================================== --- test-suite/branches/release_24/configure (original) +++ test-suite/branches/release_24/configure Mon Oct 6 23:48:29 2008 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for LLVM-TEST 2.4svn. +# Generated by GNU Autoconf 2.60 for LLVM-TEST 2.4. # # Report bugs to . # @@ -713,8 +713,8 @@ # Identity of this package. PACKAGE_NAME='LLVM-TEST' PACKAGE_TARNAME='-llvm-test-' -PACKAGE_VERSION='2.4svn' -PACKAGE_STRING='LLVM-TEST 2.4svn' +PACKAGE_VERSION='2.4' +PACKAGE_STRING='LLVM-TEST 2.4' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' ac_unique_file="SingleSource/Benchmarks/Makefile" @@ -1389,7 +1389,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LLVM-TEST 2.4svn to adapt to many kinds of systems. +\`configure' configures LLVM-TEST 2.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1454,7 +1454,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LLVM-TEST 2.4svn:";; + short | recursive ) echo "Configuration of LLVM-TEST 2.4:";; esac cat <<\_ACEOF @@ -1576,7 +1576,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LLVM-TEST configure 2.4svn +LLVM-TEST configure 2.4 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1590,7 +1590,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LLVM-TEST $as_me 2.4svn, which was +It was created by LLVM-TEST $as_me 2.4, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ @@ -21257,7 +21257,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LLVM-TEST $as_me 2.4svn, which was +This file was extended by LLVM-TEST $as_me 2.4, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21304,7 +21304,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -LLVM-TEST config.status 2.4svn +LLVM-TEST config.status 2.4 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From nicholas at mxc.ca Tue Oct 7 00:22:27 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 06 Oct 2008 22:22:27 -0700 Subject: [llvm-commits] [llvm] r57049 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Transforms/IndVarsSimplify/2008-10-03-CouldNotCompute.ll In-Reply-To: <0AF89826-5395-4C39-854F-62BEAB4A039A@apple.com> References: <200810041119.m94BJ7Lo019402@zion.cs.uiuc.edu> <0AF89826-5395-4C39-854F-62BEAB4A039A@apple.com> Message-ID: <48EAF213.4060302@mxc.ca> Dan Gohman wrote: > Hi Nick, > > Is this the right approach? It would be much simpler to just > fix evaluateAtIteration to check for return value of > BinomialCoefficient for CNC and stop trying to do further > computation. > > Or, are you envisioning someday adding code that would want > to take advantage of being able to keep going after getting > a CNC, because it's simpler to do so, or in hopes that it > might be cancelled out later? No, it isn't. I took the idea that CNC * 0 -> 0 and generalized it to the notion that we need to analyze these. We don't. For example, CNC - CNC != 0. I think your suggested fix is the right one. I'll put a patch in PR2857 soon/eventually. Nick > Also, in the patch, there are several instances of code like this: > >> + if (isa(Op)) >> + return new SCEVCouldNotCompute(); > > Instead of creating a new SCEV object, code like this can > just return Op. > > Dan > > On Oct 4, 2008, at 4:19 AM, Nick Lewycky wrote: > >> Author: nicholas >> Date: Sat Oct 4 06:19:07 2008 >> New Revision: 57049 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57049&view=rev >> Log: >> Allow the construction of SCEVs with SCEVCouldNotCompute operands, by >> implementing folding. Fixes PR2857. >> >> Added: >> llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- >> CouldNotCompute.ll >> Modified: >> llvm/trunk/lib/Analysis/ScalarEvolution.cpp >> >> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=57049&r1=57048&r2=57049&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) >> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Oct 4 06:19:07 >> 2008 >> @@ -676,6 +676,9 @@ >> return getAddRecExpr(Operands, AddRec->getLoop()); >> } >> >> + if (isa(Op)) >> + return new SCEVCouldNotCompute(); >> + >> SCEVTruncateExpr *&Result = (*SCEVTruncates)[std::make_pair(Op, >> Ty)]; >> if (Result == 0) Result = new SCEVTruncateExpr(Op, Ty); >> return Result; >> @@ -691,6 +694,9 @@ >> // operands (often constants). This would allow analysis of >> something like >> // this: for (unsigned char X = 0; X < 100; ++X) { int Y = X; } >> >> + if (isa(Op)) >> + return new SCEVCouldNotCompute(); >> + >> SCEVZeroExtendExpr *&Result = (*SCEVZeroExtends) >> [std::make_pair(Op, Ty)]; >> if (Result == 0) Result = new SCEVZeroExtendExpr(Op, Ty); >> return Result; >> @@ -706,6 +712,9 @@ >> // operands (often constants). This would allow analysis of >> something like >> // this: for (signed char X = 0; X < 100; ++X) { int Y = X; } >> >> + if (isa(Op)) >> + return new SCEVCouldNotCompute(); >> + >> SCEVSignExtendExpr *&Result = (*SCEVSignExtends) >> [std::make_pair(Op, Ty)]; >> if (Result == 0) Result = new SCEVSignExtendExpr(Op, Ty); >> return Result; >> @@ -734,6 +743,10 @@ >> // Sort by complexity, this groups all similar expression types >> together. >> GroupByComplexity(Ops); >> >> + // Could not compute plus anything equals could not compute. >> + if (isa(Ops.back())) >> + return new SCEVCouldNotCompute(); >> + >> // If there are any constants, fold them together. >> unsigned Idx = 0; >> if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { >> @@ -959,6 +972,21 @@ >> // Sort by complexity, this groups all similar expression types >> together. >> GroupByComplexity(Ops); >> >> + if (isa(Ops.back())) { >> + // CNC * 0 = 0 >> + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { >> + if (Ops[i]->getSCEVType() != scConstant) >> + break; >> + >> + SCEVConstant *SC = cast(Ops[i]); >> + if (SC->getValue()->isMinValue(false)) >> + return SC; >> + } >> + >> + // Otherwise, we can't compute it. >> + return new SCEVCouldNotCompute(); >> + } >> + >> // If there are any constants, fold them together. >> unsigned Idx = 0; >> if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { >> @@ -1124,6 +1152,9 @@ >> >> // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't >> overflow. >> >> + if (isa(LHS) || isa(RHS)) >> + return new SCEVCouldNotCompute(); >> + >> SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)]; >> if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS); >> return Result; >> @@ -1171,6 +1202,12 @@ >> } >> } >> >> + // Refuse to build an AddRec out of SCEVCouldNotCompute. >> + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { >> + if (isa(Operands[i])) >> + return new SCEVCouldNotCompute(); >> + } >> + >> SCEVAddRecExpr *&Result = >> (*SCEVAddRecExprs)[std::make_pair(L, >> std::vector(Operands.begin(), >> >> Operands.end()))]; >> @@ -1193,6 +1230,21 @@ >> // Sort by complexity, this groups all similar expression types >> together. >> GroupByComplexity(Ops); >> >> + if (isa(Ops.back())) { >> + // CNC smax +inf = +inf. >> + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { >> + if (Ops[i]->getSCEVType() != scConstant) >> + break; >> + >> + SCEVConstant *SC = cast(Ops[i]); >> + if (SC->getValue()->isMaxValue(true)) >> + return SC; >> + } >> + >> + // Otherwise, we can't compute it. >> + return new SCEVCouldNotCompute(); >> + } >> + >> // If there are any constants, fold them together. >> unsigned Idx = 0; >> if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { >> @@ -1273,6 +1325,21 @@ >> // Sort by complexity, this groups all similar expression types >> together. >> GroupByComplexity(Ops); >> >> + if (isa(Ops[0])) { >> + // CNC umax inf = inf. >> + for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { >> + if (Ops[i]->getSCEVType() != scConstant) >> + break; >> + >> + SCEVConstant *SC = cast(Ops[i]); >> + if (SC->getValue()->isMaxValue(false)) >> + return SC; >> + } >> + >> + // Otherwise, we can't compute it. >> + return new SCEVCouldNotCompute(); >> + } >> + >> // If there are any constants, fold them together. >> unsigned Idx = 0; >> if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { >> >> Added: llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- >> CouldNotCompute.ll >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03-CouldNotCompute.ll?rev=57049&view=auto >> >> = >> = >> = >> = >> = >> = >> = >> = >> ====================================================================== >> --- llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- >> CouldNotCompute.ll (added) >> +++ llvm/trunk/test/Transforms/IndVarsSimplify/2008-10-03- >> CouldNotCompute.ll Sat Oct 4 06:19:07 2008 >> @@ -0,0 +1,32 @@ >> +; RUN: llvm-as < %s | opt -indvars >> +; PR2857 >> + >> + at foo = external global i32 ; [#uses=1] >> + >> +define void @test(i32 %n, i32 %arg) { >> +entry: >> + br i1 false, label %bb.nph, label %return >> + >> +bb.nph: ; preds = %entry >> + %0 = load i32* @foo, align 4 ; [#uses=1] >> + %1 = sext i32 %0 to i64 ; [#uses=1] >> + br label %bb >> + >> +bb: ; preds = %bb, %bb.nph >> + %.in = phi i32 [ %2, %bb ], [ %n, %bb.nph ] ; [#uses=1] >> + %val.02 = phi i64 [ %5, %bb ], [ 0, %bb.nph ] ; [#uses=2] >> + %result.01 = phi i64 [ %4, %bb ], [ 0, %bb.nph ] ; [#uses=1] >> + %2 = add i32 %.in, -1 ; [#uses=2] >> + %3 = mul i64 %1, %val.02 ; [#uses=1] >> + %4 = add i64 %3, %result.01 ; [#uses=2] >> + %5 = add i64 %val.02, 1 ; [#uses=1] >> + %6 = icmp sgt i32 %2, 0 ; [#uses=1] >> + br i1 %6, label %bb, label %bb3.bb4_crit_edge >> + >> +bb3.bb4_crit_edge: ; preds = %bb >> + %.lcssa = phi i64 [ %4, %bb ] ; [#uses=0] >> + ret void >> + >> +return: ; preds = %entry >> + ret void >> +} >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From andrewl at lenharth.org Tue Oct 7 00:27:09 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 00:27:09 -0500 Subject: [llvm-commits] [llvm] r57226 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsAlpha.td lib/Target/Alpha/AlphaISelDAGToDAG.cpp lib/Target/Alpha/AlphaISelLowering.cpp In-Reply-To: <1589FB2C-9155-4943-9BEB-B775B11DFCB8@apple.com> References: <200810070210.m972AUxl026421@zion.cs.uiuc.edu> <1589FB2C-9155-4943-9BEB-B775B11DFCB8@apple.com> Message-ID: <85dfcd7f0810062227i254c940cvaaa6152c108c55ea@mail.gmail.com> On Mon, Oct 6, 2008 at 11:04 PM, Chris Lattner wrote: > > On Oct 6, 2008, at 7:10 PM, Andrew Lenharth wrote: > >> Author: alenhar2 >> Date: Mon Oct 6 21:10:26 2008 >> New Revision: 57226 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57226&view=rev >> Log: >> Note that ADDC and company don't actually expand yet (missing in legalize > > Hi Andrew, > > __builtin_alpha_umulh can be represented with generic LLVM IR (zext to i128, > multiply, shr by 64, truncate to i64). You should get good code for that > sequence already, if not, that's a bug. > > Can you just have llvm-gcc expand the builtin like we do for other builtins > supported by LLVM IR? I was thinking of doing that, but I hadn't tried to see what kind of code I got for it. Andrew From ggreif at gmail.com Tue Oct 7 01:41:03 2008 From: ggreif at gmail.com (Gabor Greif) Date: Tue, 07 Oct 2008 06:41:03 -0000 Subject: [llvm-commits] [llvm] r57237 - in /llvm/trunk/test/FrontendObjC: 2008-10-3-EhValue.m 2008-10-3-EhValue.mm Message-ID: <200810070641.m976f3Ul003977@zion.cs.uiuc.edu> Author: ggreif Date: Tue Oct 7 01:41:02 2008 New Revision: 57237 URL: http://llvm.org/viewvc/llvm-project?rev=57237&view=rev Log: fix filetype suffix Added: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.m (props changed) - copied unchanged from r57236, llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm Removed: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm Propchange: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.m ------------------------------------------------------------------------------ svn:mergeinfo = Removed: llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm?rev=57236&view=auto ============================================================================== --- llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm (original) +++ llvm/trunk/test/FrontendObjC/2008-10-3-EhValue.mm (removed) @@ -1,50 +0,0 @@ -// RUN: %llvmgcc -w -x objective-c -c %s -o /dev/null - - at interface Object { - at public - Class isa; -} -+initialize; -+alloc; -+new; -+free; --free; -+(Class)class; --(Class)class; --init; --superclass; --(const char *)name; - at end - - at interface Frob: Object - at end - - at implementation Frob: Object - at end - -static Frob* _connection = ((void *)0); - -extern void abort(void); - -void test (Object* sendPort) -{ - int cleanupPorts = 1; - Frob* receivePort = ((void *)0); - - @try { - receivePort = (Frob *) -1; - _connection = (Frob *) -1; - receivePort = ((void *)0); - sendPort = ((void *)0); - cleanupPorts = 0; - @throw [Object new]; - } - @catch(Frob *obj) { - if(!(0)) abort(); - } - @catch(id exc) { - if(!(!receivePort)) abort(); - if(!(!sendPort)) abort(); - if(!(!cleanupPorts)) abort(); - } -} From baldrick at free.fr Tue Oct 7 02:59:05 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 7 Oct 2008 09:59:05 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r57199 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200810062006.m96K656I011430@zion.cs.uiuc.edu> References: <200810062006.m96K656I011430@zion.cs.uiuc.edu> Message-ID: <200810070959.05307.baldrick@free.fr> Hi Evan, > /// EmitFILTER_EXPR - Handle FILTER_EXPR. > Value *TreeToLLVM::EmitFILTER_EXPR(tree exp) { > CreateExceptionValues(); > // Load exception selector. > - return Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); > + Value *V = Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); > + // Cast the address to the right pointer type. > + return BitCastToType(V, ConvertType(TREE_TYPE(exp))); > } I don't think this is right. Are you really seeing problems with FILTER_EXPR? The big difference between EXC_PTR_EXPR and FILTER_EXPR is that EXC_PTR_EXPR is a pointer while FILTER_EXPR is an integer. We (and gcc generic code) treat EXC_PTR_EXPR as a void*, while objc gives it a different pointer type. That can be fixed by just bitcasting pointer types. However if FILTER_EXPR is declared somewhere as an integer with a different width then that's more problematic (and the bitcast you introduced will assert!). Fortunately no-one besides the core gcc eh code creates FILTER_EXPRs, not even objc, and the places that do make them all use the same type. In short, can you please revert the FILTER_EXPR parts of the patch. Thanks, Duncan. From baldrick at free.fr Tue Oct 7 03:04:07 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 7 Oct 2008 10:04:07 +0200 Subject: [llvm-commits] [poolalloc] r57214 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp In-Reply-To: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> References: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> Message-ID: <200810071004.07554.baldrick@free.fr> > + CallSite(NewCall).setCallingConv(CallSite(TheCall).getCallingConv()); Don't forget tail call markings and parameter attributes. Ciao, Duncan. PS: These things are too easy to forget - there should really be some helpers that take care of this kind of thing... From baldrick at free.fr Tue Oct 7 03:13:20 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 7 Oct 2008 10:13:20 +0200 Subject: [llvm-commits] [llvm] r57167 - in /llvm/trunk: configure test/FrontendObjC++/dg.exp test/lib/llvm.exp In-Reply-To: <2A7F209F-0677-40E9-AFF4-EADE5D94AB44@apple.com> References: <200810061031.m96AVU4e024330@zion.cs.uiuc.edu> <2A7F209F-0677-40E9-AFF4-EADE5D94AB44@apple.com> Message-ID: <200810071013.21014.baldrick@free.fr> Hi Tanya, > Did you forget to check in autoconf/configure.ac? yeah, I forgot how configure works :) How about this? Ciao, Duncan. PS: I don't have the right autothing version to regenerate configure. Index: autoconf/configure.ac =================================================================== --- autoconf/configure.ac (revision 57238) +++ autoconf/configure.ac (working copy) @@ -872,7 +872,7 @@ llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`] AC_SUBST(LLVMGCC_VERSION,$llvmgccversion) AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers) - llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`] + llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`] AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs) AC_MSG_RESULT([ok]) fi From matthijs at stdin.nl Tue Oct 7 05:03:48 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 07 Oct 2008 10:03:48 -0000 Subject: [llvm-commits] [llvm] r57239 - /llvm/trunk/docs/LangRef.html Message-ID: <200810071003.m97A3mlD020411@zion.cs.uiuc.edu> Author: matthijs Date: Tue Oct 7 05:03:45 2008 New Revision: 57239 URL: http://llvm.org/viewvc/llvm-project?rev=57239&view=rev Log: Add two forgotten 's. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57239&r1=57238&r2=57239&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Oct 7 05:03:45 2008 @@ -4333,8 +4333,8 @@ %r = call %struct.A @foo() ; yields { 32, i8 } %gr = extractvalue %struct.A %r, 0 ; yields i32 %gr1 = extractvalue %struct.A %r, 1 ; yields i8 - %Z = call void @foo() noreturn ; indicates that foo never returns nomrally - %ZZ = call zeroext i32 @bar() ; Return value is zero extended + %Z = call void @foo() noreturn ; indicates that %foo never returns nomrally + %ZZ = call zeroext i32 @bar() ; Return value is %zero extended From andrewl at lenharth.org Tue Oct 7 08:18:04 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 08:18:04 -0500 Subject: [llvm-commits] [poolalloc] r57214 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp In-Reply-To: <200810071004.07554.baldrick@free.fr> References: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> <200810071004.07554.baldrick@free.fr> Message-ID: <85dfcd7f0810070618s1e3167f3hddf370d435b2722f@mail.gmail.com> On Tue, Oct 7, 2008 at 3:04 AM, Duncan Sands wrote: >> + CallSite(NewCall).setCallingConv(CallSite(TheCall).getCallingConv()); > > Don't forget tail call markings and parameter attributes. Thanks, the tail call markings I was still looking into. The parameter attributes are handled during the function clone/rewriting (but suffer from potential off by one errors, parameter attributes should really be properties of the Argument class rather than positional in the Function class). Andrew From neil at daikokuya.co.uk Tue Oct 7 08:19:21 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Tue, 7 Oct 2008 22:19:21 +0900 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> Message-ID: <20081007131921.GF19669@daikokuya.co.uk> Dale Johannesen wrote:- > > On Oct 6, 2008, at 11:51 AMPDT, Dan Gohman wrote: > >> > >> + fs = (shift < 0) ? opInexact : opOK; > >> // gcc forces the Quiet bit on, which means (float)(double) > >> (float_sNan) > >> // does not give you back the same bits. This is dubious, and we > >> // don't currently do it. You're really supposed to get > >> // an invalid operation signal at runtime, but nobody does that. > >> - fs = opOK; > > > > Shouldn't converting a NaN set the opInvalidOp flag? > > According to IEEE754, converting a SNan sets opInvalid, but we aren't > really trying for an accurate implementation of SNan's (nor does the > OS). > > For converting a QNan, what it says is: > "Every operation involving one or two input NaNs, none of them > signaling, shall signal no exception but, if a FP result is to be > delivered, shall deliver as its result a QNaN, which should be one of > the input NaNs. Note that format conversions might be unable to > deliver the same NaN." > > The last sentence applies here, and I'm not sure of its intent. At > face value it's a statement that it may be impossible to implement the > standard in this case, which seems unlikely. IMO an Inexact result > seems compatible with the way things work otherwise. > > To confuse things further, the value in the PR is not even an IEEE > NaN, but a pseudo-NaN in Intel jargon. It is outside all standards. The intent of APFloat as I wrote it was to replicate a conforming IEEE-754 CPU's results in software, with the return result indicating those exceptions that would occur under IEEE-754. IBM double double was later hacked on in an incomplete way. The paragraph you quote is unambiguous; these NaN to NaN conversions should always return fsOK because it "shall signal no exception". This is how the code worked before your change. Perhaps LLVM needs APFloat to evolve beyond IEEE-754; I'm not sure. But I suggest you think hard about that, and if you decide to go that way you at least use a new flag for your extensions. You should also update the comments in the .cpp and .h files appropriately, and review what other changes, if any, to other operations are needed to accomdate your new semantics. Neil. From neil at daikokuya.co.uk Tue Oct 7 08:21:39 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Tue, 7 Oct 2008 22:21:39 +0900 Subject: [llvm-commits] [llvm] r57224 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <200810070040.m970e3G9022211@zion.cs.uiuc.edu> References: <200810070040.m970e3G9022211@zion.cs.uiuc.edu> Message-ID: <20081007132139.GG19669@daikokuya.co.uk> Dale Johannesen wrote:- > Author: johannes > Date: Mon Oct 6 19:40:01 2008 > New Revision: 57224 > > URL: http://llvm.org/viewvc/llvm-project?rev=57224&view=rev > Log: > Mark negative-zero-to-int conversion as Inexact, > since -0.0 can't be represented as an int. > This prevents llvm from reducing -0.0 to a > load-and-convert of int 0. Fixes > ieee.exp/mzero[2356].c in gcc testsuite. > > > Modified: > llvm/trunk/lib/Support/APFloat.cpp > > Modified: llvm/trunk/lib/Support/APFloat.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57224&r1=57223&r2=57224&view=diff > > ============================================================================== > --- llvm/trunk/lib/Support/APFloat.cpp (original) > +++ llvm/trunk/lib/Support/APFloat.cpp Mon Oct 6 19:40:01 2008 > @@ -1784,7 +1784,8 @@ > > if(category == fcZero) { > APInt::tcSet(parts, 0, dstPartsCount); > - return opOK; > + // Negative zero can't be represented as an int. > + return sign ? opInexact : opOK; > } See my other mail. This and your other changes is abandoning the original intent of APFloat, to become some kind of fuzzy semantics. I am not in favour of this. Neil. From neil at daikokuya.co.uk Tue Oct 7 08:31:55 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Tue, 7 Oct 2008 22:31:55 +0900 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <20081007131921.GF19669@daikokuya.co.uk> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> Message-ID: <20081007133155.GH19669@daikokuya.co.uk> Neil Booth wrote:- > > For converting a QNan, what it says is: > > "Every operation involving one or two input NaNs, none of them > > signaling, shall signal no exception but, if a FP result is to be > > delivered, shall deliver as its result a QNaN, which should be one of > > the input NaNs. Note that format conversions might be unable to > > deliver the same NaN." > > > > The last sentence applies here, and I'm not sure of its intent. At > > face value it's a statement that it may be impossible to implement the > > standard in this case, which seems unlikely. IMO an Inexact result > > seems compatible with the way things work otherwise. > > > > To confuse things further, the value in the PR is not even an IEEE > > NaN, but a pseudo-NaN in Intel jargon. It is outside all standards. > > The intent of APFloat as I wrote it was to replicate a conforming > IEEE-754 CPU's results in software, with the return result indicating > those exceptions that would occur under IEEE-754. IBM double double > was later hacked on in an incomplete way. > > The paragraph you quote is unambiguous; these NaN to NaN conversions > should always return fsOK because it "shall signal no exception". > This is how the code worked before your change. > > Perhaps LLVM needs APFloat to evolve beyond IEEE-754; I'm not sure. > But I suggest you think hard about that, and if you decide to go that > way you at least use a new flag for your extensions. You should > also update the comments in the .cpp and .h files appropriately, > and review what other changes, if any, to other operations are needed > to accomdate your new semantics. I missed your bit about this being some Intel 80-bit format extension thing. If so, we should replicate the exceptions done by a real Intel / AMD CPU. I don't believe they define extra exceptions. What exceptions do they raise and what result do they give in this case? Do we match both? Neil. From alenhar2 at cs.uiuc.edu Tue Oct 7 09:15:44 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 14:15:44 -0000 Subject: [llvm-commits] [llvm] r57243 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/Alpha/add128.ll test/CodeGen/Alpha/sub128.ll Message-ID: <200810071415.m97EFi63028661@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 09:15:42 2008 New Revision: 57243 URL: http://llvm.org/viewvc/llvm-project?rev=57243&view=rev Log: Expand arith on machines without carry flags Added: llvm/trunk/test/CodeGen/Alpha/sub128.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/test/CodeGen/Alpha/add128.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57243&r1=57242&r2=57243&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 09:15:42 2008 @@ -6431,7 +6431,6 @@ break; } } - // Expand the subcomponents. SDValue LHSL, LHSH, RHSL, RHSH; ExpandOp(Node->getOperand(0), LHSL, LHSH); @@ -6442,16 +6441,41 @@ LoOps[1] = RHSL; HiOps[0] = LHSH; HiOps[1] = RHSH; - if (Node->getOpcode() == ISD::ADD) { - Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); + if(TLI.isOperationLegal(ISD::ADDC, NVT)) { + if (Node->getOpcode() == ISD::ADD) { + Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); + } else { + Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); + HiOps[2] = Lo.getValue(1); + Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); + } + break; } else { - Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); - HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); + if (Node->getOpcode() == ISD::ADD) { + Lo = DAG.getNode(ISD::ADD, VTList, LoOps, 2); + Hi = DAG.getNode(ISD::ADD, VTList, HiOps, 2); + SDValue Cmp1 = DAG.getSetCC(NVT, Lo, LoOps[0], ISD::SETULT); + SDValue Carry1 = DAG.getNode(ISD::SELECT, NVT, Cmp1, + DAG.getConstant(1, NVT), + DAG.getConstant(0, NVT)); + SDValue Cmp2 = DAG.getSetCC(NVT, Lo, LoOps[1], ISD::SETULT); + SDValue Carry2 = DAG.getNode(ISD::SELECT, NVT, Cmp2, + DAG.getConstant(1, NVT), + Carry1); + Hi = DAG.getNode(ISD::ADD, NVT, Hi, Carry2); + } else { + Lo = DAG.getNode(ISD::SUB, VTList, LoOps, 2); + Hi = DAG.getNode(ISD::SUB, VTList, HiOps, 2); + SDValue Cmp = DAG.getSetCC(NVT, LoOps[0], LoOps[1], ISD::SETULT); + SDValue Borrow = DAG.getNode(ISD::SELECT, NVT, Cmp, + DAG.getConstant(1, NVT), + DAG.getConstant(0, NVT)); + Hi = DAG.getNode(ISD::SUB, NVT, Hi, Borrow); + } + break; } - break; } case ISD::ADDC: Modified: llvm/trunk/test/CodeGen/Alpha/add128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/add128.ll?rev=57243&r1=57242&r2=57243&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/add128.ll (original) +++ llvm/trunk/test/CodeGen/Alpha/add128.ll Tue Oct 7 09:15:42 2008 @@ -1,7 +1,6 @@ ;test for ADDC and ADDE expansion ; ; RUN: llvm-as < %s | llc -march=alpha -; XFAIL: * define i128 @add128(i128 %x, i128 %y) { entry: Added: llvm/trunk/test/CodeGen/Alpha/sub128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/sub128.ll?rev=57243&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/sub128.ll (added) +++ llvm/trunk/test/CodeGen/Alpha/sub128.ll Tue Oct 7 09:15:42 2008 @@ -0,0 +1,9 @@ +;test for SUBC and SUBE expansion +; +; RUN: llvm-as < %s | llc -march=alpha + +define i128 @sub128(i128 %x, i128 %y) { +entry: + %tmp = sub i128 %y, %x + ret i128 %tmp +} From andrewl at lenharth.org Tue Oct 7 09:35:59 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 09:35:59 -0500 Subject: [llvm-commits] [poolalloc] r57214 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp In-Reply-To: <85dfcd7f0810070618s1e3167f3hddf370d435b2722f@mail.gmail.com> References: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> <200810071004.07554.baldrick@free.fr> <85dfcd7f0810070618s1e3167f3hddf370d435b2722f@mail.gmail.com> Message-ID: <85dfcd7f0810070735m2a820118vcb2779c1c110ce01@mail.gmail.com> On Tue, Oct 7, 2008 at 8:18 AM, Andrew Lenharth wrote: > On Tue, Oct 7, 2008 at 3:04 AM, Duncan Sands wrote: >>> + CallSite(NewCall).setCallingConv(CallSite(TheCall).getCallingConv()); >> >> Don't forget tail call markings and parameter attributes. > > Thanks, the tail call markings I was still looking into. The parameter > attributes are handled during the function clone/rewriting (but suffer > from potential off by one errors, parameter attributes should really > be properties of the Argument class rather than positional in the > Function class). Actually, it's not clear, does one have to specify parameter attributes on the call site too? I was under the impression they just were for the functions. hmm... Andrew From alenhar2 at cs.uiuc.edu Tue Oct 7 09:41:04 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 14:41:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57244 - /llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Message-ID: <200810071441.m97Ef5A6029697@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 09:41:03 2008 New Revision: 57244 URL: http://llvm.org/viewvc/llvm-project?rev=57244&view=rev Log: expand to llmv IR Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp?rev=57244&r1=57243&r2=57244&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp Tue Oct 7 09:41:03 2008 @@ -103,13 +103,13 @@ std::vector &Ops) { switch (FnCode) { case ALPHA_BUILTIN_UMULH: { - Function *f = - Intrinsic::getDeclaration(TheModule, Intrinsic::alpha_umulh); Value *Arg0 = Ops[0]; Value *Arg1 = Ops[1]; - Value *CallOps[2] = { Arg0, Arg1}; - Result = Builder.CreateCall(f, CallOps, CallOps+2, "tmp"); - Result = Builder.CreateBitCast(Result, ResultType, "tmp"); + Arg0 = Builder.CreateZExt(Arg0, IntegerType::get(128)); + Arg1 = Builder.CreateZExt(Arg1, IntegerType::get(128)); + Result = Builder.CreateMul(Arg0, Arg1); + Result = Builder.CreateLShr(Result, ConstantInt::get(Type::Int64Ty, 64)); + Result = Builder.CreateTrunc(Result, Type::Int64Ty); return true; } default: break; From nunoplopes at sapo.pt Tue Oct 7 09:48:14 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 07 Oct 2008 14:48:14 -0000 Subject: [llvm-commits] [llvm] r57245 - in /llvm/trunk/test: Makefile lib/llvm.exp Message-ID: <200810071448.m97EmE1u029909@zion.cs.uiuc.edu> Author: nlopes Date: Tue Oct 7 09:48:14 2008 New Revision: 57245 URL: http://llvm.org/viewvc/llvm-project?rev=57245&view=rev Log: add support for running the test suite with valgrind. to run it just type 'make VG=1', as in clang beware of the 42000 leaks reported by valgrind in the Constant.cpp + Type.cpp files. it needs fixing IMHO Modified: llvm/trunk/test/Makefile llvm/trunk/test/lib/llvm.exp Modified: llvm/trunk/test/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Makefile?rev=57245&r1=57244&r2=57245&view=diff ============================================================================== --- llvm/trunk/test/Makefile (original) +++ llvm/trunk/test/Makefile Tue Oct 7 09:48:14 2008 @@ -32,6 +32,10 @@ RUNTESTFLAGS += --tool $(CLEANED_TESTSUITE) endif +ifdef VG +VALGRIND := valgrind --tool=memcheck --quiet --trace-children=yes --error-exitcode=3 --leak-check=full +endif + IGNORE_TESTS := ifndef RUNLLVM2CPP @@ -77,7 +81,9 @@ clean:: $(RM) -rf `find $(LLVM_OBJ_ROOT)/test -name Output -type d -print` -site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config +FORCE: + +site.exp: FORCE @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.tmp @echo '# Do not edit here. If you wish to override these values' >>site.tmp @@ -103,6 +109,7 @@ @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp + @echo 'set valgrind "$(VALGRIND)"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp Modified: llvm/trunk/test/lib/llvm.exp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lib/llvm.exp?rev=57245&r1=57244&r2=57245&view=diff ============================================================================== --- llvm/trunk/test/lib/llvm.exp (original) +++ llvm/trunk/test/lib/llvm.exp Tue Oct 7 09:48:14 2008 @@ -49,11 +49,14 @@ global srcroot objroot srcdir objdir subdir target_triplet prcontext global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir + global valgrind set path [file join $srcdir $subdir] # Substitute all Tcl variables. set new_line [subst $line ] + #replace %% with _#MARKER#_ to make the replacement of %% more predictable + regsub -all {%%} $new_line {_#MARKER#_} new_line #replace %prcontext with prcontext.tcl (Must replace before %p) regsub -all {%prcontext} $new_line $prcontext new_line #replace %llvmgcc with actual path to llvmgcc @@ -78,8 +81,28 @@ regsub -all {%s} $new_line $test new_line #replace %t with temp filenames regsub -all {%t} $new_line $tmpFile new_line - #replace %% with % - regsub -all {%%} $new_line % new_line + #replace _#MARKER#_ with % + regsub -all {_#MARKER#_} $new_line % new_line + + #valgind related stuff +# regsub -all {bugpoint } $new_line "$valgrind bugpoint " new_line + regsub -all {llc } $new_line "$valgrind llc " new_line + regsub -all {lli } $new_line "$valgrind lli " new_line + regsub -all {llvm-ar } $new_line "$valgrind llvm-ar " new_line + regsub -all {llvm-as } $new_line "$valgrind llvm-as " new_line + regsub -all {llvm-bcanalyzer } $new_line "$valgrind llvm-bcanalyzer " new_line + regsub -all {llvm-dis } $new_line "$valgrind llvm-dis " new_line + regsub -all {llvm-extract } $new_line "$valgrind llvm-extract " new_line + regsub -all {llvm-ld } $new_line "$valgrind llvm-ld " new_line + regsub -all {llvm-link } $new_line "$valgrind llvm-link " new_line + regsub -all {llvm-nm } $new_line "$valgrind llvm-nm " new_line + regsub -all {llvm-prof } $new_line "$valgrind llvm-prof " new_line + regsub -all {llvm-ranlib } $new_line "$valgrind llvm-ranlib " new_line + regsub -all {([^a-zA-Z_-])opt } $new_line "\\1$valgrind opt " new_line + regsub -all {^opt } $new_line "$valgrind opt " new_line + regsub -all {tblgen } $new_line "$valgrind tblgen " new_line + regsub -all "not $valgrind " $new_line "$valgrind not " new_line + return $new_line } From baldrick at free.fr Tue Oct 7 09:50:46 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 7 Oct 2008 16:50:46 +0200 Subject: [llvm-commits] [poolalloc] r57214 - /poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp In-Reply-To: <85dfcd7f0810070735m2a820118vcb2779c1c110ce01@mail.gmail.com> References: <200810062229.m96MToU0017479@zion.cs.uiuc.edu> <85dfcd7f0810070618s1e3167f3hddf370d435b2722f@mail.gmail.com> <85dfcd7f0810070735m2a820118vcb2779c1c110ce01@mail.gmail.com> Message-ID: <200810071650.47091.baldrick@free.fr> > > Thanks, the tail call markings I was still looking into. The parameter > > attributes are handled during the function clone/rewriting (but suffer > > from potential off by one errors, parameter attributes should really > > be properties of the Argument class rather than positional in the > > Function class). > > Actually, it's not clear, does one have to specify parameter > attributes on the call site too? I was under the impression they just > were for the functions. hmm... Yes, you should. This is needed for indirect calls, also in some situations stronger information is available on the call than on the function. Ciao, Duncan. PS: I agree that parameter attributes are currently a pain to work with - it would be simpler if they were somehow attached to the Argument class. From lattner at apple.com Tue Oct 7 10:52:03 2008 From: lattner at apple.com (Tanya Lattner) Date: Tue, 7 Oct 2008 08:52:03 -0700 Subject: [llvm-commits] [llvm] r57167 - in /llvm/trunk: configure test/FrontendObjC++/dg.exp test/lib/llvm.exp In-Reply-To: <200810071013.21014.baldrick@free.fr> References: <200810061031.m96AVU4e024330@zion.cs.uiuc.edu> <2A7F209F-0677-40E9-AFF4-EADE5D94AB44@apple.com> <200810071013.21014.baldrick@free.fr> Message-ID: Thanks. I'll regenerate. If you ever need it done in the future, you can bug me too. -Tanya On Oct 7, 2008, at 1:13 AM, Duncan Sands wrote: > Hi Tanya, > >> Did you forget to check in autoconf/configure.ac? > > yeah, I forgot how configure works :) > > How about this? > > Ciao, > > Duncan. > > PS: I don't have the right autothing version to regenerate configure. > > Index: autoconf/configure.ac > =================================================================== > --- autoconf/configure.ac (revision 57238) > +++ autoconf/configure.ac (working copy) > @@ -872,7 +872,7 @@ > llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`] > AC_SUBST(LLVMGCC_VERSION,$llvmgccversion) > AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers) > - llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured > with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`] > + llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured > with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`] > AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs) > AC_MSG_RESULT([ok]) > fi From andersca at mac.com Tue Oct 7 11:14:13 2008 From: andersca at mac.com (Anders Carlsson) Date: Tue, 07 Oct 2008 16:14:13 -0000 Subject: [llvm-commits] [llvm] r57246 - in /llvm/trunk: lib/Target/X86/X86InstrSSE.td test/CodeGen/X86/2008-10-07-SSEISelBug.ll Message-ID: <200810071614.m97GEEHo000779@zion.cs.uiuc.edu> Author: andersca Date: Tue Oct 7 11:14:11 2008 New Revision: 57246 URL: http://llvm.org/viewvc/llvm-project?rev=57246&view=rev Log: Certain patterns involving the "movss" instruction were marked as requiring SSE2, when in reality movss is an SSE1 instruction. Added: llvm/trunk/test/CodeGen/X86/2008-10-07-SSEISelBug.ll Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=57246&r1=57245&r2=57246&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Tue Oct 7 11:14:11 2008 @@ -2891,11 +2891,11 @@ def : Pat<(v2f64 (X86vzmovl (v2f64 (scalar_to_vector FR64:$src)))), (MOVLSD2PDrr (V_SET0), FR64:$src)>, Requires<[HasSSE2]>; def : Pat<(v4f32 (X86vzmovl (v4f32 (scalar_to_vector FR32:$src)))), - (MOVLSS2PSrr (V_SET0), FR32:$src)>, Requires<[HasSSE2]>; + (MOVLSS2PSrr (V_SET0), FR32:$src)>, Requires<[HasSSE1]>; def : Pat<(v4f32 (X86vzmovl (v4f32 VR128:$src))), - (MOVLPSrr (V_SET0), VR128:$src)>, Requires<[HasSSE2]>; + (MOVLPSrr (V_SET0), VR128:$src)>, Requires<[HasSSE1]>; def : Pat<(v4i32 (X86vzmovl (v4i32 VR128:$src))), - (MOVLPSrr (V_SET0), VR128:$src)>, Requires<[HasSSE2]>; + (MOVLPSrr (V_SET0), VR128:$src)>, Requires<[HasSSE1]>; } // Splat v2f64 / v2i64 Added: llvm/trunk/test/CodeGen/X86/2008-10-07-SSEISelBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-07-SSEISelBug.ll?rev=57246&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-07-SSEISelBug.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-10-07-SSEISelBug.ll Tue Oct 7 11:14:11 2008 @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse,-sse2 + +define <4 x float> @f(float %w) nounwind { +entry: + %retval = alloca <4 x float> ; <<4 x float>*> [#uses=2] + %w.addr = alloca float ; [#uses=2] + %.compoundliteral = alloca <4 x float> ; <<4 x float>*> [#uses=2] + store float %w, float* %w.addr + %tmp = load float* %w.addr ; [#uses=1] + %0 = insertelement <4 x float> undef, float %tmp, i32 0 ; <<4 x float>> [#uses=1] + %1 = insertelement <4 x float> %0, float 0.000000e+00, i32 1 ; <<4 x float>> [#uses=1] + %2 = insertelement <4 x float> %1, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1] + %3 = insertelement <4 x float> %2, float 0.000000e+00, i32 3 ; <<4 x float>> [#uses=1] + store <4 x float> %3, <4 x float>* %.compoundliteral + %tmp1 = load <4 x float>* %.compoundliteral ; <<4 x float>> [#uses=1] + store <4 x float> %tmp1, <4 x float>* %retval + br label %return + +return: ; preds = %entry + %4 = load <4 x float>* %retval ; <<4 x float>> [#uses=1] + ret <4 x float> %4 +} From andrewl at lenharth.org Tue Oct 7 11:33:01 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 11:33:01 -0500 Subject: [llvm-commits] [llvm] r57243 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/Alpha/add128.ll test/CodeGen/Alpha/sub128.ll In-Reply-To: <200810071415.m97EFi63028661@zion.cs.uiuc.edu> References: <200810071415.m97EFi63028661@zion.cs.uiuc.edu> Message-ID: <85dfcd7f0810070933t18226dd9m45c25c212dc66148@mail.gmail.com> This breaks one test in Codegen/Generic on x86 (but not x86-64 or alpha). Looking into it now. Andrew On Tue, Oct 7, 2008 at 9:15 AM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Tue Oct 7 09:15:42 2008 > New Revision: 57243 > > URL: http://llvm.org/viewvc/llvm-project?rev=57243&view=rev > Log: > Expand arith on machines without carry flags > > Added: > llvm/trunk/test/CodeGen/Alpha/sub128.ll > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > llvm/trunk/test/CodeGen/Alpha/add128.ll > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57243&r1=57242&r2=57243&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 09:15:42 2008 > @@ -6431,7 +6431,6 @@ > break; > } > } > - > // Expand the subcomponents. > SDValue LHSL, LHSH, RHSL, RHSH; > ExpandOp(Node->getOperand(0), LHSL, LHSH); > @@ -6442,16 +6441,41 @@ > LoOps[1] = RHSL; > HiOps[0] = LHSH; > HiOps[1] = RHSH; > - if (Node->getOpcode() == ISD::ADD) { > - Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); > - HiOps[2] = Lo.getValue(1); > - Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); > + if(TLI.isOperationLegal(ISD::ADDC, NVT)) { > + if (Node->getOpcode() == ISD::ADD) { > + Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); > + HiOps[2] = Lo.getValue(1); > + Hi = DAG.getNode(ISD::ADDE, VTList, HiOps, 3); > + } else { > + Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); > + HiOps[2] = Lo.getValue(1); > + Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); > + } > + break; > } else { > - Lo = DAG.getNode(ISD::SUBC, VTList, LoOps, 2); > - HiOps[2] = Lo.getValue(1); > - Hi = DAG.getNode(ISD::SUBE, VTList, HiOps, 3); > + if (Node->getOpcode() == ISD::ADD) { > + Lo = DAG.getNode(ISD::ADD, VTList, LoOps, 2); > + Hi = DAG.getNode(ISD::ADD, VTList, HiOps, 2); > + SDValue Cmp1 = DAG.getSetCC(NVT, Lo, LoOps[0], ISD::SETULT); > + SDValue Carry1 = DAG.getNode(ISD::SELECT, NVT, Cmp1, > + DAG.getConstant(1, NVT), > + DAG.getConstant(0, NVT)); > + SDValue Cmp2 = DAG.getSetCC(NVT, Lo, LoOps[1], ISD::SETULT); > + SDValue Carry2 = DAG.getNode(ISD::SELECT, NVT, Cmp2, > + DAG.getConstant(1, NVT), > + Carry1); > + Hi = DAG.getNode(ISD::ADD, NVT, Hi, Carry2); > + } else { > + Lo = DAG.getNode(ISD::SUB, VTList, LoOps, 2); > + Hi = DAG.getNode(ISD::SUB, VTList, HiOps, 2); > + SDValue Cmp = DAG.getSetCC(NVT, LoOps[0], LoOps[1], ISD::SETULT); > + SDValue Borrow = DAG.getNode(ISD::SELECT, NVT, Cmp, > + DAG.getConstant(1, NVT), > + DAG.getConstant(0, NVT)); > + Hi = DAG.getNode(ISD::SUB, NVT, Hi, Borrow); > + } > + break; > } > - break; > } > > case ISD::ADDC: > > Modified: llvm/trunk/test/CodeGen/Alpha/add128.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/add128.ll?rev=57243&r1=57242&r2=57243&view=diff > > ============================================================================== > --- llvm/trunk/test/CodeGen/Alpha/add128.ll (original) > +++ llvm/trunk/test/CodeGen/Alpha/add128.ll Tue Oct 7 09:15:42 2008 > @@ -1,7 +1,6 @@ > ;test for ADDC and ADDE expansion > ; > ; RUN: llvm-as < %s | llc -march=alpha > -; XFAIL: * > > define i128 @add128(i128 %x, i128 %y) { > entry: > > Added: llvm/trunk/test/CodeGen/Alpha/sub128.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/sub128.ll?rev=57243&view=auto > > ============================================================================== > --- llvm/trunk/test/CodeGen/Alpha/sub128.ll (added) > +++ llvm/trunk/test/CodeGen/Alpha/sub128.ll Tue Oct 7 09:15:42 2008 > @@ -0,0 +1,9 @@ > +;test for SUBC and SUBE expansion > +; > +; RUN: llvm-as < %s | llc -march=alpha > + > +define i128 @sub128(i128 %x, i128 %y) { > +entry: > + %tmp = sub i128 %y, %x > + ret i128 %tmp > +} > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From alenhar2 at cs.uiuc.edu Tue Oct 7 12:03:16 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 17:03:16 -0000 Subject: [llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 12:03:15 2008 New Revision: 57247 URL: http://llvm.org/viewvc/llvm-project?rev=57247&view=rev Log: Use ADDC if it is valid at any smaller size. fixes test/Codegen/Generic/i128-addsub.ll on x86 Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57247&r1=57246&r2=57247&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 12:03:15 2008 @@ -6441,7 +6441,20 @@ LoOps[1] = RHSL; HiOps[0] = LHSH; HiOps[1] = RHSH; - if(TLI.isOperationLegal(ISD::ADDC, NVT)) { + //cascaded check to see if any smaller size has a a carry flag. + unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; + bool hasCarry = false; + if (NVT == MVT::i64) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + | TLI.isOperationLegal(OpV, MVT::i16) + | TLI.isOperationLegal(OpV, MVT::i8); + if (NVT == MVT::i32) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + | TLI.isOperationLegal(OpV, MVT::i8); + if (NVT == MVT::i16) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i8); + + if(hasCarry) { if (Node->getOpcode() == ISD::ADD) { Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); HiOps[2] = Lo.getValue(1); @@ -6456,11 +6469,13 @@ if (Node->getOpcode() == ISD::ADD) { Lo = DAG.getNode(ISD::ADD, VTList, LoOps, 2); Hi = DAG.getNode(ISD::ADD, VTList, HiOps, 2); - SDValue Cmp1 = DAG.getSetCC(NVT, Lo, LoOps[0], ISD::SETULT); + SDValue Cmp1 = DAG.getSetCC(TLI.getSetCCResultType(Lo), + Lo, LoOps[0], ISD::SETULT); SDValue Carry1 = DAG.getNode(ISD::SELECT, NVT, Cmp1, DAG.getConstant(1, NVT), DAG.getConstant(0, NVT)); - SDValue Cmp2 = DAG.getSetCC(NVT, Lo, LoOps[1], ISD::SETULT); + SDValue Cmp2 = DAG.getSetCC(TLI.getSetCCResultType(Lo), + Lo, LoOps[1], ISD::SETULT); SDValue Carry2 = DAG.getNode(ISD::SELECT, NVT, Cmp2, DAG.getConstant(1, NVT), Carry1); From alenhar2 at cs.uiuc.edu Tue Oct 7 12:09:16 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 17:09:16 -0000 Subject: [llvm-commits] [llvm] r57248 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200810071709.m97H9Hsd002878@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 12:09:16 2008 New Revision: 57248 URL: http://llvm.org/viewvc/llvm-project?rev=57248&view=rev Log: Use ADDC if it is valid at any smaller size. Do it right this time Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57248&r1=57247&r2=57248&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 12:09:16 2008 @@ -6445,14 +6445,17 @@ unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; bool hasCarry = false; if (NVT == MVT::i64) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i64) + | TLI.isOperationLegal(OpV, MVT::i32) | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i32) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i16) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i8); + hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + | TLI.isOperationLegal(OpV, MVT::i8); if(hasCarry) { if (Node->getOpcode() == ISD::ADD) { From alenhar2 at cs.uiuc.edu Tue Oct 7 12:11:29 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 17:11:29 -0000 Subject: [llvm-commits] [llvm] r57249 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200810071711.m97HBTfF002956@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 12:11:29 2008 New Revision: 57249 URL: http://llvm.org/viewvc/llvm-project?rev=57249&view=rev Log: No need for |= Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57249&r1=57248&r2=57249&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 12:11:29 2008 @@ -6445,16 +6445,16 @@ unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; bool hasCarry = false; if (NVT == MVT::i64) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i64) + hasCarry = TLI.isOperationLegal(OpV, MVT::i64) | TLI.isOperationLegal(OpV, MVT::i32) | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i32) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) + hasCarry = TLI.isOperationLegal(OpV, MVT::i32) | TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if (NVT == MVT::i16) - hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) + hasCarry = TLI.isOperationLegal(OpV, MVT::i16) | TLI.isOperationLegal(OpV, MVT::i8); if(hasCarry) { From alenhar2 at cs.uiuc.edu Tue Oct 7 12:13:32 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 17:13:32 -0000 Subject: [llvm-commits] [llvm] r57250 - /llvm/trunk/test/CodeGen/Alpha/mul128.ll Message-ID: <200810071713.m97HDWGa003016@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 12:13:32 2008 New Revision: 57250 URL: http://llvm.org/viewvc/llvm-project?rev=57250&view=rev Log: 128 mul test, xfailed Added: llvm/trunk/test/CodeGen/Alpha/mul128.ll Added: llvm/trunk/test/CodeGen/Alpha/mul128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/mul128.ll?rev=57250&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/mul128.ll (added) +++ llvm/trunk/test/CodeGen/Alpha/mul128.ll Tue Oct 7 12:13:32 2008 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -march=alpha +; XFAIL: * + +define i128 @__mulvdi3(i128 %a, i128 %b) nounwind { +entry: + %r = mul i128 %a, %b + ret i128 %r +} From andrewl at lenharth.org Tue Oct 7 12:20:13 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 12:20:13 -0500 Subject: [llvm-commits] PR2765 Patch Message-ID: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> The following is a patch for http://llvm.org/bugs/show_bug.cgi?id=2765 It shouldn't change the behavior in the common case (pure cloning) but does the correct thing when removing arguments durring clone. Passes all tests. Ok to commit? Andrew Index: lib/Transforms/Utils/CloneFunction.cpp =================================================================== --- lib/Transforms/Utils/CloneFunction.cpp (revision 57242) +++ lib/Transforms/Utils/CloneFunction.cpp (working copy) @@ -81,8 +81,24 @@ #endif // Clone any attributes. - NewFunc->copyAttributesFrom(OldFunc); + if (NewFunc->arg_size() == OldFunc->arg_size()) + NewFunc->copyAttributesFrom(OldFunc); + else { + //Some arguments were deleted with the ValueMap. Copy arguments one by one + for (Function::const_arg_iterator I = OldFunc->arg_begin(), + E = OldFunc->arg_end(); I != E; ++I) + if (Argument* Anew = dyn_cast(ValueMap[I])) + Anew->addAttr( OldFunc->getAttributes() + .getParamAttributes(I->getArgNo() + 1)); + NewFunc->setAttributes(NewFunc->getAttributes() + .addAttr(0, OldFunc->getAttributes() + .getRetAttributes())); + NewFunc->setAttributes(NewFunc->getAttributes() + .addAttr(~0, OldFunc->getAttributes() + .getFnAttributes())); + } + // Loop over all of the basic blocks in the function, cloning them as // appropriate. Note that we save BE this way in order to handle cloning of // recursive functions into themselves. From grosbach at apple.com Tue Oct 7 12:40:46 2008 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 07 Oct 2008 17:40:46 -0000 Subject: [llvm-commits] [llvm] r57251 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <200810071740.m97HekQJ003849@zion.cs.uiuc.edu> Author: grosbach Date: Tue Oct 7 12:40:46 2008 New Revision: 57251 URL: http://llvm.org/viewvc/llvm-project?rev=57251&view=rev Log: Fix Opcode values of CMP and CMN Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=57251&r1=57250&r2=57251&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Oct 7 12:40:46 2008 @@ -1099,9 +1099,9 @@ // Comparison Instructions... // -defm CMP : AI1_cmp_irs<0xA, "cmp", +defm CMP : AI1_cmp_irs<{0,1,0,1}, "cmp", BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>; -defm CMN : AI1_cmp_irs<0xB, "cmn", +defm CMN : AI1_cmp_irs<{1,1,0,1}, "cmn", BinOpFrag<(ARMcmp node:$LHS,(ineg node:$RHS))>>; // Note that TST/TEQ don't set all the same flags that CMP does! @@ -1110,9 +1110,9 @@ defm TEQ : AI1_cmp_irs<0x9, "teq", BinOpFrag<(ARMcmpNZ (xor node:$LHS, node:$RHS), 0)>>; -defm CMPnz : AI1_cmp_irs<0xA, "cmp", +defm CMPnz : AI1_cmp_irs<{0,1,0,1}, "cmp", BinOpFrag<(ARMcmpNZ node:$LHS, node:$RHS)>>; -defm CMNnz : AI1_cmp_irs<0xA, "cmn", +defm CMNnz : AI1_cmp_irs<{1,1,0,1}, "cmn", BinOpFrag<(ARMcmpNZ node:$LHS,(ineg node:$RHS))>>; def : ARMPat<(ARMcmp GPR:$src, so_imm_neg:$imm), From dalej at apple.com Tue Oct 7 12:41:35 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 7 Oct 2008 10:41:35 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <20081007131921.GF19669@daikokuya.co.uk> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> Message-ID: <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> On Oct 7, 2008, at 6:19 AMPDT, Neil Booth wrote: > Dale Johannesen wrote:- >> To confuse things further, the value in the PR is not even an IEEE >> NaN, but a pseudo-NaN in Intel jargon. It is outside all standards. > > The intent of APFloat as I wrote it was to replicate a conforming > IEEE-754 CPU's results in software, with the return result indicating > those exceptions that would occur under IEEE-754. IBM double double > was later hacked on in an incomplete way. > > The paragraph you quote is unambiguous; these NaN to NaN conversions > should always return fsOK because it "shall signal no exception". > This is how the code worked before your change. > > Perhaps LLVM needs APFloat to evolve beyond IEEE-754; I'm not sure. > But I suggest you think hard about that, and if you decide to go that > way you at least use a new flag for your extensions. You should > also update the comments in the .cpp and .h files appropriately, > and review what other changes, if any, to other operations are needed > to accomdate your new semantics. Good to hear from you on this one. What the rest of the compiler wants to know is whether a conversion can be done without loss of information. I.e. if you convert type A to type B, then back to type A, you get the original value. Right now it's using the return value == fsOK check to figure that out. I suppose the various call sites could be taught about NaNs but it really seems better to keep those details buried in APFloat somehow. I guess we could add a separate "conversion doesn't lose information" return value to the conversion routines, or even convert back and compare at the call sites, although that seems silly when the first conversion has all the needed information. I'm not so sure it's worth preserving strict IEEE behavior in all these edge cases, though, what's the value of that in LLVM? How would you approach the problem? When I implemented the -0.0 conversion to int, I thought that was what IEEE754 calls for, but I missed the definition of inexact, obscurely placed in 7.4(4). 6.3 is clear that the result should have a negative sign, and that's not implementable on a twos complement machine, yet none of the exceptions seems to apply; I guess the standard calls for quietly producing an answer known to be wrong. This one really seems like a bug in the standard. From grosbach at apple.com Tue Oct 7 12:42:10 2008 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 07 Oct 2008 17:42:10 -0000 Subject: [llvm-commits] [llvm] r57252 - /llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Message-ID: <200810071742.m97HgAYm003906@zion.cs.uiuc.edu> Author: grosbach Date: Tue Oct 7 12:42:09 2008 New Revision: 57252 URL: http://llvm.org/viewvc/llvm-project?rev=57252&view=rev Log: Clarify naming and correct conditional so that CMP and CMN instructions get the Rn operand encoded properly Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=57252&r1=57251&r2=57252&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Oct 7 12:42:09 2008 @@ -392,14 +392,11 @@ // Encode first non-shifter register operand if there is one. unsigned Format = TID.TSFlags & ARMII::FormMask; - bool isUnary = (Format == ARMII::DPRdMisc || - Format == ARMII::DPRdIm || - Format == ARMII::DPRdReg || - Format == ARMII::DPRdSoReg || - Format == ARMII::DPRnIm || - Format == ARMII::DPRnReg || - Format == ARMII::DPRnSoReg); - if (!isUnary) { + bool hasRnOperand= !(Format == ARMII::DPRdMisc || + Format == ARMII::DPRdIm || + Format == ARMII::DPRdReg || + Format == ARMII::DPRdSoReg); + if (hasRnOperand) { Binary |= getMachineOpValue(MI, OpIdx) << ARMII::RegRnShift; ++OpIdx; } From dpatel at apple.com Tue Oct 7 12:48:33 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 07 Oct 2008 17:48:33 -0000 Subject: [llvm-commits] [llvm] r57253 - /llvm/trunk/docs/LangRef.html Message-ID: <200810071748.m97HmXRo004122@zion.cs.uiuc.edu> Author: dpatel Date: Tue Oct 7 12:48:33 2008 New Revision: 57253 URL: http://llvm.org/viewvc/llvm-project?rev=57253&view=rev Log: Improve function definition, call and invoke instruction docs. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57253&r1=57252&r2=57253&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Oct 7 12:48:33 2008 @@ -784,6 +784,14 @@ function is forced to have at least that much alignment. All alignments must be a power of 2.

    +
    Syntax:
    + +
    +
    +define [linkage] [visibility] [cconv] [ret attrs] <ResultType> @<FunctionName> ([argument list]) [fn Attrs] [section "name"] [align N] [gc] { ... }
    +
    +
    + @@ -2046,8 +2054,7 @@
    Syntax:
    -  <result> = invoke [cconv] [RetAttrs] <ptr to function ty> <function ptr val>(<function args>) 
    +  <result> = invoke [cconv] [ret attrs] <ptr to function ty> <function ptr val>(<function args>) [fn attrs]
                     to label <normal label> unwind label <exception label>
     
    @@ -2097,7 +2104,7 @@
  • 'exception label': the label reached when a callee returns with the unwind instruction.
  • -
  • The optional function attributes list. Only +
  • The optional function attributes list. Only 'noreturn', 'nounwind', 'readonly' and 'readnone' attributes are valid here.
  • @@ -4249,7 +4256,7 @@
    Syntax:
    -  <result> = [tail] call [cconv] [RetAttrs] <ty> [<fnty>*] <fnptrval>(<param list>)
    +  <result> = [tail] call [cconv] [ret attrs] <ty> [<fnty>*] <fnptrval>(<function args>) [fn attrs]
     
    Overview:
    @@ -4305,7 +4312,7 @@ arguments can be specified.

  • -

    The optional function attributes list. Only +

    The optional function attributes list. Only 'noreturn', 'nounwind', 'readonly' and 'readnone' attributes are valid here.

  • From gohman at apple.com Tue Oct 7 12:53:57 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 7 Oct 2008 10:53:57 -0700 (PDT) Subject: [llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> References: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> Message-ID: <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> On Tue, October 7, 2008 10:03 am, Andrew Lenharth wrote: > Author: alenhar2 > Date: Tue Oct 7 12:03:15 2008 > New Revision: 57247 > > URL: http://llvm.org/viewvc/llvm-project?rev=57247&view=rev > Log: > Use ADDC if it is valid at any smaller size. fixes > test/Codegen/Generic/i128-addsub.ll on x86 > > Modified: > llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > > Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57247&r1=57246&r2=57247&view=diff > > ============================================================================== > --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) > +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 > 12:03:15 2008 > @@ -6441,7 +6441,20 @@ > LoOps[1] = RHSL; > HiOps[0] = LHSH; > HiOps[1] = RHSH; > - if(TLI.isOperationLegal(ISD::ADDC, NVT)) { > + //cascaded check to see if any smaller size has a a carry flag. > + unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; > + bool hasCarry = false; > + if (NVT == MVT::i64) > + hasCarry |= TLI.isOperationLegal(OpV, MVT::i32) > + | TLI.isOperationLegal(OpV, MVT::i16) > + | TLI.isOperationLegal(OpV, MVT::i8); > + if (NVT == MVT::i32) > + hasCarry |= TLI.isOperationLegal(OpV, MVT::i16) > + | TLI.isOperationLegal(OpV, MVT::i8); > + if (NVT == MVT::i16) > + hasCarry |= TLI.isOperationLegal(OpV, MVT::i8); Previously, it was possible to do an i256 add on x86. I guess we don't have any testcases for that in the repository though. How about a more general approach? Warning untested code: bool hasCarry = false; for (unsigned BitSize = NVT.getSizeInBits(); BitSize != 0; BitSize /= 2) { MVT AVT = MVT::getIntegerVT(BitSize); if (TLI.isOperationLegal(OpV, AVT)) { hasCarry = true; break; } } FWIW, LegalizeIntegerTypes.cpp will eventually need to do something similar, and it'll need to account for non-power-of-two integer sizes also. Dan From dpatel at apple.com Tue Oct 7 13:00:04 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 7 Oct 2008 11:00:04 -0700 Subject: [llvm-commits] PR2765 Patch In-Reply-To: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> References: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> Message-ID: <6E453EE6-194B-4783-88D1-2F39497326F4@apple.com> On Oct 7, 2008, at 10:20 AM, Andrew Lenharth wrote: > The following is a patch for > http://llvm.org/bugs/show_bug.cgi?id=2765 > > It shouldn't change the behavior in the common case (pure cloning) but > does the correct thing when removing arguments durring clone. Passes > all tests. Ok to commit? yes, looks good. > > > Andrew > > Index: lib/Transforms/Utils/CloneFunction.cpp > =================================================================== > --- lib/Transforms/Utils/CloneFunction.cpp (revision 57242) > +++ lib/Transforms/Utils/CloneFunction.cpp (working copy) > @@ -81,8 +81,24 @@ > #endif > > // Clone any attributes. > - NewFunc->copyAttributesFrom(OldFunc); > + if (NewFunc->arg_size() == OldFunc->arg_size()) > + NewFunc->copyAttributesFrom(OldFunc); > + else { > + //Some arguments were deleted with the ValueMap. Copy arguments > one by one > + for (Function::const_arg_iterator I = OldFunc->arg_begin(), > + E = OldFunc->arg_end(); I != E; ++I) > + if (Argument* Anew = dyn_cast(ValueMap[I])) > + Anew->addAttr( OldFunc->getAttributes() > + .getParamAttributes(I->getArgNo() + 1)); > + NewFunc->setAttributes(NewFunc->getAttributes() > + .addAttr(0, OldFunc->getAttributes() > + .getRetAttributes())); > + NewFunc->setAttributes(NewFunc->getAttributes() > + .addAttr(~0, OldFunc->getAttributes() > + .getFnAttributes())); > > + } > + > // Loop over all of the basic blocks in the function, cloning them > as > // appropriate. Note that we save BE this way in order to handle > cloning of > // recursive functions into themselves. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits - Devang From alenhar2 at cs.uiuc.edu Tue Oct 7 13:08:39 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 18:08:39 -0000 Subject: [llvm-commits] [llvm] r57254 - /llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Message-ID: <200810071808.m97I8dCV004839@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 13:08:38 2008 New Revision: 57254 URL: http://llvm.org/viewvc/llvm-project?rev=57254&view=rev Log: Correctly set attributes when removing args during cloning. Fixes PR2765 Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=57254&r1=57253&r2=57254&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Tue Oct 7 13:08:38 2008 @@ -81,7 +81,23 @@ #endif // Clone any attributes. - NewFunc->copyAttributesFrom(OldFunc); + if (NewFunc->arg_size() == OldFunc->arg_size()) + NewFunc->copyAttributesFrom(OldFunc); + else { + //Some arguments were deleted with the ValueMap. Copy arguments one by one + for (Function::const_arg_iterator I = OldFunc->arg_begin(), + E = OldFunc->arg_end(); I != E; ++I) + if (Argument* Anew = dyn_cast(ValueMap[I])) + Anew->addAttr( OldFunc->getAttributes() + .getParamAttributes(I->getArgNo() + 1)); + NewFunc->setAttributes(NewFunc->getAttributes() + .addAttr(0, OldFunc->getAttributes() + .getRetAttributes())); + NewFunc->setAttributes(NewFunc->getAttributes() + .addAttr(~0, OldFunc->getAttributes() + .getFnAttributes())); + + } // Loop over all of the basic blocks in the function, cloning them as // appropriate. Note that we save BE this way in order to handle cloning of From alenhar2 at cs.uiuc.edu Tue Oct 7 13:27:23 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 07 Oct 2008 18:27:23 -0000 Subject: [llvm-commits] [llvm] r57255 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200810071827.m97IRNes005514@zion.cs.uiuc.edu> Author: alenhar2 Date: Tue Oct 7 13:27:23 2008 New Revision: 57255 URL: http://llvm.org/viewvc/llvm-project?rev=57255&view=rev Log: Use Dan's supperior check Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57255&r1=57254&r2=57255&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Oct 7 13:27:23 2008 @@ -6441,22 +6441,18 @@ LoOps[1] = RHSL; HiOps[0] = LHSH; HiOps[1] = RHSH; + //cascaded check to see if any smaller size has a a carry flag. unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC; bool hasCarry = false; - if (NVT == MVT::i64) - hasCarry = TLI.isOperationLegal(OpV, MVT::i64) - | TLI.isOperationLegal(OpV, MVT::i32) - | TLI.isOperationLegal(OpV, MVT::i16) - | TLI.isOperationLegal(OpV, MVT::i8); - if (NVT == MVT::i32) - hasCarry = TLI.isOperationLegal(OpV, MVT::i32) - | TLI.isOperationLegal(OpV, MVT::i16) - | TLI.isOperationLegal(OpV, MVT::i8); - if (NVT == MVT::i16) - hasCarry = TLI.isOperationLegal(OpV, MVT::i16) - | TLI.isOperationLegal(OpV, MVT::i8); - + for (unsigned BitSize = NVT.getSizeInBits(); BitSize != 0; BitSize /= 2) { + MVT AVT = MVT::getIntegerVT(BitSize); + if (TLI.isOperationLegal(OpV, AVT)) { + hasCarry = true; + break; + } + } + if(hasCarry) { if (Node->getOpcode() == ISD::ADD) { Lo = DAG.getNode(ISD::ADDC, VTList, LoOps, 2); From andrewl at lenharth.org Tue Oct 7 13:27:47 2008 From: andrewl at lenharth.org (Andrew Lenharth) Date: Tue, 7 Oct 2008 13:27:47 -0500 Subject: [llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> References: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> Message-ID: <85dfcd7f0810071127t5fb067b9g44de8be2973703d7@mail.gmail.com> On Tue, Oct 7, 2008 at 12:53 PM, Dan Gohman wrote: > Previously, it was possible to do an i256 add on x86. I guess we > don't have any testcases for that in the repository though. > How about a more general approach? Warning untested code: > > bool hasCarry = false; > for (unsigned BitSize = NVT.getSizeInBits(); BitSize != 0; BitSize /= 2) { > MVT AVT = MVT::getIntegerVT(BitSize); > if (TLI.isOperationLegal(OpV, AVT)) { > hasCarry = true; > break; > } > } Yes, much better. And now tested. Andrew From evan.cheng at apple.com Tue Oct 7 13:44:14 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 07 Oct 2008 18:44:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57256 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200810071844.m97IiEk2006076@zion.cs.uiuc.edu> Author: evancheng Date: Tue Oct 7 13:44:13 2008 New Revision: 57256 URL: http://llvm.org/viewvc/llvm-project?rev=57256&view=rev Log: Per Duncan's review: eh_select expressions do not need bitcast. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=57256&r1=57255&r2=57256&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Oct 7 13:44:13 2008 @@ -3747,9 +3747,7 @@ Value *TreeToLLVM::EmitFILTER_EXPR(tree exp) { CreateExceptionValues(); // Load exception selector. - Value *V = Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); - // Cast the address to the right pointer type. - return BitCastToType(V, ConvertType(TREE_TYPE(exp))); + return Builder.CreateLoad(ExceptionSelectorValue, "eh_select"); } /// EmitRESX_EXPR - Handle RESX_EXPR. @@ -6190,8 +6188,7 @@ LValue TreeToLLVM::EmitLV_FILTER_EXPR(tree exp) { CreateExceptionValues(); - return BitCastToType(ExceptionSelectorValue, - PointerType::getUnqual(ConvertType(TREE_TYPE(exp)))); + return ExceptionSelectorValue; } //===----------------------------------------------------------------------===// From dalej at apple.com Tue Oct 7 13:54:29 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 07 Oct 2008 18:54:29 -0000 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td Message-ID: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> Author: johannes Date: Tue Oct 7 13:54:28 2008 New Revision: 57257 URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev Log: Model hardwired inputs & outputs of x86 8-bit divides correctly. Fixes local RA miscompilation of gcc.c-torture/execute/20020904-1.c -O0. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 2008 @@ -728,7 +728,7 @@ } // unsigned division/remainder -let Defs = [AX,EFLAGS], Uses = [AL,AH] in +let Defs = [AL,AH,EFLAGS], Uses = [AX] in def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/r8 = AL,AH "div{b}\t$src", []>; let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in @@ -738,7 +738,7 @@ def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // EDX:EAX/r32 = EAX,EDX "div{l}\t$src", []>; let mayLoad = 1 in { -let Defs = [AX,EFLAGS], Uses = [AL,AH] in +let Defs = [AL,AH,EFLAGS], Uses = [AX] in def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/[mem8] = AL,AH "div{b}\t$src", []>; let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in @@ -750,7 +750,7 @@ } // Signed division/remainder. -let Defs = [AX,EFLAGS], Uses = [AL,AH] in +let Defs = [AL,AH,EFLAGS], Uses = [AX] in def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // AX/r8 = AL,AH "idiv{b}\t$src", []>; let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in @@ -760,7 +760,7 @@ def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // EDX:EAX/r32 = EAX,EDX "idiv{l}\t$src", []>; let mayLoad = 1, mayLoad = 1 in { -let Defs = [AX,EFLAGS], Uses = [AL,AH] in +let Defs = [AL,AH,EFLAGS], Uses = [AX] in def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/[mem8] = AL,AH "idiv{b}\t$src", []>; let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in From grosbach at apple.com Tue Oct 7 14:05:35 2008 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 07 Oct 2008 19:05:35 -0000 Subject: [llvm-commits] [llvm] r57258 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrInfo.h Message-ID: <200810071905.m97J5aEk006788@zion.cs.uiuc.edu> Author: grosbach Date: Tue Oct 7 14:05:35 2008 New Revision: 57258 URL: http://llvm.org/viewvc/llvm-project?rev=57258&view=rev Log: Encode the conditional execution predicate when JITing. Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=57258&r1=57257&r2=57258&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Oct 7 14:05:35 2008 @@ -256,8 +256,8 @@ unsigned ARMCodeEmitter::getAddrModeNoneInstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary) { - // FIXME: Assume CC is AL for now. - Binary |= ARMCC::AL << 28; + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; switch (TID.TSFlags & ARMII::FormMask) { default: @@ -376,8 +376,8 @@ unsigned ARMCodeEmitter::getAddrMode1InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary) { - // FIXME: Assume CC is AL for now. - Binary |= ARMCC::AL << 28; + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; // Encode S bit if MI modifies CPSR. Binary |= getAddrMode1SBit(MI, TID); @@ -429,8 +429,8 @@ unsigned ARMCodeEmitter::getAddrMode2InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary) { - // FIXME: Assume CC is AL for now. - Binary |= ARMCC::AL << 28; + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; // Set first operand Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; @@ -470,8 +470,8 @@ unsigned ARMCodeEmitter::getAddrMode3InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary) { - // FIXME: Assume CC is AL for now. - Binary |= ARMCC::AL << 28; + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; // Set first operand Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; @@ -507,8 +507,8 @@ unsigned ARMCodeEmitter::getAddrMode4InstrBinary(const MachineInstr &MI, const TargetInstrDesc &TID, unsigned Binary) { - // FIXME: Assume CC is AL for now. - Binary |= ARMCC::AL << 28; + // Set the conditional execution predicate + Binary |= II->getPredicate(&MI) << 28; // Set first operand Binary |= getMachineOpValue(MI, 0) << ARMII::RegRnShift; Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=57258&r1=57257&r2=57258&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Tue Oct 7 14:05:35 2008 @@ -217,6 +217,12 @@ // Predication support. virtual bool isPredicated(const MachineInstr *MI) const; + ARMCC::CondCodes getPredicate(const MachineInstr *MI) const { + int PIdx = MI->findFirstPredOperandIdx(); + return PIdx != -1 ? (ARMCC::CondCodes)MI->getOperand(PIdx).getImm() + : ARMCC::AL; + } + virtual bool PredicateInstruction(MachineInstr *MI, const SmallVectorImpl &Pred) const; From baldrick at free.fr Tue Oct 7 14:24:51 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 7 Oct 2008 21:24:51 +0200 Subject: [llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> References: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> Message-ID: <200810072124.51364.baldrick@free.fr> > FWIW, LegalizeIntegerTypes.cpp will eventually need to do > something similar, and it'll need to account for non-power-of-two > integer sizes also. As long as there are testcases, I will deal with it when I get back to working on LegalizeTypes. Ciao, Duncan. From resistor at mac.com Tue Oct 7 15:22:30 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 07 Oct 2008 20:22:30 -0000 Subject: [llvm-commits] [llvm] r57259 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/CodeGen/LiveIntervalAnalysis.cpp lib/CodeGen/RegAllocLinearScan.cpp lib/CodeGen/SimpleRegisterCoalescing.cpp lib/CodeGen/TwoAddressInstructionPass.cpp lib/Target/TargetMachine.cpp Message-ID: <200810072022.m97KMUsO009373@zion.cs.uiuc.edu> Author: resistor Date: Tue Oct 7 15:22:28 2008 New Revision: 57259 URL: http://llvm.org/viewvc/llvm-project?rev=57259&view=rev Log: Add an option to enable StrongPHIElimination, for ease of testing. Modified: llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/Target/TargetMachine.cpp Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Tue Oct 7 15:22:28 2008 @@ -102,6 +102,10 @@ /// which trades away generated code quality in favor of reducing /// compile time. extern bool EnableFastISel; + + /// StrongPHIElim - This flag enables more aggressive PHI elimination + /// wth earlier copy coalescing. + extern bool StrongPHIElim; } // End llvm namespace Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Oct 7 15:22:28 2008 @@ -30,6 +30,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/Statistic.h" @@ -67,8 +68,12 @@ AU.addRequired(); AU.addPreservedID(MachineLoopInfoID); AU.addPreservedID(MachineDominatorsID); - AU.addPreservedID(PHIEliminationID); - AU.addRequiredID(PHIEliminationID); + + if (!StrongPHIElim) { + AU.addPreservedID(PHIEliminationID); + AU.addRequiredID(PHIEliminationID); + } + AU.addRequiredID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); } Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Tue Oct 7 15:22:28 2008 @@ -26,6 +26,7 @@ #include "llvm/CodeGen/RegisterCoalescer.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/Statistic.h" @@ -107,6 +108,8 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); + if (StrongPHIElim) + AU.addRequiredID(StrongPHIEliminationID); // Make sure PassManager knows which analyses to make available // to coalescing and which analyses coalescing invalidates. AU.addRequiredTransitive(); Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Tue Oct 7 15:22:28 2008 @@ -25,6 +25,7 @@ #include "llvm/CodeGen/RegisterCoalescer.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/SmallSet.h" @@ -72,7 +73,10 @@ AU.addRequired(); AU.addPreserved(); AU.addPreservedID(MachineDominatorsID); - AU.addPreservedID(PHIEliminationID); + if (StrongPHIElim) + AU.addPreservedID(StrongPHIEliminationID); + else + AU.addPreservedID(PHIEliminationID); AU.addPreservedID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); } Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Tue Oct 7 15:22:28 2008 @@ -37,6 +37,7 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/BitVector.h" @@ -76,7 +77,10 @@ AU.addPreserved(); AU.addPreservedID(MachineLoopInfoID); AU.addPreservedID(MachineDominatorsID); - AU.addPreservedID(PHIEliminationID); + if (StrongPHIElim) + AU.addPreservedID(StrongPHIEliminationID); + else + AU.addPreservedID(PHIEliminationID); MachineFunctionPass::getAnalysisUsage(AU); } Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=57259&r1=57258&r2=57259&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Tue Oct 7 15:22:28 2008 @@ -39,6 +39,7 @@ bool RealignStack; bool VerboseAsm; bool DisableJumpTables; + bool StrongPHIElim; } static cl::opt PrintCode("print-machineinstrs", @@ -157,6 +158,12 @@ cl::location(DisableJumpTables), cl::init(false)); +static cl::opt +EnableStrongPHIElim(cl::Hidden, "strong-phi-elim", + cl::desc("Use strong PHI elimination."), + cl::location(StrongPHIElim), + cl::init(false)); + //--------------------------------------------------------------------------- // TargetMachine Class // From evan.cheng at apple.com Tue Oct 7 15:34:36 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 7 Oct 2008 13:34:36 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> Message-ID: <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> Hi Dale, I think we ought to fix the bug in the local register allocator instead. Is it not checking for aliases or sub-registers somewhere? Thanks, Evan On Oct 7, 2008, at 11:54 AM, Dale Johannesen wrote: > Author: johannes > Date: Tue Oct 7 13:54:28 2008 > New Revision: 57257 > > URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev > Log: > Model hardwired inputs & outputs of x86 8-bit divides correctly. > Fixes local RA miscompilation of gcc.c-torture/execute/20020904-1.c - > O0. > > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.td > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 2008 > @@ -728,7 +728,7 @@ > } > > // unsigned division/remainder > -let Defs = [AX,EFLAGS], Uses = [AL,AH] in > +let Defs = [AL,AH,EFLAGS], Uses = [AX] in > def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/ > r8 = AL,AH > "div{b}\t$src", []>; > let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in > @@ -738,7 +738,7 @@ > def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // > EDX:EAX/r32 = EAX,EDX > "div{l}\t$src", []>; > let mayLoad = 1 in { > -let Defs = [AX,EFLAGS], Uses = [AL,AH] in > +let Defs = [AL,AH,EFLAGS], Uses = [AX] in > def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/ > [mem8] = AL,AH > "div{b}\t$src", []>; > let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in > @@ -750,7 +750,7 @@ > } > > // Signed division/remainder. > -let Defs = [AX,EFLAGS], Uses = [AL,AH] in > +let Defs = [AL,AH,EFLAGS], Uses = [AX] in > def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // AX/ > r8 = AL,AH > "idiv{b}\t$src", []>; > let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in > @@ -760,7 +760,7 @@ > def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // > EDX:EAX/r32 = EAX,EDX > "idiv{l}\t$src", []>; > let mayLoad = 1, mayLoad = 1 in { > -let Defs = [AX,EFLAGS], Uses = [AL,AH] in > +let Defs = [AL,AH,EFLAGS], Uses = [AX] in > def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/ > [mem8] = AL,AH > "idiv{b}\t$src", []>; > let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Oct 7 15:39:12 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 20:39:12 -0000 Subject: [llvm-commits] [llvm] r57260 - /llvm/trunk/test/CodeGen/X86/i256-add.ll Message-ID: <200810072039.m97KdC6x009992@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 15:39:12 2008 New Revision: 57260 URL: http://llvm.org/viewvc/llvm-project?rev=57260&view=rev Log: Add a testcase for i256 add. i256 isn't fully supported in codegen right now, but add and subtract work. Added: llvm/trunk/test/CodeGen/X86/i256-add.ll Added: llvm/trunk/test/CodeGen/X86/i256-add.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/i256-add.ll?rev=57260&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/i256-add.ll (added) +++ llvm/trunk/test/CodeGen/X86/i256-add.ll Tue Oct 7 15:39:12 2008 @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc -march=x86 > %t +; RUN: grep adcl %t | count 7 +; RUN: grep sbbl %t | count 7 + +define void @add(i256* %p, i256* %q) nounwind { + %a = load i256* %p + %b = load i256* %q + %c = add i256 %a, %b + store i256 %c, i256* %p + ret void +} +define void @sub(i256* %p, i256* %q) nounwind { + %a = load i256* %p + %b = load i256* %q + %c = sub i256 %a, %b + store i256 %c, i256* %p + ret void +} From dalej at apple.com Tue Oct 7 15:44:10 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 7 Oct 2008 13:44:10 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> Message-ID: On Oct 7, 2008, at 1:34 PMPDT, Evan Cheng wrote: > Hi Dale, > > I think we ought to fix the bug in the local register allocator > instead. Is it not checking for aliases or sub-registers somewhere? > > Thanks, > > Evan Surely not "instead", the code I changed was clearly wrong. Here are before-and-after dumps. I have not tracked it through the code, but it looks like it's assuming imp-use physregs are supposed to match in type with the definition of that reg. That seems like a reasonable assumption to me since the code generator has complete control of those types. Before > Starting RegAlloc of: %AX = MOV16rr %reg1029 > Regs have values: [AL,%reg1026] [CX,%reg1029] > Last use of CX[%reg1029], removing it from live set > Last use of CL[%reg1029], removing it from live set > Last use of CH[%reg1029], removing it from live set > Spilling register AL containing %reg1026 to stack slot #4 > Register AX [%reg3] is never used, removing it frame live list > Register AL [%reg2] is never used, removing it frame live list > Register AH [%reg1] is never used, removing it frame live list > Register EAX [%reg17] is never used, removing it frame live list > > Starting RegAlloc of: DIV8r %reg1026, %AX, > %EFLAGS, %AL, %AH > Regs have values: > Reloading %reg1026 into AL <<<<<<<<< wrong > Last use of AL[%reg1026], removing it from live set > Last use of AH[%reg1], removing it from live set > Register AX [%reg3] is never used, removing it frame live list > Register AL [%reg2] is never used, removing it frame live list > Register AH [%reg1] is never used, removing it frame live list > Register EAX [%reg17] is never used, removing it frame live list > Register EFLAGS [%reg23] is never used, removing it frame live list After > Starting RegAlloc of: %AX = MOV16rr %reg1029 > Regs have values: [AL,%reg1026] [CX,%reg1029] > Last use of CX[%reg1029], removing it from live set > Last use of CL[%reg1029], removing it from live set > Last use of CH[%reg1029], removing it from live set > Spilling register AL containing %reg1026 to stack slot #4 > > Starting RegAlloc of: DIV8r %reg1026, %AL, %AH def,dead>, %EFLAGS, %AX > Regs have values: [AH,%reg0] [AL,%reg0] [AX,%reg0] > Reloading %reg1026 into CL > Last use of CL[%reg1026], removing it from live set > Last use of AX[%reg3], removing it from live set > Last use of AL[%reg3], removing it from live set > Last use of AH[%reg3], removing it from live set > Register AH [%reg1] is never used, removing it frame live list > Register AX [%reg3] is never used, removing it frame live list > Register EAX [%reg17] is never used, removing it frame live list > Register EFLAGS [%reg23] is never used, removing it frame live list -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081007/6112d9cd/attachment.html From evan.cheng at apple.com Tue Oct 7 16:01:19 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 7 Oct 2008 14:01:19 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> Message-ID: On Oct 7, 2008, at 1:44 PM, Dale Johannesen wrote: > > On Oct 7, 2008, at 1:34 PMPDT, Evan Cheng wrote: > >> Hi Dale, >> >> I think we ought to fix the bug in the local register allocator >> instead. Is it not checking for aliases or sub-registers somewhere? >> >> Thanks, >> >> Evan > > Surely not "instead", the code I changed was clearly wrong. > > Here are before-and-after dumps. I have not tracked it through the > code, but it looks like it's assuming imp-use physregs are supposed > to match in type with the definition of that reg. That seems like a > reasonable assumption to me since the code generator has complete > control of those types. This is a local liveness bug. AX == AL + AH. The def of AX by MOV16rr should not be dead. I assume this is a bug that's exposed by fastisel? Owen, can you work with Dale on this? Thanks, Evan > > Before > >> Starting RegAlloc of: %AX = MOV16rr %reg1029 >> Regs have values: [AL,%reg1026] [CX,%reg1029] >> Last use of CX[%reg1029], removing it from live set >> Last use of CL[%reg1029], removing it from live set >> Last use of CH[%reg1029], removing it from live set >> Spilling register AL containing %reg1026 to stack slot #4 >> Register AX [%reg3] is never used, removing it frame live list >> Register AL [%reg2] is never used, removing it frame live list >> Register AH [%reg1] is never used, removing it frame live list >> Register EAX [%reg17] is never used, removing it frame live list >> >> Starting RegAlloc of: DIV8r %reg1026, %AX, >> %EFLAGS, %AL, %AH >> Regs have values: >> Reloading %reg1026 into AL <<<<<<<<< wrong >> Last use of AL[%reg1026], removing it from live set >> Last use of AH[%reg1], removing it from live set >> Register AX [%reg3] is never used, removing it frame live list >> Register AL [%reg2] is never used, removing it frame live list >> Register AH [%reg1] is never used, removing it frame live list >> Register EAX [%reg17] is never used, removing it frame live list >> Register EFLAGS [%reg23] is never used, removing it frame live list > > > After > >> Starting RegAlloc of: %AX = MOV16rr %reg1029 >> Regs have values: [AL,%reg1026] [CX,%reg1029] >> Last use of CX[%reg1029], removing it from live set >> Last use of CL[%reg1029], removing it from live set >> Last use of CH[%reg1029], removing it from live set >> Spilling register AL containing %reg1026 to stack slot #4 >> >> Starting RegAlloc of: DIV8r %reg1026, %AL, %AH> def,dead>, %EFLAGS, %AX >> Regs have values: [AH,%reg0] [AL,%reg0] [AX,%reg0] >> Reloading %reg1026 into CL >> Last use of CL[%reg1026], removing it from live set >> Last use of AX[%reg3], removing it from live set >> Last use of AL[%reg3], removing it from live set >> Last use of AH[%reg3], removing it from live set >> Register AH [%reg1] is never used, removing it frame live list >> Register AX [%reg3] is never used, removing it frame live list >> Register EAX [%reg17] is never used, removing it frame live list >> Register EFLAGS [%reg23] is never used, removing it frame live list > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081007/0edda733/attachment.html From grosbach at apple.com Tue Oct 7 16:01:51 2008 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 07 Oct 2008 21:01:51 -0000 Subject: [llvm-commits] [llvm] r57261 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Message-ID: <200810072101.m97L1pOb010729@zion.cs.uiuc.edu> Author: grosbach Date: Tue Oct 7 16:01:51 2008 New Revision: 57261 URL: http://llvm.org/viewvc/llvm-project?rev=57261&view=rev Log: need ARM.h for ARMCC definition Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.h?rev=57261&r1=57260&r2=57261&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.h Tue Oct 7 16:01:51 2008 @@ -16,6 +16,7 @@ #include "llvm/Target/TargetInstrInfo.h" #include "ARMRegisterInfo.h" +#include "ARM.h" namespace llvm { class ARMSubtarget; From matthijs at stdin.nl Tue Oct 7 16:02:48 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 7 Oct 2008 23:02:48 +0200 Subject: [llvm-commits] PR2765 Patch In-Reply-To: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> References: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> Message-ID: <20081007210248.GP6091@katherina.student.utwente.nl> Hi Andrew, > + for (Function::const_arg_iterator I = OldFunc->arg_begin(), > + E = OldFunc->arg_end(); I != E; ++I) > + if (Argument* Anew = dyn_cast(ValueMap[I])) What does ValueMap[I] return when the argument is removed? I would expect NULL, but in that case you should be using dyn_cast_or_null IIRC? > + Anew->addAttr( OldFunc->getAttributes() > + .getParamAttributes(I->getArgNo() + 1)); > + NewFunc->setAttributes(NewFunc->getAttributes() > + .addAttr(0, OldFunc->getAttributes() > + .getRetAttributes())); > + NewFunc->setAttributes(NewFunc->getAttributes() > + .addAttr(~0, OldFunc->getAttributes() > + .getFnAttributes())); There is also a Function::addAttribute. Any particular reason not to use it? For the ~0 case, using Function::addFnAttr might be even better, since it prevents the use of the ~0 magic number. Perhaps there should be a addReturnAttr as well? I can't find it, so perhaps you could add it as well (probably submit that as a separate patch). Alternatively, I guess Devang should have a look at this, since he was working on this. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081007/192ab361/attachment.bin From gohman at apple.com Tue Oct 7 16:03:21 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 7 Oct 2008 14:03:21 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> Message-ID: <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> This looks like the same problem I found related to how fast-isel emits shifts. The local register allocator's liveness code does not check aliases or subregisters at all right now. We could fix it, but on the other hand it's arguably sloppy for instruction selectors to not precisely describe their physical register uses. Dan On Oct 7, 2008, at 1:34 PM, Evan Cheng wrote: > Hi Dale, > > I think we ought to fix the bug in the local register allocator > instead. Is it not checking for aliases or sub-registers somewhere? > > Thanks, > > Evan > > On Oct 7, 2008, at 11:54 AM, Dale Johannesen wrote: > >> Author: johannes >> Date: Tue Oct 7 13:54:28 2008 >> New Revision: 57257 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev >> Log: >> Model hardwired inputs & outputs of x86 8-bit divides correctly. >> Fixes local RA miscompilation of gcc.c-torture/execute/20020904-1.c - >> O0. >> >> >> Modified: >> llvm/trunk/lib/Target/X86/X86InstrInfo.td >> >> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 >> 2008 >> @@ -728,7 +728,7 @@ >> } >> >> // unsigned division/remainder >> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >> def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/ >> r8 = AL,AH >> "div{b}\t$src", []>; >> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >> @@ -738,7 +738,7 @@ >> def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // >> EDX:EAX/r32 = EAX,EDX >> "div{l}\t$src", []>; >> let mayLoad = 1 in { >> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >> def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/ >> [mem8] = AL,AH >> "div{b}\t$src", []>; >> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >> @@ -750,7 +750,7 @@ >> } >> >> // Signed division/remainder. >> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >> def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // AX/ >> r8 = AL,AH >> "idiv{b}\t$src", []>; >> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >> @@ -760,7 +760,7 @@ >> def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // >> EDX:EAX/r32 = EAX,EDX >> "idiv{l}\t$src", []>; >> let mayLoad = 1, mayLoad = 1 in { >> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >> def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/ >> [mem8] = AL,AH >> "idiv{b}\t$src", []>; >> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Tue Oct 7 16:07:16 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 7 Oct 2008 14:07:16 -0700 Subject: [llvm-commits] PR2765 Patch In-Reply-To: <20081007210248.GP6091@katherina.student.utwente.nl> References: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> <20081007210248.GP6091@katherina.student.utwente.nl> Message-ID: On Oct 7, 2008, at 2:02 PM, Matthijs Kooijman wrote: > Perhaps there should be a addReturnAttr as well? I can't find it, so > perhaps > you could add it as well (probably submit that as a separate patch). That's a good idea. - Devang From grosbach at apple.com Tue Oct 7 16:08:09 2008 From: grosbach at apple.com (Jim Grosbach) Date: Tue, 07 Oct 2008 21:08:09 -0000 Subject: [llvm-commits] [llvm] r57262 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Message-ID: <200810072108.m97L897J010946@zion.cs.uiuc.edu> Author: grosbach Date: Tue Oct 7 16:08:09 2008 New Revision: 57262 URL: http://llvm.org/viewvc/llvm-project?rev=57262&view=rev Log: Unconditional branch instruction encoding fix. Needs to use ABI, not AXI, to get the proper opcode bits. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=57262&r1=57261&r2=57262&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Oct 7 16:08:09 2008 @@ -567,7 +567,7 @@ // B is "predicable" since it can be xformed into a Bcc. let isBarrier = 1 in { let isPredicable = 1 in - def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b $target", + def B : ABI<{0,1,0,1}, (outs), (ins brtarget:$target), Branch, "b $target", [(br bb:$target)]>; let isNotDuplicable = 1, isIndirectBranch = 1 in { From evan.cheng at apple.com Tue Oct 7 16:15:55 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 7 Oct 2008 14:15:55 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> Message-ID: On Oct 7, 2008, at 2:03 PM, Dan Gohman wrote: > This looks like the same problem I found related to how fast-isel > emits shifts. The local register allocator's liveness code > does not check aliases or subregisters at all right now. That needs to be fixed. > > > We could fix it, but on the other hand it's arguably sloppy for > instruction selectors to not precisely describe their physical > register uses. I agree. In this case DVI8r should say it defines AL, AH and uses AL, AH which makes it clear it reads 2 values and outputs 2. On the other hand, it should not matter if it says it uses AX which is the same as AL + AH. Evan > > > Dan > > On Oct 7, 2008, at 1:34 PM, Evan Cheng wrote: > >> Hi Dale, >> >> I think we ought to fix the bug in the local register allocator >> instead. Is it not checking for aliases or sub-registers somewhere? >> >> Thanks, >> >> Evan >> >> On Oct 7, 2008, at 11:54 AM, Dale Johannesen wrote: >> >>> Author: johannes >>> Date: Tue Oct 7 13:54:28 2008 >>> New Revision: 57257 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev >>> Log: >>> Model hardwired inputs & outputs of x86 8-bit divides correctly. >>> Fixes local RA miscompilation of gcc.c-torture/execute/ >>> 20020904-1.c - >>> O0. >>> >>> >>> Modified: >>> llvm/trunk/lib/Target/X86/X86InstrInfo.td >>> >>> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ==================================================================== >>> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >>> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 >>> 2008 >>> @@ -728,7 +728,7 @@ >>> } >>> >>> // unsigned division/remainder >>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>> def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // AX/ >>> r8 = AL,AH >>> "div{b}\t$src", []>; >>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>> @@ -738,7 +738,7 @@ >>> def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // >>> EDX:EAX/r32 = EAX,EDX >>> "div{l}\t$src", []>; >>> let mayLoad = 1 in { >>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>> def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/ >>> [mem8] = AL,AH >>> "div{b}\t$src", []>; >>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>> @@ -750,7 +750,7 @@ >>> } >>> >>> // Signed division/remainder. >>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>> def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // AX/ >>> r8 = AL,AH >>> "idiv{b}\t$src", []>; >>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>> @@ -760,7 +760,7 @@ >>> def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // >>> EDX:EAX/r32 = EAX,EDX >>> "idiv{l}\t$src", []>; >>> let mayLoad = 1, mayLoad = 1 in { >>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>> def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/ >>> [mem8] = AL,AH >>> "idiv{b}\t$src", []>; >>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Tue Oct 7 16:21:09 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 7 Oct 2008 14:21:09 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> Message-ID: <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> On Oct 7, 2008, at 2:15 PMPDT, Evan Cheng wrote: > > On Oct 7, 2008, at 2:03 PM, Dan Gohman wrote: > >> This looks like the same problem I found related to how fast-isel >> emits shifts. The local register allocator's liveness code >> does not check aliases or subregisters at all right now. > > That needs to be fixed. > >> >> >> We could fix it, but on the other hand it's arguably sloppy for >> instruction selectors to not precisely describe their physical >> register uses. > > I agree. In this case DVI8r should say it defines AL, AH and uses AL, > AH which makes it clear it reads 2 values and outputs 2. No, it reads 1 value and outputs two. It is not the same as DIV16 and DIV32. The way I have it matches Intel docs. > On the other > hand, it should not matter if it says it uses AX which is the same as > AL + AH. > > Evan > >> >> >> Dan >> >> On Oct 7, 2008, at 1:34 PM, Evan Cheng wrote: >> >>> Hi Dale, >>> >>> I think we ought to fix the bug in the local register allocator >>> instead. Is it not checking for aliases or sub-registers somewhere? >>> >>> Thanks, >>> >>> Evan >>> >>> On Oct 7, 2008, at 11:54 AM, Dale Johannesen wrote: >>> >>>> Author: johannes >>>> Date: Tue Oct 7 13:54:28 2008 >>>> New Revision: 57257 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev >>>> Log: >>>> Model hardwired inputs & outputs of x86 8-bit divides correctly. >>>> Fixes local RA miscompilation of gcc.c-torture/execute/ >>>> 20020904-1.c - >>>> O0. >>>> >>>> >>>> Modified: >>>> llvm/trunk/lib/Target/X86/X86InstrInfo.td >>>> >>>> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >>>> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 >>>> 2008 >>>> @@ -728,7 +728,7 @@ >>>> } >>>> >>>> // unsigned division/remainder >>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>> def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // >>>> AX/ >>>> r8 = AL,AH >>>> "div{b}\t$src", []>; >>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>> @@ -738,7 +738,7 @@ >>>> def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // >>>> EDX:EAX/r32 = EAX,EDX >>>> "div{l}\t$src", []>; >>>> let mayLoad = 1 in { >>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>> def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/ >>>> [mem8] = AL,AH >>>> "div{b}\t$src", []>; >>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>> @@ -750,7 +750,7 @@ >>>> } >>>> >>>> // Signed division/remainder. >>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>> def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // >>>> AX/ >>>> r8 = AL,AH >>>> "idiv{b}\t$src", []>; >>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>> @@ -760,7 +760,7 @@ >>>> def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // >>>> EDX:EAX/r32 = EAX,EDX >>>> "idiv{l}\t$src", []>; >>>> let mayLoad = 1, mayLoad = 1 in { >>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>> def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/ >>>> [mem8] = AL,AH >>>> "idiv{b}\t$src", []>; >>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>> >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Oct 7 16:21:39 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 7 Oct 2008 14:21:39 -0700 Subject: [llvm-commits] [llvm] r57247 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp In-Reply-To: <200810072124.51364.baldrick@free.fr> References: <200810071703.m97H3GGL002647@zion.cs.uiuc.edu> <54924.76.220.41.203.1223402037.squirrel@webmail.apple.com> <200810072124.51364.baldrick@free.fr> Message-ID: <11381FC2-3AE5-4072-94EC-83DBF5BB5DDC@apple.com> On Oct 7, 2008, at 12:24 PM, Duncan Sands wrote: >> FWIW, LegalizeIntegerTypes.cpp will eventually need to do >> something similar, and it'll need to account for non-power-of-two >> integer sizes also. > > As long as there are testcases, I will deal with it when > I get back to working on LegalizeTypes. Thanks! Andrew added dejagnu testcases for i128 arithmetic on Alpha, and I added one for i256 arithmetic on x86, so I believe the basic functionality is covered. Dan From criswell at uiuc.edu Tue Oct 7 16:23:45 2008 From: criswell at uiuc.edu (John Criswell) Date: Tue, 07 Oct 2008 21:23:45 -0000 Subject: [llvm-commits] [poolalloc] r57263 - /poolalloc/trunk/lib/DSA/StdLibPass.cpp Message-ID: <200810072123.m97LNjTO011561@zion.cs.uiuc.edu> Author: criswell Date: Tue Oct 7 16:23:44 2008 New Revision: 57263 URL: http://llvm.org/viewvc/llvm-project?rev=57263&view=rev Log: When collapsing the DSNodes of return values and parameters, ensure that we only collapse the return value if it is, in fact, a pointer. Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=57263&r1=57262&r2=57263&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original) +++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Tue Oct 7 16:23:44 2008 @@ -151,7 +151,8 @@ toMerge[0].mergeWith(toMerge[y]); if (recFuncs[x].action.collapse) { - Graph.getNodeForValue(CI).getNode()->foldNodeCompletely(); + if (isa(CI->getType())) + Graph.getNodeForValue(CI).getNode()->foldNodeCompletely(); for (unsigned y = 1; y < CI->getNumOperands(); ++y) if (isa(CI->getOperand(y)->getType())) if (DSNode * Node=Graph.getNodeForValue(CI->getOperand(y)).getNode()) From evan.cheng at apple.com Tue Oct 7 16:29:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 7 Oct 2008 14:29:44 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> Message-ID: <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> On Oct 7, 2008, at 2:21 PM, Dale Johannesen wrote: > > On Oct 7, 2008, at 2:15 PMPDT, Evan Cheng wrote: > >> >> On Oct 7, 2008, at 2:03 PM, Dan Gohman wrote: >> >>> This looks like the same problem I found related to how fast-isel >>> emits shifts. The local register allocator's liveness code >>> does not check aliases or subregisters at all right now. >> >> That needs to be fixed. >> >>> >>> >>> We could fix it, but on the other hand it's arguably sloppy for >>> instruction selectors to not precisely describe their physical >>> register uses. >> >> I agree. In this case DVI8r should say it defines AL, AH and uses AL, >> AH which makes it clear it reads 2 values and outputs 2. > > No, it reads 1 value and outputs two. It is not the same as DIV16 and > DIV32. > The way I have it matches Intel docs. Ok. It's good to match what Intel manual says. But that's additional goodness. Previously DIV16r is marked as using AL, AH and the implicit use is copied to AX. While this is not ideal, it's not incorrect. Local liveness cannot mark AX as dead. Evan > > >> On the other >> hand, it should not matter if it says it uses AX which is the same as >> AL + AH. >> >> Evan >> >>> >>> >>> Dan >>> >>> On Oct 7, 2008, at 1:34 PM, Evan Cheng wrote: >>> >>>> Hi Dale, >>>> >>>> I think we ought to fix the bug in the local register allocator >>>> instead. Is it not checking for aliases or sub-registers somewhere? >>>> >>>> Thanks, >>>> >>>> Evan >>>> >>>> On Oct 7, 2008, at 11:54 AM, Dale Johannesen wrote: >>>> >>>>> Author: johannes >>>>> Date: Tue Oct 7 13:54:28 2008 >>>>> New Revision: 57257 >>>>> >>>>> URL: http://llvm.org/viewvc/llvm-project?rev=57257&view=rev >>>>> Log: >>>>> Model hardwired inputs & outputs of x86 8-bit divides correctly. >>>>> Fixes local RA miscompilation of gcc.c-torture/execute/ >>>>> 20020904-1.c - >>>>> O0. >>>>> >>>>> >>>>> Modified: >>>>> llvm/trunk/lib/Target/X86/X86InstrInfo.td >>>>> >>>>> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57257&r1=57256&r2=57257&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> ================================================================== >>>>> --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) >>>>> +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Tue Oct 7 13:54:28 >>>>> 2008 >>>>> @@ -728,7 +728,7 @@ >>>>> } >>>>> >>>>> // unsigned division/remainder >>>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>>> def DIV8r : I<0xF6, MRM6r, (outs), (ins GR8:$src), // >>>>> AX/ >>>>> r8 = AL,AH >>>>> "div{b}\t$src", []>; >>>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>>> @@ -738,7 +738,7 @@ >>>>> def DIV32r : I<0xF7, MRM6r, (outs), (ins GR32:$src), // >>>>> EDX:EAX/r32 = EAX,EDX >>>>> "div{l}\t$src", []>; >>>>> let mayLoad = 1 in { >>>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>>> def DIV8m : I<0xF6, MRM6m, (outs), (ins i8mem:$src), // AX/ >>>>> [mem8] = AL,AH >>>>> "div{b}\t$src", []>; >>>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>>> @@ -750,7 +750,7 @@ >>>>> } >>>>> >>>>> // Signed division/remainder. >>>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>>> def IDIV8r : I<0xF6, MRM7r, (outs), (ins GR8:$src), // >>>>> AX/ >>>>> r8 = AL,AH >>>>> "idiv{b}\t$src", []>; >>>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>>> @@ -760,7 +760,7 @@ >>>>> def IDIV32r: I<0xF7, MRM7r, (outs), (ins GR32:$src), // >>>>> EDX:EAX/r32 = EAX,EDX >>>>> "idiv{l}\t$src", []>; >>>>> let mayLoad = 1, mayLoad = 1 in { >>>>> -let Defs = [AX,EFLAGS], Uses = [AL,AH] in >>>>> +let Defs = [AL,AH,EFLAGS], Uses = [AX] in >>>>> def IDIV8m : I<0xF6, MRM7m, (outs), (ins i8mem:$src), // AX/ >>>>> [mem8] = AL,AH >>>>> "idiv{b}\t$src", []>; >>>>> let Defs = [AX,DX,EFLAGS], Uses = [AX,DX] in >>>>> >>>>> >>>>> _______________________________________________ >>>>> llvm-commits mailing list >>>>> llvm-commits at cs.uiuc.edu >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From gohman at apple.com Tue Oct 7 16:50:37 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 21:50:37 -0000 Subject: [llvm-commits] [llvm] r57264 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp Message-ID: <200810072150.m97Lob1Z012444@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 16:50:36 2008 New Revision: 57264 URL: http://llvm.org/viewvc/llvm-project?rev=57264&view=rev Log: Instead of emitting an implicit use for the super-register of X86::CL that was used, emit an EXTRACT_SUBREG from the CL super-register to CL. This more precisely describes how the CL register is being used. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=57264&r1=57263&r2=57264&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Oct 7 16:50:36 2008 @@ -866,12 +866,16 @@ unsigned Op1Reg = getRegForValue(I->getOperand(1)); if (Op1Reg == 0) return false; TII.copyRegToReg(*MBB, MBB->end(), CReg, Op1Reg, RC, RC); + + // The shift instruction uses X86::CL. If we defined a super-register + // of X86::CL, emit an EXTRACT_SUBREG to precisely describe what + // we're doing here. + if (CReg != X86::CL) + BuildMI(MBB, TII.get(TargetInstrInfo::EXTRACT_SUBREG), X86::CL) + .addReg(CReg).addImm(X86::SUBREG_8BIT); + unsigned ResultReg = createResultReg(RC); - BuildMI(MBB, TII.get(OpReg), ResultReg).addReg(Op0Reg) - // FIXME: The "Local" register allocator's physreg liveness doesn't - // recognize subregs. Adding the superreg of CL that's actually defined - // prevents it from being re-allocated for this instruction. - .addReg(CReg, false, true); + BuildMI(MBB, TII.get(OpReg), ResultReg).addReg(Op0Reg); UpdateValueMap(I, ResultReg); return true; } @@ -976,7 +980,7 @@ BuildMI(MBB, TII.get(CopyOpc), CopyReg).addReg(InputReg); // Then issue an extract_subreg. - unsigned ResultReg = FastEmitInst_extractsubreg(CopyReg,1); // x86_subreg_8bit + unsigned ResultReg = FastEmitInst_extractsubreg(CopyReg, X86::SUBREG_8BIT); if (!ResultReg) return false; From gohman at apple.com Tue Oct 7 17:03:27 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 22:03:27 -0000 Subject: [llvm-commits] [llvm] r57265 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <200810072203.m97M3RN8012856@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 17:03:27 2008 New Revision: 57265 URL: http://llvm.org/viewvc/llvm-project?rev=57265&view=rev Log: Avoid emitting redundant materializations of integer constants for things like null pointers, which at this level aren't different from regular integer constants. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=57265&r1=57264&r2=57265&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Oct 7 17:03:27 2008 @@ -81,7 +81,9 @@ } else if (isa(V)) { Reg = TargetMaterializeAlloca(cast(V)); } else if (isa(V)) { - Reg = FastEmit_i(VT, VT, ISD::Constant, 0); + // Translate this as an integer zero so that it can be + // local-CSE'd with actual integer zeros. + Reg = getRegForValue(Constant::getNullValue(TD.getIntPtrType())); } else if (ConstantFP *CF = dyn_cast(V)) { Reg = FastEmit_f(VT, VT, ISD::ConstantFP, CF); @@ -95,8 +97,7 @@ APFloat::rmTowardZero) != APFloat::opOK) { APInt IntVal(IntBitWidth, 2, x); - unsigned IntegerReg = FastEmit_i(IntVT.getSimpleVT(), IntVT.getSimpleVT(), - ISD::Constant, IntVal.getZExtValue()); + unsigned IntegerReg = getRegForValue(ConstantInt::get(IntVal)); if (IntegerReg != 0) Reg = FastEmit_r(IntVT.getSimpleVT(), VT, ISD::SINT_TO_FP, IntegerReg); } From gohman at apple.com Tue Oct 7 17:10:33 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 22:10:33 -0000 Subject: [llvm-commits] [llvm] r57266 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp Message-ID: <200810072210.m97MAX31013137@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 17:10:33 2008 New Revision: 57266 URL: http://llvm.org/viewvc/llvm-project?rev=57266&view=rev Log: Add MBB successors and physreg Uses in the same order that SDISel typically adds them in. This makes it a little easier to compare FastISel output with SDISel output. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=57266&r1=57265&r2=57266&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Oct 7 17:10:33 2008 @@ -784,8 +784,8 @@ default: return false; } - MBB->addSuccessor(TrueMBB); FastEmitBranch(FalseMBB); + MBB->addSuccessor(TrueMBB); return true; } } @@ -797,9 +797,8 @@ BuildMI(MBB, TII.get(X86::TEST8rr)).addReg(OpReg).addReg(OpReg); BuildMI(MBB, TII.get(X86::JNE)).addMBB(TrueMBB); - MBB->addSuccessor(TrueMBB); - FastEmitBranch(FalseMBB); + MBB->addSuccessor(TrueMBB); return true; } @@ -1180,10 +1179,8 @@ MIB.addReg(X86::EBX); // Add implicit physical register uses to the call. - while (!RegArgs.empty()) { - MIB.addReg(RegArgs.back()); - RegArgs.pop_back(); - } + for (unsigned i = 0, e = RegArgs.size(); i != e; ++i) + MIB.addReg(RegArgs[i]); // Issue CALLSEQ_END unsigned AdjStackUp = TM.getRegisterInfo()->getCallFrameDestroyOpcode(); From neil at daikokuya.co.uk Tue Oct 7 17:19:28 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Wed, 8 Oct 2008 07:19:28 +0900 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> Message-ID: <20081007221928.GI19669@daikokuya.co.uk> Dale Johannesen wrote:- > Good to hear from you on this one. > > What the rest of the compiler wants to know is whether a conversion > can be done without loss of information. I.e. if you convert type A > to type B, then back to type A, you get the original value. Right now > it's using the return value == fsOK check > to figure that out. I suppose the various call sites could be taught > about NaNs but it really seems better to keep those details buried in > APFloat somehow. > > I guess we could add a separate "conversion doesn't lose information" > return value to the conversion routines, or even convert back and > compare at the call sites, although that seems silly when the first > conversion has all the needed information. I'm not so sure it's worth > preserving strict IEEE behavior in all these edge cases, though, > what's the value of that in LLVM? How would you approach the problem? That seems reasonable. However LLVM may also be interested in simulating the target CPU, in a JIT or run-time library, or asking "does this operation raise any hardware exceptions, and which ones", this question being important for optimization? This was the original intent of the code and should be preserved. I'd like to preserve that. So could you add an extra flag for this case? > When I implemented the -0.0 conversion to int, I thought that was what > IEEE754 calls for, but I missed the definition of inexact, obscurely > placed in 7.4(4). 6.3 is clear that the result should have a negative > sign, and that's not implementable on a twos complement machine, yet > none of the exceptions seems to apply; I guess the standard calls for > quietly producing an answer known to be wrong. This one really seems > like a bug in the standard. This one should be special-cased at the call site. I think the loss of IEEE semantics, which are there for good reason and may even be being relied on elsewhere in APFloat, is a very bad idea here. Chris, what do you think? Neil. From tonic at nondot.org Tue Oct 7 17:21:04 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 22:21:04 -0000 Subject: [llvm-commits] [llvm] r57267 - in /llvm/trunk: autoconf/configure.ac configure Message-ID: <200810072221.m97ML4kQ026855@zion.cs.uiuc.edu> Author: tbrethou Date: Tue Oct 7 17:21:03 2008 New Revision: 57267 URL: http://llvm.org/viewvc/llvm-project?rev=57267&view=rev Log: Fix configure issue where configure turned "obj-c++" into "obj" in the langs line. Update configure script. Modified: llvm/trunk/autoconf/configure.ac llvm/trunk/configure Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=57267&r1=57266&r2=57267&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Oct 7 17:21:03 2008 @@ -872,7 +872,7 @@ llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`] AC_SUBST(LLVMGCC_VERSION,$llvmgccversion) AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers) - llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`] + llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`] AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs) AC_MSG_RESULT([ok]) fi Modified: llvm/trunk/configure URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=57267&r1=57266&r2=57267&view=diff ============================================================================== --- llvm/trunk/configure (original) +++ llvm/trunk/configure Tue Oct 7 17:21:03 2008 @@ -34246,7 +34246,7 @@ LLVMGCC_MAJVERS=$llvmgccmajvers - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` LLVMGCC_LANGS=$llvmgcclangs { echo "$as_me:$LINENO: result: ok" >&5 From echristo at apple.com Tue Oct 7 17:33:45 2008 From: echristo at apple.com (Eric Christopher) Date: Tue, 07 Oct 2008 22:33:45 -0000 Subject: [llvm-commits] [llvm] r57268 - /llvm/trunk/include/llvm/Function.h Message-ID: <200810072233.m97MXkRK027555@zion.cs.uiuc.edu> Author: echristo Date: Tue Oct 7 17:33:44 2008 New Revision: 57268 URL: http://llvm.org/viewvc/llvm-project?rev=57268&view=rev Log: Fix disagreement about where the attributes are ~0 != ~0U. Modified: llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=57268&r1=57267&r2=57268&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Tue Oct 7 17:33:44 2008 @@ -158,7 +158,7 @@ /// void addFnAttr(Attributes N) { // Function Attributes are stored at ~0 index - addAttribute(~0, N); + addAttribute(~0U, N); } /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm From tonic at nondot.org Tue Oct 7 17:34:35 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 22:34:35 -0000 Subject: [llvm-commits] [llvm] r57269 - in /llvm/branches/release_24: autoconf/configure.ac configure Message-ID: <200810072234.m97MYamP027599@zion.cs.uiuc.edu> Author: tbrethou Date: Tue Oct 7 17:34:35 2008 New Revision: 57269 URL: http://llvm.org/viewvc/llvm-project?rev=57269&view=rev Log: Merge from mainline. Modified: llvm/branches/release_24/autoconf/configure.ac llvm/branches/release_24/configure Modified: llvm/branches/release_24/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/autoconf/configure.ac?rev=57269&r1=57268&r2=57269&view=diff ============================================================================== --- llvm/branches/release_24/autoconf/configure.ac (original) +++ llvm/branches/release_24/autoconf/configure.ac Tue Oct 7 17:34:35 2008 @@ -872,7 +872,7 @@ llvmgccmajvers=[`echo $llvmgccversion | sed 's/^\([0-9]\).*/\1/'`] AC_SUBST(LLVMGCC_VERSION,$llvmgccversion) AC_SUBST(LLVMGCC_MAJVERS,$llvmgccmajvers) - llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'`] + llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`] AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs) AC_MSG_RESULT([ok]) fi Modified: llvm/branches/release_24/configure URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/configure?rev=57269&r1=57268&r2=57269&view=diff ============================================================================== --- llvm/branches/release_24/configure (original) +++ llvm/branches/release_24/configure Tue Oct 7 17:34:35 2008 @@ -34246,7 +34246,7 @@ LLVMGCC_MAJVERS=$llvmgccmajvers - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ -]*\).*/\1/'` + llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` LLVMGCC_LANGS=$llvmgcclangs { echo "$as_me:$LINENO: result: ok" >&5 From gohman at apple.com Tue Oct 7 18:00:56 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 23:00:56 -0000 Subject: [llvm-commits] [llvm] r57270 - in /llvm/trunk: lib/CodeGen/LLVMTargetMachine.cpp test/CodeGen/X86/2008-05-21-CoalescerBug.ll Message-ID: <200810072300.m97N0u3i028552@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 18:00:56 2008 New Revision: 57270 URL: http://llvm.org/viewvc/llvm-project?rev=57270&view=rev Log: Remove -disable-fast-isel. Use cl::boolOrDefault with -fast-isel instead. So now: -fast-isel or -fast-isel=true enable fast-isel, and -fast-isel=false disables it. Fast-isel is also on by default with -fast, and off by default otherwise. Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=57270&r1=57269&r2=57270&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original) +++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Tue Oct 7 18:00:56 2008 @@ -56,12 +56,9 @@ // Enable or disable FastISel. Both options are needed, because // FastISel is enabled by default with -fast, and we wish to be // able to enable or disable fast-isel independently from -fast. -static cl::opt +static cl::opt EnableFastISelOption("fast-isel", cl::Hidden, cl::desc("Enable the experimental \"fast\" instruction selector")); -static cl::opt -DisableFastISelOption("disable-fast-isel", cl::Hidden, - cl::desc("Disable the experimental \"fast\" instruction selector")); FileModel::Model LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM, @@ -175,10 +172,8 @@ // Standard Lower-Level Passes. // Enable FastISel with -fast, but allow that to be overridden. - assert((!EnableFastISelOption || !DisableFastISelOption) && - "Both -fast-isel and -disable-fast-isel given!"); - if (EnableFastISelOption || - (Fast && !DisableFastISelOption)) + if (EnableFastISelOption == cl::BOU_TRUE || + (Fast && EnableFastISelOption != cl::BOU_FALSE)) EnableFastISel = true; // Ask the target for an isel. Modified: llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll?rev=57270&r1=57269&r2=57270&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-05-21-CoalescerBug.ll Tue Oct 7 18:00:56 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | llc -march=x86 -fast -disable-fast-isel | grep mov | count 5 +; RUN: llvm-as < %s | llc -march=x86 -fast -fast-isel=false | grep mov | count 5 ; PR2343 %llvm.dbg.anchor.type = type { i32, i32 } From gohman at apple.com Tue Oct 7 18:01:45 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 7 Oct 2008 16:01:45 -0700 Subject: [llvm-commits] [llvm] r56930 - /llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp In-Reply-To: References: <200810012039.m91KdKb2028324@zion.cs.uiuc.edu> Message-ID: <24E3355D-BEAC-4F59-8620-9D31CB7947EC@apple.com> On Oct 4, 2008, at 1:29 PM, Chris Lattner wrote: > > On Oct 1, 2008, at 1:39 PM, Dan Gohman wrote: > >> +// Enable or disable FastISel. Both options are needed, because >> +// FastISel is enabled by default with -fast, and we wish to be >> +// able to enable or disable fast-isel independently from -fast. >> +static cl::opt >> +EnableFastISelOption("fast-isel", cl::Hidden, >> + cl::desc("Enable the experimental \"fast\" instruction >> selector")); >> +static cl::opt >> +DisableFastISelOption("disable-fast-isel", cl::Hidden, >> + cl::desc("Disable the experimental \"fast\" instruction >> selector")); > > This seems like it should be a tri-state/enum option, not two > different and mutually conflicting options. Aha, there's even a boolOrDefault tri-state option parser already available. I've removed -disable-fast-isel in favor of this. Thanks! Dan From kremenek at apple.com Tue Oct 7 18:10:46 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 07 Oct 2008 23:10:46 -0000 Subject: [llvm-commits] [llvm] r57276 - /llvm/tags/checker/checker-109/ Message-ID: <200810072310.m97NAkeH029154@zion.cs.uiuc.edu> Author: kremenek Date: Tue Oct 7 18:10:46 2008 New Revision: 57276 URL: http://llvm.org/viewvc/llvm-project?rev=57276&view=rev Log: Tagging checker-109. Added: llvm/tags/checker/checker-109/ - copied from r57275, llvm/trunk/ From tonic at nondot.org Tue Oct 7 18:17:49 2008 From: tonic at nondot.org (Tanya Lattner) Date: Tue, 07 Oct 2008 23:17:49 -0000 Subject: [llvm-commits] [llvm] r57278 - /llvm/branches/release_24/include/llvm/Function.h Message-ID: <200810072317.m97NHnAN029582@zion.cs.uiuc.edu> Author: tbrethou Date: Tue Oct 7 18:17:48 2008 New Revision: 57278 URL: http://llvm.org/viewvc/llvm-project?rev=57278&view=rev Log: Merge from mainline. Fix disagreement about where the attributes are ~0 != ~0U. Modified: llvm/branches/release_24/include/llvm/Function.h Modified: llvm/branches/release_24/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/include/llvm/Function.h?rev=57278&r1=57277&r2=57278&view=diff ============================================================================== --- llvm/branches/release_24/include/llvm/Function.h (original) +++ llvm/branches/release_24/include/llvm/Function.h Tue Oct 7 18:17:48 2008 @@ -158,7 +158,7 @@ /// void addFnAttr(Attributes N) { // Function Attributes are stored at ~0 index - addAttribute(~0, N); + addAttribute(~0U, N); } /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm From kremenek at apple.com Tue Oct 7 18:18:20 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 07 Oct 2008 23:18:20 -0000 Subject: [llvm-commits] [llvm] r57279 - /llvm/tags/checker/checker-109/ Message-ID: <200810072318.m97NIK81029615@zion.cs.uiuc.edu> Author: kremenek Date: Tue Oct 7 18:18:20 2008 New Revision: 57279 URL: http://llvm.org/viewvc/llvm-project?rev=57279&view=rev Log: Removing checker-109. Removed: llvm/tags/checker/checker-109/ From gohman at apple.com Tue Oct 7 18:30:36 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 07 Oct 2008 23:30:36 -0000 Subject: [llvm-commits] [test-suite] r57281 - /test-suite/trunk/autoconf/configure.ac Message-ID: <200810072330.m97NUagZ030230@zion.cs.uiuc.edu> Author: djg Date: Tue Oct 7 18:30:36 2008 New Revision: 57281 URL: http://llvm.org/viewvc/llvm-project?rev=57281&view=rev Log: Add '=DIR' to the --with-llvmobj help, for consistency with all the other options. Modified: test-suite/trunk/autoconf/configure.ac Modified: test-suite/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/autoconf/configure.ac?rev=57281&r1=57280&r2=57281&view=diff ============================================================================== --- test-suite/trunk/autoconf/configure.ac (original) +++ test-suite/trunk/autoconf/configure.ac Tue Oct 7 18:30:36 2008 @@ -58,7 +58,7 @@ dnl Location of LLVM object code AC_ARG_WITH(llvmobj, - AS_HELP_STRING([--with-llvmobj],Location of LLVM Object Code), + AS_HELP_STRING([--with-llvmobj=DIR],Location of LLVM Object Code), AC_SUBST(LLVM_OBJ,[$withval]), AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) From kremenek at apple.com Tue Oct 7 18:35:58 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 07 Oct 2008 23:35:58 -0000 Subject: [llvm-commits] [llvm] r57283 - /llvm/tags/checker/checker-109/ Message-ID: <200810072335.m97NZw5a030448@zion.cs.uiuc.edu> Author: kremenek Date: Tue Oct 7 18:35:57 2008 New Revision: 57283 URL: http://llvm.org/viewvc/llvm-project?rev=57283&view=rev Log: Tagging checker-109. Added: llvm/tags/checker/checker-109/ - copied from r57282, llvm/trunk/ From sam at rfc1149.net Tue Oct 7 10:30:38 2008 From: sam at rfc1149.net (Samuel Tardieu) Date: Tue, 07 Oct 2008 17:30:38 +0200 Subject: [llvm-commits] [PATCH] Add include where needed Message-ID: <20081007153038.15951.75226.stgit@arrakis.enst.fr> This is needed to get "stderr", "EOF", "sprintf", and so on. GCC 4.4.0 cannot compile LLVM without that in Release mode. --- .../Interpreter/ExternalFunctions.cpp | 1 + lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 1 + lib/System/DynamicLibrary.cpp | 1 + lib/Target/PIC16/PIC16InstrInfo.cpp | 1 + lib/Target/PowerPC/PPCMachOWriterInfo.cpp | 1 + lib/Transforms/Scalar/GVN.cpp | 1 + lib/Transforms/Utils/UnrollLoop.cpp | 1 + lib/VMCore/PassManager.cpp | 1 + utils/TableGen/InstrEnumEmitter.cpp | 1 + utils/TableGen/TGLexer.cpp | 1 + 10 files changed, 10 insertions(+), 0 deletions(-) diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 684d7db..66a26cf 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -27,6 +27,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/ManagedStatic.h" #include +#include #include #include #include diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index 0ffc779..618f144 100644 --- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include using namespace llvm; diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp index 5e3b6cb..970266f 100644 --- a/lib/System/DynamicLibrary.cpp +++ b/lib/System/DynamicLibrary.cpp @@ -13,6 +13,7 @@ #include "llvm/System/DynamicLibrary.h" #include "llvm/Config/config.h" +#include #include #include diff --git a/lib/Target/PIC16/PIC16InstrInfo.cpp b/lib/Target/PIC16/PIC16InstrInfo.cpp index cc1cb88..96858e3 100644 --- a/lib/Target/PIC16/PIC16InstrInfo.cpp +++ b/lib/Target/PIC16/PIC16InstrInfo.cpp @@ -18,6 +18,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "PIC16GenInstrInfo.inc" +#include using namespace llvm; diff --git a/lib/Target/PowerPC/PPCMachOWriterInfo.cpp b/lib/Target/PowerPC/PPCMachOWriterInfo.cpp index b5b71e5..3bfa6d7 100644 --- a/lib/Target/PowerPC/PPCMachOWriterInfo.cpp +++ b/lib/Target/PowerPC/PPCMachOWriterInfo.cpp @@ -16,6 +16,7 @@ #include "PPCTargetMachine.h" #include "llvm/CodeGen/MachORelocation.h" #include "llvm/Support/OutputBuffer.h" +#include using namespace llvm; PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 25b61c1..0e1900c 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -36,6 +36,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include using namespace llvm; STATISTIC(NumGVNInstr, "Number of instructions deleted"); diff --git a/lib/Transforms/Utils/UnrollLoop.cpp b/lib/Transforms/Utils/UnrollLoop.cpp index a86306c..63493dc 100644 --- a/lib/Transforms/Utils/UnrollLoop.cpp +++ b/lib/Transforms/Utils/UnrollLoop.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" +#include using namespace llvm; diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 29a6df0..0dcceac 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -22,6 +22,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm-c/Core.h" #include +#include #include #include using namespace llvm; diff --git a/utils/TableGen/InstrEnumEmitter.cpp b/utils/TableGen/InstrEnumEmitter.cpp index df07119..4b4791b 100644 --- a/utils/TableGen/InstrEnumEmitter.cpp +++ b/utils/TableGen/InstrEnumEmitter.cpp @@ -15,6 +15,7 @@ #include "InstrEnumEmitter.h" #include "CodeGenTarget.h" #include "Record.h" +#include using namespace llvm; // runEnums - Print out enum values for all of the instructions. diff --git a/utils/TableGen/TGLexer.cpp b/utils/TableGen/TGLexer.cpp index a6de239..e7465de 100644 --- a/utils/TableGen/TGLexer.cpp +++ b/utils/TableGen/TGLexer.cpp @@ -17,6 +17,7 @@ #include #include "llvm/Config/config.h" #include +#include #include #include using namespace llvm; From sam at rfc1149.net Tue Oct 7 10:30:43 2008 From: sam at rfc1149.net (Samuel Tardieu) Date: Tue, 07 Oct 2008 17:30:43 +0200 Subject: [llvm-commits] [PATCH] Add missing semicolumns in parser rules Message-ID: <20081007153043.15951.66052.stgit@arrakis.enst.fr> Those missing semicolumns are required to compile with the latest Bison. --- lib/AsmParser/llvmAsmParser.y | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 608ed72..bb4843f 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1296,9 +1296,9 @@ FuncAttr : NORETURN { $$ = Attribute::NoReturn; } | SIGNEXT { $$ = Attribute::SExt; } | READNONE { $$ = Attribute::ReadNone; } | READONLY { $$ = Attribute::ReadOnly; } - | NOINLINE { $$ = Attribute::NoInline } - | ALWAYSINLINE { $$ = Attribute::AlwaysInline } - | OPTSIZE { $$ = Attribute::OptimizeForSize } + | NOINLINE { $$ = Attribute::NoInline; } + | ALWAYSINLINE { $$ = Attribute::AlwaysInline; } + | OPTSIZE { $$ = Attribute::OptimizeForSize; } ; OptFuncAttrs : /* empty */ { $$ = Attribute::None; } From sam at rfc1149.net Tue Oct 7 10:30:48 2008 From: sam at rfc1149.net (Samuel Tardieu) Date: Tue, 07 Oct 2008 17:30:48 +0200 Subject: [llvm-commits] [PATCH] Add parentheses to avoid warnings in GCC 4.4.0 Message-ID: <20081007153048.15951.72507.stgit@arrakis.enst.fr> --- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 6f9893c..8cb5e4f 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3939,7 +3939,7 @@ static bool CollectBSwapParts(Value *V, int OverallLeftShift, uint32_t ByteMask, // X >>u 2 -> collect(X, -2) OverallLeftShift -= ByteShift; ByteMask <<= ByteShift; - ByteMask &= (~0U >> 32-ByteValues.size()); + ByteMask &= (~0U >> (32-ByteValues.size())); } if (OverallLeftShift >= (int)ByteValues.size()) return true; From sam at rfc1149.net Tue Oct 7 10:30:53 2008 From: sam at rfc1149.net (Samuel Tardieu) Date: Tue, 07 Oct 2008 17:30:53 +0200 Subject: [llvm-commits] [PATCH] Use template to distinguish between variants of function Message-ID: <20081007153053.15951.34438.stgit@arrakis.enst.fr> GCC 4.4.0 gives an error on the "int" declaration for example saying that it has already been declared (using the "short" one). Using templates here allow the compiler to distinguish between the function to choose and is, IMO, cleaner. Also, "llvm/Support/DataTypes.h" was not included, leading to error messages about not knowing "uint32_t" for example. --- lib/Target/CellSPU/SPU.h | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/Target/CellSPU/SPU.h b/lib/Target/CellSPU/SPU.h index 2d765b6..776b9bf 100644 --- a/lib/Target/CellSPU/SPU.h +++ b/lib/Target/CellSPU/SPU.h @@ -15,6 +15,7 @@ #ifndef LLVM_TARGET_IBMCELLSPU_H #define LLVM_TARGET_IBMCELLSPU_H +#include "llvm/Support/DataTypes.h" #include namespace llvm { @@ -33,25 +34,33 @@ namespace llvm { This predicate tests for a signed 10-bit value, returning the 10-bit value as a short if true. */ - inline bool isS10Constant(short Value) { + template + inline bool isS10Constant(T Value); + + template<> + inline bool isS10Constant(short Value) { int SExtValue = ((int) Value << (32 - 10)) >> (32 - 10); return ((Value > 0 && Value <= (1 << 9) - 1) || (Value < 0 && (short) SExtValue == Value)); } - inline bool isS10Constant(int Value) { + template<> + inline bool isS10Constant(int Value) { return (Value >= -(1 << 9) && Value <= (1 << 9) - 1); } - inline bool isS10Constant(uint32_t Value) { + template<> + inline bool isS10Constant(uint32_t Value) { return (Value <= ((1 << 9) - 1)); } - inline bool isS10Constant(int64_t Value) { + template<> + inline bool isS10Constant(int64_t Value) { return (Value >= -(1 << 9) && Value <= (1 << 9) - 1); } - inline bool isS10Constant(uint64_t Value) { + template<> + inline bool isS10Constant(uint64_t Value) { return (Value <= ((1 << 9) - 1)); } From clattner at apple.com Tue Oct 7 21:46:30 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 19:46:30 -0700 Subject: [llvm-commits] [llvm] r57262 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td In-Reply-To: <200810072108.m97L897J010946@zion.cs.uiuc.edu> References: <200810072108.m97L897J010946@zion.cs.uiuc.edu> Message-ID: On Oct 7, 2008, at 2:08 PM, Jim Grosbach wrote: > Author: grosbach > Date: Tue Oct 7 16:08:09 2008 > New Revision: 57262 > > URL: http://llvm.org/viewvc/llvm-project?rev=57262&view=rev > Log: > Unconditional branch instruction encoding fix. Needs to use ABI, not > AXI, to get the proper opcode bits. Hi Jim, > +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Oct 7 16:08:09 2008 > @@ -567,7 +567,7 @@ > // B is "predicable" since it can be xformed into a Bcc. > let isBarrier = 1 in { > let isPredicable = 1 in > - def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b > $target", > + def B : ABI<{0,1,0,1}, (outs), (ins brtarget:$target), Branch, > "b $target", > [(br bb:$target)]>; I assume you're changing 0xA to 0,1,0,1 due to an endianness issue? Why not just change the ABI/AXI patterns to do the bit swapping? I'd strongly prefer to have all the instructions (like B) have clear and easy to understand encodings in them. I'd rather push any complexity/ weirdness up into parent tblgen classes. -Chris > > > let isNotDuplicable = 1, isIndirectBranch = 1 in { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Tue Oct 7 23:30:53 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 08 Oct 2008 04:30:53 -0000 Subject: [llvm-commits] [llvm] r57286 - /llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Message-ID: <200810080430.m984Urwc031571@zion.cs.uiuc.edu> Author: resistor Date: Tue Oct 7 23:30:51 2008 New Revision: 57286 URL: http://llvm.org/viewvc/llvm-project?rev=57286&view=rev Log: Fix the case where an instruction is not properly marked as using all registers that alias its inputs. Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=57286&r1=57285&r2=57286&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Tue Oct 7 23:30:51 2008 @@ -575,8 +575,26 @@ // them for later. Also, we have to process these // _before_ processing the defs, since an instr // uses regs before it defs them. - if (MO.isReg() && MO.getReg() && MO.isUse()) + if (MO.isReg() && MO.getReg() && MO.isUse()) { LastUseDef[MO.getReg()] = std::make_pair(I, i); + + + if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) continue; + + const unsigned* subregs = TRI->getAliasSet(MO.getReg()); + if (subregs) { + while (*subregs) { + DenseMap >::iterator + alias = LastUseDef.find(*subregs); + + if (alias != LastUseDef.end() && + alias->second.first != I) + LastUseDef[*subregs] = std::make_pair(I, i); + + ++subregs; + } + } + } } for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { From clattner at apple.com Wed Oct 8 01:25:11 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:25:11 -0700 Subject: [llvm-commits] [llvm] r57226 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsAlpha.td lib/Target/Alpha/AlphaISelDAGToDAG.cpp lib/Target/Alpha/AlphaISelLowering.cpp In-Reply-To: <85dfcd7f0810062227i254c940cvaaa6152c108c55ea@mail.gmail.com> References: <200810070210.m972AUxl026421@zion.cs.uiuc.edu> <1589FB2C-9155-4943-9BEB-B775B11DFCB8@apple.com> <85dfcd7f0810062227i254c940cvaaa6152c108c55ea@mail.gmail.com> Message-ID: <36591249-9EA6-4775-955F-939D56765471@apple.com> On Oct 6, 2008, at 10:27 PM, Andrew Lenharth wrote: > On Mon, Oct 6, 2008 at 11:04 PM, Chris Lattner > wrote: >> >> On Oct 6, 2008, at 7:10 PM, Andrew Lenharth wrote: >> >>> Author: alenhar2 >>> Date: Mon Oct 6 21:10:26 2008 >>> New Revision: 57226 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=57226&view=rev >>> Log: >>> Note that ADDC and company don't actually expand yet (missing in >>> legalize >> >> Hi Andrew, >> >> __builtin_alpha_umulh can be represented with generic LLVM IR (zext >> to i128, >> multiply, shr by 64, truncate to i64). You should get good code >> for that >> sequence already, if not, that's a bug. >> >> Can you just have llvm-gcc expand the builtin like we do for other >> builtins >> supported by LLVM IR? > > I was thinking of doing that, but I hadn't tried to see what kind of > code I got for it. We have the ability to write unit tests for this sort of thing :) $ cat t.ll define i64 @test(i64 %in1, i64 %in2) { %t = zext i64 %in1 to i128 %s = zext i64 %in2 to i128 %u = mul i128 %t, %s %v = lshr i128 %u, 64 %q = trunc i128 %v to i64 ret i64 %q } $ llvm-as < t.ll | llc -march=alpha ... test: ldah $29,0($27) !gpdisp!1 lda $29,0($29) !gpdisp!1 $test..ng: umulh $16,$17,$0 ret $31,($26),1 .end test I'm no alpha guru, but that looks pretty good to me, -Chris From sabre at nondot.org Wed Oct 8 01:26:14 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 08 Oct 2008 06:26:14 -0000 Subject: [llvm-commits] [llvm] r57287 - /llvm/trunk/docs/LangRef.html Message-ID: <200810080626.m986QFDJ002778@zion.cs.uiuc.edu> Author: lattner Date: Wed Oct 8 01:26:11 2008 New Revision: 57287 URL: http://llvm.org/viewvc/llvm-project?rev=57287&view=rev Log: fix typo Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=57287&r1=57286&r2=57287&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Wed Oct 8 01:26:11 2008 @@ -4340,7 +4340,7 @@ %r = call %struct.A @foo() ; yields { 32, i8 } %gr = extractvalue %struct.A %r, 0 ; yields i32 %gr1 = extractvalue %struct.A %r, 1 ; yields i8 - %Z = call void @foo() noreturn ; indicates that %foo never returns nomrally + %Z = call void @foo() noreturn ; indicates that %foo never returns normally %ZZ = call zeroext i32 @bar() ; Return value is %zero extended From clattner at apple.com Wed Oct 8 01:28:05 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:28:05 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r57244 - /llvm-gcc-4.2/trunk/gcc/config/alpha/llvm-alpha.cpp In-Reply-To: <200810071441.m97Ef5A6029697@zion.cs.uiuc.edu> References: <200810071441.m97Ef5A6029697@zion.cs.uiuc.edu> Message-ID: On Oct 7, 2008, at 7:41 AM, Andrew Lenharth wrote: > Author: alenhar2 > Date: Tue Oct 7 09:41:03 2008 > New Revision: 57244 > > URL: http://llvm.org/viewvc/llvm-project?rev=57244&view=rev > Log: > expand to llmv IR Thanks Andrew! -Chris From clattner at apple.com Wed Oct 8 01:34:20 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:34:20 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> Message-ID: <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> On Oct 7, 2008, at 2:29 PM, Evan Cheng wrote: >>>> We could fix it, but on the other hand it's arguably sloppy for >>>> instruction selectors to not precisely describe their physical >>>> register uses. >>> >>> I agree. In this case DVI8r should say it defines AL, AH and uses >>> AL, >>> AH which makes it clear it reads 2 values and outputs 2. >> >> No, it reads 1 value and outputs two. It is not the same as DIV16 >> and >> DIV32. >> The way I have it matches Intel docs. > > Ok. It's good to match what Intel manual says. But that's additional > goodness. Previously DIV16r is marked as using AL, AH and the implicit > use is copied to AX. While this is not ideal, it's not incorrect. > Local liveness cannot mark AX as dead. To put it another way, it looks like (as Dale said) both changes are useful. The change to make div more closely follow the docs is useful on its own merits, but the local RA should still be fixed. -Chris From clattner at apple.com Wed Oct 8 01:36:38 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:36:38 -0700 Subject: [llvm-commits] [llvm] r57258 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrInfo.h In-Reply-To: <200810071905.m97J5aEk006788@zion.cs.uiuc.edu> References: <200810071905.m97J5aEk006788@zion.cs.uiuc.edu> Message-ID: <7376E2D8-3214-422B-BF37-EE386E2BBF06@apple.com> On Oct 7, 2008, at 12:05 PM, Jim Grosbach wrote: > Author: grosbach > Date: Tue Oct 7 14:05:35 2008 > New Revision: 57258 > > URL: http://llvm.org/viewvc/llvm-project?rev=57258&view=rev > Log: > Encode the conditional execution predicate when JITing. Ok, > +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Oct 7 14:05:35 > 2008 > @@ -256,8 +256,8 @@ > unsigned ARMCodeEmitter::getAddrModeNoneInstrBinary(const > MachineInstr &MI, > const > TargetInstrDesc &TID, > unsigned Binary) { > - // FIXME: Assume CC is AL for now. > - Binary |= ARMCC::AL << 28; > + // Set the conditional execution predicate > + Binary |= II->getPredicate(&MI) << 28; This makes the assumption that the ARMCC::CondCodes enums follows exactly with the encodings used by the ARM instruction set. THis is a reasonable thing, but is a new requirement. Please put a comment above the CondCodes enum that points out that the numbering *must* follow the ISA. Thanks Jim, -Chris From clattner at apple.com Wed Oct 8 01:40:37 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:40:37 -0700 Subject: [llvm-commits] PR2765 Patch In-Reply-To: <20081007210248.GP6091@katherina.student.utwente.nl> References: <85dfcd7f0810071020w4a0cf3b7vb3fc21e90867c346@mail.gmail.com> <20081007210248.GP6091@katherina.student.utwente.nl> Message-ID: <48A2DBF8-8B60-4242-A364-6DF89C32D248@apple.com> On Oct 7, 2008, at 2:02 PM, Matthijs Kooijman wrote: > Hi Andrew, > >> + for (Function::const_arg_iterator I = OldFunc->arg_begin(), >> + E = OldFunc->arg_end(); I != E; ++I) >> + if (Argument* Anew = dyn_cast(ValueMap[I])) > What does ValueMap[I] return when the argument is removed? I would > expect > NULL, but in that case you should be using dyn_cast_or_null IIRC? This should be fine. If the argument is removed, any uses of it have to be remapped to something (e.g. a constant or some other expression). Arguments all must be in the map. -Chris From sabre at nondot.org Wed Oct 8 01:42:28 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 08 Oct 2008 06:42:28 -0000 Subject: [llvm-commits] [llvm] r57288 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200810080642.m986gTAv003271@zion.cs.uiuc.edu> Author: lattner Date: Wed Oct 8 01:42:28 2008 New Revision: 57288 URL: http://llvm.org/viewvc/llvm-project?rev=57288&view=rev Log: Add parentheses to avoid warnings in GCC 4.4.0, patch by Samuel Tardieu! Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=57288&r1=57287&r2=57288&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Oct 8 01:42:28 2008 @@ -3939,7 +3939,7 @@ // X >>u 2 -> collect(X, -2) OverallLeftShift -= ByteShift; ByteMask <<= ByteShift; - ByteMask &= (~0U >> 32-ByteValues.size()); + ByteMask &= (~0U >> (32-ByteValues.size())); } if (OverallLeftShift >= (int)ByteValues.size()) return true; From clattner at apple.com Wed Oct 8 01:42:50 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:42:50 -0700 Subject: [llvm-commits] [PATCH] Add parentheses to avoid warnings in GCC 4.4.0 In-Reply-To: <20081007153048.15951.72507.stgit@arrakis.enst.fr> References: <20081007153048.15951.72507.stgit@arrakis.enst.fr> Message-ID: <58C9BBFC-59B1-467F-B6BA-91ABB749579B@apple.com> Applied, thanks! http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20081006/068238.html On Oct 7, 2008, at 8:30 AM, Samuel Tardieu wrote: > > --- > lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/ > Transforms/Scalar/InstructionCombining.cpp > index 6f9893c..8cb5e4f 100644 > --- a/lib/Transforms/Scalar/InstructionCombining.cpp > +++ b/lib/Transforms/Scalar/InstructionCombining.cpp > @@ -3939,7 +3939,7 @@ static bool CollectBSwapParts(Value *V, int > OverallLeftShift, uint32_t ByteMask, > // X >>u 2 -> collect(X, -2) > OverallLeftShift -= ByteShift; > ByteMask <<= ByteShift; > - ByteMask &= (~0U >> 32-ByteValues.size()); > + ByteMask &= (~0U >> (32-ByteValues.size())); > } > > if (OverallLeftShift >= (int)ByteValues.size()) return true; > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From sabre at nondot.org Wed Oct 8 01:44:36 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 08 Oct 2008 06:44:36 -0000 Subject: [llvm-commits] [llvm] r57289 - /llvm/trunk/lib/AsmParser/llvmAsmParser.y Message-ID: <200810080644.m986ia8B003353@zion.cs.uiuc.edu> Author: lattner Date: Wed Oct 8 01:44:36 2008 New Revision: 57289 URL: http://llvm.org/viewvc/llvm-project?rev=57289&view=rev Log: Add missing semicolumns in parser rules, those missing semicolumns are required to compile with the latest Bison. Patch by Samuel Tardieu! Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=57289&r1=57288&r2=57289&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Wed Oct 8 01:44:36 2008 @@ -1296,9 +1296,9 @@ | SIGNEXT { $$ = Attribute::SExt; } | READNONE { $$ = Attribute::ReadNone; } | READONLY { $$ = Attribute::ReadOnly; } - | NOINLINE { $$ = Attribute::NoInline } - | ALWAYSINLINE { $$ = Attribute::AlwaysInline } - | OPTSIZE { $$ = Attribute::OptimizeForSize } + | NOINLINE { $$ = Attribute::NoInline; } + | ALWAYSINLINE { $$ = Attribute::AlwaysInline; } + | OPTSIZE { $$ = Attribute::OptimizeForSize; } ; OptFuncAttrs : /* empty */ { $$ = Attribute::None; } From sabre at nondot.org Wed Oct 8 01:44:45 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 08 Oct 2008 06:44:45 -0000 Subject: [llvm-commits] [llvm] r57290 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200810080644.m986iktG003368@zion.cs.uiuc.edu> Author: lattner Date: Wed Oct 8 01:44:45 2008 New Revision: 57290 URL: http://llvm.org/viewvc/llvm-project?rev=57290&view=rev Log: regenerate Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=57290&r1=57289&r2=57290&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Wed Oct 8 01:44:45 2008 @@ -394,7 +394,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1375,7 +1375,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 974 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1423,7 +1423,7 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } -/* Line 187 of yacc.c. */ +/* Line 193 of yacc.c. */ #line 1428 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -1487,7 +1487,7 @@ #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -2920,7 +2920,7 @@ we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -3661,152 +3661,152 @@ switch (yyn) { case 29: -#line 1146 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1146 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1147 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1147 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1148 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1148 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1149 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1149 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1171 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1178 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3814,7 +3814,7 @@ break; case 69: -#line 1182 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3822,7 +3822,7 @@ break; case 70: -#line 1187 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3830,7 +3830,7 @@ break; case 74: -#line 1196 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3838,7 +3838,7 @@ break; case 75: -#line 1201 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3846,157 +3846,157 @@ break; case 76: -#line 1207 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 77: -#line 1208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 78: -#line 1209 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 79: -#line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 80: -#line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 81: -#line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 82: -#line 1216 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 83: -#line 1217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 84: -#line 1218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 85: -#line 1222 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 87: -#line 1224 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 88: -#line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 89: -#line 1229 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 90: -#line 1230 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 91: -#line 1231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 92: -#line 1235 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 93: -#line 1236 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1236 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1237 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 95: -#line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 96: -#line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 97: -#line 1243 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 98: -#line 1244 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 99: -#line 1245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 100: -#line 1248 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1249 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 102: -#line 1250 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 103: -#line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 104: -#line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 105: -#line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 106: -#line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -4006,176 +4006,176 @@ break; case 107: -#line 1261 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 108: -#line 1262 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 109: -#line 1263 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 110: -#line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 111: -#line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 112: -#line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::StructRet; ;} break; case 113: -#line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoAlias; ;} break; case 114: -#line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ByVal; ;} break; case 115: -#line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::Nest; ;} break; case 116: -#line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 117: -#line 1274 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 118: -#line 1275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 119: -#line 1280 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 120: -#line 1281 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 121: -#line 1282 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 122: -#line 1285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 123: -#line 1286 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 124: -#line 1292 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoReturn; ;} break; case 125: -#line 1293 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoUnwind; ;} break; case 126: -#line 1294 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 127: -#line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 128: -#line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1296 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 129: -#line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadNone; ;} break; case 130: -#line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadOnly; ;} break; case 131: -#line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Attributes) = Attribute::NoInline ;} +#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Attributes) = Attribute::NoInline; ;} break; case 132: -#line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Attributes) = Attribute::AlwaysInline ;} +#line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Attributes) = Attribute::AlwaysInline; ;} break; case 133: -#line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Attributes) = Attribute::OptimizeForSize ;} +#line 1301 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Attributes) = Attribute::OptimizeForSize; ;} break; case 134: -#line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 135: -#line 1305 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 136: -#line 1311 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 137: -#line 1312 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1312 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 138: -#line 1319 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 139: -#line 1320 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4185,12 +4185,12 @@ break; case 140: -#line 1326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 141: -#line 1327 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1327 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4200,7 +4200,7 @@ break; case 142: -#line 1336 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4211,27 +4211,27 @@ break; case 143: -#line 1344 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1344 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 144: -#line 1345 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1345 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 145: -#line 1350 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1350 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 146: -#line 1351 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1351 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 147: -#line 1352 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1352 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4240,7 +4240,7 @@ break; case 148: -#line 1357 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4250,7 +4250,7 @@ break; case 156: -#line 1373 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1373 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4258,7 +4258,7 @@ break; case 157: -#line 1377 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4266,7 +4266,7 @@ break; case 158: -#line 1381 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1381 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4277,7 +4277,7 @@ break; case 159: -#line 1388 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1388 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4286,7 +4286,7 @@ break; case 160: -#line 1393 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1393 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4298,7 +4298,7 @@ break; case 161: -#line 1401 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1401 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4337,7 +4337,7 @@ break; case 162: -#line 1436 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4371,7 +4371,7 @@ break; case 163: -#line 1467 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1467 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4380,7 +4380,7 @@ break; case 164: -#line 1472 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1472 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4394,7 +4394,7 @@ break; case 165: -#line 1482 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4408,7 +4408,7 @@ break; case 166: -#line 1492 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4416,7 +4416,7 @@ break; case 167: -#line 1496 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4430,7 +4430,7 @@ break; case 168: -#line 1506 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1506 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4438,7 +4438,7 @@ break; case 169: -#line 1513 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1513 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4448,7 +4448,7 @@ break; case 170: -#line 1522 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4459,14 +4459,14 @@ break; case 171: -#line 1529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 172: -#line 1534 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1534 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4475,7 +4475,7 @@ break; case 173: -#line 1539 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1539 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4483,7 +4483,7 @@ break; case 175: -#line 1547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1547 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4494,7 +4494,7 @@ break; case 176: -#line 1554 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1554 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4505,7 +4505,7 @@ break; case 177: -#line 1561 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1561 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4513,7 +4513,7 @@ break; case 178: -#line 1569 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1569 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4523,7 +4523,7 @@ break; case 179: -#line 1575 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1575 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4532,7 +4532,7 @@ break; case 180: -#line 1587 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1587 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4564,7 +4564,7 @@ break; case 181: -#line 1615 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1615 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4584,7 +4584,7 @@ break; case 182: -#line 1631 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1631 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4615,7 +4615,7 @@ break; case 183: -#line 1658 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1658 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4647,7 +4647,7 @@ break; case 184: -#line 1686 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1686 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4677,7 +4677,7 @@ break; case 185: -#line 1712 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1712 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4701,7 +4701,7 @@ break; case 186: -#line 1732 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4731,7 +4731,7 @@ break; case 187: -#line 1758 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1758 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4755,7 +4755,7 @@ break; case 188: -#line 1778 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1778 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4771,7 +4771,7 @@ break; case 189: -#line 1790 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1790 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4782,7 +4782,7 @@ break; case 190: -#line 1797 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1797 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4852,7 +4852,7 @@ break; case 191: -#line 1863 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4866,7 +4866,7 @@ break; case 192: -#line 1873 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4880,7 +4880,7 @@ break; case 193: -#line 1883 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4890,7 +4890,7 @@ break; case 194: -#line 1889 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1889 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4904,7 +4904,7 @@ break; case 195: -#line 1899 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1899 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4914,7 +4914,7 @@ break; case 196: -#line 1905 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1905 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4928,7 +4928,7 @@ break; case 197: -#line 1915 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant true must have type i1"); @@ -4938,7 +4938,7 @@ break; case 198: -#line 1921 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant false must have type i1"); @@ -4948,7 +4948,7 @@ break; case 199: -#line 1927 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4963,7 +4963,7 @@ break; case 200: -#line 1940 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1940 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4979,7 +4979,7 @@ break; case 201: -#line 1952 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1952 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -5004,7 +5004,7 @@ break; case 202: -#line 1973 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1973 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -5016,7 +5016,7 @@ break; case 203: -#line 1981 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -5026,7 +5026,7 @@ break; case 204: -#line 1987 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -5041,7 +5041,7 @@ break; case 205: -#line 1998 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1998 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -5050,7 +5050,7 @@ break; case 206: -#line 2003 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2003 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -5059,7 +5059,7 @@ break; case 207: -#line 2008 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2008 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -5068,7 +5068,7 @@ break; case 208: -#line 2013 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2013 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -5077,7 +5077,7 @@ break; case 209: -#line 2018 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2018 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5087,7 +5087,7 @@ break; case 210: -#line 2024 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5097,7 +5097,7 @@ break; case 211: -#line 2030 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5107,7 +5107,7 @@ break; case 212: -#line 2036 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5119,7 +5119,7 @@ break; case 213: -#line 2044 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5131,7 +5131,7 @@ break; case 214: -#line 2055 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5139,7 +5139,7 @@ break; case 215: -#line 2059 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5148,27 +5148,27 @@ break; case 216: -#line 2067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 217: -#line 2067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 218: -#line 2070 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 219: -#line 2070 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 220: -#line 2073 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2073 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5184,7 +5184,7 @@ break; case 221: -#line 2085 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5200,7 +5200,7 @@ break; case 222: -#line 2106 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5209,7 +5209,7 @@ break; case 223: -#line 2111 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5218,12 +5218,12 @@ break; case 226: -#line 2124 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 227: -#line 2124 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5231,26 +5231,26 @@ break; case 228: -#line 2128 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 229: -#line 2128 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 230: -#line 2131 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 231: -#line 2134 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5278,7 +5278,7 @@ break; case 232: -#line 2158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5293,7 +5293,7 @@ break; case 233: -#line 2170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5305,14 +5305,14 @@ break; case 234: -#line 2177 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2177 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 235: -#line 2181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5322,14 +5322,14 @@ break; case 236: -#line 2186 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2186 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 237: -#line 2190 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5340,7 +5340,7 @@ break; case 238: -#line 2196 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5348,7 +5348,7 @@ break; case 239: -#line 2200 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5392,21 +5392,21 @@ break; case 240: -#line 2240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 241: -#line 2243 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 242: -#line 2249 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5419,7 +5419,7 @@ break; case 243: -#line 2259 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5427,7 +5427,7 @@ break; case 244: -#line 2263 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5435,7 +5435,7 @@ break; case 246: -#line 2270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5444,7 +5444,7 @@ break; case 247: -#line 2275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5453,14 +5453,14 @@ break; case 248: -#line 2280 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 249: -#line 2289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5474,7 +5474,7 @@ break; case 250: -#line 2299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5488,7 +5488,7 @@ break; case 251: -#line 2310 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2310 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5496,7 +5496,7 @@ break; case 252: -#line 2314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2314 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5509,7 +5509,7 @@ break; case 253: -#line 2323 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2323 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5522,7 +5522,7 @@ break; case 254: -#line 2332 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2332 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5530,7 +5530,7 @@ break; case 255: -#line 2338 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2338 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(4) - (11)].StrVal)); delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory! @@ -5681,7 +5681,7 @@ break; case 258: -#line 2488 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5693,7 +5693,7 @@ break; case 261: -#line 2499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2499 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5701,7 +5701,7 @@ break; case 262: -#line 2504 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5712,7 +5712,7 @@ break; case 263: -#line 2516 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2516 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5720,7 +5720,7 @@ break; case 264: -#line 2520 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2520 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5728,7 +5728,7 @@ break; case 265: -#line 2525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2525 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5736,7 +5736,7 @@ break; case 266: -#line 2529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5744,7 +5744,7 @@ break; case 267: -#line 2533 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2533 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5753,7 +5753,7 @@ break; case 268: -#line 2538 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2538 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5762,7 +5762,7 @@ break; case 269: -#line 2543 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2543 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5770,7 +5770,7 @@ break; case 270: -#line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2547 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5778,7 +5778,7 @@ break; case 271: -#line 2551 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5786,7 +5786,7 @@ break; case 272: -#line 2555 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2555 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5794,7 +5794,7 @@ break; case 273: -#line 2559 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5802,7 +5802,7 @@ break; case 274: -#line 2563 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2563 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5810,7 +5810,7 @@ break; case 275: -#line 2567 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5836,7 +5836,7 @@ break; case 276: -#line 2589 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2589 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5862,7 +5862,7 @@ break; case 277: -#line 2611 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2611 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5872,7 +5872,7 @@ break; case 278: -#line 2617 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5889,7 +5889,7 @@ break; case 279: -#line 2630 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2630 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5905,7 +5905,7 @@ break; case 280: -#line 2642 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2642 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5914,7 +5914,7 @@ break; case 281: -#line 2647 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2647 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5930,7 +5930,7 @@ break; case 282: -#line 2659 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2659 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5940,7 +5940,7 @@ break; case 283: -#line 2665 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2665 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5948,7 +5948,7 @@ break; case 284: -#line 2669 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5958,7 +5958,7 @@ break; case 285: -#line 2679 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2679 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5966,7 +5966,7 @@ break; case 286: -#line 2683 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2683 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5974,7 +5974,7 @@ break; case 287: -#line 2687 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2687 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5983,7 +5983,7 @@ break; case 288: -#line 2692 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5992,7 +5992,7 @@ break; case 291: -#line 2705 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2705 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -6003,7 +6003,7 @@ break; case 292: -#line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -6012,7 +6012,7 @@ break; case 293: -#line 2719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2719 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -6020,7 +6020,7 @@ break; case 294: -#line 2724 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2724 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6028,7 +6028,7 @@ break; case 295: -#line 2728 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2728 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6036,7 +6036,7 @@ break; case 296: -#line 2737 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2737 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -6048,7 +6048,7 @@ break; case 297: -#line 2746 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -6063,7 +6063,7 @@ break; case 298: -#line 2759 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2759 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -6076,7 +6076,7 @@ break; case 299: -#line 2768 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2768 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -6084,7 +6084,7 @@ break; case 300: -#line 2772 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2772 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -6094,7 +6094,7 @@ break; case 301: -#line 2780 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6118,7 +6118,7 @@ break; case 302: -#line 2800 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2800 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -6126,7 +6126,7 @@ break; case 303: -#line 2804 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2804 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6135,7 +6135,7 @@ break; case 304: -#line 2809 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2809 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6150,7 +6150,7 @@ break; case 305: -#line 2820 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6173,7 +6173,7 @@ break; case 306: -#line 2839 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2839 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6186,7 +6186,7 @@ break; case 307: -#line 2849 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6293,7 +6293,7 @@ break; case 308: -#line 2952 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2952 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6301,7 +6301,7 @@ break; case 309: -#line 2956 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2956 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6309,7 +6309,7 @@ break; case 310: -#line 2963 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2963 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6324,7 +6324,7 @@ break; case 311: -#line 2974 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6340,7 +6340,7 @@ break; case 312: -#line 2987 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6352,7 +6352,7 @@ break; case 313: -#line 2996 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6367,7 +6367,7 @@ break; case 314: -#line 3009 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3009 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6382,7 +6382,7 @@ break; case 315: -#line 3020 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3020 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6394,7 +6394,7 @@ break; case 316: -#line 3030 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6409,7 +6409,7 @@ break; case 317: -#line 3041 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6421,7 +6421,7 @@ break; case 318: -#line 3049 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6435,7 +6435,7 @@ break; case 319: -#line 3059 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6446,17 +6446,17 @@ break; case 320: -#line 3066 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 321: -#line 3069 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3069 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 322: -#line 3070 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6465,7 +6465,7 @@ break; case 323: -#line 3078 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3078 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6475,7 +6475,7 @@ break; case 324: -#line 3084 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3084 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6486,7 +6486,7 @@ break; case 325: -#line 3093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3093 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6494,7 +6494,7 @@ break; case 326: -#line 3097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3097 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6502,7 +6502,7 @@ break; case 327: -#line 3102 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3102 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6522,7 +6522,7 @@ break; case 328: -#line 3118 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6543,7 +6543,7 @@ break; case 329: -#line 3135 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3135 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6559,7 +6559,7 @@ break; case 330: -#line 3147 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6575,7 +6575,7 @@ break; case 331: -#line 3159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6593,7 +6593,7 @@ break; case 332: -#line 3173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6611,7 +6611,7 @@ break; case 333: -#line 3187 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6627,7 +6627,7 @@ break; case 334: -#line 3199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (isa((yyvsp[(2) - (6)].ValueVal)->getType())) { // vector select @@ -6652,7 +6652,7 @@ break; case 335: -#line 3220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6663,7 +6663,7 @@ break; case 336: -#line 3227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6673,7 +6673,7 @@ break; case 337: -#line 3233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6683,7 +6683,7 @@ break; case 338: -#line 3239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6693,7 +6693,7 @@ break; case 339: -#line 3245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6712,7 +6712,7 @@ break; case 340: -#line 3261 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6825,7 +6825,7 @@ break; case 341: -#line 3370 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR @@ -6833,7 +6833,7 @@ break; case 342: -#line 3375 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3375 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6841,7 +6841,7 @@ break; case 343: -#line 3379 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3379 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6849,7 +6849,7 @@ break; case 344: -#line 3386 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3386 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6860,7 +6860,7 @@ break; case 345: -#line 3393 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3393 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6874,7 +6874,7 @@ break; case 346: -#line 3403 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3403 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6885,7 +6885,7 @@ break; case 347: -#line 3410 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3410 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6899,7 +6899,7 @@ break; case 348: -#line 3420 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3420 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6910,7 +6910,7 @@ break; case 349: -#line 3428 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3428 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6928,7 +6928,7 @@ break; case 350: -#line 3442 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3442 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6949,7 +6949,7 @@ break; case 351: -#line 3459 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3459 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6967,7 +6967,7 @@ break; case 352: -#line 3473 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6986,7 +6986,7 @@ break; case 353: -#line 3488 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -7005,7 +7005,7 @@ break; case 354: -#line 3503 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3503 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -7241,7 +7241,7 @@ } -#line 3522 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=57290&r1=57289&r2=57290&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Wed Oct 8 01:44:45 2008 @@ -360,7 +360,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 974 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +#line 974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -408,7 +408,7 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } -/* Line 1489 of yacc.c. */ +/* Line 1529 of yacc.c. */ #line 413 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=57290&r1=57289&r2=57290&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Wed Oct 8 01:44:45 2008 @@ -1296,9 +1296,9 @@ | SIGNEXT { $$ = Attribute::SExt; } | READNONE { $$ = Attribute::ReadNone; } | READONLY { $$ = Attribute::ReadOnly; } - | NOINLINE { $$ = Attribute::NoInline } - | ALWAYSINLINE { $$ = Attribute::AlwaysInline } - | OPTSIZE { $$ = Attribute::OptimizeForSize } + | NOINLINE { $$ = Attribute::NoInline; } + | ALWAYSINLINE { $$ = Attribute::AlwaysInline; } + | OPTSIZE { $$ = Attribute::OptimizeForSize; } ; OptFuncAttrs : /* empty */ { $$ = Attribute::None; } From clattner at apple.com Wed Oct 8 01:45:06 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:45:06 -0700 Subject: [llvm-commits] [PATCH] Add missing semicolumns in parser rules In-Reply-To: <20081007153043.15951.66052.stgit@arrakis.enst.fr> References: <20081007153043.15951.66052.stgit@arrakis.enst.fr> Message-ID: Applied, thanks! http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20081006/068240.html http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20081006/068241.html -Chris On Oct 7, 2008, at 8:30 AM, Samuel Tardieu wrote: > Those missing semicolumns are required to compile with the latest > Bison. > --- > lib/AsmParser/llvmAsmParser.y | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/ > llvmAsmParser.y > index 608ed72..bb4843f 100644 > --- a/lib/AsmParser/llvmAsmParser.y > +++ b/lib/AsmParser/llvmAsmParser.y > @@ -1296,9 +1296,9 @@ FuncAttr : NORETURN { $$ = > Attribute::NoReturn; } > | SIGNEXT { $$ = Attribute::SExt; } > | READNONE { $$ = Attribute::ReadNone; } > | READONLY { $$ = Attribute::ReadOnly; } > - | NOINLINE { $$ = Attribute::NoInline } > - | ALWAYSINLINE { $$ = Attribute::AlwaysInline } > - | OPTSIZE { $$ = Attribute::OptimizeForSize } > + | NOINLINE { $$ = Attribute::NoInline; } > + | ALWAYSINLINE { $$ = Attribute::AlwaysInline; } > + | OPTSIZE { $$ = Attribute::OptimizeForSize; } > ; > > OptFuncAttrs : /* empty */ { $$ = Attribute::None; } > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From clattner at apple.com Wed Oct 8 01:47:08 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 7 Oct 2008 23:47:08 -0700 Subject: [llvm-commits] [PATCH] Use template to distinguish between variants of function In-Reply-To: <20081007153053.15951.34438.stgit@arrakis.enst.fr> References: <20081007153053.15951.34438.stgit@arrakis.enst.fr> Message-ID: On Oct 7, 2008, at 8:30 AM, Samuel Tardieu wrote: > GCC 4.4.0 gives an error on the "int" declaration for example > saying that it has already been declared (using the "short" > one). Using templates here allow the compiler to distinguish > between the function to choose and is, IMO, cleaner. Ok, this seems reasonable. However, it and hte patches are less trivial than the other ones, so I can't apply them manually. Please regenerate the patch and send them as attachments to the email, thanks Samuel! -Chris From baldrick at free.fr Wed Oct 8 02:23:51 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 08 Oct 2008 07:23:51 -0000 Subject: [llvm-commits] [llvm] r57291 - in /llvm/trunk: lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp lib/ExecutionEngine/JIT/JITMemoryManager.cpp lib/System/DynamicLibrary.cpp lib/Target/PIC16/PIC16InstrInfo.cpp lib/Target/PowerPC/PPCMachOWriterInfo.cpp lib/Transforms/Scalar/GVN.cpp lib/Transforms/Utils/UnrollLoop.cpp lib/VMCore/PassManager.cpp utils/TableGen/InstrEnumEmitter.cpp utils/TableGen/TGLexer.cpp Message-ID: <200810080723.m987Nqle004705@zion.cs.uiuc.edu> Author: baldrick Date: Wed Oct 8 02:23:46 2008 New Revision: 57291 URL: http://llvm.org/viewvc/llvm-project?rev=57291&view=rev Log: Add include where needed by gcc-4.4. Patch by Samuel Tardieu. Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp llvm/trunk/lib/System/DynamicLibrary.cpp llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp llvm/trunk/lib/Target/PowerPC/PPCMachOWriterInfo.cpp llvm/trunk/lib/Transforms/Scalar/GVN.cpp llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp llvm/trunk/lib/VMCore/PassManager.cpp llvm/trunk/utils/TableGen/InstrEnumEmitter.cpp llvm/trunk/utils/TableGen/TGLexer.cpp Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Wed Oct 8 02:23:46 2008 @@ -27,6 +27,7 @@ #include "llvm/Target/TargetData.h" #include "llvm/Support/ManagedStatic.h" #include +#include #include #include #include Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Wed Oct 8 02:23:46 2008 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include using namespace llvm; Modified: llvm/trunk/lib/System/DynamicLibrary.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/DynamicLibrary.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/System/DynamicLibrary.cpp (original) +++ llvm/trunk/lib/System/DynamicLibrary.cpp Wed Oct 8 02:23:46 2008 @@ -13,6 +13,7 @@ #include "llvm/System/DynamicLibrary.h" #include "llvm/Config/config.h" +#include #include #include Modified: llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/PIC16/PIC16InstrInfo.cpp Wed Oct 8 02:23:46 2008 @@ -18,6 +18,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "PIC16GenInstrInfo.inc" +#include using namespace llvm; Modified: llvm/trunk/lib/Target/PowerPC/PPCMachOWriterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCMachOWriterInfo.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCMachOWriterInfo.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCMachOWriterInfo.cpp Wed Oct 8 02:23:46 2008 @@ -16,6 +16,7 @@ #include "PPCTargetMachine.h" #include "llvm/CodeGen/MachORelocation.h" #include "llvm/Support/OutputBuffer.h" +#include using namespace llvm; PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM) Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Oct 8 02:23:46 2008 @@ -36,6 +36,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include using namespace llvm; STATISTIC(NumGVNInstr, "Number of instructions deleted"); Modified: llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/UnrollLoop.cpp Wed Oct 8 02:23:46 2008 @@ -27,6 +27,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Local.h" +#include using namespace llvm; Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Wed Oct 8 02:23:46 2008 @@ -22,6 +22,7 @@ #include "llvm/Analysis/Dominators.h" #include "llvm-c/Core.h" #include +#include #include #include using namespace llvm; Modified: llvm/trunk/utils/TableGen/InstrEnumEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/InstrEnumEmitter.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/InstrEnumEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/InstrEnumEmitter.cpp Wed Oct 8 02:23:46 2008 @@ -15,6 +15,7 @@ #include "InstrEnumEmitter.h" #include "CodeGenTarget.h" #include "Record.h" +#include using namespace llvm; // runEnums - Print out enum values for all of the instructions. Modified: llvm/trunk/utils/TableGen/TGLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/TGLexer.cpp?rev=57291&r1=57290&r2=57291&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/TGLexer.cpp (original) +++ llvm/trunk/utils/TableGen/TGLexer.cpp Wed Oct 8 02:23:46 2008 @@ -17,6 +17,7 @@ #include #include "llvm/Config/config.h" #include +#include #include #include using namespace llvm; From baldrick at free.fr Wed Oct 8 02:44:54 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 08 Oct 2008 07:44:54 -0000 Subject: [llvm-commits] [llvm] r57292 - /llvm/trunk/lib/Target/CellSPU/SPU.h Message-ID: <200810080744.m987issA008954@zion.cs.uiuc.edu> Author: baldrick Date: Wed Oct 8 02:44:52 2008 New Revision: 57292 URL: http://llvm.org/viewvc/llvm-project?rev=57292&view=rev Log: Use template to distinguish between function variants. GCC 4.4.0 gives an error on the "int" declaration for example saying that it has already been declared (using the "short" one). Using templates here allow the compiler to distinguish between the function to choose. Also, "llvm/Support/DataTypes.h" was not included, leading to error messages about not knowing "uint32_t" for example. Patch by Samuel Tardieu. Modified: llvm/trunk/lib/Target/CellSPU/SPU.h Modified: llvm/trunk/lib/Target/CellSPU/SPU.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPU.h?rev=57292&r1=57291&r2=57292&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPU.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPU.h Wed Oct 8 02:44:52 2008 @@ -15,6 +15,7 @@ #ifndef LLVM_TARGET_IBMCELLSPU_H #define LLVM_TARGET_IBMCELLSPU_H +#include "llvm/Support/DataTypes.h" #include namespace llvm { @@ -33,25 +34,33 @@ This predicate tests for a signed 10-bit value, returning the 10-bit value as a short if true. */ - inline bool isS10Constant(short Value) { + template + inline bool isS10Constant(T Value); + + template<> + inline bool isS10Constant(short Value) { int SExtValue = ((int) Value << (32 - 10)) >> (32 - 10); return ((Value > 0 && Value <= (1 << 9) - 1) || (Value < 0 && (short) SExtValue == Value)); } - inline bool isS10Constant(int Value) { + template<> + inline bool isS10Constant(int Value) { return (Value >= -(1 << 9) && Value <= (1 << 9) - 1); } - inline bool isS10Constant(uint32_t Value) { + template<> + inline bool isS10Constant(uint32_t Value) { return (Value <= ((1 << 9) - 1)); } - inline bool isS10Constant(int64_t Value) { + template<> + inline bool isS10Constant(int64_t Value) { return (Value >= -(1 << 9) && Value <= (1 << 9) - 1); } - inline bool isS10Constant(uint64_t Value) { + template<> + inline bool isS10Constant(uint64_t Value) { return (Value <= ((1 << 9) - 1)); } From baldrick at free.fr Wed Oct 8 02:49:41 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 8 Oct 2008 09:49:41 +0200 Subject: [llvm-commits] [PATCH] Add include where needed In-Reply-To: <20081007153038.15951.75226.stgit@arrakis.enst.fr> References: <20081007153038.15951.75226.stgit@arrakis.enst.fr> Message-ID: <200810080949.41713.baldrick@free.fr> On Tuesday 07 October 2008 17:30:38 Samuel Tardieu wrote: > This is needed to get "stderr", "EOF", "sprintf", and so on. > GCC 4.4.0 cannot compile LLVM without that in Release mode. I applied this - thanks! Ciao, Duncan. From baldrick at free.fr Wed Oct 8 02:50:02 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 8 Oct 2008 09:50:02 +0200 Subject: [llvm-commits] [PATCH] Use template to distinguish between variants of function In-Reply-To: <20081007153053.15951.34438.stgit@arrakis.enst.fr> References: <20081007153053.15951.34438.stgit@arrakis.enst.fr> Message-ID: <200810080950.02551.baldrick@free.fr> On Tuesday 07 October 2008 17:30:53 Samuel Tardieu wrote: > GCC 4.4.0 gives an error on the "int" declaration for example > saying that it has already been declared (using the "short" > one). Using templates here allow the compiler to distinguish > between the function to choose and is, IMO, cleaner. I applied this - thanks! Ciao, Duncan. From evan.cheng at apple.com Wed Oct 8 04:49:16 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 8 Oct 2008 02:49:16 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> Message-ID: <7ABE9A1A-148A-4037-A749-3E918EA4665B@apple.com> Yes, Owen is working on fixing (or rather has fixed) local RA. Evan On Oct 7, 2008, at 11:34 PM, Chris Lattner wrote: > On Oct 7, 2008, at 2:29 PM, Evan Cheng wrote: >>>>> We could fix it, but on the other hand it's arguably sloppy for >>>>> instruction selectors to not precisely describe their physical >>>>> register uses. >>>> >>>> I agree. In this case DVI8r should say it defines AL, AH and uses >>>> AL, >>>> AH which makes it clear it reads 2 values and outputs 2. >>> >>> No, it reads 1 value and outputs two. It is not the same as DIV16 >>> and >>> DIV32. >>> The way I have it matches Intel docs. >> >> Ok. It's good to match what Intel manual says. But that's additional >> goodness. Previously DIV16r is marked as using AL, AH and the >> implicit >> use is copied to AX. While this is not ideal, it's not incorrect. >> Local liveness cannot mark AX as dead. > > To put it another way, it looks like (as Dale said) both changes are > useful. The change to make div more closely follow the docs is useful > on its own merits, but the local RA should still be fixed. > > -Chris > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From grosbach at apple.com Wed Oct 8 11:24:37 2008 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 08 Oct 2008 16:24:37 -0000 Subject: [llvm-commits] [llvm] r57295 - /llvm/trunk/lib/Target/ARM/ARM.h Message-ID: <200810081624.m98GObf1000907@zion.cs.uiuc.edu> Author: grosbach Date: Wed Oct 8 11:24:35 2008 New Revision: 57295 URL: http://llvm.org/viewvc/llvm-project?rev=57295&view=rev Log: Comment to be explicit that the enumeration values for CondCodes matter. Modified: llvm/trunk/lib/Target/ARM/ARM.h Modified: llvm/trunk/lib/Target/ARM/ARM.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.h?rev=57295&r1=57294&r2=57295&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARM.h (original) +++ llvm/trunk/lib/Target/ARM/ARM.h Wed Oct 8 11:24:35 2008 @@ -27,6 +27,8 @@ // Enums corresponding to ARM condition codes namespace ARMCC { + // The CondCodes constants map directly to the 4-bit encoding of the + // condition field for predicated instructions. enum CondCodes { EQ, NE, From grosbach at apple.com Wed Oct 8 11:28:43 2008 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 8 Oct 2008 09:28:43 -0700 Subject: [llvm-commits] [llvm] r57258 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrInfo.h In-Reply-To: <7376E2D8-3214-422B-BF37-EE386E2BBF06@apple.com> References: <200810071905.m97J5aEk006788@zion.cs.uiuc.edu> <7376E2D8-3214-422B-BF37-EE386E2BBF06@apple.com> Message-ID: On Oct 7, 2008, at 11:36 PM, Chris Lattner wrote: > >> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Oct 7 >> 14:05:35 2008 >> @@ -256,8 +256,8 @@ >> unsigned ARMCodeEmitter::getAddrModeNoneInstrBinary(const >> MachineInstr &MI, >> const >> TargetInstrDesc &TID, >> unsigned Binary) { >> - // FIXME: Assume CC is AL for now. >> - Binary |= ARMCC::AL << 28; >> + // Set the conditional execution predicate >> + Binary |= II->getPredicate(&MI) << 28; > > This makes the assumption that the ARMCC::CondCodes enums follows > exactly with the encodings used by the ARM instruction set. THis is > a reasonable thing, but is a new requirement. Please put a comment > above the CondCodes enum that points out that the numbering *must* > follow the ISA. A comment to that effect is good sense. I'll add it. I wasn't (intentionally) adding a new requirement. My understanding was that the equivalent was already asserted, as evidenced by, for example, the "ARMCC::A: << 28" that the new code is replacing. That doesn't really matter, though. A comment is a good idea regardless. Done. -Jim From lattner at apple.com Wed Oct 8 11:35:01 2008 From: lattner at apple.com (Tanya Lattner) Date: Wed, 8 Oct 2008 09:35:01 -0700 Subject: [llvm-commits] [test-suite] r57281 - /test-suite/trunk/autoconf/configure.ac In-Reply-To: <200810072330.m97NUagZ030230@zion.cs.uiuc.edu> References: <200810072330.m97NUagZ030230@zion.cs.uiuc.edu> Message-ID: <9E2D17D9-FCBE-473B-86E7-2F49442FA9E3@apple.com> Regenerate the configure script? -Tanya On Oct 7, 2008, at 4:30 PM, Dan Gohman wrote: > Author: djg > Date: Tue Oct 7 18:30:36 2008 > New Revision: 57281 > > URL: http://llvm.org/viewvc/llvm-project?rev=57281&view=rev > Log: > Add '=DIR' to the --with-llvmobj help, for consistency with all the > other options. > > Modified: > test-suite/trunk/autoconf/configure.ac > > Modified: test-suite/trunk/autoconf/configure.ac > URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/autoconf/configure.ac?rev=57281&r1=57280&r2=57281&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- test-suite/trunk/autoconf/configure.ac (original) > +++ test-suite/trunk/autoconf/configure.ac Tue Oct 7 18:30:36 2008 > @@ -58,7 +58,7 @@ > > dnl Location of LLVM object code > AC_ARG_WITH(llvmobj, > - AS_HELP_STRING([--with-llvmobj],Location of LLVM Object Code), > + AS_HELP_STRING([--with-llvmobj=DIR],Location of LLVM Object Code), > AC_SUBST(LLVM_OBJ,[$withval]), > AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081008/54aeed05/attachment.html From clattner at apple.com Wed Oct 8 11:38:14 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 8 Oct 2008 09:38:14 -0700 Subject: [llvm-commits] [llvm] r57258 - in /llvm/trunk/lib/Target/ARM: ARMCodeEmitter.cpp ARMInstrInfo.h In-Reply-To: References: <200810071905.m97J5aEk006788@zion.cs.uiuc.edu> <7376E2D8-3214-422B-BF37-EE386E2BBF06@apple.com> Message-ID: On Oct 8, 2008, at 9:28 AM, Jim Grosbach wrote: > > On Oct 7, 2008, at 11:36 PM, Chris Lattner wrote: >> >>> +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Oct 7 >>> 14:05:35 2008 >>> @@ -256,8 +256,8 @@ >>> unsigned ARMCodeEmitter::getAddrModeNoneInstrBinary(const >>> MachineInstr &MI, >>> const >>> TargetInstrDesc &TID, >>> unsigned Binary) { >>> - // FIXME: Assume CC is AL for now. >>> - Binary |= ARMCC::AL << 28; >>> + // Set the conditional execution predicate >>> + Binary |= II->getPredicate(&MI) << 28; >> >> This makes the assumption that the ARMCC::CondCodes enums follows >> exactly with the encodings used by the ARM instruction set. THis is >> a reasonable thing, but is a new requirement. Please put a comment >> above the CondCodes enum that points out that the numbering *must* >> follow the ISA. > > > A comment to that effect is good sense. I'll add it. I wasn't > (intentionally) adding a new requirement. My understanding was that > the equivalent was already asserted, as evidenced by, for example, the > "ARMCC::A: << 28" that the new code is replacing. That doesn't really > matter, though. A comment is a good idea regardless. Done. Good point, thanks Jim! -Chris From gohman at apple.com Wed Oct 8 11:49:34 2008 From: gohman at apple.com (Dan Gohman) Date: Wed, 8 Oct 2008 09:49:34 -0700 (PDT) Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> Message-ID: <60303.76.220.41.203.1223484574.squirrel@webmail.apple.com> On Tue, October 7, 2008 11:34 pm, Chris Lattner wrote: > On Oct 7, 2008, at 2:29 PM, Evan Cheng wrote: >>>>> We could fix it, but on the other hand it's arguably sloppy for >>>>> instruction selectors to not precisely describe their physical >>>>> register uses. >>>> >>>> I agree. In this case DVI8r should say it defines AL, AH and uses >>>> AL, >>>> AH which makes it clear it reads 2 values and outputs 2. >>> >>> No, it reads 1 value and outputs two. It is not the same as DIV16 >>> and >>> DIV32. >>> The way I have it matches Intel docs. >> >> Ok. It's good to match what Intel manual says. But that's additional >> goodness. Previously DIV16r is marked as using AL, AH and the implicit >> use is copied to AX. While this is not ideal, it's not incorrect. >> Local liveness cannot mark AX as dead. > > To put it another way, it looks like (as Dale said) both changes are > useful. The change to make div more closely follow the docs is useful > on its own merits, but the local RA should still be fixed. Can you explain why? If instruction selectors are working properly, this won't matter. So it's making local RA do more work (read: slowing down -O0!), and also the MachineInstr DCE used by fast-isel, and as far as I can tell the only benefit is that it silently covers up bugs elsewhere. Would the situation be different if we had a MachineInstr-level verifier? If it could flag physreg alias abuses, we could be more confident that we're not missing any other cases. This is an area where there are a lot of implicit assumptions, and I'd like to understand the assumptions better. Thanks, Dan From tonic at nondot.org Wed Oct 8 11:52:24 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 08 Oct 2008 16:52:24 -0000 Subject: [llvm-commits] [llvm] r57296 - /llvm/branches/release_24/docs/LangRef.html Message-ID: <200810081652.m98GqO65001928@zion.cs.uiuc.edu> Author: tbrethou Date: Wed Oct 8 11:52:23 2008 New Revision: 57296 URL: http://llvm.org/viewvc/llvm-project?rev=57296&view=rev Log: Merge from mainline. Add two forgotten
    's. Modified: llvm/branches/release_24/docs/LangRef.html Modified: llvm/branches/release_24/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/docs/LangRef.html?rev=57296&r1=57295&r2=57296&view=diff ============================================================================== --- llvm/branches/release_24/docs/LangRef.html (original) +++ llvm/branches/release_24/docs/LangRef.html Wed Oct 8 11:52:23 2008 @@ -4333,8 +4333,8 @@ %r = call %struct.A @foo() ; yields { 32, i8 } %gr = extractvalue %struct.A %r, 0 ; yields i32 %gr1 = extractvalue %struct.A %r, 1 ; yields i8 - %Z = call void @foo() noreturn ; indicates that foo never returns nomrally - %ZZ = call zeroext i32 @bar() ; Return value is zero extended + %Z = call void @foo() noreturn ; indicates that %foo never returns nomrally + %ZZ = call zeroext i32 @bar() ; Return value is %zero extended From clattner at apple.com Wed Oct 8 11:54:03 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 8 Oct 2008 09:54:03 -0700 Subject: [llvm-commits] [llvm] r57257 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <60303.76.220.41.203.1223484574.squirrel@webmail.apple.com> References: <200810071854.m97IsTFq006416@zion.cs.uiuc.edu> <562281E8-8029-4666-BAEA-765DAAA23F69@apple.com> <0951BE97-1242-47F5-B03F-52D9B53E6BBD@apple.com> <15C81154-C32F-4D72-A34C-B69731E907E1@apple.com> <7A3355B2-456F-4B23-A018-872CF0FCAD54@apple.com> <0027F6D9-E169-487E-870C-C7E45CF1095B@apple.com> <60303.76.220.41.203.1223484574.squirrel@webmail.apple.com> Message-ID: <4051B534-5A21-4F07-AD55-F9B202A381EF@apple.com> On Oct 8, 2008, at 9:49 AM, Dan Gohman wrote: >> To put it another way, it looks like (as Dale said) both changes are >> useful. The change to make div more closely follow the docs is >> useful >> on its own merits, but the local RA should still be fixed. > > Can you explain why? IMO, the RA should maintain sensible invariants: if an instruction defs AL and AH, it should be the same as def'ing AX. Changing the instruction is goodness just because it more closely model's the ISA manual, I don't think it should affect correctness. > If instruction selectors are working properly, this won't matter. > So it's making local RA do more work (read: slowing down -O0!), > and also the MachineInstr DCE used by fast-isel, and as far as I > can tell the only benefit is that it silently covers up bugs > elsewhere. > > Would the situation be different if we had a MachineInstr-level > verifier? If it could flag physreg alias abuses, we could be > more confident that we're not missing any other cases. A machineinstr verifier is long overdue and I'm sure it would find lots of issues! > This is an area where there are a lot of implicit assumptions, and > I'd like to understand the assumptions better. Me too! :) -Chris From tonic at nondot.org Wed Oct 8 11:56:22 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 08 Oct 2008 16:56:22 -0000 Subject: [llvm-commits] [llvm] r57297 - /llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y Message-ID: <200810081656.m98GuMMd002093@zion.cs.uiuc.edu> Author: tbrethou Date: Wed Oct 8 11:56:22 2008 New Revision: 57297 URL: http://llvm.org/viewvc/llvm-project?rev=57297&view=rev Log: Merge from mainline. Add missing semicolumns in parser rules, those missing semicolumns are required to compile with the latest Bison. Modified: llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y Modified: llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y?rev=57297&r1=57296&r2=57297&view=diff ============================================================================== --- llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/branches/release_24/lib/AsmParser/llvmAsmParser.y Wed Oct 8 11:56:22 2008 @@ -1296,9 +1296,9 @@ | SIGNEXT { $$ = Attribute::SExt; } | READNONE { $$ = Attribute::ReadNone; } | READONLY { $$ = Attribute::ReadOnly; } - | NOINLINE { $$ = Attribute::NoInline } - | ALWAYSINLINE { $$ = Attribute::AlwaysInline } - | OPTSIZE { $$ = Attribute::OptimizeForSize } + | NOINLINE { $$ = Attribute::NoInline; } + | ALWAYSINLINE { $$ = Attribute::AlwaysInline; } + | OPTSIZE { $$ = Attribute::OptimizeForSize; } ; OptFuncAttrs : /* empty */ { $$ = Attribute::None; } From evan.cheng at apple.com Wed Oct 8 12:44:44 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 8 Oct 2008 10:44:44 -0700 Subject: [llvm-commits] [llvm] r57286 - /llvm/trunk/lib/CodeGen/RegAllocLocal.cpp In-Reply-To: <200810080430.m984Urwc031571@zion.cs.uiuc.edu> References: <200810080430.m984Urwc031571@zion.cs.uiuc.edu> Message-ID: <3053D4BA-FFB9-4856-8BC5-15FAA189F35D@apple.com> On Oct 7, 2008, at 9:30 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Oct 7 23:30:51 2008 > New Revision: 57286 > > URL: http://llvm.org/viewvc/llvm-project?rev=57286&view=rev > Log: > Fix the case where an instruction is not properly marked as using > all registers that alias its inputs. > > Modified: > llvm/trunk/lib/CodeGen/RegAllocLocal.cpp > > Modified: llvm/trunk/lib/CodeGen/RegAllocLocal.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLocal.cpp?rev=57286&r1=57285&r2=57286&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/CodeGen/RegAllocLocal.cpp (original) > +++ llvm/trunk/lib/CodeGen/RegAllocLocal.cpp Tue Oct 7 23:30:51 2008 > @@ -575,8 +575,26 @@ > // them for later. Also, we have to process these > // _before_ processing the defs, since an instr > // uses regs before it defs them. > - if (MO.isReg() && MO.getReg() && MO.isUse()) > + if (MO.isReg() && MO.getReg() && MO.isUse()) { > LastUseDef[MO.getReg()] = std::make_pair(I, i); > + > + > + if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) > continue; > + > + const unsigned* subregs = TRI->getAliasSet(MO.getReg()); Why call it subregs? That's confusing. > > + if (subregs) { > + while (*subregs) { This seems like a good time to get alias set the same treatment as subreg set (i.e. hash)? Thanks, Evan > > + DenseMap > >::iterator > + alias = LastUseDef.find(*subregs); > + > + if (alias != LastUseDef.end() && > + alias->second.first != I) > + LastUseDef[*subregs] = std::make_pair(I, i); > + > + ++subregs; > + } > + } > + } > } > > for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Wed Oct 8 12:52:24 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 17:52:24 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57300 - in /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple: bswap-1.c bswap-2.c Message-ID: <200810081752.m98HqOdG030155@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 12:52:23 2008 New Revision: 57300 URL: http://llvm.org/viewvc/llvm-project?rev=57300&view=rev Log: llvm-gcc does better optimization than gcc on these; adjust tests to compensate. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c?rev=57300&r1=57299&r2=57300&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c Wed Oct 8 12:52:23 2008 @@ -58,6 +58,7 @@ } /* The capital R's throughout are so these match only instructions: */ /* { dg-final { if [ istarget arm*-*-darwin* ] { global compiler_flags; if [string match "*-march=armv6*" $compiler_flags] { scan-assembler-times "\\\trev" 9 } } } } */ -/* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 3 } } } } */ +/* LLVM LOCAL llvm-gcc reduces more cases than gcc */ +/* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 9 } } } } */ /* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if [string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 6 } } } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c?rev=57300&r1=57299&r2=57300&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c Wed Oct 8 12:52:23 2008 @@ -17,8 +17,14 @@ static int count = 0; static int llcount = 0; -uint32 f(uint32 x) { count++; return x; } -uint64 llf(uint64 x) { llcount++; return x; } +/* LLVM LOCAL begin llvm-gcc is smart enough to figure out f() returns its + argument and does optimizations based on that. Undefine these to preserve + the point of the test. */ +/*extern uint32 f(){ count++; return x; }*/ +/*uint64 llf(uint64 x) { llcount++; return x; }*/ +extern uint32 f(); +extern uint64 llf(); +/* LLVM LOCAL end */ unsigned int Reverse4 (volatile unsigned int x) { /* does NOT produce Rev */ return ((x & 0x0000ff00) <<8) | ((x & 0x00ff0000) >> 8) | ((x & 0xff000000) >> 24) | ((x & 0x000000ff) << 24); From dalej at apple.com Wed Oct 8 12:55:52 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 17:55:52 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57301 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c Message-ID: <200810081755.m98HtqmI000481@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 12:55:52 2008 New Revision: 57301 URL: http://llvm.org/viewvc/llvm-project?rev=57301&view=rev Log: Remove undefined behavior in test (llvm-gcc was removing the entire generated code, not what I'd want it to do, but standard-conformant) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c?rev=57301&r1=57300&r2=57301&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/i386-bitmask1.c Wed Oct 8 12:55:52 2008 @@ -4,12 +4,15 @@ /* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */ /* { dg-final { scan-assembler "and.*(0xffffff00|4294967040)" } } */ unsigned char lut[256]; +/* LLVM LOCAL make these global */ +unsigned int *srcptr, *dstptr; void foo( int count ) { int j; - unsigned int *srcptr, *dstptr; + /* LLVM LOCAL begin remove uninitialized srcptr, dstptr */ + /* LLVM LOCAL end */ for (j = 0; j < count; j++) { unsigned int tmp = *srcptr; unsigned int alpha = (tmp&255); From resistor at mac.com Wed Oct 8 12:57:02 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 08 Oct 2008 10:57:02 -0700 Subject: [llvm-commits] [llvm] r57286 - /llvm/trunk/lib/CodeGen/RegAllocLocal.cpp In-Reply-To: <3053D4BA-FFB9-4856-8BC5-15FAA189F35D@apple.com> References: <200810080430.m984Urwc031571@zion.cs.uiuc.edu> <3053D4BA-FFB9-4856-8BC5-15FAA189F35D@apple.com> Message-ID: On Oct 8, 2008, at 10:44 AM, Evan Cheng wrote: >> + if (subregs) { >> + while (*subregs) { > > This seems like a good time to get alias set the same treatment as > subreg set (i.e. hash)? Not in this case. The code actually needs to iterate through all the aliases, not just test for membership. --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2624 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081008/f709a1c5/attachment.bin From dalej at apple.com Wed Oct 8 13:29:13 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 18:29:13 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57302 - in /llvm-gcc-4.2/trunk/gcc/testsuite: g++.dg/gomp/macro-3.C gcc.dg/gomp/macro-3.c Message-ID: <200810081829.m98ITDnd009080@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 13:29:13 2008 New Revision: 57302 URL: http://llvm.org/viewvc/llvm-project?rev=57302&view=rev Log: Disable a couple of dump-crawling tests for llvm-gcc. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/macro-3.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/macro-3.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/macro-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/gomp/macro-3.C?rev=57302&r1=57301&r2=57302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/macro-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/macro-3.C Wed Oct 8 13:29:13 2008 @@ -1,6 +1,8 @@ // PR preprocessor/27746 // { dg-do compile } // { dg-options "-fopenmp -fdump-tree-omplower" } +// LLVM LOCAL test not applicable +// { dg-require-fdump "" } #define omp FOO #define p parallel Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/macro-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/macro-3.c?rev=57302&r1=57301&r2=57302&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/macro-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/macro-3.c Wed Oct 8 13:29:13 2008 @@ -1,6 +1,8 @@ /* PR preprocessor/27746 */ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-omplower" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ #define omp FOO #define p parallel From nunoplopes at sapo.pt Wed Oct 8 13:45:59 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Wed, 08 Oct 2008 18:45:59 -0000 Subject: [llvm-commits] [llvm] r57305 - /llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Message-ID: <200810081845.m98Ijxvv009956@zion.cs.uiuc.edu> Author: nlopes Date: Wed Oct 8 13:45:59 2008 New Revision: 57305 URL: http://llvm.org/viewvc/llvm-project?rev=57305&view=rev Log: dont specialize weak functions and the like Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Modified: llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp?rev=57305&r1=57304&r2=57305&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/PartialSpecialization.cpp Wed Oct 8 13:45:59 2008 @@ -108,7 +108,7 @@ bool Changed = false; for (Module::iterator I = M.begin(); I != M.end(); ++I) { Function &F = *I; - if (F.isDeclaration()) continue; + if (F.isDeclaration() || F.mayBeOverridden()) continue; SmallVector interestingArgs; scanForInterest(F, interestingArgs); From dpatel at apple.com Wed Oct 8 15:09:34 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 08 Oct 2008 20:09:34 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57307 - /llvm-gcc-4.2/trunk/gcc/cppdefault.c Message-ID: <200810082009.m98K9Zbn014240@zion.cs.uiuc.edu> Author: dpatel Date: Wed Oct 8 15:09:30 2008 New Revision: 57307 URL: http://llvm.org/viewvc/llvm-project?rev=57307&view=rev Log: Do not let isysroot override fixincludes and gcc's private headers paths. Modified: llvm-gcc-4.2/trunk/gcc/cppdefault.c Modified: llvm-gcc-4.2/trunk/gcc/cppdefault.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cppdefault.c?rev=57307&r1=57306&r2=57307&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cppdefault.c (original) +++ llvm-gcc-4.2/trunk/gcc/cppdefault.c Wed Oct 8 15:09:30 2008 @@ -78,7 +78,10 @@ #endif #ifdef GCC_INCLUDE_DIR /* This is the dir for fixincludes and for gcc's private headers. */ - { GCC_INCLUDE_DIR, "GCC", 0, 0, ADD_SYSROOT, 0 }, + /* APPLE LOCAL begin */ + /* Do not let isysroot override fixincludes and gcc's private headers paths. */ + { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, + /* APPLE LOCAL end */ #endif #ifdef CROSS_INCLUDE_DIR /* One place the target system's headers might be. */ From grosbach at apple.com Wed Oct 8 15:18:28 2008 From: grosbach at apple.com (Jim Grosbach) Date: Wed, 8 Oct 2008 13:18:28 -0700 Subject: [llvm-commits] [llvm] r57262 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td In-Reply-To: References: <200810072108.m97L897J010946@zion.cs.uiuc.edu> Message-ID: On Oct 7, 2008, at 7:46 PM, Chris Lattner wrote: >> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Oct 7 16:08:09 >> 2008 >> @@ -567,7 +567,7 @@ >> // B is "predicable" since it can be xformed into a Bcc. >> let isBarrier = 1 in { >> let isPredicable = 1 in >> - def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b >> $target", >> + def B : ABI<{0,1,0,1}, (outs), (ins brtarget:$target), Branch, >> "b $target", >> [(br bb:$target)]>; > > I assume you're changing 0xA to 0,1,0,1 due to an endianness issue? > Why not just change the ABI/AXI patterns to do the bit swapping? I'd > strongly prefer to have all the instructions (like B) have clear and > easy to understand encodings in them. I'd rather push any complexity/ > weirdness up into parent tblgen classes. Hi Chris, I absolutely agree, and that's something I'm going to look at fixing in the near future. Right now, the assumption is that opcode values are laid out such that the MSB is on the right. I don't much care for that since the ARM documentation shows things w/ MSB on the left. There's already a lot of confusion about which order the opcode pattern should take in the the ARM .td files. There's quite a few instructions that encode improperly due to that. I'm going to try to get that straightened out and have everything be represented as it looks in the ARM docs. That was outside the scope of what I wanted to accomplish in this patch, though. For this, I just wanted to get a simple unconditional branch encoding correctly so I can have some simple test code (a Hanoi solver, in this case) running via the JIT. Short version, "I agree. Fixing that format confusion is next on the agenda." -Jim From clattner at apple.com Wed Oct 8 15:39:20 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 8 Oct 2008 13:39:20 -0700 Subject: [llvm-commits] [llvm] r57262 - /llvm/trunk/lib/Target/ARM/ARMInstrInfo.td In-Reply-To: References: <200810072108.m97L897J010946@zion.cs.uiuc.edu> Message-ID: On Oct 8, 2008, at 1:18 PM, Jim Grosbach wrote: > On Oct 7, 2008, at 7:46 PM, Chris Lattner wrote: >>> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Tue Oct 7 16:08:09 >>> 2008 >>> @@ -567,7 +567,7 @@ >>> // B is "predicable" since it can be xformed into a Bcc. >>> let isBarrier = 1 in { >>> let isPredicable = 1 in >>> - def B : AXI<0xA, (outs), (ins brtarget:$target), Branch, "b >>> $target", >>> + def B : ABI<{0,1,0,1}, (outs), (ins brtarget:$target), Branch, >>> "b $target", >>> [(br bb:$target)]>; >> >> I assume you're changing 0xA to 0,1,0,1 due to an endianness issue? >> Why not just change the ABI/AXI patterns to do the bit swapping? I'd >> strongly prefer to have all the instructions (like B) have clear and >> easy to understand encodings in them. I'd rather push any >> complexity/ >> weirdness up into parent tblgen classes. > > > Hi Chris, > > I absolutely agree, and that's something I'm going to look at fixing > in the near future. Right now, the assumption is that opcode values > are laid out such that the MSB is on the right. I don't much care > for that since the ARM documentation shows things w/ MSB on the > left. There's already a lot of confusion about which order the > opcode pattern should take in the the ARM .td files. There's quite a > few instructions that encode improperly due to that. I'm going to > try to get that straightened out and have everything be represented > as it looks in the ARM docs. > > That was outside the scope of what I wanted to accomplish in this > patch, though. For this, I just wanted to get a simple unconditional > branch encoding correctly so I can have some simple test code (a > Hanoi solver, in this case) running via the JIT. > > Short version, "I agree. Fixing that format confusion is next on the > agenda." Ok, I guess my metapoint is that we should aim for the .td file to follow the manual (which I haven't looked at recently) as closely as possible. handling it as a separate patch is fine by me :) -Chris From dalej at apple.com Wed Oct 8 16:49:47 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 21:49:47 -0000 Subject: [llvm-commits] [llvm] r57309 - in /llvm/trunk: include/llvm/Target/DarwinTargetAsmInfo.h lib/Target/DarwinTargetAsmInfo.cpp Message-ID: <200810082149.m98LnlHh016100@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 16:49:47 2008 New Revision: 57309 URL: http://llvm.org/viewvc/llvm-project?rev=57309&view=rev Log: (re)Put const weak strings in appropriate section on Darwin. g++dg/abi/key2.C Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=57309&r1=57308&r2=57309&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original) +++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Wed Oct 8 16:49:47 2008 @@ -26,6 +26,7 @@ struct DarwinTargetAsmInfo: public TargetAsmInfo { const Section* TextCoalSection; + const Section* ConstTextCoalSection; const Section* ConstDataCoalSection; const Section* ConstDataSection; const Section* DataCoalSection; Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=57309&r1=57308&r2=57309&view=diff ============================================================================== --- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Wed Oct 8 16:49:47 2008 @@ -43,6 +43,8 @@ TextCoalSection = getNamedSection("\t__TEXT,__textcoal_nt,coalesced,pure_instructions", SectionFlags::Code); + ConstTextCoalSection = getNamedSection("\t__TEXT,__const_coal,coalesced", + SectionFlags::None); ConstDataCoalSection = getNamedSection("\t__DATA,__const_coal,coalesced", SectionFlags::None); ConstDataSection = getUnnamedSection(".const_data", SectionFlags::None); @@ -95,7 +97,7 @@ (isNonStatic ? ConstDataSection : getReadOnlySection())); case SectionKind::RODataMergeStr: return (isWeak ? - ConstDataCoalSection : + ConstTextCoalSection : MergeableStringSection(cast(GV))); case SectionKind::RODataMergeConst: return (isWeak ? From dalej at apple.com Wed Oct 8 16:50:21 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 21:50:21 -0000 Subject: [llvm-commits] [llvm] r57310 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Message-ID: <200810082150.m98LoLqf016136@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 16:50:21 2008 New Revision: 57310 URL: http://llvm.org/viewvc/llvm-project?rev=57310&view=rev Log: Align EH tables before label is emitted, not after, thus aligning the label. Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=57310&r1=57309&r2=57310&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Wed Oct 8 16:50:21 2008 @@ -3430,8 +3430,8 @@ // Begin the exception table. Asm->SwitchToDataSection(TAI->getDwarfExceptionSection()); - O << "GCC_except_table" << SubprogramCount << ":\n"; Asm->EmitAlignment(2, 0, 0, false); + O << "GCC_except_table" << SubprogramCount << ":\n"; for (unsigned i = 0; i != SizeAlign; ++i) { Asm->EmitInt8(0); Asm->EOL("Padding"); From dalej at apple.com Wed Oct 8 16:52:41 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 21:52:41 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57311 - in /llvm-gcc-4.2/trunk/gcc/testsuite: g++.dg/abi/key2.C g++.dg/eh/table.C g++.dg/gomp/atomic-10.C g++.dg/gomp/atomic-3.C g++.dg/gomp/atomic-9.C obj-c++.dg/objc2-instanceSizeStart-1.mm objc.dg/6128170.m Message-ID: <200810082152.m98Lqfmn016232@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 16:52:41 2008 New Revision: 57311 URL: http://llvm.org/viewvc/llvm-project?rev=57311&view=rev Log: Adjust or disable tests as appropriate for llvm-gcc. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/abi/key2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-10.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-3.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-9.C llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/abi/key2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/abi/key2.C?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/abi/key2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/abi/key2.C Wed Oct 8 16:52:41 2008 @@ -2,14 +2,14 @@ // PR darwin/25908 // { dg-do compile { target *-*-darwin* } } -// { dg-final { scan-assembler ".globl __ZTV1f\\n .weak_definition __ZTV1f\\n .section __DATA,__const_coal,coalesced" } } -// { dg-final { scan-assembler ".globl __ZTS1f\\n .weak_definition __ZTS1f\\n .section __TEXT,__const_coal,coalesced" } } -// LLVM LOCAL begin +// LLVM LOCAL begin rearrange tests to check current syntax +// { dg-final { scan-assembler " .section __DATA,__const_coal,coalesced\\n .globl __ZTV1f\\n .weak_definition __ZTV1f\\n" } } +// { dg-final { scan-assembler " .section __TEXT,__const_coal,coalesced\\n .globl __ZTS1f\\n .weak_definition __ZTS1f\\n" } } // With llvm ZTI1f is in the right place, but the ordering is different // so the .section directive is not needed. Do the best we can. // (It belongs in the same place as ZTV1f.) -// LLVM LOCAL end // { dg-final { scan-assembler ".globl __ZTI1f\\n .weak_definition __ZTI1f\\n" } } +// LLVM LOCAL end class f { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/eh/table.C?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/eh/table.C Wed Oct 8 16:52:41 2008 @@ -1,5 +1,6 @@ // { dg-do compile { target *-*-darwin* } } -// { dg-final { scan-assembler "GCC_except_table0" } } +// LLVM LOCAL adjust for different syntax +// { dg-final { scan-assembler "GCC_except_table" } } void needed(); void unneeded(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-10.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/gomp/atomic-10.C?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-10.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-10.C Wed Oct 8 16:52:41 2008 @@ -1,6 +1,8 @@ // PR middle-end/28046 // { dg-do compile } // { dg-options "-fopenmp -fdump-tree-gimple" } +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ int a[3], b; struct C { int x; int y; } c; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/gomp/atomic-3.C?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-3.C Wed Oct 8 16:52:41 2008 @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-gimple" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ int *xyzzy; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-9.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/gomp/atomic-9.C?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-9.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/gomp/atomic-9.C Wed Oct 8 16:52:41 2008 @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-gimple" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ volatile int *bar(void); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/objc2-instanceSizeStart-1.mm?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/objc2-instanceSizeStart-1.mm Wed Oct 8 16:52:41 2008 @@ -11,4 +11,5 @@ @implementation SubNoIvars @end int main() { return 0; } -/* { dg-final { scan-assembler "l_OBJC_CLASS_RO_\\\$_SubNoIvars:\n\t.long\t0\n\t.long\t8\n\t.long\t8" } } */ +/* LLVM LOCAL adjust for different syntax */ +/* { dg-final { scan-assembler "l_OBJC_CLASS_RO_\\\$_SubNoIvars:.*\n\t(.space\t4|.long\t0)\n\t.long\t8.*\n\t.long\t8" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m?rev=57311&r1=57310&r2=57311&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m Wed Oct 8 16:52:41 2008 @@ -1,7 +1,8 @@ /* APPLE LOCAL file 6128170 */ /* { dg-do compile { target i?86*-*-darwin* x86_64-*-darwin* } } */ /* { dg-options { "-m64" } } */ -/* { dg-final { scan-assembler "GCC_except_table.*:\nLLSDA" } } */ +/* LLVM LOCAL adjust for different syntax */ +/* { dg-final { scan-assembler "GCC_except_table.*:\n(LLSDA|Lexception)" } } */ /* { dg-final { scan-assembler-not "GCC_except_table.*:\n\t.align" } } */ #include void test() From evan.cheng at apple.com Wed Oct 8 17:11:12 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 08 Oct 2008 22:11:12 -0000 Subject: [llvm-commits] [test-suite] r57312 - /test-suite/trunk/MultiSource/Applications/Makefile Message-ID: <200810082211.m98MBCln016824@zion.cs.uiuc.edu> Author: evancheng Date: Wed Oct 8 17:11:11 2008 New Revision: 57312 URL: http://llvm.org/viewvc/llvm-project?rev=57312&view=rev Log: Don't run lua when SMALL_PROBLEM_SIZE is defined. Modified: test-suite/trunk/MultiSource/Applications/Makefile Modified: test-suite/trunk/MultiSource/Applications/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/Makefile?rev=57312&r1=57311&r2=57312&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Applications/Makefile (original) +++ test-suite/trunk/MultiSource/Applications/Makefile Wed Oct 8 17:11:11 2008 @@ -5,7 +5,11 @@ include $(LEVEL)/Makefile.config PARALLEL_DIRS = Burg aha sgefa siod lambda-0.1.3 d spiff hbd treecc SPASS \ - hexxagon oggenc JM viterbi minisat SIBsim4 ClamAV sqlite3 lemon lua + hexxagon oggenc JM viterbi minisat SIBsim4 ClamAV sqlite3 lemon + +ifndef SMALL_PROBLEM_SIZE +PARALLEL_DIRS += lua +endif # Obsequi uses Linux-only features; need to fix that ifeq ($(OS),Linux) From dalej at apple.com Wed Oct 8 17:21:50 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 22:21:50 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57314 - in /llvm-gcc-4.2/trunk/gcc/testsuite: gcc.dg/20040813-1.c gcc.dg/bincl-1.c gcc.dg/darwin-20040809-2.c gcc.dg/debug-bnsym-1.c gcc.dg/debug-globals-1.c gcc.dg/debug-lsym-1.c gcc.dg/debug-lsym-2.c gcc.dg/debug-lsym-3.c gcc.dg/debug-lsym-4.c gcc.dg/stabs-4209166.c gcc.dg/stabs-4223137.c lib/target-supports-dg.exp Message-ID: <200810082221.m98MLoHi017303@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 17:21:49 2008 New Revision: 57314 URL: http://llvm.org/viewvc/llvm-project?rev=57314&view=rev Log: Disable a bunch of tests that assume stabs work. llvm doesn't support those. Will be easy to reverse if somebody wants to implement them. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/20040813-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bincl-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-20040809-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-bnsym-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-globals-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-4.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4209166.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4223137.c llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports-dg.exp Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/20040813-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/20040813-1.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/20040813-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/20040813-1.c Wed Oct 8 17:21:49 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-sysv5* } { "*" } { "" } } */ /* { dg-options "-gstabs" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ int main () Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bincl-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bincl-1.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bincl-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/bincl-1.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs -fno-eliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include "bincl-1.h" int Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-20040809-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-20040809-2.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-20040809-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/darwin-20040809-2.c Wed Oct 8 17:21:49 2008 @@ -3,6 +3,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ int main () Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-bnsym-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-bnsym-1.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-bnsym-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-bnsym-1.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ void foo() { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-globals-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-globals-1.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-globals-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-globals-1.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -O2" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ static int foo; int bar; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-1.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-1.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ inline double foo () { return 42.0; } extern int bar(); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-2.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-2.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ extern double d; void foobar() Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-3.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-3.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ static double d; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-4.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-4.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-4.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-lsym-4.c Wed Oct 8 17:21:49 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ static double d = 0.42; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4209166.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4209166.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4209166.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4209166.c Wed Oct 8 17:21:49 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ struct blah; typedef struct blah *Foo; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4223137.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4223137.c?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4223137.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/stabs-4223137.c Wed Oct 8 17:21:49 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols -Wno-format" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include int main (int argc, const char *argv) Modified: llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports-dg.exp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports-dg.exp?rev=57314&r1=57313&r2=57314&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports-dg.exp (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/lib/target-supports-dg.exp Wed Oct 8 17:21:49 2008 @@ -97,6 +97,14 @@ } } +# Skip tests that use stabs; llvm doesn't currently support these. +proc dg-require-stabs { args } { + if { [ is_llvm ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # LLVM LOCAL end # If this target does not support DLL attributes skip this test. From dalej at apple.com Wed Oct 8 17:23:10 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 08 Oct 2008 22:23:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57315 - in /llvm-gcc-4.2/trunk/gcc/testsuite: g++.dg/R4281384.C g++.dg/bincl-1.C g++.dg/other/PR23205.C g++.dg/stab-4334498.C gcc.dg/debug-4215975.c obj-c++.dg/debug-1.mm obj-c++.dg/stabs-1.mm obj-c++.dg/stabs-2.mm obj-c++.dg/stabs-3.mm objc.dg/stabs-1.m objc.dg/stabs-2.m objc.dg/stabs-3.m objc.dg/stabs-4.m Message-ID: <200810082223.m98MNAB9017367@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 17:23:09 2008 New Revision: 57315 URL: http://llvm.org/viewvc/llvm-project?rev=57315&view=rev Log: Disable more stabs tests. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/R4281384.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/bincl-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/other/PR23205.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/stab-4334498.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-4215975.c llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-2.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-2.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-4.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/R4281384.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/R4281384.C?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/R4281384.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/R4281384.C Wed Oct 8 17:23:09 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ class A { public: Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/bincl-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/bincl-1.C?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/bincl-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/bincl-1.C Wed Oct 8 17:23:09 2008 @@ -5,6 +5,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs -fno-eliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include "bincl-1.h" int Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/other/PR23205.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/other/PR23205.C?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/other/PR23205.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/other/PR23205.C Wed Oct 8 17:23:09 2008 @@ -1,6 +1,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ const int foobar = 4; int foo () Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/stab-4334498.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/stab-4334498.C?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/stab-4334498.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/stab-4334498.C Wed Oct 8 17:23:09 2008 @@ -6,6 +6,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ class A { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-4215975.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-4215975.c?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-4215975.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/debug-4215975.c Wed Oct 8 17:23:09 2008 @@ -5,6 +5,9 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -feliminate-unused-debug-symbols" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ + int main( void ) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/debug-1.mm?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/debug-1.mm Wed Oct 8 17:23:09 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-options "-gstabs+ -gfull" } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ class A { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/stabs-1.mm?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-1.mm Wed Oct 8 17:23:09 2008 @@ -6,6 +6,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-2.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/stabs-2.mm?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-2.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-2.mm Wed Oct 8 17:23:09 2008 @@ -5,6 +5,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-gstabs+ -gused" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/stabs-3.mm?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/stabs-3.mm Wed Oct 8 17:23:09 2008 @@ -5,6 +5,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-gstabs+ -gfull" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-1.m?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-1.m Wed Oct 8 17:23:09 2008 @@ -4,6 +4,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ @interface MyClass + newWithArg: arg; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-2.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-2.m?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-2.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-2.m Wed Oct 8 17:23:09 2008 @@ -6,6 +6,8 @@ /* { dg-do compile } */ /* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-3.m?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-3.m Wed Oct 8 17:23:09 2008 @@ -5,6 +5,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-gstabs+ -gused" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-4.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-4.m?rev=57315&r1=57314&r2=57315&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-4.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/stabs-4.m Wed Oct 8 17:23:09 2008 @@ -5,6 +5,8 @@ /* { dg-do compile { target *-*-darwin* } } */ /* { dg-options "-gstabs+ -gfull" } */ +/* LLVM LOCAL llvm doesn't currently support stabs. */ +/* { dg-require-stabs "" } */ #include From dalej at apple.com Wed Oct 8 19:32:19 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 00:32:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57316 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200810090032.m990WJr3021785@zion.cs.uiuc.edu> Author: johannes Date: Wed Oct 8 19:32:18 2008 New Revision: 57316 URL: http://llvm.org/viewvc/llvm-project?rev=57316&view=rev Log: Accept INIT_EXPR here. These are built by the C++ FE on occasion with semantics not quite the same as MODIFY_EXPR (initialization vs assignment in C++). Here we can handle them identically to MODIFY_EXPR. Fixes g++.apple/block-global-block.C etc. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=57316&r1=57315&r2=57316&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Wed Oct 8 19:32:18 2008 @@ -903,7 +903,7 @@ Value *TreeToLLVM::Emit(tree exp, const MemRef *DestLoc) { assert((isAggregateTreeType(TREE_TYPE(exp)) == (DestLoc != 0) || - TREE_CODE(exp) == MODIFY_EXPR) && + TREE_CODE(exp) == MODIFY_EXPR || TREE_CODE(exp) == INIT_EXPR) && "Didn't pass DestLoc to an aggregate expr, or passed it to scalar!"); Value *Result = 0; @@ -954,6 +954,7 @@ case OBJ_TYPE_REF: Result = EmitOBJ_TYPE_REF(exp); break; case ADDR_EXPR: Result = EmitADDR_EXPR(exp); break; case CALL_EXPR: Result = EmitCALL_EXPR(exp, DestLoc); break; + case INIT_EXPR: case MODIFY_EXPR: Result = EmitMODIFY_EXPR(exp, DestLoc); break; case ASM_EXPR: Result = EmitASM_EXPR(exp); break; case NON_LVALUE_EXPR: Result = Emit(TREE_OPERAND(exp, 0), DestLoc); break; @@ -1799,7 +1800,8 @@ tree retval = TREE_OPERAND(exp, 0); assert((!retval || TREE_CODE(retval) == RESULT_DECL || - (TREE_CODE(retval) == MODIFY_EXPR && + ((TREE_CODE(retval) == MODIFY_EXPR + || TREE_CODE(retval) == INIT_EXPR) && TREE_CODE(TREE_OPERAND(retval, 0)) == RESULT_DECL)) && "RETURN_EXPR not gimple!"); @@ -2889,6 +2891,8 @@ } /// EmitMODIFY_EXPR - Note that MODIFY_EXPRs are rvalues only! +/// We also handle INIT_EXPRs here; these are built by the C++ FE on rare +/// occasions, and have slightly different semantics that don't affect us here. /// Value *TreeToLLVM::EmitMODIFY_EXPR(tree exp, const MemRef *DestLoc) { tree lhs = TREE_OPERAND (exp, 0); From clattner at apple.com Wed Oct 8 23:48:48 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 8 Oct 2008 21:48:48 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <20081007221928.GI19669@daikokuya.co.uk> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> <20081007221928.GI19669@daikokuya.co.uk> Message-ID: <8932AF70-A8BC-4B51-B297-577ABB16086B@apple.com> On Oct 7, 2008, at 3:19 PM, Neil Booth wrote: >> When I implemented the -0.0 conversion to int, I thought that was >> what >> IEEE754 calls for, but I missed the definition of inexact, obscurely >> placed in 7.4(4). 6.3 is clear that the result should have a >> negative >> sign, and that's not implementable on a twos complement machine, yet >> none of the exceptions seems to apply; I guess the standard calls for >> quietly producing an answer known to be wrong. This one really seems >> like a bug in the standard. > > This one should be special-cased at the call site. I think the loss > of IEEE semantics, which are there for good reason and may even be > being relied on elsewhere in APFloat, is a very bad idea here. > > Chris, what do you think? Dale and I discussed this today and basically came to the conclusion that keeping APFloat as close to IEEE semantics is goodness. The issue is that we don't really know what we're doing here :), and IEEE is common currency among numericists. I think that it's best to change the clients of these functions to be implemented in different ways (e.g. fptrunc then fpextend and see if we have the same bit pattern) or add new methods that do crazy things that are somehow different than what IEEE says. -Chris From sabre at nondot.org Wed Oct 8 23:50:58 2008 From: sabre at nondot.org (Chris Lattner) Date: Thu, 09 Oct 2008 04:50:58 -0000 Subject: [llvm-commits] [llvm] r57318 - in /llvm/trunk: lib/Target/Alpha/AlphaISelLowering.cpp test/CodeGen/Alpha/mul128.ll Message-ID: <200810090450.m994owMQ000486@zion.cs.uiuc.edu> Author: lattner Date: Wed Oct 8 23:50:56 2008 New Revision: 57318 URL: http://llvm.org/viewvc/llvm-project?rev=57318&view=rev Log: get CodeGen/Alpha/mul128.ll to work. Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/test/CodeGen/Alpha/mul128.ll Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=57318&r1=57317&r2=57318&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Wed Oct 8 23:50:56 2008 @@ -96,6 +96,8 @@ setOperationAction(ISD::SUBC , MVT::i64, Expand); setOperationAction(ISD::SUBE , MVT::i64, Expand); + setOperationAction(ISD::UMUL_LOHI, MVT::i64, Expand); + // We don't support sin/cos/sqrt/pow setOperationAction(ISD::FSIN , MVT::f64, Expand); Modified: llvm/trunk/test/CodeGen/Alpha/mul128.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Alpha/mul128.ll?rev=57318&r1=57317&r2=57318&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Alpha/mul128.ll (original) +++ llvm/trunk/test/CodeGen/Alpha/mul128.ll Wed Oct 8 23:50:56 2008 @@ -1,5 +1,4 @@ ; RUN: llvm-as < %s | llc -march=alpha -; XFAIL: * define i128 @__mulvdi3(i128 %a, i128 %b) nounwind { entry: From alenhar2 at cs.uiuc.edu Thu Oct 9 01:24:33 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 09 Oct 2008 06:24:33 -0000 Subject: [llvm-commits] [poolalloc] r57319 - in /poolalloc/trunk/lib: DSA/BottomUpClosure.cpp DSA/CallTargets.cpp DSA/CompleteBottomUp.cpp DSA/DataStructure.cpp DSA/DataStructureStats.cpp DSA/EquivClassGraphs.cpp DSA/Local.cpp DSA/Printer.cpp DSA/StdLibPass.cpp DSA/Steensgaard.cpp DSA/TopDownClosure.cpp PoolAllocate/PoolAllocate.cpp PoolAllocate/TransformFunctionBody.cpp Message-ID: <200810090624.m996OXZl004491@zion.cs.uiuc.edu> Author: alenhar2 Date: Thu Oct 9 01:24:31 2008 New Revision: 57319 URL: http://llvm.org/viewvc/llvm-project?rev=57319&view=rev Log: simplify and unify code. EQ pass may be broken Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp poolalloc/trunk/lib/DSA/CallTargets.cpp poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp poolalloc/trunk/lib/DSA/DataStructure.cpp poolalloc/trunk/lib/DSA/DataStructureStats.cpp poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp poolalloc/trunk/lib/DSA/Local.cpp poolalloc/trunk/lib/DSA/Printer.cpp poolalloc/trunk/lib/DSA/StdLibPass.cpp poolalloc/trunk/lib/DSA/Steensgaard.cpp poolalloc/trunk/lib/DSA/TopDownClosure.cpp poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Thu Oct 9 01:24:31 2008 @@ -14,7 +14,7 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "bu_dsa" +#define DEBUG_TYPE "dsa-bu" #include "dsa/DataStructure.h" #include "dsa/DSGraph.h" #include "llvm/Module.h" @@ -40,17 +40,10 @@ // program. // bool BUDataStructures::runOnModule(Module &M) { - StdLibDataStructures &LocalDSA = getAnalysis(); - setGraphSource(&LocalDSA); - setTargetData(LocalDSA.getTargetData()); - setGraphClone(false); - GlobalECs = LocalDSA.getGlobalECs(); + init(&getAnalysis(), false, true); - GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph(), GlobalECs); - GlobalsGraph->setPrintAuxCalls(); - - std::vector Stack; - hash_map ValMap; + std::vector Stack; + hash_map ValMap; unsigned NextID = 1; Function *MainFunc = M.getFunction("main"); @@ -61,7 +54,7 @@ // Calculate the graphs for any functions that are unreachable from main... for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && !DSInfo.count(I)) { + if (!I->isDeclaration() && !hasDSGraph(*I)) { if (MainFunc) DOUT << "*** BU: Function unreachable from main: " << I->getName() << "\n"; @@ -69,14 +62,8 @@ CloneAuxIntoGlobal(getDSGraph(*I)); } - //Be sure to get the all unresolved call sites - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && InlinedSomewhere.find(I) == InlinedSomewhere.end()) - CloneAuxIntoGlobal(getDSGraph(*I)); - InlinedSomewhere.clear(); - // If we computed any temporary indcallgraphs, free them now. - for (std::map, + for (std::map, std::pair > >::iterator I = IndCallGraphMap.begin(), E = IndCallGraphMap.end(); I != E; ++I) { I->second.second.clear(); // Drop arg refs into the graph. @@ -122,13 +109,13 @@ DSGraph::IgnoreGlobals); } - NumCallEdges += ActualCallees.size(); + NumCallEdges += callee_size(); return false; } static inline bool nodeContainsExternalFunction(const DSNode *N) { - std::vector Funcs; + std::vector Funcs; N->addFullFunctionList(Funcs); for (unsigned i = 0, e = Funcs.size(); i != e; ++i) if (Funcs[i]->isDeclaration()) return true; @@ -165,7 +152,7 @@ } static void GetAllCallees(const DSCallSite &CS, - std::vector &Callees) { + std::vector &Callees) { if (CS.isDirectCall()) { if (!CS.getCalleeFunc()->isDeclaration()) Callees.push_back(CS.getCalleeFunc()); @@ -184,7 +171,7 @@ } static void GetAnyCallees(const DSCallSite &CS, - std::vector &Callees) { + std::vector &Callees) { if (CS.isDirectCall()) { if (!CS.getCalleeFunc()->isDeclaration()) Callees.push_back(CS.getCalleeFunc()); @@ -204,7 +191,7 @@ /// GetAllAuxCallees - Return a list containing all of the resolvable callees in /// the aux list for the specified graph in the Callees vector. -static void GetAllAuxCallees(DSGraph &G, std::vector &Callees) { +static void GetAllAuxCallees(DSGraph &G, std::vector &Callees) { Callees.clear(); for (DSGraph::afc_iterator I = G.afc_begin(), E = G.afc_end(); I != E; ++I) GetAllCallees(*I, Callees); @@ -212,16 +199,16 @@ /// GetAnyAuxCallees - Return a list containing all of the callees in /// the aux list for the specified graph in the Callees vector. -static void GetAnyAuxCallees(DSGraph &G, std::vector &Callees) { +static void GetAnyAuxCallees(DSGraph &G, std::vector &Callees) { Callees.clear(); for (DSGraph::afc_iterator I = G.afc_begin(), E = G.afc_end(); I != E; ++I) GetAnyCallees(*I, Callees); } -unsigned BUDataStructures::calculateGraphs(Function *F, - std::vector &Stack, +unsigned BUDataStructures::calculateGraphs(const Function *F, + std::vector &Stack, unsigned &NextID, - hash_map &ValMap) { + hash_map &ValMap) { assert(!ValMap.count(F) && "Shouldn't revisit functions!"); unsigned Min = NextID++, MyID = Min; ValMap[F] = Min; @@ -240,18 +227,18 @@ DSGraph &Graph = getOrCreateGraph(F); // Find all callee functions. - std::vector CalleeFunctions; + std::vector CalleeFunctions; GetAnyAuxCallees(Graph, CalleeFunctions); std::sort(CalleeFunctions.begin(), CalleeFunctions.end()); - std::vector::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end()); + std::vector::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end()); CalleeFunctions.resize(uid - CalleeFunctions.begin()); // The edges out of the current node are the call site targets... for (unsigned i = 0, e = CalleeFunctions.size(); i != e; ++i) { - Function *Callee = CalleeFunctions[i]; + const Function *Callee = CalleeFunctions[i]; unsigned M; // Have we visited the destination function yet? - hash_map::iterator It = ValMap.find(Callee); + hash_map::iterator It = ValMap.find(Callee); if (It == ValMap.end()) // No, visit it now. M = calculateGraphs(Callee, Stack, NextID, ValMap); else // Yes, get it's number. @@ -281,10 +268,10 @@ unsigned oldsize = CalleeFunctions.size(); GetAnyAuxCallees(Graph, CalleeFunctions); std::sort(CalleeFunctions.begin(), CalleeFunctions.end()); - std::vector::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end()); + std::vector::iterator uid = std::unique(CalleeFunctions.begin(), CalleeFunctions.end()); CalleeFunctions.resize(uid - CalleeFunctions.begin()); - std::vector ResolvedFuncs; + std::vector ResolvedFuncs; GetAllAuxCallees(Graph, ResolvedFuncs); if (ResolvedFuncs.size() || CalleeFunctions.size() > oldsize) { DOUT << "Recalculating " << F->getName() << " due to new knowledge\n"; @@ -293,6 +280,8 @@ } else { ValMap[F] = ~0U; } + //propagate incomplete call nodes + inlineUnresolved(Graph); return MyID; } else { @@ -301,7 +290,7 @@ std::vector SCCGraphs; unsigned SCCSize = 1; - Function *NF = Stack.back(); + const Function *NF = Stack.back(); ValMap[NF] = ~0U; DSGraph &SCCGraph = getDSGraph(*NF); @@ -319,7 +308,7 @@ // Update the Function -> DSG map. for (DSGraph::retnodes_iterator I = NFG.retnodes_begin(), E = NFG.retnodes_end(); I != E; ++I) - DSInfo[I->first] = &SCCGraph; + setDSGraph(*I->first, &SCCGraph); SCCGraph.spliceFrom(NFG); delete &NFG; @@ -346,6 +335,8 @@ << "DONE with SCC #: " << MyID << "\n"; // We never have to revisit "SCC" processed functions... + //propagate incomplete call nodes + inlineUnresolved(SCCGraph); return MyID; } @@ -361,24 +352,6 @@ GG.getAuxFunctionCalls().push_front(RC.cloneCallSite(*ii)); } -// releaseMemory - If the pass pipeline is done with this pass, we can release -// our memory... here... -// -void BUDataStructures::releaseMyMemory() { - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) { - I->second->getReturnNodes().erase(I->first); - if (I->second->getReturnNodes().empty()) - delete I->second; - } - - // Empty map so next time memory is released, data structures are not - // re-deleted. - DSInfo.clear(); - delete GlobalsGraph; - GlobalsGraph = 0; -} - void BUDataStructures::calculateGraph(DSGraph &Graph) { // If this graph contains the main function, clone the globals graph into this // graph before we inline callees and other fun stuff. @@ -416,8 +389,7 @@ std::list &AuxCallsList = Graph.getAuxFunctionCalls(); TempFCs.swap(AuxCallsList); - bool Printed = false; - std::vector CalledFuncs; + std::vector CalledFuncs; while (!TempFCs.empty()) { DSCallSite &CS = *TempFCs.begin(); @@ -447,9 +419,8 @@ Instruction *TheCall = CS.getCallSite().getInstruction(); if (CalledFuncs.size() == 1 && (isComplete || hasDSGraph(*CalledFuncs[0]))) { - Function *Callee = CalledFuncs[0]; - ActualCallees.insert(std::make_pair(TheCall, Callee)); - if (isComplete) InlinedSomewhere.insert(Callee); + const Function *Callee = CalledFuncs[0]; + callee_add(TheCall, Callee); // Get the data structure graph for the called function. GI = &getDSGraph(*Callee); // Graph to inline @@ -463,20 +434,19 @@ (isComplete?0:DSGraph::DontCloneAuxCallNodes)); ++NumBUInlines; } else { - if (!Printed) - DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); + DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); DEBUG(std::cerr << " calls " << CalledFuncs.size() << " fns from site: " << CS.getCallSite().getInstruction() << " " << *CS.getCallSite().getInstruction()); DEBUG(std::cerr << " Fns ="); unsigned NumPrinted = 0; - for (std::vector::iterator I = CalledFuncs.begin(), + for (std::vector::iterator I = CalledFuncs.begin(), E = CalledFuncs.end(); I != E; ++I) { if (NumPrinted++ < 8) DOUT << " " << (*I)->getName(); // Add the call edges to the call graph. - ActualCallees.insert(std::make_pair(TheCall, *I)); + callee_add(TheCall, *I); } DOUT << "\n"; @@ -496,7 +466,7 @@ IndCallGraphMap[CalledFuncs]; if (IndCallGraph.first == 0) { - std::vector::iterator I = CalledFuncs.begin(), + std::vector::iterator I = CalledFuncs.begin(), E = CalledFuncs.end(); // Start with a copy of the first graph. @@ -510,7 +480,6 @@ // Merge all of the other callees into this graph. for (++I; I != E; ++I) { - if (isComplete) InlinedSomewhere.insert(*I); // If the graph already contains the nodes for the function, don't // bother merging it in again. if (!GI->containsFunction(*I)) { @@ -576,66 +545,142 @@ //Graph.writeGraphToFile(cerr, "bu_" + F.getName()); } -static const Function *getFnForValue(const Value *V) { - if (const Instruction *I = dyn_cast(V)) - return I->getParent()->getParent(); - else if (const Argument *A = dyn_cast(V)) - return A->getParent(); - else if (const BasicBlock *BB = dyn_cast(V)) - return BB->getParent(); - return 0; -} - -/// deleteValue/copyValue - Interfaces to update the DSGraphs in the program. -/// These correspond to the interfaces defined in the AliasAnalysis class. -void BUDataStructures::deleteValue(Value *V) { - if (const Function *F = getFnForValue(V)) { // Function local value? - // If this is a function local value, just delete it from the scalar map! - getDSGraph(*F).getScalarMap().eraseIfExists(V); - return; - } - - if (Function *F = dyn_cast(V)) { - assert(getDSGraph(*F).getReturnNodes().size() == 1 && - "cannot handle scc's"); - delete DSInfo[F]; - DSInfo.erase(F); - return; - } - - assert(!isa(V) && "Do not know how to delete GV's yet!"); -} - -void BUDataStructures::copyValue(Value *From, Value *To) { - if (From == To) return; - if (const Function *F = getFnForValue(From)) { // Function local value? - // If this is a function local value, just delete it from the scalar map! - getDSGraph(*F).getScalarMap().copyScalarIfExists(From, To); - return; - } - - if (Function *FromF = dyn_cast(From)) { - Function *ToF = cast(To); - assert(!DSInfo.count(ToF) && "New Function already exists!"); - DSGraph *NG = new DSGraph(getDSGraph(*FromF), GlobalECs); - DSInfo[ToF] = NG; - assert(NG->getReturnNodes().size() == 1 && "Cannot copy SCC's yet!"); - - // Change the Function* is the returnnodes map to the ToF. - DSNodeHandle Ret = NG->retnodes_begin()->second; - NG->getReturnNodes().clear(); - NG->getReturnNodes()[ToF] = Ret; - return; - } - - if (const Function *F = getFnForValue(To)) { - DSGraph &G = getDSGraph(*F); - G.getScalarMap().copyScalarIfExists(From, To); - return; - } - - cerr << *From; - cerr << *To; - assert(0 && "Do not know how to copy this yet!"); - abort(); +void BUDataStructures::inlineUnresolved(DSGraph &Graph) { + std::list TempFCs; + std::list &AuxCallsList = Graph.getAuxFunctionCalls(); + TempFCs.insert(TempFCs.begin(), AuxCallsList.begin(), AuxCallsList.end()); + + std::vector CalledFuncs; + while (!TempFCs.empty()) { + DSCallSite CS = *TempFCs.begin(); + TempFCs.erase(TempFCs.begin()); + CalledFuncs.clear(); + GetAnyCallees(CS, CalledFuncs); + if (CalledFuncs.empty()) + continue; + + DSGraph *GI; + Instruction *TheCall = CS.getCallSite().getInstruction(); + if (CalledFuncs.size() == 1 && hasDSGraph(*CalledFuncs[0])) { + const Function *Callee = CalledFuncs[0]; + callee_add(TheCall, Callee); + + // Get the data structure graph for the called function. + GI = &getDSGraph(*Callee); // Graph to inline + if (GI == &Graph) continue; + DOUT << " Inlining graph for " << Callee->getName() + << "[" << GI->getGraphSize() << "+" + << GI->getAuxFunctionCalls().size() << "] into '" + << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+" + << Graph.getAuxFunctionCalls().size() << "]\n"; + Graph.mergeInGraph(CS, *Callee, *GI, + DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes); + ++NumBUInlines; + } else { + DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); + DEBUG(std::cerr << " calls " << CalledFuncs.size() + << " fns from site: " << CS.getCallSite().getInstruction() + << " " << *CS.getCallSite().getInstruction()); + DEBUG(std::cerr << " Fns ="); + unsigned NumPrinted = 0; + + for (std::vector::iterator I = CalledFuncs.begin(), + E = CalledFuncs.end(); I != E; ++I) { + if (NumPrinted++ < 8) DOUT << " " << (*I)->getName(); + + // Add the call edges to the call graph. + callee_add(TheCall, *I); + } + DOUT << "\n"; + + for (unsigned x = 0; x < CalledFuncs.size(); ) + if (!hasDSGraph(*CalledFuncs[x])) + CalledFuncs.erase(CalledFuncs.begin() + x); + else + ++x; + if (!CalledFuncs.size()) + continue; + + // See if we already computed a graph for this set of callees. + std::sort(CalledFuncs.begin(), CalledFuncs.end()); + std::pair > &IndCallGraph = + IndCallGraphMap[CalledFuncs]; + + if (IndCallGraph.first == &Graph) continue; + + if (IndCallGraph.first == 0) { + std::vector::iterator I = CalledFuncs.begin(), + E = CalledFuncs.end(); + + // Start with a copy of the first graph. + GI = IndCallGraph.first = new DSGraph(getDSGraph(**I), GlobalECs); + GI->setGlobalsGraph(Graph.getGlobalsGraph()); + std::vector &Args = IndCallGraph.second; + + // Get the argument nodes for the first callee. The return value is + // the 0th index in the vector. + GI->getFunctionArgumentsForCall(*I, Args); + + // Merge all of the other callees into this graph. + for (++I; I != E; ++I) { + // If the graph already contains the nodes for the function, don't + // bother merging it in again. + if (!GI->containsFunction(*I)) { + GI->cloneInto(getDSGraph(**I)); + ++NumBUInlines; + } + + std::vector NextArgs; + GI->getFunctionArgumentsForCall(*I, NextArgs); + unsigned i = 0, e = Args.size(); + for (; i != e; ++i) { + if (i == NextArgs.size()) break; + Args[i].mergeWith(NextArgs[i]); + } + for (e = NextArgs.size(); i != e; ++i) + Args.push_back(NextArgs[i]); + } + + // Clean up the final graph! + GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals); + } else { + DOUT << "***\n*** RECYCLED GRAPH ***\n***\n"; + } + + GI = IndCallGraph.first; + + // Merge the unified graph into this graph now. + DOUT << " Inlining multi callee graph " + << "[" << GI->getGraphSize() << "+" + << GI->getAuxFunctionCalls().size() << "] into '" + << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+" + << Graph.getAuxFunctionCalls().size() << "]\n"; + + Graph.mergeInGraph(CS, IndCallGraph.second, *GI, + DSGraph::StripAllocaBit | + DSGraph::DontCloneCallNodes); + ++NumBUInlines; + } + } + + // Recompute the Incomplete markers + Graph.maskIncompleteMarkers(); + Graph.markIncompleteNodes(DSGraph::MarkFormalArgs); + + // Delete dead nodes. Treat globals that are unreachable but that can + // reach live nodes as live. + Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals); + + // When this graph is finalized, clone the globals in the graph into the + // globals graph to make sure it has everything, from all graphs. + DSScalarMap &MainSM = Graph.getScalarMap(); + ReachabilityCloner RC(*GlobalsGraph, Graph, DSGraph::StripAllocaBit); + + // Clone everything reachable from globals in the function graph into the + // globals graph. + for (DSScalarMap::global_iterator I = MainSM.global_begin(), + E = MainSM.global_end(); I != E; ++I) + RC.getClonedNH(MainSM[*I]); + + //Graph.writeGraphToFile(cerr, "bu_" + F.getName()); } Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/CallTargets.cpp (original) +++ poolalloc/trunk/lib/DSA/CallTargets.cpp Thu Oct 9 01:24:31 2008 @@ -78,7 +78,7 @@ void CallTargetFinder::print(std::ostream &O, const Module *M) const { O << "[* = incomplete] CS: func list\n"; - for (std::map >::const_iterator ii = + for (std::map >::const_iterator ii = IndMap.begin(), ee = IndMap.end(); ii != ee; ++ii) { if (!ii->first.getCalledFunction()) { //only print indirect @@ -90,7 +90,7 @@ << cs.getInstruction()->getName() << " "; } O << ii->first.getInstruction() << ":"; - for (std::vector::const_iterator i = ii->second.begin(), + for (std::vector::const_iterator i = ii->second.begin(), e = ii->second.end(); i != e; ++i) { O << " " << (*i)->getName(); } @@ -109,11 +109,11 @@ AU.addRequired(); } -std::vector::iterator CallTargetFinder::begin(CallSite cs) { +std::vector::iterator CallTargetFinder::begin(CallSite cs) { return IndMap[cs].begin(); } -std::vector::iterator CallTargetFinder::end(CallSite cs) { +std::vector::iterator CallTargetFinder::end(CallSite cs) { return IndMap[cs].end(); } Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original) +++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Thu Oct 9 01:24:31 2008 @@ -13,7 +13,7 @@ // //===----------------------------------------------------------------------===// -#define DEBUG_TYPE "cbudatastructure" +#define DEBUG_TYPE "dsa-cbu" #include "dsa/DataStructure.h" #include "llvm/Module.h" #include "dsa/DSGraph.h" @@ -25,7 +25,7 @@ namespace { RegisterPass - X("cbudatastructure", "'Complete' Bottom-up Data Structure Analysis"); + X("dsa-cbu", "'Complete' Bottom-up Data Structure Analysis"); STATISTIC (NumCBUInlines, "Number of graphs inlined"); } @@ -35,13 +35,7 @@ // program. // bool CompleteBUDataStructures::runOnModule(Module &M) { - BUDataStructures &BU = getAnalysis(); - GlobalECs = BU.getGlobalECs(); - GlobalsGraph = new DSGraph(BU.getGlobalsGraph(), GlobalECs); - GlobalsGraph->setPrintAuxCalls(); - - // Our call graph is the same as the BU data structures call graph - ActualCallees = BU.getActualCallees(); + init(&getAnalysis(), false, true); std::vector Stack; hash_map ValMap; @@ -50,18 +44,18 @@ Function *MainFunc = M.getFunction("main"); if (MainFunc) { if (!MainFunc->isDeclaration()) - calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); + calculateSCCGraphs(getOrCreateGraph(MainFunc), Stack, NextID, ValMap); } else { DOUT << "CBU-DSA: No 'main' function found!\n"; } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && !DSInfo.count(I)) { + if (!I->isDeclaration() && !hasDSGraph(*I)) { if (MainFunc) { DOUT << "*** CBU: Function unreachable from main: " << I->getName() << "\n"; } - calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap); + calculateSCCGraphs(getOrCreateGraph(I), Stack, NextID, ValMap); } GlobalsGraph->removeTriviallyDeadNodes(); @@ -71,7 +65,7 @@ // into the main function's graph so that the main function contains all of // the information about global pools and GV usage in the program. if (MainFunc && !MainFunc->isDeclaration()) { - DSGraph &MainGraph = getOrCreateGraph(*MainFunc); + DSGraph &MainGraph = getOrCreateGraph(MainFunc); const DSGraph &GG = *MainGraph.getGlobalsGraph(); ReachabilityCloner RC(MainGraph, GG, DSGraph::DontCloneCallNodes | @@ -91,27 +85,6 @@ return false; } -DSGraph &CompleteBUDataStructures::getOrCreateGraph(Function &F) { - // Has the graph already been created? - DSGraph *&Graph = DSInfo[&F]; - if (Graph) return *Graph; - - // Copy the BU graph... - Graph = new DSGraph(getAnalysis().getDSGraph(F), GlobalECs); - Graph->setGlobalsGraph(GlobalsGraph); - Graph->setPrintAuxCalls(); - - // Make sure to update the DSInfo map for all of the functions currently in - // this graph! - for (DSGraph::retnodes_iterator I = Graph->retnodes_begin(); - I != Graph->retnodes_end(); ++I) - DSInfo[I->first] = Graph; - - return *Graph; -} - - - unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG, std::vector &Stack, unsigned &NextID, @@ -127,11 +100,10 @@ Instruction *Call = CI->getCallSite().getInstruction(); // Loop over all of the actually called functions... - callee_iterator I = callee_begin(Call), E = callee_end(Call); - for (; I != E && I->first == Call; ++I) { - assert(I->first == Call && "Bad callee construction!"); - if (!I->second->isDeclaration()) { - DSGraph &Callee = getOrCreateGraph(*I->second); + for (callee_iterator I = callee_begin(Call), E = callee_end(Call); + I != E ; ++I) { + if (!(*I)->isDeclaration()) { + DSGraph &Callee = getOrCreateGraph(*I); unsigned M; // Have we visited the destination function yet? hash_map::iterator It = ValMap.find(&Callee); @@ -159,7 +131,7 @@ // Update the DSInfo map and delete the old graph... for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); I != NG->retnodes_end(); ++I) - DSInfo[I->first] = &FG; + setDSGraph(*I->first, &FG); // Remove NG from the ValMap since the pointer may get recycled. ValMap.erase(NG); @@ -204,16 +176,15 @@ // Inline direct calls as well as indirect calls because the direct // callee may have indirect callees and so may have changed. // - callee_iterator I = callee_begin(TheCall),E = callee_end(TheCall); unsigned TNum = 0, Num = 0; - DEBUG(Num = std::distance(I, E)); - for (; I != E; ++I, ++TNum) { - assert(I->first == TheCall && "Bad callee construction!"); - Function *CalleeFunc = I->second; + DEBUG(Num = std::distance(callee_begin(TheCall), callee_end(TheCall))); + for (callee_iterator I = callee_begin(TheCall), E = callee_end(TheCall); + I != E; ++I, ++TNum) { + const Function *CalleeFunc = *I; if (!CalleeFunc->isDeclaration()) { // Merge the callee's graph into this graph. This works for normal // calls or for self recursion within an SCC. - DSGraph &GI = getOrCreateGraph(*CalleeFunc); + DSGraph &GI = getOrCreateGraph(CalleeFunc); ++NumCBUInlines; G.mergeInGraph(CS, *CalleeFunc, GI, DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes | Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructure.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructure.cpp Thu Oct 9 01:24:31 2008 @@ -112,14 +112,14 @@ // DSScalarMap Implementation //===----------------------------------------------------------------------===// -DSNodeHandle &DSScalarMap::AddGlobal(GlobalValue *GV) { +DSNodeHandle &DSScalarMap::AddGlobal(const GlobalValue *GV) { assert(ValueMap.count(GV) == 0 && "GV already exists!"); // If the node doesn't exist, check to see if it's a global that is // equated to another global in the program. - EquivalenceClasses::iterator ECI = GlobalECs.findValue(GV); + EquivalenceClasses::iterator ECI = GlobalECs.findValue(GV); if (ECI != GlobalECs.end()) { - GlobalValue *Leader = *GlobalECs.findLeader(ECI); + const GlobalValue *Leader = *GlobalECs.findLeader(ECI); if (Leader != GV) { GV = Leader; iterator I = ValueMap.find(GV); @@ -220,13 +220,13 @@ // addGlobal - Add an entry for a global value to the Globals list. This also // marks the node with the 'G' flag if it does not already have it. // -void DSNode::addGlobal(GlobalValue *GV) { +void DSNode::addGlobal(const GlobalValue *GV) { // First, check to make sure this is the leader if the global is in an // equivalence class. GV = getParentGraph()->getScalarMap().getLeaderForGlobal(GV); // Keep the list sorted. - std::vector::iterator I = + std::vector::iterator I = std::lower_bound(Globals.begin(), Globals.end(), GV); if (I == Globals.end() || *I != GV) { @@ -237,8 +237,8 @@ // removeGlobal - Remove the specified global that is explicitly in the globals // list. -void DSNode::removeGlobal(GlobalValue *GV) { - std::vector::iterator I = +void DSNode::removeGlobal(const GlobalValue *GV) { + std::vector::iterator I = std::lower_bound(Globals.begin(), Globals.end(), GV); assert(I != Globals.end() && *I == GV && "Global not in node!"); Globals.erase(I); @@ -316,13 +316,13 @@ /// addFullGlobalsList - Compute the full set of global values that are /// represented by this node. Unlike getGlobalsList(), this requires fair /// amount of work to compute, so don't treat this method call as free. -void DSNode::addFullGlobalsList(std::vector &List) const { +void DSNode::addFullGlobalsList(std::vector &List) const { if (globals_begin() == globals_end()) return; - EquivalenceClasses &EC = getParentGraph()->getGlobalECs(); + EquivalenceClasses &EC = getParentGraph()->getGlobalECs(); for (globals_iterator I = globals_begin(), E = globals_end(); I != E; ++I) { - EquivalenceClasses::iterator ECI = EC.findValue(*I); + EquivalenceClasses::iterator ECI = EC.findValue(*I); if (ECI == EC.end()) List.push_back(*I); else @@ -332,20 +332,20 @@ /// addFullFunctionList - Identical to addFullGlobalsList, but only return the /// functions in the full list. -void DSNode::addFullFunctionList(std::vector &List) const { +void DSNode::addFullFunctionList(std::vector &List) const { if (globals_begin() == globals_end()) return; - EquivalenceClasses &EC = getParentGraph()->getGlobalECs(); + EquivalenceClasses &EC = getParentGraph()->getGlobalECs(); for (globals_iterator I = globals_begin(), E = globals_end(); I != E; ++I) { - EquivalenceClasses::iterator ECI = EC.findValue(*I); + EquivalenceClasses::iterator ECI = EC.findValue(*I); if (ECI == EC.end()) { - if (Function *F = dyn_cast(*I)) + if (const Function *F = dyn_cast(*I)) List.push_back(F); } else { - for (EquivalenceClasses::member_iterator MI = + for (EquivalenceClasses::member_iterator MI = EC.member_begin(ECI), E = EC.member_end(); MI != E; ++MI) - if (Function *F = dyn_cast(*MI)) + if (const Function *F = dyn_cast(*MI)) List.push_back(F); } } @@ -765,7 +765,7 @@ return false; } - Module *M = 0; + const Module *M = 0; if (getParentGraph()->retnodes_begin() != getParentGraph()->retnodes_end()) M = getParentGraph()->retnodes_begin()->first->getParent(); @@ -802,51 +802,13 @@ } -/// MergeSortedVectors - Efficiently merge a vector into another vector where -/// duplicates are not allowed and both are sorted. This assumes that 'T's are -/// efficiently copyable and have sane comparison semantics. -/// -static void MergeSortedVectors(std::vector &Dest, - const std::vector &Src) { - // By far, the most common cases will be the simple ones. In these cases, - // avoid having to allocate a temporary vector... - // - if (Src.empty()) { // Nothing to merge in... - return; - } else if (Dest.empty()) { // Just copy the result in... - Dest = Src; - } else if (Src.size() == 1) { // Insert a single element... - const GlobalValue *V = Src[0]; - std::vector::iterator I = - std::lower_bound(Dest.begin(), Dest.end(), V); - if (I == Dest.end() || *I != Src[0]) // If not already contained... - Dest.insert(I, Src[0]); - } else if (Dest.size() == 1) { - GlobalValue *Tmp = Dest[0]; // Save value in temporary... - Dest = Src; // Copy over list... - std::vector::iterator I = - std::lower_bound(Dest.begin(), Dest.end(), Tmp); - if (I == Dest.end() || *I != Tmp) // If not already contained... - Dest.insert(I, Tmp); - - } else { - // Make a copy to the side of Dest... - std::vector Old(Dest); - - // Make space for all of the type entries now... - Dest.resize(Dest.size()+Src.size()); - - // Merge the two sorted ranges together... into Dest. - std::merge(Old.begin(), Old.end(), Src.begin(), Src.end(), Dest.begin()); - - // Now erase any duplicate entries that may have accumulated into the - // vectors (because they were in both of the input sets) - Dest.erase(std::unique(Dest.begin(), Dest.end()), Dest.end()); - } -} - -void DSNode::mergeGlobals(const std::vector &RHS) { - MergeSortedVectors(Globals, RHS); +void DSNode::mergeGlobals(const std::vector &RHS) { + std::vector Temp; + std::back_insert_iterator< std::vector > back_it (Temp); + std::set_union(Globals.begin(), Globals.end(), + RHS.begin(), RHS.end(), + back_it); + Globals.swap(Temp); } // MergeNodes - Helper function for DSNode::mergeWith(). @@ -1002,7 +964,7 @@ CurNodeH.getNode()->mergeGlobals(N->Globals); // Delete the globals from the old node... - std::vector().swap(N->Globals); + N->Globals.clear(); } } @@ -1081,7 +1043,7 @@ DSScalarMap &DestSM = Dest.getScalarMap(); for (DSNode::globals_iterator I = SN->globals_begin(),E = SN->globals_end(); I != E; ++I) { - GlobalValue *GV = *I; + const GlobalValue *GV = *I; DSScalarMap::iterator GI = DestSM.find(GV); if (GI != DestSM.end() && !GI->second.isNull()) { // We found one, use merge instead! @@ -1137,7 +1099,7 @@ // map with the correct offset. for (DSNode::globals_iterator I = SN->globals_begin(), E = SN->globals_end(); I != E; ++I) { - GlobalValue *GV = *I; + const GlobalValue *GV = *I; const DSNodeHandle &SrcGNH = Src.getNodeForValue(GV); DSNodeHandle &DestGNH = NodeMap[SrcGNH.getNode()]; assert(DestGNH.getNode() == NH.getNode() &&"Global mapping inconsistent"); @@ -1226,7 +1188,7 @@ // into. for (DSNode::globals_iterator I = SN->globals_begin(), E = SN->globals_end(); I != E; ++I) { - GlobalValue *GV = *I; + const GlobalValue *GV = *I; const DSNodeHandle &SrcGNH = Src.getNodeForValue(GV); DSNodeHandle &DestGNH = NodeMap[SrcGNH.getNode()]; assert(DestGNH.getNode()==NH.getNode() &&"Global mapping inconsistent"); @@ -1257,7 +1219,7 @@ // in the scalar map for them! for (DSNode::globals_iterator I = SN->globals_begin(), E = SN->globals_end(); I != E; ++I) { - GlobalValue *GV = *I; + const GlobalValue *GV = *I; const DSNodeHandle &SrcGNH = Src.getNodeForValue(GV); DSNodeHandle &DestGNH = NodeMap[SrcGNH.getNode()]; assert(DestGNH.getNode()==NH.getNode() &&"Global mapping inconsistent"); @@ -1389,7 +1351,7 @@ //===----------------------------------------------------------------------===// // Define here to avoid including iOther.h and BasicBlock.h in DSGraph.h -Function &DSCallSite::getCaller() const { +const Function &DSCallSite::getCaller() const { return *Site.getInstruction()->getParent()->getParent(); } @@ -1466,7 +1428,7 @@ } -DSGraph::DSGraph(DSGraph &G, EquivalenceClasses &ECs, +DSGraph::DSGraph(DSGraph &G, EquivalenceClasses &ECs, unsigned CloneFlags) : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) { PrintAuxCalls = false; @@ -1671,10 +1633,10 @@ /// function arguments. The vector is filled in with the return value (or /// null if it is not pointer compatible), followed by all of the /// pointer-compatible arguments. -void DSGraph::getFunctionArgumentsForCall(Function *F, +void DSGraph::getFunctionArgumentsForCall(const Function *F, std::vector &Args) const { Args.push_back(getReturnNodeFor(*F)); - for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end(); + for (Function::const_arg_iterator AI = F->arg_begin(), E = F->arg_end(); AI != E; ++AI) if (isa(AI->getType())) { Args.push_back(getNodeForValue(AI)); @@ -1840,7 +1802,7 @@ // through another global. Compute the set of node that can reach globals and // aux call nodes to copy over, then do it. std::vector AuxCallToCopy; - std::vector GlobalsToCopy; + std::vector GlobalsToCopy; // NodesReachCopiedNodes - Memoize results for efficiency. Contains a // true/false value for every visited node that reaches a copied node without @@ -1887,7 +1849,7 @@ /// merges the nodes specified in the call site with the formal arguments in the /// graph. /// -void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F, +void DSGraph::mergeInGraph(const DSCallSite &CS, const Function &F, const DSGraph &Graph, unsigned CloneFlags) { // Set up argument bindings. std::vector Args; @@ -1899,10 +1861,10 @@ /// getCallSiteForArguments - Get the arguments and return value bindings for /// the specified function in the current graph. /// -DSCallSite DSGraph::getCallSiteForArguments(Function &F) const { +DSCallSite DSGraph::getCallSiteForArguments(const Function &F) const { std::vector Args; - for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) + for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) if (isa(I->getType())) Args.push_back(getNodeForValue(I)); @@ -1982,8 +1944,8 @@ if (Flags & DSGraph::MarkFormalArgs) for (ReturnNodesTy::iterator FI = ReturnNodes.begin(), E =ReturnNodes.end(); FI != E; ++FI) { - Function &F = *FI->first; - for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); + const Function &F = *FI->first; + for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) if (isa(I->getType())) markIncompleteNode(getNodeForValue(I).getNode()); @@ -2013,7 +1975,7 @@ // Mark all global nodes as incomplete. for (DSScalarMap::global_iterator I = ScalarMap.global_begin(), E = ScalarMap.global_end(); I != E; ++I) - if (GlobalVariable *GV = dyn_cast(*I)) + if (const GlobalVariable *GV = dyn_cast(*I)) if (!GV->hasInitializer() || // Always mark external globals incomp. (!GV->isConstant() && (Flags & DSGraph::IgnoreGlobals) == 0)) markIncompleteNode(ScalarMap[GV].getNode()); @@ -2029,7 +1991,7 @@ } static inline bool nodeContainsExternalFunction(const DSNode *N) { - std::vector Funcs; + std::vector Funcs; N->addFullFunctionList(Funcs); for (unsigned i = 0, e = Funcs.size(); i != e; ++i) if (Funcs[i]->isDeclaration()) return true; @@ -2246,7 +2208,7 @@ // scalar map, so we check those now. // if (Node.getNumReferrers() == Node.getGlobalsList().size()) { - const std::vector &Globals = Node.getGlobalsList(); + const std::vector &Globals = Node.getGlobalsList(); // Loop through and make sure all of the globals are referring directly // to the node... @@ -2371,7 +2333,7 @@ // Alive - a set that holds all nodes found to be reachable/alive. hash_set Alive; - std::vector > GlobalNodes; + std::vector > GlobalNodes; // Copy and merge all information about globals to the GlobalsGraph if this is // not a final pass (where unreachable globals are removed). @@ -2507,7 +2469,7 @@ DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK()); } -void DSGraph::AssertNodeContainsGlobal(const DSNode *N, GlobalValue *GV) const { +void DSGraph::AssertNodeContainsGlobal(const DSNode *N, const GlobalValue *GV) const { assert(std::find(N->globals_begin(),N->globals_end(), GV) != N->globals_end() && "Global value not in node!"); } @@ -2543,7 +2505,7 @@ E = ScalarMap.end(); I != E; ++I) { assert(!I->second.isNull() && "Null node in scalarmap!"); AssertNodeInGraph(I->second.getNode()); - if (GlobalValue *GV = dyn_cast(I->first)) { + if (const GlobalValue *GV = dyn_cast(I->first)) { assert(I->second.getNode()->isGlobalNode() && "Global points to node, but node isn't global?"); AssertNodeContainsGlobal(I->second.getNode(), GV); @@ -2557,8 +2519,8 @@ for (ReturnNodesTy::const_iterator RI = ReturnNodes.begin(), E = ReturnNodes.end(); RI != E; ++RI) { - Function &F = *RI->first; - for (Function::arg_iterator AI = F.arg_begin(); AI != F.arg_end(); ++AI) + const Function &F = *RI->first; + for (Function::const_arg_iterator AI = F.arg_begin(); AI != F.arg_end(); ++AI) if (isa(AI->getType())) assert(!getNodeForValue(AI).isNull() && "Pointer argument must be in the scalar map!"); @@ -2759,7 +2721,7 @@ abort(); } -DSGraph& DataStructures::getOrCreateGraph(Function* F) { +DSGraph& DataStructures::getOrCreateGraph(const Function* F) { assert(F && "No function"); DSGraph *&G = DSInfo[F]; if (!G) { @@ -2789,11 +2751,11 @@ void DataStructures::formGlobalECs() { // Grow the equivalence classes for the globals to include anything that we // now know to be aliased. - std::set ECGlobals; + std::set ECGlobals; buildGlobalECs(ECGlobals); if (!ECGlobals.empty()) { DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n"; - for (hash_map::iterator I = DSInfo.begin(), + for (DSInfoTy::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) eliminateUsesOfECGlobals(*I->second, ECGlobals); } @@ -2804,9 +2766,9 @@ /// apart. Instead of maintaining this information in all of the graphs /// throughout the entire program, store only a single global (the "leader") in /// the graphs, and build equivalence classes for the rest of the globals. -void DataStructures::buildGlobalECs(std::set &ECGlobals) { +void DataStructures::buildGlobalECs(std::set &ECGlobals) { DSScalarMap &SM = GlobalsGraph->getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); + EquivalenceClasses &GlobalECs = SM.getGlobalECs(); for (DSGraph::node_iterator I = GlobalsGraph->node_begin(), E = GlobalsGraph->node_end(); I != E; ++I) { @@ -2814,7 +2776,7 @@ // First, build up the equivalence set for this block of globals. DSNode::globals_iterator i = I->globals_begin(); - GlobalValue *First = *i++; + const GlobalValue *First = *i++; for( ; i != I->globals_end(); ++i) { GlobalECs.unionSets(First, *i); ECGlobals.insert(*i); @@ -2837,14 +2799,14 @@ /// really just equivalent to some other globals, remove the globals from the /// specified DSGraph (if present), and merge any nodes with their leader nodes. void DataStructures::eliminateUsesOfECGlobals(DSGraph &G, - const std::set &ECGlobals) { + const std::set &ECGlobals) { DSScalarMap &SM = G.getScalarMap(); - EquivalenceClasses &GlobalECs = SM.getGlobalECs(); + EquivalenceClasses &GlobalECs = SM.getGlobalECs(); bool MadeChange = false; for (DSScalarMap::global_iterator GI = SM.global_begin(), E = SM.global_end(); GI != E; ) { - GlobalValue *GV = *GI++; + const GlobalValue *GV = *GI++; if (!ECGlobals.count(GV)) continue; const DSNodeHandle &GVNH = SM[GV]; @@ -2852,7 +2814,7 @@ // Okay, this global is in some equivalence class. Start by finding the // leader of the class. - GlobalValue *Leader = GlobalECs.getLeaderValue(GV); + const GlobalValue *Leader = GlobalECs.getLeaderValue(GV); // If the leader isn't already in the graph, insert it into the node // corresponding to GV. @@ -2877,3 +2839,37 @@ DEBUG(if(MadeChange) G.AssertGraphOK()); } + +void DataStructures::init(DataStructures* D, bool clone, bool printAuxCalls) { + assert (!GraphSource && "Already init"); + GraphSource = D; + Clone = clone; + TD = D->TD; + ActualCallees = D->ActualCallees; + GlobalECs = D->getGlobalECs(); + GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs); + if (printAuxCalls) GlobalsGraph->setPrintAuxCalls(); +} + +void DataStructures::init(TargetData* T) { + assert (!TD && "Already init"); + GraphSource = 0; + Clone = false; + TD = T; + GlobalsGraph = new DSGraph(GlobalECs, *T); +} + +void DataStructures::releaseMemory() { + for (DSInfoTy::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) { + I->second->getReturnNodes().erase(I->first); + if (I->second->getReturnNodes().empty()) + delete I->second; + } + + // Empty map so next time memory is released, data structures are not + // re-deleted. + DSInfo.clear(); + ActualCallees.clear(); + delete GlobalsGraph; + GlobalsGraph = 0; +} Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Thu Oct 9 01:24:31 2008 @@ -26,7 +26,7 @@ namespace { STATISTIC (TotalNumCallees, "Total number of callee functions at all indirect call sites"); STATISTIC (NumIndirectCalls, "Total number of indirect call sites in the program"); - STATISTIC (NumPoolNodes, "Number of allocation nodes that could be pool allocated"); + // STATISTIC (NumPoolNodes, "Number of allocation nodes that could be pool allocated"); // Typed/Untyped memory accesses: If DSA can infer that the types the loads // and stores are accessing are correct (ie, the node has not been collapsed), @@ -88,7 +88,7 @@ I != E; ++I) if (isIndirectCallee(I->getCallSite().getCalledValue())) { // This is an indirect function call - std::vector Callees; + std::vector Callees; I->getCalleeNode()->addFullFunctionList(Callees); if (Callees.size() > 0) { Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original) +++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Thu Oct 9 01:24:31 2008 @@ -29,7 +29,7 @@ using namespace llvm; namespace { - RegisterPass X("eqdatastructure", + RegisterPass X("dsa-eq", "Equivalence-class Bottom-up Data Structure Analysis"); STATISTIC (NumEquivBUInlines, "Number of graphs inlined"); @@ -39,7 +39,7 @@ char EquivClassGraphs::ID = 0; -EquivClassGraphs::EquivClassGraphs() : ModulePass((intptr_t)&ID) {} +EquivClassGraphs::EquivClassGraphs() : DataStructures((intptr_t)&ID) {} #ifndef NDEBUG template @@ -58,12 +58,12 @@ // getSomeCalleeForCallSite - Return any one callee function at a call site. // -Function *EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const{ +const Function *EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const{ Function *thisFunc = CS.getCaller(); assert(thisFunc && "getSomeCalleeForCallSite(): Not a valid call site?"); DSGraph &DSG = getDSGraph(*thisFunc); DSNode *calleeNode = DSG.getNodeForValue(CS.getCalledValue()).getNode(); - std::map::const_iterator I = + std::map::const_iterator I = OneCalledFunction.find(calleeNode); return (I == OneCalledFunction.end())? NULL : I->second; } @@ -72,14 +72,7 @@ // in the program. // bool EquivClassGraphs::runOnModule(Module &M) { - CBU = &getAnalysis(); - GlobalECs = CBU->getGlobalECs(); - DEBUG(CheckAllGraphs(&M, *CBU)); - - GlobalsGraph = new DSGraph(CBU->getGlobalsGraph(), GlobalECs); - GlobalsGraph->setPrintAuxCalls(); - - ActualCallees = CBU->getActualCallees(); + init(&getAnalysis(), false, true); // Find equivalence classes of functions called from common call sites. // Fold the CBU graphs for all functions in an equivalence class. @@ -90,16 +83,16 @@ std::map ValMap; unsigned NextID = 1; - Function *MainFunc = M.getFunction("main"); + const Function *MainFunc = M.getFunction("main"); if (MainFunc && !MainFunc->isDeclaration()) { - processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); + processSCC(getOrCreateGraph(MainFunc), Stack, NextID, ValMap); } else { cerr << "Fold Graphs: No 'main' function found!\n"; } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration()) - processSCC(getOrCreateGraph(*I), Stack, NextID, ValMap); + processSCC(getOrCreateGraph(I), Stack, NextID, ValMap); DEBUG(CheckAllGraphs(&M, *this)); @@ -110,7 +103,7 @@ // into the main function's graph so that the main function contains all of // the information about global pools and GV usage in the program. if (MainFunc && !MainFunc->isDeclaration()) { - DSGraph &MainGraph = getOrCreateGraph(*MainFunc); + DSGraph &MainGraph = getOrCreateGraph(MainFunc); const DSGraph &GG = *MainGraph.getGlobalsGraph(); ReachabilityCloner RC(MainGraph, GG, DSGraph::DontCloneCallNodes | @@ -140,7 +133,7 @@ UI != E; ++UI) // This only happens to direct uses by instructions. if (Instruction *User = dyn_cast(*UI)) { - DSGraph &DSG = getOrCreateGraph(*User->getParent()->getParent()); + DSGraph &DSG = getOrCreateGraph(User->getParent()->getParent()); if (!DSG.getScalarMap().count(GI)) { // If this global does not exist in the graph, but it is immediately // used by an instruction in the graph, clone it over from the @@ -159,46 +152,26 @@ // unify the N functions together in the FuncECs set. // void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { - const ActualCalleesTy& AC = CBU->getActualCallees(); - // Loop over all of the indirect calls in the program. If a call site can // call multiple different functions, we need to unify all of the callees into // the same equivalence class. - Instruction *LastInst = 0; - Function *FirstFunc = 0; - for (ActualCalleesTy::const_iterator I=AC.begin(), E=AC.end(); I != E; ++I) { - if (I->second->isDeclaration()) - continue; // Ignore functions we cannot modify - - CallSite CS = CallSite::get(I->first); - - if (CS.getCalledFunction()) { // Direct call: - FuncECs.insert(I->second); // -- Make sure function has equiv class - FirstFunc = I->second; // -- First callee at this site - } else { // Else indirect call - // DOUT << "CALLEE: " << I->second->getName() - // << " from : " << I->first; - if (I->first != LastInst) { - // This is the first callee from this call site. - LastInst = I->first; - FirstFunc = I->second; - // Instead of storing the lastInst For Indirection call Sites we store - // the DSNode for the function ptr arguemnt - Function *thisFunc = LastInst->getParent()->getParent(); - DSGraph &TFG = CBU->getDSGraph(*thisFunc); - DSNode *calleeNode = TFG.getNodeForValue(CS.getCalledValue()).getNode(); - OneCalledFunction[calleeNode] = FirstFunc; - FuncECs.insert(I->second); + std::vector keys; + callee_get_keys(keys); + + for (std::vector::iterator ii = keys.begin(), ee = keys.end(); + ii != ee; ++ii) { + const Function* F = 0; + for (callee_iterator csi = callee_begin(*ii), cse = callee_end(*ii); + csi != cse; ++csi) { + if (F != *csi) { + F = *csi; + FuncECs.insert(*csi); + const Function *thisFunc = (*ii)->getParent()->getParent(); + DSGraph &TFG = getOrCreateGraph(thisFunc); + DSNode *calleeNode = TFG.getNodeForValue((*ii)->getOperand(0)).getNode(); + OneCalledFunction[calleeNode] = *csi; } else { - // This is not the first possible callee from a particular call site. - // Union the callee in with the other functions. - FuncECs.unionSets(FirstFunc, I->second); -#ifndef NDEBUG - Function *thisFunc = LastInst->getParent()->getParent(); - DSGraph &TFG = CBU->getDSGraph(*thisFunc); - DSNode *calleeNode = TFG.getNodeForValue(CS.getCalledValue()).getNode(); - assert(OneCalledFunction.count(calleeNode) > 0 && "Missed a call?"); -#endif + FuncECs.unionSets(*csi, F); } } @@ -207,29 +180,29 @@ // its graph, then we include all other functions that are also in G(F). // Currently, that is just the functions in the same call-graph-SCC as F. // - DSGraph& funcDSGraph = CBU->getDSGraph(*I->second); + DSGraph& funcDSGraph = getOrCreateGraph(F); for (DSGraph::retnodes_iterator RI = funcDSGraph.retnodes_begin(), RE = funcDSGraph.retnodes_end(); RI != RE; ++RI) - FuncECs.unionSets(FirstFunc, RI->first); + FuncECs.unionSets(F, RI->first); } // Now that all of the equivalences have been built, merge the graphs for // each equivalence class. // DOUT << "\nIndirect Function Equivalence Sets:\n"; - for (EquivalenceClasses::iterator EQSI = FuncECs.begin(), E = + for (EquivalenceClasses::iterator EQSI = FuncECs.begin(), E = FuncECs.end(); EQSI != E; ++EQSI) { if (!EQSI->isLeader()) continue; - EquivalenceClasses::member_iterator SI = + EquivalenceClasses::member_iterator SI = FuncECs.member_begin(EQSI); assert(SI != FuncECs.member_end() && "Empty equiv set??"); - EquivalenceClasses::member_iterator SN = SI; + EquivalenceClasses::member_iterator SN = SI; ++SN; if (SN == FuncECs.member_end()) continue; // Single function equivalence set, no merging to do. - Function* LF = *SI; + const Function* LF = *SI; #ifndef NDEBUG DOUT <<" Equivalence set for leader " << LF->getName() <<" = "; @@ -241,12 +214,12 @@ // This equiv class has multiple functions: merge their graphs. First, // clone the CBU graph for the leader and make it the common graph for the // equivalence graph. - DSGraph &MergedG = getOrCreateGraph(*LF); + DSGraph &MergedG = getOrCreateGraph(LF); // Record the argument nodes for use in merging later below. std::vector ArgNodes; - for (Function::arg_iterator AI = LF->arg_begin(), E = LF->arg_end(); + for (Function::const_arg_iterator AI = LF->arg_begin(), E = LF->arg_end(); AI != E; ++AI) if (DS::isPointerType(AI->getType())) ArgNodes.push_back(MergedG.getNodeForValue(AI)); @@ -255,18 +228,16 @@ // that two or more functions may have the same graph, and it only needs // to be merged in once. std::set GraphsMerged; - GraphsMerged.insert(&CBU->getDSGraph(*LF)); + GraphsMerged.insert(&getOrCreateGraph(LF)); for (++SI; SI != FuncECs.member_end(); ++SI) { - Function *F = *SI; - DSGraph &CBUGraph = CBU->getDSGraph(*F); + const Function *F = *SI; + DSGraph &CBUGraph = getOrCreateGraph(F); if (GraphsMerged.insert(&CBUGraph).second) { // Record the "folded" graph for the function. for (DSGraph::retnodes_iterator I = CBUGraph.retnodes_begin(), - E = CBUGraph.retnodes_end(); I != E; ++I) { - assert(DSInfo[I->first] == 0 && "Graph already exists for Fn!"); - DSInfo[I->first] = &MergedG; - } + E = CBUGraph.retnodes_end(); I != E; ++I) + setDSGraph(*I->first, &MergedG); // Clone this member of the equivalence class into MergedG. MergedG.cloneInto(CBUGraph); @@ -277,7 +248,7 @@ // Merge the function arguments with all argument nodes found so far. // If there are extra function args, add them to the vector of argNodes - Function::arg_iterator AI2 = F->arg_begin(), AI2end = F->arg_end(); + Function::const_arg_iterator AI2 = F->arg_begin(), AI2end = F->arg_end(); for (unsigned arg = 0, numArgs = ArgNodes.size(); arg != numArgs && AI2 != AI2end; ++AI2, ++arg) if (DS::isPointerType(AI2->getType())) @@ -293,31 +264,6 @@ } -DSGraph &EquivClassGraphs::getOrCreateGraph(Function &F) { - // Has the graph already been created? - DSGraph *&Graph = DSInfo[&F]; - if (Graph) return *Graph; - - DSGraph &CBUGraph = CBU->getDSGraph(F); - - // Copy the CBU graph... - Graph = new DSGraph(CBUGraph, GlobalECs); // updates the map via reference - Graph->setGlobalsGraph(&getGlobalsGraph()); - Graph->setPrintAuxCalls(); - - // Make sure to update the DSInfo map for all functions in the graph! - for (DSGraph::retnodes_iterator I = Graph->retnodes_begin(); - I != Graph->retnodes_end(); ++I) - if (I->first != &F) { - DSGraph *&FG = DSInfo[I->first]; - assert(FG == 0 && "Merging function in SCC twice?"); - FG = Graph; - } - - return *Graph; -} - - unsigned EquivClassGraphs:: processSCC(DSGraph &FG, std::vector &Stack, unsigned &NextID, std::map &ValMap) { @@ -339,9 +285,9 @@ // Loop over all of the actually called functions... for (callee_iterator I = callee_begin(Call), E = callee_end(Call); I != E; ++I) - if (!I->second->isDeclaration()) { + if (!(*I)->isDeclaration()) { // Process the callee as necessary. - unsigned M = processSCC(getOrCreateGraph(*I->second), + unsigned M = processSCC(getOrCreateGraph(*I), Stack, NextID, ValMap); if (M < Min) Min = M; } @@ -364,7 +310,7 @@ // Update the DSInfo map and delete the old graph... for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); I != NG->retnodes_end(); ++I) - DSInfo[I->first] = &FG; + setDSGraph(*I->first, &FG); // Remove NG from the ValMap since the pointer may get recycled. ValMap.erase(NG); @@ -416,19 +362,19 @@ // Loop over all potential callees to find the first non-external callee. for (TNum = 0, Num = std::distance(I, E); I != E; ++I, ++TNum) - if (!I->second->isDeclaration()) + if (!(*I)->isDeclaration()) break; // Now check if the graph has changed and if so, clone and inline it. if (I != E) { - Function *CalleeFunc = I->second; + const Function *CalleeFunc = *I; // Merge the callee's graph into this graph, if not already the same. // Callees in the same equivalence class (which subsumes those // in the same SCCs) have the same graph. Note that all recursion // including self-recursion have been folded in the equiv classes. // - CalleeGraph = &getOrCreateGraph(*CalleeFunc); + CalleeGraph = &getOrCreateGraph(CalleeFunc); if (CalleeGraph != &G) { ++NumFoldGraphInlines; G.mergeInGraph(CS, *CalleeFunc, *CalleeGraph, @@ -452,8 +398,8 @@ // same graph as the one inlined above. if (CalleeGraph) for (++I, ++TNum; I != E; ++I, ++TNum) - if (!I->second->isDeclaration()) - assert(CalleeGraph == &getOrCreateGraph(*I->second) && + if (!(*I)->isDeclaration()) + assert(CalleeGraph == &getOrCreateGraph(*I) && "Callees at a call site have different graphs?"); #endif } Modified: poolalloc/trunk/lib/DSA/Local.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Local.cpp (original) +++ poolalloc/trunk/lib/DSA/Local.cpp Thu Oct 9 01:24:31 2008 @@ -155,7 +155,7 @@ for (DSScalarMap::global_iterator I = g.getScalarMap().global_begin(); I != g.getScalarMap().global_end(); ++I) - if (GlobalVariable *GV = dyn_cast(*I)) + if (const GlobalVariable *GV = dyn_cast(*I)) if (!GV->isDeclaration() && GV->isConstant()) RC.merge(g.getNodeForValue(GV), g.getGlobalsGraph()->getNodeForValue(GV)); } @@ -765,10 +765,9 @@ char LocalDataStructures::ID; bool LocalDataStructures::runOnModule(Module &M) { - setTargetData(getAnalysis()); + init(&getAnalysis()); // First step, build the globals graph. - GlobalsGraph = new DSGraph(GlobalECs, getTargetData()); { GraphBuilder GGB(*GlobalsGraph); @@ -788,7 +787,7 @@ if (!I->isDeclaration()) { DSGraph* G = new DSGraph(GlobalECs, getTargetData(), GlobalsGraph); GraphBuilder GGB(*I, *G); - DSInfo.insert(std::make_pair(I, G)); + setDSGraph(*I, G); } GlobalsGraph->removeTriviallyDeadNodes(); @@ -803,21 +802,3 @@ return false; } -// releaseMemory - If the pass pipeline is done with this pass, we can release -// our memory... here... -// -void LocalDataStructures::releaseMemory() { - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) { - I->second->getReturnNodes().erase(I->first); - if (I->second->getReturnNodes().empty()) - delete I->second; - } - - // Empty map so next time memory is released, data structures are not - // re-deleted. - DSInfo.clear(); - delete GlobalsGraph; - GlobalsGraph = 0; -} - Modified: poolalloc/trunk/lib/DSA/Printer.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Printer.cpp (original) +++ poolalloc/trunk/lib/DSA/Printer.cpp Thu Oct 9 01:24:31 2008 @@ -43,7 +43,7 @@ static std::string getCaption(const DSNode *N, const DSGraph *G) { std::stringstream OS; - Module *M = 0; + const Module *M = 0; if (!G) G = N->getParentGraph(); @@ -83,7 +83,7 @@ OS << "\n"; } - EquivalenceClasses *GlobalECs = 0; + EquivalenceClasses *GlobalECs = 0; if (G) GlobalECs = &G->getGlobalECs(); for (unsigned i = 0, e = N->getGlobalsList().size(); i != e; ++i) { @@ -91,7 +91,7 @@ // Figure out how many globals are equivalent to this one. if (GlobalECs) { - EquivalenceClasses::iterator I = + EquivalenceClasses::iterator I = GlobalECs->findValue(N->getGlobalsList()[i]); if (I != GlobalECs->end()) { unsigned NumMembers = @@ -147,7 +147,7 @@ /// static void addCustomGraphFeatures(const DSGraph *G, GraphWriter &GW) { - Module *CurMod = 0; + const Module *CurMod = 0; if (G->retnodes_begin() != G->retnodes_end()) CurMod = G->retnodes_begin()->first->getParent(); else { @@ -286,7 +286,7 @@ bool IsDuplicateGraph = false; if (I->getName() == "main" || !OnlyPrintMain) { - Function *SCCFn = Gr.retnodes_begin()->first; + const Function *SCCFn = Gr.retnodes_begin()->first; if (&*I == SCCFn) { Gr.writeGraphToFile(O, Prefix+I->getName()); } else { @@ -296,7 +296,7 @@ << "\n"; } } else { - Function *SCCFn = Gr.retnodes_begin()->first; + const Function *SCCFn = Gr.retnodes_begin()->first; if (&*I == SCCFn) { O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... [" << Gr.getGraphSize() << "+" << NumCalls << "]\n"; Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original) +++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Thu Oct 9 01:24:31 2008 @@ -31,111 +31,175 @@ char StdLibDataStructures::ID; +#define numOps 10 + struct libAction { - bool ret_read, ret_write, ret_heap; - bool args_read, args_write, args_heap; + bool read[numOps]; + bool write[numOps]; + bool heap[numOps]; bool mergeAllArgs; bool mergeWithRet; bool collapse; }; +#define NRET_NARGS {0,0,0,0,0,0,0,0,0,0} +#define YRET_NARGS {1,0,0,0,0,0,0,0,0,0} +#define NRET_YARGS {0,1,1,1,1,1,1,1,1,1} +#define YRET_YARGS {1,1,1,1,1,1,1,1,1,1} +#define NRET_NYARGS {0,0,1,1,1,1,1,1,1,1} +#define YRET_NYARGS {1,0,1,1,1,1,1,1,1,1} +#define NRET_YNARGS {0,1,0,0,0,0,0,0,0,0} +#define YRET_YNARGS {1,1,0,0,0,0,0,0,0,0} + + const struct { const char* name; libAction action; } recFuncs[] = { - {"calloc", {false, true, true, false, false, false, false, false, false}}, - {"malloc", {false, true, true, false, false, false, false, false, false}}, - {"valloc", {false, true, true, false, false, false, false, false, false}}, - {"memalign", {false, true, true, false, false, false, false, false, false}}, - {"strdup", {false, true, true, false, false, false, false, false, true}}, - {"wcsdup", {false, true, true, false, false, false, false, false, true}}, - {"free", {false, false, false, false, true, true, false, false, false}}, - {"realloc", {false, true, true, false, true, true, false, true, true}}, - {"atoi", {false, false, false, true, false, false, false, false, false}}, - {"atof", {false, false, false, true, false, false, false, false, false}}, - {"atol", {false, false, false, true, false, false, false, false, false}}, - {"atoll", {false, false, false, true, false, false, false, false, false}}, - {"remove", {false, false, false, true, false, false, false, false, false}}, - {"unlink", {false, false, false, true, false, false, false, false, false}}, - {"rename", {false, false, false, true, false, false, false, false, false}}, - {"memcmp", {false, false, false, true, false, false, false, false, false}}, - {"strcmp", {false, false, false, true, false, false, false, false, false}}, - {"strncmp", {false, false, false, true, false, false, false, false, false}}, - {"execl", {false, false, false, true, false, false, false, false, false}}, - {"execlp", {false, false, false, true, false, false, false, false, false}}, - {"execle", {false, false, false, true, false, false, false, false, false}}, - {"execv", {false, false, false, true, false, false, false, false, false}}, - {"execvp", {false, false, false, true, false, false, false, false, false}}, - {"chmod", {false, false, false, true, false, false, false, false, false}}, - {"puts", {false, false, false, true, false, false, false, false, false}}, - {"write", {false, false, false, true, false, false, false, false, false}}, - {"open", {false, false, false, true, false, false, false, false, false}}, - {"create", {false, false, false, true, false, false, false, false, false}}, - {"truncate", {false, false, false, true, false, false, false, false, false}}, - {"chdir", {false, false, false, true, false, false, false, false, false}}, - {"mkdir", {false, false, false, true, false, false, false, false, false}}, - {"rmdir", {false, false, false, true, false, false, false, false, false}}, - {"strlen", {false, false, false, true, false, false, false, false, false}}, - {"read", {false, false, false, false, true, false, false, false, false}}, - {"pipe", {false, false, false, false, true, false, false, false, false}}, - {"wait", {false, false, false, false, true, false, false, false, false}}, - {"time", {false, false, false, false, true, false, false, false, false}}, - {"getrusage",{false, false, false, false, true, false, false, false, false}}, - {"memchr", { true, false, false, true, false, false, false, true, true}}, - {"memrchr", { true, false, false, true, false, false, false, true, true}}, - {"rawmemchr",{ true, false, false, true, false, false, false, true, true}}, - {"memmove", {false, true, false, true, true, false, true, true, true}}, - {"bcopy", {false, false, false, true, true, false, true, false, true}}, - {"strcpy", {false, true, false, true, true, false, true, true, true}}, - {"strncpy", {false, true, false, true, true, false, true, true, true}}, - {"memccpy", {false, true, false, true, true, false, true, true, true}}, - {"wcscpy", {false, true, false, true, true, false, true, true, true}}, - {"wcsncpy", {false, true, false, true, true, false, true, true, true}}, - {"wmemccpy", {false, true, false, true, true, false, true, true, true}}, + {"stat", {NRET_YNARGS, NRET_NYARGS, NRET_NARGS, false, false, false}}, + {"fstat", {NRET_YNARGS, NRET_NYARGS, NRET_NARGS, false, false, false}}, + {"lstat", {NRET_YNARGS, NRET_NYARGS, NRET_NARGS, false, false, false}}, + + //printf not strictly true, %n could cause a write + {"printf", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"fprintf", {NRET_YARGS, NRET_YNARGS, NRET_NARGS, false, false, false}}, + {"sprintf", {NRET_YARGS, NRET_YNARGS, NRET_NARGS, false, false, false}}, + {"snprintf", {NRET_YARGS, NRET_YNARGS, NRET_NARGS, false, false, false}}, + + {"calloc", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + {"malloc", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + {"valloc", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + {"memalign", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + {"realloc", {NRET_NARGS, YRET_NARGS, YRET_YNARGS, false, true, true}}, + {"free", {NRET_NARGS, NRET_NARGS, NRET_YNARGS, false, false, false}}, + + {"strdup", {NRET_YARGS, YRET_NARGS, YRET_NARGS, false, true, false}}, + {"wcsdup", {NRET_YARGS, YRET_NARGS, YRET_NARGS, false, true, false}}, + + {"atoi", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"atof", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"atol", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"atoll", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"atoq", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + + {"strcmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"wcscmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"strncmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"wcsncmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"strcasecmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"wcscasecmp", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"strncasecmp",{NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"wcsncasecmp",{NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"strlen", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + {"wcslen", {NRET_YARGS, NRET_NARGS, NRET_NARGS, false, false, false}}, + + {"memchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"wmemchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"memrchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"strchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"wcschr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"strrchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"wcsrchr", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + {"strchrhul", {YRET_YARGS, NRET_NARGS, NRET_NARGS, false, true, true}}, + + +#if 0 + {"remove", {false, false, false, true, false, false, false, false, false}}, + {"unlink", {false, false, false, true, false, false, false, false, false}}, + {"rename", {false, false, false, true, false, false, false, false, false}}, + {"memcmp", {false, false, false, true, false, false, false, false, false}}, + {"execl", {false, false, false, true, false, false, false, false, false}}, + {"execlp", {false, false, false, true, false, false, false, false, false}}, + {"execle", {false, false, false, true, false, false, false, false, false}}, + {"execv", {false, false, false, true, false, false, false, false, false}}, + {"execvp", {false, false, false, true, false, false, false, false, false}}, + {"chmod", {false, false, false, true, false, false, false, false, false}}, + {"puts", {false, false, false, true, false, false, false, false, false}}, + {"write", {false, false, false, true, false, false, false, false, false}}, + {"open", {false, false, false, true, false, false, false, false, false}}, + {"create", {false, false, false, true, false, false, false, false, false}}, + {"truncate", {false, false, false, true, false, false, false, false, false}}, + {"chdir", {false, false, false, true, false, false, false, false, false}}, + {"mkdir", {false, false, false, true, false, false, false, false, false}}, + {"rmdir", {false, false, false, true, false, false, false, false, false}}, + {"read", {false, false, false, false, true, false, false, false, false}}, + {"pipe", {false, false, false, false, true, false, false, false, false}}, + {"wait", {false, false, false, false, true, false, false, false, false}}, + {"time", {false, false, false, false, true, false, false, false, false}}, + {"getrusage", {false, false, false, false, true, false, false, false, false}}, + {"memmove", {false, true, false, true, true, false, true, true, true}}, + {"bcopy", {false, false, false, true, true, false, true, false, true}}, + {"strcpy", {false, true, false, true, true, false, true, true, true}}, + {"strncpy", {false, true, false, true, true, false, true, true, true}}, + {"memccpy", {false, true, false, true, true, false, true, true, true}}, + {"wcscpy", {false, true, false, true, true, false, true, true, true}}, + {"wcsncpy", {false, true, false, true, true, false, true, true, true}}, + {"wmemccpy", {false, true, false, true, true, false, true, true, true}}, + {"fclose", {false, false, false, true, true, false, false, false, false}}, + {"fopen", {false, true, true, true, false, false, false, false, false}}, + {"getcwd", { true, true, true, true, true, true, false, true, true}}, +#endif + //C++ functions, as mangled on linux gcc 4.2 + //operator new(unsigned long) + {"_Znwm", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + //operator new[](unsigned long) + {"_Znam", {NRET_NARGS, YRET_NARGS, YRET_NARGS, false, false, false}}, + //operator delete(void*) + {"_ZdlPv", {NRET_NARGS, NRET_NARGS, NRET_YNARGS, false, false, false}}, + //operator delete[](void*) + {"_ZdaPv", {NRET_NARGS, NRET_NARGS, NRET_YNARGS, false, false, false}}, + }; -bool StdLibDataStructures::runOnModule(Module &M) { - LocalDataStructures &LocalDSA = getAnalysis(); - setGraphSource(&LocalDSA); - setTargetData(LocalDSA.getTargetData()); - setGraphClone(false); - GlobalECs = LocalDSA.getGlobalECs(); +void StdLibDataStructures::eraseCallsTo(Function* F) { + for (Value::use_iterator ii = F->use_begin(), ee = F->use_end(); + ii != ee; ++ii) + if (CallInst* CI = dyn_cast(ii)) + if (CI->getOperand(0) == F) { + DSGraph& Graph = getDSGraph(*CI->getParent()->getParent()); + //delete the call + DOUT << "Removing " << F->getName() << " from " << CI->getParent()->getParent()->getName() << "\n"; + Graph.removeFunctionCalls(*F); + } +} - GlobalsGraph = new DSGraph(LocalDSA.getGlobalsGraph(), GlobalECs); - GlobalsGraph->setPrintAuxCalls(); +bool StdLibDataStructures::runOnModule(Module &M) { + init(&getAnalysis(), false, true); //Clone Module for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration()) getOrCreateGraph(&*I); + //Functions we handle by summary + for (int x = 0; recFuncs[x].name; ++x) if (Function* F = M.getFunction(recFuncs[x].name)) - if (F->isDeclaration()) + if (F->isDeclaration()) { for (Value::use_iterator ii = F->use_begin(), ee = F->use_end(); ii != ee; ++ii) if (CallInst* CI = dyn_cast(ii)) if (CI->getOperand(0) == F) { DSGraph& Graph = getDSGraph(*CI->getParent()->getParent()); - if (recFuncs[x].action.ret_read) + if (recFuncs[x].action.read[0]) Graph.getNodeForValue(CI).getNode()->setReadMarker(); - if (recFuncs[x].action.ret_write) + if (recFuncs[x].action.write[0]) Graph.getNodeForValue(CI).getNode()->setModifiedMarker(); - if (recFuncs[x].action.ret_heap) + if (recFuncs[x].action.heap[0]) Graph.getNodeForValue(CI).getNode()->setHeapMarker(); - if (recFuncs[x].action.args_read) - for (unsigned y = 1; y < CI->getNumOperands(); ++y) + for (unsigned y = 1; y < CI->getNumOperands(); ++y) + if (recFuncs[x].action.read[y]) if (isa(CI->getOperand(y)->getType())) if (DSNode * Node=Graph.getNodeForValue(CI->getOperand(y)).getNode()) Node->setReadMarker(); - if (recFuncs[x].action.args_write) - for (unsigned y = 1; y < CI->getNumOperands(); ++y) + for (unsigned y = 1; y < CI->getNumOperands(); ++y) + if (recFuncs[x].action.write[y]) if (isa(CI->getOperand(y)->getType())) if (DSNode * Node=Graph.getNodeForValue(CI->getOperand(y)).getNode()) Node->setModifiedMarker(); - if (recFuncs[x].action.args_heap) - for (unsigned y = 1; y < CI->getNumOperands(); ++y) + for (unsigned y = 1; y < CI->getNumOperands(); ++y) + if (recFuncs[x].action.heap[y]) if (isa(CI->getOperand(y)->getType())) if (DSNode * Node=Graph.getNodeForValue(CI->getOperand(y)).getNode()) Node->setHeapMarker(); @@ -156,32 +220,19 @@ for (unsigned y = 1; y < CI->getNumOperands(); ++y) if (isa(CI->getOperand(y)->getType())) if (DSNode * Node=Graph.getNodeForValue(CI->getOperand(y)).getNode()) - Node->foldNodeCompletely(); + Node->foldNodeCompletely(); } - + } + for (Value::use_iterator ii = F->use_begin(), ee = F->use_end(); + ii != ee; ++ii) + if (CallInst* CI = dyn_cast(ii)) + if (CI->getOperand(0) == F) { + DSGraph& Graph = getDSGraph(*CI->getParent()->getParent()); //delete the call DOUT << "Removing " << F->getName() << " from " << CI->getParent()->getParent()->getName() << "\n"; Graph.removeFunctionCalls(*F); } + } return false; } - -// releaseMemory - If the pass pipeline is done with this pass, we can release -// our memory... here... -// -void StdLibDataStructures::releaseMemory() { - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) { - I->second->getReturnNodes().erase(I->first); - if (I->second->getReturnNodes().empty()) - delete I->second; - } - - // Empty map so next time memory is released, data structures are not - // re-deleted. - DSInfo.clear(); - delete GlobalsGraph; - GlobalsGraph = 0; -} - Modified: poolalloc/trunk/lib/DSA/Steensgaard.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Steensgaard.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Steensgaard.cpp (original) +++ poolalloc/trunk/lib/DSA/Steensgaard.cpp Thu Oct 9 01:24:31 2008 @@ -27,7 +27,7 @@ class Steens : public ModulePass, public AliasAnalysis { DSGraph *ResultGraph; - EquivalenceClasses GlobalECs; // Always empty + EquivalenceClasses GlobalECs; // Always empty public: static char ID; Steens() : ModulePass((intptr_t)&ID), ResultGraph(0) {} @@ -73,7 +73,7 @@ virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2); private: - void ResolveFunctionCall(Function *F, const DSCallSite &Call, + void ResolveFunctionCall(const Function *F, const DSCallSite &Call, DSNodeHandle &RetVal); }; @@ -93,7 +93,7 @@ /// with the specified call site descriptor. This function links the arguments /// and the return value for the call site context-insensitively. /// -void Steens::ResolveFunctionCall(Function *F, const DSCallSite &Call, +void Steens::ResolveFunctionCall(const Function *F, const DSCallSite &Call, DSNodeHandle &RetVal) { assert(ResultGraph != 0 && "Result graph not allocated!"); DSGraph::ScalarMapTy &ValMap = ResultGraph->getScalarMap(); @@ -104,7 +104,7 @@ // Loop over all pointer arguments, resolving them to their provided pointers unsigned PtrArgIdx = 0; - for (Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end(); + for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); AI != AE && PtrArgIdx < Call.getNumPtrArgs(); ++AI) { DSGraph::ScalarMapTy::iterator I = ValMap.find(AI); if (I != ValMap.end()) // If its a pointer argument... @@ -150,7 +150,7 @@ DSCallSite &CurCall = *CI++; // Loop over the called functions, eliminating as many as possible... - std::vector CallTargets; + std::vector CallTargets; if (CurCall.isDirectCall()) CallTargets.push_back(CurCall.getCalleeFunc()); else @@ -158,7 +158,7 @@ for (unsigned c = 0; c != CallTargets.size(); ) { // If we can eliminate this function call, do so! - Function *F = CallTargets[c]; + const Function *F = CallTargets[c]; if (!F->isDeclaration()) { ResolveFunctionCall(F, CurCall, ResultGraph->getReturnNodes()[F]); CallTargets[c] = CallTargets.back(); Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Thu Oct 9 01:24:31 2008 @@ -48,7 +48,7 @@ for (unsigned i = 0, e = N->getNumLinks(); i != e; ++i) { DSNodeHandle &NH = N->getLink(i*N->getPointerSize()); if (DSNode *NN = NH.getNode()) { - std::vector Functions; + std::vector Functions; NN->addFullFunctionList(Functions); ArgsRemainIncomplete.insert(Functions.begin(), Functions.end()); markReachableFunctionsExternallyAccessible(NN, Visited); @@ -61,14 +61,7 @@ // program. // bool TDDataStructures::runOnModule(Module &M) { - BUInfo = &getAnalysis(); - setGraphSource(BUInfo); - setTargetData(BUInfo->getTargetData()); - setGraphClone(true); - - GlobalECs = BUInfo->getGlobalECs(); - GlobalsGraph = new DSGraph(BUInfo->getGlobalsGraph(), GlobalECs); - GlobalsGraph->setPrintAuxCalls(); + init(&getAnalysis(), true, true); // Figure out which functions must not mark their arguments complete because // they are accessible outside this compilation unit. Currently, these @@ -144,7 +137,8 @@ } -void TDDataStructures::ComputePostOrder(Function &F,hash_set &Visited, +void TDDataStructures::ComputePostOrder(const Function &F, + hash_set &Visited, std::vector &PostOrder) { if (F.isDeclaration()) return; DSGraph &G = getOrCreateGraph(&F); @@ -154,39 +148,14 @@ // Recursively traverse all of the callee graphs. for (DSGraph::fc_iterator CI = G.fc_begin(), CE = G.fc_end(); CI != CE; ++CI){ Instruction *CallI = CI->getCallSite().getInstruction(); - for (BUDataStructures::callee_iterator I = BUInfo->callee_begin(CallI), - E = BUInfo->callee_end(CallI); I != E; ++I) - ComputePostOrder(*I->second, Visited, PostOrder); + for (callee_iterator I = callee_begin(CallI), + E = callee_end(CallI); I != E; ++I) + ComputePostOrder(**I, Visited, PostOrder); } PostOrder.push_back(&G); } - - - - -// releaseMemory - If the pass pipeline is done with this pass, we can release -// our memory... here... -// -// FIXME: This should be releaseMemory and will work fine, except that LoadVN -// has no way to extend the lifetime of the pass, which screws up ds-aa. -// -void TDDataStructures::releaseMyMemory() { - for (hash_map::iterator I = DSInfo.begin(), - E = DSInfo.end(); I != E; ++I) { - I->second->getReturnNodes().erase(I->first); - if (I->second->getReturnNodes().empty()) - delete I->second; - } - - // Empty map so next time memory is released, data structures are not - // re-deleted. - DSInfo.clear(); - delete GlobalsGraph; - GlobalsGraph = 0; -} - /// InlineCallersIntoGraph - Inline all of the callers of the specified DS graph /// into it, then recompute completeness of nodes in the resultant graph. void TDDataStructures::InlineCallersIntoGraph(DSGraph &DSG) { @@ -235,7 +204,7 @@ // Inline all call sites from this caller graph. do { const DSCallSite &CS = *EdgesFromCaller.back().CS; - Function &CF = *EdgesFromCaller.back().CalledFunction; + const Function &CF = *EdgesFromCaller.back().CalledFunction; DOUT << " [TD] Inlining graph into Fn '" << CF.getName() << "' from "; if (CallerGraph.getReturnNodes().empty()) DOUT << "SYNTHESIZED INDIRECT GRAPH"; @@ -300,21 +269,21 @@ Instruction *CallI = CI->getCallSite().getInstruction(); // For each function in the invoked function list at this call site... - BUDataStructures::callee_iterator IPI = - BUInfo->callee_begin(CallI), IPE = BUInfo->callee_end(CallI); + callee_iterator IPI = + callee_begin(CallI), IPE = callee_end(CallI); // Skip over all calls to this graph (SCC calls). - while (IPI != IPE && &getDSGraph(*IPI->second) == &DSG) + while (IPI != IPE && &getDSGraph(**IPI) == &DSG) ++IPI; // All SCC calls? if (IPI == IPE) continue; - Function *FirstCallee = IPI->second; + const Function *FirstCallee = *IPI; ++IPI; // Skip over more SCC calls. - while (IPI != IPE && &getDSGraph(*IPI->second) == &DSG) + while (IPI != IPE && &getDSGraph(**IPI) == &DSG) ++IPI; // If there is exactly one callee from this call site, remember the edge in @@ -331,15 +300,14 @@ // this set of targets. If so, we don't want to do M*N inlining operations, // so we build up a new, private, graph that represents the calls of all // calls to this set of functions. - std::vector Callees; - for (BUDataStructures::ActualCalleesTy::const_iterator I = - BUInfo->callee_begin(CallI), E = BUInfo->callee_end(CallI); + std::vector Callees; + for (callee_iterator I = callee_begin(CallI), E = callee_end(CallI); I != E; ++I) - if (!I->second->isDeclaration()) - Callees.push_back(I->second); + if (!(*I)->isDeclaration()) + Callees.push_back(*I); std::sort(Callees.begin(), Callees.end()); - std::map, DSGraph*>::iterator IndCallRecI = + std::map, DSGraph*>::iterator IndCallRecI = IndCallMap.lower_bound(Callees); DSGraph *IndCallGraph; Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Thu Oct 9 01:24:31 2008 @@ -393,6 +393,7 @@ OldFuncTy->isVarArg()); // Create the new function... Function *New = Function::Create(FuncTy, Function::InternalLinkage, F.getName()); + New->copyAttributesFrom(&F); F.getParent()->getFunctionList().insert(&F, New); CloneToOrigMap[New] = &F; // Remember original function. Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=57319&r1=57318&r2=57319&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Thu Oct 9 01:24:31 2008 @@ -70,9 +70,15 @@ void visitMemAlignCall(CallSite CS); void visitStrdupCall(CallSite CS); void visitFreeInst(FreeInst &FI); - void visitCallSite(CallSite CS); - void visitCallInst(CallInst &CI) { visitCallSite(&CI); } - void visitInvokeInst(InvokeInst &II) { visitCallSite(&II); } + void visitCallSite(CallSite &CS); + void visitCallInst(CallInst &CI) { + CallSite CS(&CI); + visitCallSite(CS); + } + void visitInvokeInst(InvokeInst &II) { + CallSite CS(&II); + visitCallSite(CS); + } void visitLoadInst(LoadInst &I); void visitStoreInst (StoreInst &I); @@ -532,8 +538,8 @@ } -void FuncTransform::visitCallSite(CallSite CS) { - Function *CF = CS.getCalledFunction(); +void FuncTransform::visitCallSite(CallSite& CS) { + const Function *CF = CS.getCalledFunction(); Instruction *TheCall = CS.getInstruction(); // If the called function is casted from one function type to another, peer @@ -614,11 +620,10 @@ if (!CF) for (EquivClassGraphs::callee_iterator I = ECGraphs.callee_begin(OrigInst), - E = ECGraphs.callee_end(OrigInst); I != E; ++I) - if (I->second) { - CF = I->second; - break; - } + E = ECGraphs.callee_end(OrigInst); I != E; ++I) { + CF = *I; + break; + } // If we didn't find the callee in the constructed call graph, try // checking in the DSNode itself. @@ -627,11 +632,11 @@ if (!CF) { DSGraph* dg = &ECGraphs.getDSGraph(*OrigInst->getParent()->getParent()); DSNode* d = dg->getNodeForValue(OrigInst->getOperand(0)).getNode(); - const std::vector &g = d->getGlobalsList(); - for(std::vector::const_iterator ii = g.begin(), ee = g.end(); + const std::vector &g = d->getGlobalsList(); + for(std::vector::const_iterator ii = g.begin(), ee = g.end(); !CF && ii != ee; ++ii) { - EquivalenceClasses< GlobalValue *> & EC = ECGraphs.getGlobalECs(); - for (EquivalenceClasses::member_iterator MI = EC.findLeader(*ii); + EquivalenceClasses< const GlobalValue *> & EC = ECGraphs.getGlobalECs(); + for (EquivalenceClasses::member_iterator MI = EC.findLeader(*ii); MI != EC.member_end(); ++MI) // Loop over members in this set. if ((CF = dyn_cast(*MI))) { std::cerr << "\n***\nPA: *** WARNING (FuncTransform::visitCallSite): " @@ -654,6 +659,7 @@ std::cerr << "\n***\nPA: *** WARNING (FuncTransform::visitCallSite): " << "Unknown callees for call-site in function " << CS.getCaller()->getName() << "\n***\n"; + abort(); return; } @@ -665,8 +671,8 @@ EquivClassGraphs::callee_iterator I = ECGraphs.callee_begin(OrigInst), E = ECGraphs.callee_end(OrigInst); for (; I != E; ++I) - if (!I->second->isDeclaration()) - assert(CalleeGraph == &ECGraphs.getDSGraph(*I->second) && + if (!(*I)->isDeclaration()) + assert(CalleeGraph == &ECGraphs.getDSGraph(**I) && "Callees at call site do not have a common graph!"); #endif @@ -692,7 +698,7 @@ NewCallee = CastInst::createPointerCast(CS.getCalledValue(), PFTy, "tmp", TheCall); } - Function::arg_iterator FAI = CF->arg_begin(), E = CF->arg_end(); + Function::const_arg_iterator FAI = CF->arg_begin(), E = CF->arg_end(); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end(); for ( ; FAI != E && AI != AE; ++FAI, ++AI) if (!isa(*AI)) From nicholas at mxc.ca Thu Oct 9 01:27:14 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Thu, 09 Oct 2008 06:27:14 -0000 Subject: [llvm-commits] [llvm] r57320 - /llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Message-ID: <200810090627.m996REi3004595@zion.cs.uiuc.edu> Author: nicholas Date: Thu Oct 9 01:27:14 2008 New Revision: 57320 URL: http://llvm.org/viewvc/llvm-project?rev=57320&view=rev Log: Don't drop alignment on globals when cloning. Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Modified: llvm/trunk/lib/Transforms/Utils/CloneModule.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneModule.cpp?rev=57320&r1=57319&r2=57320&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/CloneModule.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/CloneModule.cpp Thu Oct 9 01:27:14 2008 @@ -55,10 +55,14 @@ // don't worry about attributes or initializers, they will come later. // for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); - I != E; ++I) - ValueMap[I] = new GlobalVariable(I->getType()->getElementType(), false, - GlobalValue::ExternalLinkage, 0, - I->getName(), New); + I != E; ++I) { + GlobalVariable *GV = new GlobalVariable(I->getType()->getElementType(), + false, + GlobalValue::ExternalLinkage, 0, + I->getName(), New); + GV->setAlignment(I->getAlignment()); + ValueMap[I] = GV; + } // Loop over the functions in the module, making external functions as before for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) { @@ -66,7 +70,7 @@ Function::Create(cast(I->getType()->getElementType()), GlobalValue::ExternalLinkage, I->getName(), New); NF->copyAttributesFrom(I); - ValueMap[I]= NF; + ValueMap[I] = NF; } // Loop over the aliases in the module From alenhar2 at cs.uiuc.edu Thu Oct 9 01:27:33 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 09 Oct 2008 06:27:33 -0000 Subject: [llvm-commits] [poolalloc] r57321 - in /poolalloc/trunk/include: dsa/CallTargets.h dsa/DSGraph.h dsa/DSNode.h dsa/DSSupport.h dsa/DataStructure.h poolalloc/PoolAllocate.h Message-ID: <200810090627.m996RXtM004620@zion.cs.uiuc.edu> Author: alenhar2 Date: Thu Oct 9 01:27:33 2008 New Revision: 57321 URL: http://llvm.org/viewvc/llvm-project?rev=57321&view=rev Log: simplify and unify code. EQ pass may be broken Modified: poolalloc/trunk/include/dsa/CallTargets.h poolalloc/trunk/include/dsa/DSGraph.h poolalloc/trunk/include/dsa/DSNode.h poolalloc/trunk/include/dsa/DSSupport.h poolalloc/trunk/include/dsa/DataStructure.h poolalloc/trunk/include/poolalloc/PoolAllocate.h Modified: poolalloc/trunk/include/dsa/CallTargets.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/CallTargets.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/CallTargets.h (original) +++ poolalloc/trunk/include/dsa/CallTargets.h Thu Oct 9 01:27:33 2008 @@ -24,7 +24,7 @@ namespace llvm { class CallTargetFinder : public ModulePass { - std::map > IndMap; + std::map > IndMap; std::set CompleteSites; std::list AllSites; @@ -40,8 +40,8 @@ virtual void print(std::ostream &O, const Module *M) const; // Given a CallSite, get an iterator of callees - std::vector::iterator begin(CallSite cs); - std::vector::iterator end(CallSite cs); + std::vector::iterator begin(CallSite cs); + std::vector::iterator end(CallSite cs); // Iterate over CallSites in program std::list::iterator cs_begin(); Modified: poolalloc/trunk/include/dsa/DSGraph.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSGraph.h (original) +++ poolalloc/trunk/include/dsa/DSGraph.h Thu Oct 9 01:27:33 2008 @@ -39,17 +39,17 @@ /// globals or unique node handles active in the function. /// class DSScalarMap { - typedef hash_map ValueMapTy; + typedef hash_map ValueMapTy; ValueMapTy ValueMap; - typedef hash_set GlobalSetTy; + typedef hash_set GlobalSetTy; GlobalSetTy GlobalSet; - EquivalenceClasses &GlobalECs; + EquivalenceClasses &GlobalECs; public: - DSScalarMap(EquivalenceClasses &ECs) : GlobalECs(ECs) {} + DSScalarMap(EquivalenceClasses &ECs) : GlobalECs(ECs) {} - EquivalenceClasses &getGlobalECs() const { return GlobalECs; } + EquivalenceClasses &getGlobalECs() const { return GlobalECs; } // Compatibility methods: provide an interface compatible with a map of // Value* to DSNodeHandle's. @@ -60,56 +60,56 @@ const_iterator begin() const { return ValueMap.begin(); } const_iterator end() const { return ValueMap.end(); } - GlobalValue *getLeaderForGlobal(GlobalValue *GV) const { - EquivalenceClasses::iterator ECI = GlobalECs.findValue(GV); + const GlobalValue *getLeaderForGlobal(const GlobalValue *GV) const { + EquivalenceClasses::iterator ECI = GlobalECs.findValue(GV); if (ECI == GlobalECs.end()) return GV; return *GlobalECs.findLeader(ECI); } - iterator find(Value *V) { + iterator find(const Value *V) { iterator I = ValueMap.find(V); if (I != ValueMap.end()) return I; - if (GlobalValue *GV = dyn_cast(V)) { + if (const GlobalValue *GV = dyn_cast(V)) { // If this is a global, check to see if it is equivalenced to something // in the map. - GlobalValue *Leader = getLeaderForGlobal(GV); + const GlobalValue *Leader = getLeaderForGlobal(GV); if (Leader != GV) - I = ValueMap.find((Value*)Leader); + I = ValueMap.find((const Value*)Leader); } return I; } - const_iterator find(Value *V) const { + const_iterator find(const Value *V) const { const_iterator I = ValueMap.find(V); if (I != ValueMap.end()) return I; - if (GlobalValue *GV = dyn_cast(V)) { + if (const GlobalValue *GV = dyn_cast(V)) { // If this is a global, check to see if it is equivalenced to something // in the map. - GlobalValue *Leader = getLeaderForGlobal(GV); + const GlobalValue *Leader = getLeaderForGlobal(GV); if (Leader != GV) - I = ValueMap.find((Value*)Leader); + I = ValueMap.find((const Value*)Leader); } return I; } /// getRawEntryRef - This method can be used by clients that are aware of the /// global value equivalence class in effect. - DSNodeHandle &getRawEntryRef(Value *V) { + DSNodeHandle &getRawEntryRef(const Value *V) { std::pair IP = ValueMap.insert(std::make_pair(V, DSNodeHandle())); if (IP.second) // Inserted the new entry into the map. - if (GlobalValue *GV = dyn_cast(V)) + if (const GlobalValue *GV = dyn_cast(V)) GlobalSet.insert(GV); return IP.first->second; } - unsigned count(Value *V) const { return ValueMap.find(V) != ValueMap.end(); } + unsigned count(const Value *V) const { return ValueMap.find(V) != ValueMap.end(); } - void erase(Value *V) { erase(ValueMap.find(V)); } + void erase(const Value *V) { erase(ValueMap.find(V)); } - void eraseIfExists(Value *V) { + void eraseIfExists(const Value *V) { iterator I = find(V); if (I != end()) erase(I); } @@ -117,7 +117,7 @@ /// replaceScalar - When an instruction needs to be modified, this method can /// be used to update the scalar map to remove the old and insert the new. /// - void replaceScalar(Value *Old, Value *New) { + void replaceScalar(const Value *Old, const Value *New) { iterator I = find(Old); assert(I != end() && "Old value is not in the map!"); ValueMap.insert(std::make_pair(New, I->second)); @@ -126,7 +126,7 @@ /// copyScalarIfExists - If Old exists in the scalar map, make New point to /// whatever Old did. - void copyScalarIfExists(Value *Old, Value *New) { + void copyScalarIfExists(const Value *Old, const Value *New) { iterator I = find(Old); if (I != end()) ValueMap.insert(std::make_pair(New, I->second)); @@ -134,12 +134,12 @@ /// operator[] - Return the DSNodeHandle for the specified value, creating a /// new null handle if there is no entry yet. - DSNodeHandle &operator[](Value *V) { + DSNodeHandle &operator[](const Value *V) { iterator I = ValueMap.find(V); if (I != ValueMap.end()) return I->second; // Return value if already exists. - if (GlobalValue *GV = dyn_cast(V)) + if (const GlobalValue *GV = dyn_cast(V)) return AddGlobal(GV); return ValueMap.insert(std::make_pair(V, DSNodeHandle())).first->second; @@ -147,7 +147,7 @@ void erase(iterator I) { assert(I != ValueMap.end() && "Cannot erase end!"); - if (GlobalValue *GV = dyn_cast(I->first)) + if (const GlobalValue *GV = dyn_cast(I->first)) GlobalSet.erase(GV); ValueMap.erase(I); } @@ -178,9 +178,9 @@ global_iterator global_begin() const { return GlobalSet.begin(); } global_iterator global_end() const { return GlobalSet.end(); } unsigned global_size() const { return GlobalSet.size(); } - unsigned global_count(GlobalValue *GV) const { return GlobalSet.count(GV); } + unsigned global_count(const GlobalValue *GV) const { return GlobalSet.count(GV); } private: - DSNodeHandle &AddGlobal(GlobalValue *GV); + DSNodeHandle &AddGlobal(const GlobalValue *GV); }; //===----------------------------------------------------------------------===// @@ -190,7 +190,7 @@ public: // Public data-type declarations... typedef DSScalarMap ScalarMapTy; - typedef hash_map ReturnNodesTy; + typedef hash_map ReturnNodesTy; typedef ilist NodeListTy; /// NodeMapTy - This data type is used when cloning one graph into another to @@ -236,7 +236,7 @@ DSGraph(const DSGraph&); // DO NOT IMPLEMENT public: // Create a new, empty, DSGraph. - DSGraph(EquivalenceClasses &ECs, const TargetData &td, + DSGraph(EquivalenceClasses &ECs, const TargetData &td, DSGraph *GG = 0) :GlobalsGraph(GG), PrintAuxCalls(false), ScalarMap(ECs), TD(td) @@ -250,7 +250,7 @@ // source. You need to set a new GlobalsGraph with the setGlobalsGraph // method. // - DSGraph( DSGraph &DSG, EquivalenceClasses &ECs, + DSGraph( DSGraph &DSG, EquivalenceClasses &ECs, unsigned CloneFlags = 0); ~DSGraph(); @@ -259,7 +259,7 @@ /// getGlobalECs - Return the set of equivalence classes that the global /// variables in the program form. - EquivalenceClasses &getGlobalECs() const { + EquivalenceClasses &getGlobalECs() const { return ScalarMap.getGlobalECs(); } @@ -334,21 +334,21 @@ /// getNodeForValue - Given a value that is used or defined in the body of the /// current function, return the DSNode that it points to. /// - DSNodeHandle &getNodeForValue(Value *V) { return ScalarMap[V]; } + DSNodeHandle &getNodeForValue(const Value *V) { return ScalarMap[V]; } - const DSNodeHandle &getNodeForValue(Value *V) const { + const DSNodeHandle &getNodeForValue(const Value *V) const { ScalarMapTy::const_iterator I = ScalarMap.find(V); assert(I != ScalarMap.end() && "Use non-const lookup function if node may not be in the map"); return I->second; } - bool hasNodeForValue(Value* V) const { + bool hasNodeForValue(const Value* V) const { ScalarMapTy::const_iterator I = ScalarMap.find(V); return I != ScalarMap.end(); } - void eraseNodeForValue(Value* V) { + void eraseNodeForValue(const Value* V) { ScalarMap.erase(V); } @@ -367,25 +367,25 @@ /// getReturnNodeFor - Return the return node for the specified function. /// - DSNodeHandle &getReturnNodeFor(Function &F) { + DSNodeHandle &getReturnNodeFor(const Function &F) { ReturnNodesTy::iterator I = ReturnNodes.find(&F); assert(I != ReturnNodes.end() && "F not in this DSGraph!"); return I->second; } - const DSNodeHandle &getReturnNodeFor(Function &F) const { + const DSNodeHandle &getReturnNodeFor(const Function &F) const { ReturnNodesTy::const_iterator I = ReturnNodes.find(&F); assert(I != ReturnNodes.end() && "F not in this DSGraph!"); return I->second; } - DSNodeHandle& getOrCreateReturnNodeFor(Function& F) { + DSNodeHandle& getOrCreateReturnNodeFor(const Function& F) { return ReturnNodes[&F]; } /// containsFunction - Return true if this DSGraph contains information for /// the specified function. - bool containsFunction(Function *F) const { + bool containsFunction(const Function *F) const { return ReturnNodes.count(F); } @@ -508,7 +508,7 @@ /// function arguments. The vector is filled in with the return value (or /// null if it is not pointer compatible), followed by all of the /// pointer-compatible arguments. - void getFunctionArgumentsForCall(Function *F, + void getFunctionArgumentsForCall(const Function *F, std::vector &Args) const; /// mergeInGraph - This graph merges in the minimal number of @@ -523,13 +523,13 @@ /// mergeInGraph - This method is the same as the above method, but the /// argument bindings are provided by using the formal arguments of F. /// - void mergeInGraph(const DSCallSite &CS, Function &F, const DSGraph &Graph, - unsigned CloneFlags); + void mergeInGraph(const DSCallSite &CS, const Function &F, + const DSGraph &Graph, unsigned CloneFlags); /// getCallSiteForArguments - Get the arguments and return value bindings for /// the specified function in the current graph. /// - DSCallSite getCallSiteForArguments(Function &F) const; + DSCallSite getCallSiteForArguments(const Function &F) const; /// getDSCallSiteForCallSite - Given an LLVM CallSite object that is live in /// the context of this graph, return the DSCallSite for it. @@ -540,7 +540,7 @@ assert((!N || N->getParentGraph() == this) && "AssertNodeInGraph: Node is not in graph!"); } - void AssertNodeContainsGlobal(const DSNode *N, GlobalValue *GV) const; + void AssertNodeContainsGlobal(const DSNode *N, const GlobalValue *GV) const; void AssertCallSiteInGraph(const DSCallSite &CS) const; void AssertCallNodesInGraph() const; Modified: poolalloc/trunk/include/dsa/DSNode.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSNode.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSNode.h (original) +++ poolalloc/trunk/include/dsa/DSNode.h Thu Oct 9 01:27:33 2008 @@ -75,7 +75,7 @@ /// Globals - The list of global values that are merged into this node. /// - std::vector Globals; + std::vector Globals; void operator=(const DSNode &); // DO NOT IMPLEMENT DSNode(const DSNode &); // DO NOT IMPLEMENT @@ -291,34 +291,34 @@ /// addGlobal - Add an entry for a global value to the Globals list. This /// also marks the node with the 'G' flag if it does not already have it. /// - void addGlobal(GlobalValue *GV); + void addGlobal(const GlobalValue *GV); /// removeGlobal - Remove the specified global that is explicitly in the /// globals list. - void removeGlobal(GlobalValue *GV); + void removeGlobal(const GlobalValue *GV); - void mergeGlobals(const std::vector &RHS); - void clearGlobals() { std::vector().swap(Globals); } + void mergeGlobals(const std::vector &RHS); + void clearGlobals() { Globals.clear(); } /// getGlobalsList - Return the set of global leaders that are represented by /// this node. Note that globals that are in this equivalence class but are /// not leaders are not returned: for that, use addFullGlobalsList(). - const std::vector &getGlobalsList() const { return Globals; } + const std::vector &getGlobalsList() const { return Globals; } /// addFullGlobalsList - Compute the full set of global values that are /// represented by this node. Unlike getGlobalsList(), this requires fair /// amount of work to compute, so don't treat this method call as free. - void addFullGlobalsList(std::vector &List) const; + void addFullGlobalsList(std::vector &List) const; /// addFullFunctionList - Identical to addFullGlobalsList, but only return the /// functions in the full list. - void addFullFunctionList(std::vector &List) const; + void addFullFunctionList(std::vector &List) const; /// globals_iterator/begin/end - Provide iteration methods over the global /// value leaders set that is merged into this node. Like the getGlobalsList /// method, these iterators do not return globals that are part of the /// equivalence classes for globals in this node, but aren't leaders. - typedef std::vector::const_iterator globals_iterator; + typedef std::vector::const_iterator globals_iterator; globals_iterator globals_begin() const { return Globals.begin(); } globals_iterator globals_end() const { return Globals.end(); } Modified: poolalloc/trunk/include/dsa/DSSupport.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSSupport.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSSupport.h (original) +++ poolalloc/trunk/include/dsa/DSSupport.h Thu Oct 9 01:27:33 2008 @@ -163,11 +163,11 @@ /// the DSNode handles for the function arguments. /// class DSCallSite { - CallSite Site; // Actual call site - Function *CalleeF; // The function called (direct call) - DSNodeHandle CalleeN; // The function node called (indirect call) - DSNodeHandle RetVal; // Returned value - std::vector CallArgs;// The pointer arguments + CallSite Site; // Actual call site + const Function *CalleeF; // The function called (direct call) + DSNodeHandle CalleeN; // The function node called (indirect call) + DSNodeHandle RetVal; // Returned value + std::vector CallArgs; // The pointer arguments static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src, const hash_map &NodeMap) { @@ -204,7 +204,7 @@ assert(Callee && "Null callee node specified for call site!"); Args.swap(CallArgs); } - DSCallSite(CallSite CS, const DSNodeHandle &rv, Function *Callee, + DSCallSite(CallSite CS, const DSNodeHandle &rv, const Function *Callee, std::vector &Args) : Site(CS), CalleeF(Callee), RetVal(rv) { assert(Callee && "Null callee function specified for call site!"); @@ -249,7 +249,7 @@ // Accessor functions... - Function &getCaller() const; + const Function &getCaller() const; CallSite getCallSite() const { return Site; } DSNodeHandle &getRetVal() { return RetVal; } const DSNodeHandle &getRetVal() const { return RetVal; } @@ -257,7 +257,7 @@ DSNode *getCalleeNode() const { assert(!CalleeF && CalleeN.getNode()); return CalleeN.getNode(); } - Function *getCalleeFunc() const { + const Function *getCalleeFunc() const { assert(!CalleeN.getNode() && CalleeF); return CalleeF; } Modified: poolalloc/trunk/include/dsa/DataStructure.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DataStructure.h (original) +++ poolalloc/trunk/include/dsa/DataStructure.h Thu Oct 9 01:27:33 2008 @@ -37,7 +37,12 @@ FunctionPass *createDataStructureGraphCheckerPass(); class DataStructures : public ModulePass { - + typedef std::map > ActualCalleesTy; + typedef hash_map DSInfoTy; +public: + typedef std::set::const_iterator callee_iterator; + +private: /// TargetData, comes in handy TargetData* TD; @@ -47,60 +52,90 @@ /// Do we clone Graphs or steal them? bool Clone; - void buildGlobalECs(std::set& ECGlobals); + void buildGlobalECs(std::set& ECGlobals); - void eliminateUsesOfECGlobals(DSGraph& G, const std::set &ECGlobals); + void eliminateUsesOfECGlobals(DSGraph& G, const std::set &ECGlobals); -protected: // DSInfo, one graph for each function - hash_map DSInfo; + DSInfoTy DSInfo; + + // Callgraph, as computed so far + ActualCalleesTy ActualCallees; + +protected: /// The Globals Graph contains all information on the globals DSGraph *GlobalsGraph; /// GlobalECs - The equivalence classes for each global value that is merged /// with other global values in the DSGraphs. - EquivalenceClasses GlobalECs; + EquivalenceClasses GlobalECs; - void setGraphSource(DataStructures* D) { - assert(!GraphSource && "Already have a Graph"); - GraphSource = D; - } + void init(DataStructures* D, bool clone, bool printAuxCalls); + void init(TargetData* T); - void setGraphClone(bool clone) { - Clone = clone; - } + void formGlobalECs(); - void setTargetData(TargetData& T) { - TD = &T; - } - void formGlobalECs(); + void callee_add(const Instruction* I, const Function* F) { + ActualCallees[I].insert(F); + } DataStructures(intptr_t id) :ModulePass(id), TD(0), GraphSource(0), GlobalsGraph(0) {} public: + callee_iterator callee_begin(const Instruction *I) const { + ActualCalleesTy::const_iterator ii = ActualCallees.find(I); + assert(ii != ActualCallees.end() && "No calls for instruction"); + return ii->second.begin(); + } + + callee_iterator callee_end(const Instruction *I) const { + ActualCalleesTy::const_iterator ii = ActualCallees.find(I); + assert(ii != ActualCallees.end() && "No calls for instruction"); + return ii->second.end(); + } + + unsigned callee_size() const { + unsigned sum = 0; + for (ActualCalleesTy::const_iterator ii = ActualCallees.begin(), + ee = ActualCallees.end(); ii != ee; ++ii) + sum += ii->second.size(); + return sum; + } + + void callee_get_keys(std::vector& keys) { + for (ActualCalleesTy::const_iterator ii = ActualCallees.begin(), + ee = ActualCallees.end(); ii != ee; ++ii) + keys.push_back(ii->first); + } + + virtual void releaseMemory(); bool hasDSGraph(const Function &F) const { - return DSInfo.find(const_cast(&F)) != DSInfo.end(); + return DSInfo.find(&F) != DSInfo.end(); } /// getDSGraph - Return the data structure graph for the specified function. /// DSGraph &getDSGraph(const Function &F) const { - hash_map::const_iterator I = - DSInfo.find(const_cast(&F)); + hash_map::const_iterator I = DSInfo.find(&F); assert(I != DSInfo.end() && "Function not in module!"); return *I->second; } - DSGraph& getOrCreateGraph(Function* F); + void setDSGraph(const Function& F, DSGraph* G) { + assert(!DSInfo[&F] && "DSGraph already exists"); + DSInfo[&F] = G; + } + + DSGraph& getOrCreateGraph(const Function* F); DSGraph &getGlobalsGraph() const { return *GlobalsGraph; } - EquivalenceClasses &getGlobalECs() { return GlobalECs; } + EquivalenceClasses &getGlobalECs() { return GlobalECs; } TargetData& getTargetData() const { return *TD; } @@ -129,15 +164,9 @@ /// void print(std::ostream &O, const Module *M) const; - /// releaseMemory - if the pass pipeline is done with this pass, we can - /// release our memory... - /// - virtual void releaseMemory(); - /// getAnalysisUsage - This obviously provides a data structure graph. /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); } }; @@ -145,6 +174,7 @@ // StdLibDataStructures - This analysis recognizes common standard c library // functions and generates graphs for them. class StdLibDataStructures : public DataStructures { + void eraseCallsTo(Function* F); public: static char ID; StdLibDataStructures() : DataStructures((intptr_t)&ID) {} @@ -156,15 +186,9 @@ /// void print(std::ostream &O, const Module *M) const; - /// releaseMemory - if the pass pipeline is done with this pass, we can - /// release our memory... - /// - virtual void releaseMemory(); - /// getAnalysisUsage - This obviously provides a data structure graph. /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); } }; @@ -175,19 +199,16 @@ /// class BUDataStructures : public DataStructures { protected: - std::set > ActualCallees; // This map is only maintained during construction of BU Graphs - std::map, + std::map, std::pair > > IndCallGraphMap; - std::set InlinedSomewhere; - BUDataStructures(intptr_t id) : DataStructures(id) {} public: static char ID; BUDataStructures() : DataStructures((intptr_t)&ID) {} - ~BUDataStructures() { releaseMyMemory(); } + ~BUDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); @@ -200,36 +221,19 @@ /// void print(std::ostream &O, const Module *M) const; - // FIXME: Once the pass manager is straightened out, rename this to - // releaseMemory. - void releaseMyMemory(); - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); } - typedef std::set > ActualCalleesTy; - const ActualCalleesTy &getActualCallees() const { - return ActualCallees; - } - - typedef ActualCalleesTy::const_iterator callee_iterator; - callee_iterator callee_begin(Instruction *I) const { - return ActualCallees.lower_bound(std::pair(I, 0)); - } - - callee_iterator callee_end(Instruction *I) const { - I = (Instruction*)((char*)I + 1); - return ActualCallees.lower_bound(std::pair(I, 0)); - } - private: void calculateGraph(DSGraph &G); - unsigned calculateGraphs(Function *F, std::vector &Stack, + void inlineUnresolved(DSGraph &G); + + unsigned calculateGraphs(const Function *F, + std::vector &Stack, unsigned &NextID, - hash_map &ValMap); + hash_map &ValMap); void CloneAuxIntoGlobal(DSGraph& G); @@ -242,7 +246,7 @@ /// by the bottom-up pass. /// class TDDataStructures : public DataStructures { - hash_set ArgsRemainIncomplete; + hash_set ArgsRemainIncomplete; BUDataStructures *BUInfo; /// CallerCallEdges - For a particular graph, we keep a list of these records @@ -250,9 +254,9 @@ struct CallerCallEdge { DSGraph *CallerGraph; // The graph of the caller function. const DSCallSite *CS; // The actual call site. - Function *CalledFunction; // The actual function being called. + const Function *CalledFunction; // The actual function being called. - CallerCallEdge(DSGraph *G, const DSCallSite *cs, Function *CF) + CallerCallEdge(DSGraph *G, const DSCallSite *cs, const Function *CF) : CallerGraph(G), CS(cs), CalledFunction(CF) {} bool operator<(const CallerCallEdge &RHS) const { @@ -269,12 +273,12 @@ // is a sorted set of callee functions, the value is the DSGraph that holds // all of the caller graphs merged together, and the DSCallSite to merge with // the arguments for each function. - std::map, DSGraph*> IndCallMap; + std::map, DSGraph*> IndCallMap; public: static char ID; TDDataStructures() : DataStructures((intptr_t)&ID) {} - ~TDDataStructures() { releaseMyMemory(); } + ~TDDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); @@ -282,14 +286,9 @@ /// void print(std::ostream &O, const Module *M) const; - /// If the pass pipeline is done with this pass, we can release our memory... - /// - virtual void releaseMyMemory(); - /// getAnalysisUsage - This obviously provides a data structure graph. /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); } @@ -298,7 +297,7 @@ hash_set &Visited); void InlineCallersIntoGraph(DSGraph &G); - void ComputePostOrder(Function &F, hash_set &Visited, + void ComputePostOrder(const Function &F, hash_set &Visited, std::vector &PostOrder); }; @@ -308,32 +307,28 @@ /// their callers graphs, making the result more useful for things like pool /// allocation. /// -class CompleteBUDataStructures : public BUDataStructures { +class CompleteBUDataStructures : public DataStructures { public: static char ID; - CompleteBUDataStructures() : BUDataStructures((intptr_t)&ID) {} - ~CompleteBUDataStructures() { releaseMyMemory(); } + CompleteBUDataStructures() : DataStructures((intptr_t)&ID) {} + ~CompleteBUDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); - - // FIXME: TEMPORARY (remove once finalization of indirect call sites in the - // globals graph has been implemented in the BU pass) - AU.addRequired(); } /// print - Print out the analysis results... /// void print(std::ostream &O, const Module *M) const; + virtual void releaseMemory(); + private: unsigned calculateSCCGraphs(DSGraph &FG, std::vector &Stack, unsigned &NextID, hash_map &ValMap); - DSGraph &getOrCreateGraph(Function &F); void processGraph(DSGraph &G); }; @@ -343,30 +338,16 @@ /// DS graph for all functions in an equivalence class. After this merging, /// graphs are inlined bottom-up on the SCCs of the final (CBU) call graph. /// -struct EquivClassGraphs : public ModulePass { - CompleteBUDataStructures *CBU; - - DSGraph *GlobalsGraph; - - // DSInfo - one graph for each function. - hash_map DSInfo; - - /// ActualCallees - The actual functions callable from indirect call sites. - /// - std::set > ActualCallees; +struct EquivClassGraphs : public DataStructures { // Equivalence class where functions that can potentially be called via the // same function pointer are in the same class. - EquivalenceClasses FuncECs; + EquivalenceClasses FuncECs; /// OneCalledFunction - For each indirect call, we keep track of one /// target of the call. This is used to find equivalence class called by /// a call site. - std::map OneCalledFunction; - - /// GlobalECs - The equivalence classes for each global value that is merged - /// with other global values in the DSGraphs. - EquivalenceClasses GlobalECs; + std::map OneCalledFunction; public: static char ID; @@ -382,49 +363,12 @@ /// void print(std::ostream &O, const Module *M) const; - EquivalenceClasses &getGlobalECs() { return GlobalECs; } - - /// getDSGraph - Return the data structure graph for the specified function. - /// This returns the folded graph. The folded graph is the same as the CBU - /// graph iff the function is in a singleton equivalence class AND all its - /// callees also have the same folded graph as the CBU graph. - /// - DSGraph &getDSGraph(const Function &F) const { - hash_map::const_iterator I = DSInfo.find(&F); - assert(I != DSInfo.end() && "No graph computed for that function!"); - return *I->second; - } - - bool hasDSGraph(const Function &F) const { - return DSInfo.find(&F) != DSInfo.end(); - } - /// getSomeCalleeForCallSite - Return any one callee function at /// a call site. /// - Function *getSomeCalleeForCallSite(const CallSite &CS) const; - - DSGraph &getGlobalsGraph() const { - return *GlobalsGraph; - } - - typedef std::set > ActualCalleesTy; - const ActualCalleesTy &getActualCallees() const { - return ActualCallees; - } - - typedef ActualCalleesTy::const_iterator callee_iterator; - callee_iterator callee_begin(Instruction *I) const { - return ActualCallees.lower_bound(std::pair(I, 0)); - } - - callee_iterator callee_end(Instruction *I) const { - I = (Instruction*)((char*)I + 1); - return ActualCallees.lower_bound(std::pair(I, 0)); - } + const Function *getSomeCalleeForCallSite(const CallSite &CS) const; virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); AU.addRequired(); } @@ -436,7 +380,6 @@ std::map &ValMap); void processGraph(DSGraph &FG); - DSGraph &getOrCreateGraph(Function &F); }; } // End llvm namespace Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=57321&r1=57320&r2=57321&view=diff ============================================================================== --- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original) +++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Thu Oct 9 01:27:33 2008 @@ -113,9 +113,9 @@ bool BoundsChecksEnabled; virtual ~PoolAllocateGroup () {return;} - virtual PA::FuncInfo *getFuncInfo(Function &F) { return 0;} - virtual PA::FuncInfo *getFuncInfoOrClone(Function &F) {return 0;} - virtual Function *getOrigFunctionFromClone(Function *F) const {return 0;} + virtual PA::FuncInfo *getFuncInfo(const Function &F) { return 0;} + virtual PA::FuncInfo *getFuncInfoOrClone(const Function &F) {return 0;} + virtual Function *getOrigFunctionFromClone(const Function *F) const {return 0;} virtual const Type * getPoolType() {return 0;} @@ -151,7 +151,7 @@ Module *CurModule; CallTargetFinder* CTF; - std::map CloneToOrigMap; + std::map CloneToOrigMap; public: Constant *PoolInit, *PoolDestroy, *PoolAlloc, *PoolRealloc, *PoolMemAlign; @@ -169,7 +169,7 @@ std::map GlobalNodes; protected: - std::map FunctionInfo; + std::map FunctionInfo; public: static char ID; @@ -188,22 +188,22 @@ /// getOrigFunctionFromClone - Given a pointer to a function that was cloned /// from another function, return the original function. If the argument /// function is not a clone, return null. - Function *getOrigFunctionFromClone(Function *F) const { - std::map::const_iterator I = CloneToOrigMap.find(F); + Function *getOrigFunctionFromClone(const Function *F) const { + std::map::const_iterator I = CloneToOrigMap.find(F); return I != CloneToOrigMap.end() ? I->second : 0; } /// getFuncInfo - Return the FuncInfo object for the specified function. /// - PA::FuncInfo *getFuncInfo(Function &F) { - std::map::iterator I = FunctionInfo.find(&F); + PA::FuncInfo *getFuncInfo(const Function &F) { + std::map::iterator I = FunctionInfo.find(&F); return I != FunctionInfo.end() ? &I->second : 0; } /// getFuncInfoOrClone - Return the function info object for for the specified /// function. If this function is a clone of another function, return the /// function info object for the original function. - PA::FuncInfo *getFuncInfoOrClone(Function &F) { + PA::FuncInfo *getFuncInfoOrClone(const Function &F) { // If it is cloned or not check it out. if (PA::FuncInfo *FI = getFuncInfo(F)) return FI; @@ -366,7 +366,7 @@ class PoolAllocateSimple : public PoolAllocate { Value * TheGlobalPool; DSGraph * CombinedDSGraph; - EquivalenceClasses GlobalECs; + EquivalenceClasses GlobalECs; TargetData * TD; public: static char ID; From alenhar2 at cs.uiuc.edu Thu Oct 9 01:31:27 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 09 Oct 2008 06:31:27 -0000 Subject: [llvm-commits] [poolalloc] r57322 - in /poolalloc/trunk: runtime/FL2Allocator/PoolAllocator.cpp runtime/Makefile runtime/PreRT/ runtime/PreRT/Makefile runtime/PreRT/qsort.c runtime/PreRT/strdup.c test/TEST.poolalloc.Makefile Message-ID: <200810090631.m996VRwi004769@zion.cs.uiuc.edu> Author: alenhar2 Date: Thu Oct 9 01:31:27 2008 New Revision: 57322 URL: http://llvm.org/viewvc/llvm-project?rev=57322&view=rev Log: libc impl for annoying functions Added: poolalloc/trunk/runtime/PreRT/ poolalloc/trunk/runtime/PreRT/Makefile (with props) poolalloc/trunk/runtime/PreRT/qsort.c poolalloc/trunk/runtime/PreRT/strdup.c Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp poolalloc/trunk/runtime/Makefile poolalloc/trunk/test/TEST.poolalloc.Makefile Modified: poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp?rev=57322&r1=57321&r2=57322&view=diff ============================================================================== --- poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp (original) +++ poolalloc/trunk/runtime/FL2Allocator/PoolAllocator.cpp Thu Oct 9 01:31:27 2008 @@ -27,6 +27,8 @@ #define INITIAL_SLAB_SIZE 4096 #define LARGE_SLAB_SIZE 4096 +#define NDEBUG + #ifndef NDEBUG // Configuration macros. Define up to one of these. #define PRINT_NUM_POOLS // Print use dynamic # pools info Modified: poolalloc/trunk/runtime/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/Makefile?rev=57322&r1=57321&r2=57322&view=diff ============================================================================== --- poolalloc/trunk/runtime/Makefile (original) +++ poolalloc/trunk/runtime/Makefile Thu Oct 9 01:31:27 2008 @@ -6,6 +6,6 @@ # # List all of the subdirectories that we will compile. # -DIRS=FreeListAllocator FL2Allocator +DIRS=FreeListAllocator FL2Allocator PreRT include $(LEVEL)/Makefile.common Added: poolalloc/trunk/runtime/PreRT/Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/PreRT/Makefile?rev=57322&view=auto ============================================================================== --- poolalloc/trunk/runtime/PreRT/Makefile (added) +++ poolalloc/trunk/runtime/PreRT/Makefile Thu Oct 9 01:31:27 2008 @@ -0,0 +1,6 @@ +LEVEL = ../.. +BYTECODE_LIBRARY=1 +LIBRARYNAME=pa_pre_rt + +include $(LEVEL)/Makefile.common + Propchange: poolalloc/trunk/runtime/PreRT/Makefile ------------------------------------------------------------------------------ svn:executable = * Added: poolalloc/trunk/runtime/PreRT/qsort.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/PreRT/qsort.c?rev=57322&view=auto ============================================================================== --- poolalloc/trunk/runtime/PreRT/qsort.c (added) +++ poolalloc/trunk/runtime/PreRT/qsort.c Thu Oct 9 01:31:27 2008 @@ -0,0 +1,284 @@ +/* Copyright (C) 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Written by Douglas C. Schmidt (schmidt at ics.uci.edu). + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* If you consider tuning this algorithm, you should consult first: + Engineering a sort function; Jon Bentley and M. Douglas McIlroy; + Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993. */ + +#include +#include +#include +#include + +/* Byte-wise swap two items of size SIZE. */ +#define SWAP(a, b, size) \ + do \ + { \ + register size_t __size = (size); \ + register char *__a = (a), *__b = (b); \ + do \ + { \ + char __tmp = *__a; \ + *__a++ = *__b; \ + *__b++ = __tmp; \ + } while (--__size > 0); \ + } while (0) + +/* Discontinue quicksort algorithm when partition gets below this size. + This particular magic number was chosen to work best on a Sun 4/260. */ +#define MAX_THRESH 4 + +/* Stack node declarations used to store unfulfilled partition obligations. */ +typedef struct + { + char *lo; + char *hi; + } stack_node; + +/* The next 4 #defines implement a very fast in-line stack abstraction. */ +/* The stack needs log (total_elements) entries (we could even subtract + log(MAX_THRESH)). Since total_elements has type size_t, we get as + upper bound for log (total_elements): + bits per byte (CHAR_BIT) * sizeof(size_t). */ +#define STACK_SIZE (CHAR_BIT * sizeof(size_t)) +#define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top)) +#define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi))) +#define STACK_NOT_EMPTY (stack < top) + + +/* Order size using quicksort. This implementation incorporates + four optimizations discussed in Sedgewick: + + 1. Non-recursive, using an explicit stack of pointer that store the + next array partition to sort. To save time, this maximum amount + of space required to store an array of SIZE_MAX is allocated on the + stack. Assuming a 32-bit (64 bit) integer for size_t, this needs + only 32 * sizeof(stack_node) == 256 bytes (for 64 bit: 1024 bytes). + Pretty cheap, actually. + + 2. Chose the pivot element using a median-of-three decision tree. + This reduces the probability of selecting a bad pivot value and + eliminates certain extraneous comparisons. + + 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving + insertion sort to order the MAX_THRESH items within each partition. + This is a big win, since insertion sort is faster for small, mostly + sorted array segments. + + 4. The larger of the two sub-partitions is always pushed onto the + stack first, with the algorithm then concentrating on the + smaller partition. This *guarantees* no more than log (total_elems) + stack size is needed (actually O(1) in this case)! */ + +void +qsort (void *const pbase, size_t total_elems, size_t size, + int(*cmp)(const void*, const void*)) +{ + register char *base_ptr = (char *) pbase; + + const size_t max_thresh = MAX_THRESH * size; + + if (total_elems == 0) + /* Avoid lossage with unsigned arithmetic below. */ + return; + + if (total_elems > MAX_THRESH) + { + char *lo = base_ptr; + char *hi = &lo[size * (total_elems - 1)]; + stack_node stack[STACK_SIZE]; + stack_node *top = stack; + + PUSH (NULL, NULL); + + while (STACK_NOT_EMPTY) + { + char *left_ptr; + char *right_ptr; + + /* Select median value from among LO, MID, and HI. Rearrange + LO and HI so the three values are sorted. This lowers the + probability of picking a pathological pivot value and + skips a comparison for both the LEFT_PTR and RIGHT_PTR in + the while loops. */ + + char *mid = lo + size * ((hi - lo) / size >> 1); + + if ((*cmp) ((void *) mid, (void *) lo) < 0) + SWAP (mid, lo, size); + if ((*cmp) ((void *) hi, (void *) mid) < 0) + SWAP (mid, hi, size); + else + goto jump_over; + if ((*cmp) ((void *) mid, (void *) lo) < 0) + SWAP (mid, lo, size); + jump_over:; + + left_ptr = lo + size; + right_ptr = hi - size; + + /* Here's the famous ``collapse the walls'' section of quicksort. + Gotta like those tight inner loops! They are the main reason + that this algorithm runs much faster than others. */ + do + { + while ((*cmp) ((void *) left_ptr, (void *) mid) < 0) + left_ptr += size; + + while ((*cmp) ((void *) mid, (void *) right_ptr) < 0) + right_ptr -= size; + + if (left_ptr < right_ptr) + { + SWAP (left_ptr, right_ptr, size); + if (mid == left_ptr) + mid = right_ptr; + else if (mid == right_ptr) + mid = left_ptr; + left_ptr += size; + right_ptr -= size; + } + else if (left_ptr == right_ptr) + { + left_ptr += size; + right_ptr -= size; + break; + } + } + while (left_ptr <= right_ptr); + + /* Set up pointers for next iteration. First determine whether + left and right partitions are below the threshold size. If so, + ignore one or both. Otherwise, push the larger partition's + bounds on the stack and continue sorting the smaller one. */ + + if ((size_t) (right_ptr - lo) <= max_thresh) + { + if ((size_t) (hi - left_ptr) <= max_thresh) + /* Ignore both small partitions. */ + POP (lo, hi); + else + /* Ignore small left partition. */ + lo = left_ptr; + } + else if ((size_t) (hi - left_ptr) <= max_thresh) + /* Ignore small right partition. */ + hi = right_ptr; + else if ((right_ptr - lo) > (hi - left_ptr)) + { + /* Push larger left partition indices. */ + PUSH (lo, right_ptr); + lo = left_ptr; + } + else + { + /* Push larger right partition indices. */ + PUSH (left_ptr, hi); + hi = right_ptr; + } + } + } + + /* Once the BASE_PTR array is partially sorted by quicksort the rest + is completely sorted using insertion sort, since this is efficient + for partitions below MAX_THRESH size. BASE_PTR points to the beginning + of the array to sort, and END_PTR points at the very last element in + the array (*not* one beyond it!). */ + +#define min(x, y) ((x) < (y) ? (x) : (y)) + + { + char *const end_ptr = &base_ptr[size * (total_elems - 1)]; + char *tmp_ptr = base_ptr; + char *thresh = min(end_ptr, base_ptr + max_thresh); + register char *run_ptr; + + /* Find smallest element in first threshold and place it at the + array's beginning. This is the smallest array element, + and the operation speeds up insertion sort's inner loop. */ + + for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) + if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) + tmp_ptr = run_ptr; + + if (tmp_ptr != base_ptr) + SWAP (tmp_ptr, base_ptr, size); + + /* Insertion sort, running from left-hand-side up to right-hand-side. */ + + run_ptr = base_ptr + size; + while ((run_ptr += size) <= end_ptr) + { + tmp_ptr = run_ptr - size; + while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) + tmp_ptr -= size; + + tmp_ptr += size; + if (tmp_ptr != run_ptr) + { + char *trav; + + trav = run_ptr + size; + while (--trav >= run_ptr) + { + char c = *trav; + char *hi, *lo; + + for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) + *hi = *lo; + *hi = c; + } + } + } + } +} + +#if 0 +int lt(const void* x, const void* y) { + int xv = *(int*)x; + int yv = *(int*)y; + if (xv < yv) return -1; + if (xv > yv) return 1; + return 0; +} +int gt(const void* x, const void* y) { + int xv = *(int*)x; + int yv = *(int*)y; + if (xv > yv) return -1; + if (xv < yv) return 1; + return 0; +} + +int main() { + int size = 100000; + int* arr = malloc(size*sizeof(int)); + srand(0); + for (int x = 0; x < size; ++x) + arr[x] = rand(); + + qsort(arr, size, sizeof(int), lt); + qsort(arr, size, sizeof(int), gt); + qsort(arr, size, sizeof(int), lt); + qsort(arr, size, sizeof(int), lt); + for (int x = 0 ; x < size; ++x) + printf("%d\n", arr[x]); + return 0; +} +#endif + Added: poolalloc/trunk/runtime/PreRT/strdup.c URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/PreRT/strdup.c?rev=57322&view=auto ============================================================================== --- poolalloc/trunk/runtime/PreRT/strdup.c (added) +++ poolalloc/trunk/runtime/PreRT/strdup.c Thu Oct 9 01:31:27 2008 @@ -0,0 +1,16 @@ +#include +#include + +#undef strdup + +char* strdup(const char *s) +{ + size_t len = strlen (s) + 1; + void *new = malloc (len); + + if (new == NULL) + return NULL; + + return (char *) memcpy (new, s, len); +} + Modified: poolalloc/trunk/test/TEST.poolalloc.Makefile URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/TEST.poolalloc.Makefile?rev=57322&r1=57321&r2=57322&view=diff ============================================================================== --- poolalloc/trunk/test/TEST.poolalloc.Makefile (original) +++ poolalloc/trunk/test/TEST.poolalloc.Makefile Thu Oct 9 01:31:27 2008 @@ -21,6 +21,9 @@ RELDIR := $(subst $(PROGDIR),,$(CURDIR)) PADIR := /home/andrewl/Research/llvm/projects/poolalloc +# Bits of runtime to improve analysis +PA_PRE_RT := $(PADIR)/Release/lib/libpa_pre_rt.bca + # Pool allocator pass shared object PA_SO := $(PADIR)/Debug/lib/libpoolalloc$(SHLIBEXT) DSA_SO := $(PADIR)/Debug/lib/libLLVMDataStructure$(SHLIBEXT) @@ -28,7 +31,7 @@ # Pool allocator runtime library #PA_RT := $(PADIR)/Debug/lib/libpoolalloc_fl_rt.bc #PA_RT_O := $(PROJECT_DIR)/lib/$(CONFIGURATION)/poolalloc_rt.o -PA_RT_O := $(PADIR)/Release/lib/poolalloc_rt.o +PA_RT_O := $(PADIR)/Debug/lib/poolalloc_rt.o #PA_RT_O := $(PROJECT_DIR)/lib/Release/poolalloc_fl_rt.o # Command to run opt with the pool allocator pass loaded @@ -41,31 +44,39 @@ OPTZN_PASSES := -globaldce -ipsccp -deadargelim -adce -instcombine -simplifycfg -# This rule runs the pool allocator on the .llvm.bc file to produce a new .bc +$(PROGRAMS_TO_TEST:%=Output/%.temp.bc): \ +Output/%.temp.bc: Output/%.llvm.bc + -$(LLVMLD) -link-as-library $< $(PA_PRE_RT) -o $@ + +$(PROGRAMS_TO_TEST:%=Output/%.base.bc): \ +Output/%.base.bc: Output/%.temp.bc $(LOPT) + -$(LOPT) -instnamer -internalize -globaldce $< -f -o $@ + +# This rule runs the pool allocator on the .base.bc file to produce a new .bc # file $(PROGRAMS_TO_TEST:%=Output/%.poolalloc.bc): \ -Output/%.poolalloc.bc: Output/%.llvm.bc $(PA_SO) $(LOPT) +Output/%.poolalloc.bc: Output/%.base.bc $(PA_SO) $(LOPT) - at rm -f $(CURDIR)/$@.info -$(OPT_PA_STATS) -poolalloc $(EXTRA_PA_FLAGS) $(OPTZN_PASSES) -pooloptimize $< -o $@ -f 2>&1 > $@.out $(PROGRAMS_TO_TEST:%=Output/%.basepa.bc): \ -Output/%.basepa.bc: Output/%.llvm.bc $(PA_SO) $(LOPT) +Output/%.basepa.bc: Output/%.base.bc $(PA_SO) $(LOPT) - at rm -f $(CURDIR)/$@.info -$(OPT_PA_STATS) -poolalloc -poolalloc-disable-alignopt -poolalloc-force-all-poolfrees -poolalloc-heuristic=AllNodes $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out $(PROGRAMS_TO_TEST:%=Output/%.mallocrepl.bc): \ -Output/%.mallocrepl.bc: Output/%.llvm.bc $(PA_SO) $(LOPT) +Output/%.mallocrepl.bc: Output/%.base.bc $(PA_SO) $(LOPT) - at rm -f $(CURDIR)/$@.info -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=AllInOneGlobalPool $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out $(PROGRAMS_TO_TEST:%=Output/%.onlyoverhead.bc): \ -Output/%.onlyoverhead.bc: Output/%.llvm.bc $(PA_SO) $(LOPT) +Output/%.onlyoverhead.bc: Output/%.base.bc $(PA_SO) $(LOPT) - at rm -f $(CURDIR)/$@.info -$(OPT_PA_STATS) -poolalloc -poolalloc-heuristic=OnlyOverhead $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out $(PROGRAMS_TO_TEST:%=Output/%.nonpa.bc): \ -Output/%.nonpa.bc: Output/%.llvm.bc $(LOPT) +Output/%.nonpa.bc: Output/%.base.bc $(LOPT) - at rm -f $(CURDIR)/$@.info -$(LOPT) $(OPTZN_PASSES) $< -o $@ -f 2>&1 > $@.out From baldrick at free.fr Thu Oct 9 03:38:51 2008 From: baldrick at free.fr (Duncan Sands) Date: Thu, 9 Oct 2008 10:38:51 +0200 Subject: [llvm-commits] [llvm-gcc-4.2] r57316 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp In-Reply-To: <200810090032.m990WJr3021785@zion.cs.uiuc.edu> References: <200810090032.m990WJr3021785@zion.cs.uiuc.edu> Message-ID: <200810091038.51252.baldrick@free.fr> Hi Dale, > Accept INIT_EXPR here. These are built by the C++ FE on > occasion with semantics not quite the same as MODIFY_EXPR > (initialization vs assignment in C++). Here we can > handle them identically to MODIFY_EXPR. > Fixes g++.apple/block-global-block.C etc. you seemed to have missed one place: line 882 (don't create a temp to hold the value - this is the reason for the test at the start of TreeToLLVM::Emit, which you did change): // If this stmt returns an aggregate value (e.g. a call whose result is // ignored), create a temporary to receive the value. Note that we don't // do this for MODIFY_EXPRs as an efficiency hack. if (isAggregateTreeType(TREE_TYPE(stmt)) && TREE_CODE(stmt)!= MODIFY_EXPR) DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt))); Otherwise looks good! Ciao, Duncan. From dalej at apple.com Thu Oct 9 11:50:49 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 9 Oct 2008 09:50:49 -0700 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: <8932AF70-A8BC-4B51-B297-577ABB16086B@apple.com> References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> <20081007221928.GI19669@daikokuya.co.uk> <8932AF70-A8BC-4B51-B297-577ABB16086B@apple.com> Message-ID: On Oct 8, 2008, at 9:48 PMPDT, Chris Lattner wrote: > On Oct 7, 2008, at 3:19 PM, Neil Booth wrote: >>> When I implemented the -0.0 conversion to int, I thought that was >>> what >>> IEEE754 calls for, but I missed the definition of inexact, obscurely >>> placed in 7.4(4). 6.3 is clear that the result should have a >>> negative >>> sign, and that's not implementable on a twos complement machine, yet >>> none of the exceptions seems to apply; I guess the standard calls >>> for >>> quietly producing an answer known to be wrong. This one really >>> seems >>> like a bug in the standard. >> >> This one should be special-cased at the call site. I think the loss >> of IEEE semantics, which are there for good reason and may even be >> being relied on elsewhere in APFloat, is a very bad idea here. >> >> Chris, what do you think? > > Dale and I discussed this today and basically came to the conclusion > that keeping APFloat as close to IEEE semantics is goodness. The > issue is that we don't really know what we're doing here :), and IEEE > is common currency among numericists. I think that it's best to > change the clients of these functions to be implemented in different > ways (e.g. fptrunc then fpextend and see if we have the same bit > pattern) or add new methods that do crazy things that are somehow > different than what IEEE says. I'd put it a little differently. What consumers of APFloat conversions need is not IEEE754-compatible exception codes, and I think it's unfortunate that we need to add some new mechanism to get the information that's actually needed, while the IEEE codes are currently useless. But the argument that IEEE compatibility might be useful in the future has merit, so I'm OK with doing it this way. I'll take care of this over the next day or two. From dalej at apple.com Thu Oct 9 12:22:50 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 17:22:50 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57324 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200810091722.m99HMpVr007213@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 12:22:44 2008 New Revision: 57324 URL: http://llvm.org/viewvc/llvm-project?rev=57324&view=rev Log: Fix bug in my last checkin pointed out by Duncan, thanks. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=57324&r1=57323&r2=57324&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Oct 9 12:22:44 2008 @@ -882,7 +882,8 @@ // If this stmt returns an aggregate value (e.g. a call whose result is // ignored), create a temporary to receive the value. Note that we don't // do this for MODIFY_EXPRs as an efficiency hack. - if (isAggregateTreeType(TREE_TYPE(stmt)) && TREE_CODE(stmt)!= MODIFY_EXPR) + if (isAggregateTreeType(TREE_TYPE(stmt)) && + TREE_CODE(stmt)!= MODIFY_EXPR && TREE_CODE(stmt)!=INIT_EXPR) DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt))); Emit(stmt, DestLoc.Ptr ? &DestLoc : NULL); From sabre at nondot.org Thu Oct 9 13:19:51 2008 From: sabre at nondot.org (Chris Lattner) Date: Thu, 9 Oct 2008 13:19:51 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/index.html Message-ID: <200810091819.m99IJpgc009280@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: index.html updated: 1.82 -> 1.83 --- Log message: Fix tag --- Diffs of the changes: (+1 -1) index.html | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.82 llvm-www/pubs/index.html:1.83 --- llvm-www/pubs/index.html:1.82 Thu Oct 9 13:18:04 2008 +++ llvm-www/pubs/index.html Thu Oct 9 13:18:40 2008 @@ -6,7 +6,7 @@
  • "KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs"
    -Cristian Cadar, Daniel Dunbar, Dawson Engler
    +Cristian Cadar, Daniel Dunbar, Dawson Engler
    Proc. 8th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2008), December 2008
  • From sabre at nondot.org Thu Oct 9 13:19:51 2008 From: sabre at nondot.org (Chris Lattner) Date: Thu, 9 Oct 2008 13:19:51 -0500 Subject: [llvm-commits] CVS: llvm-www/pubs/2008-12-OSDI-KLEE.html 2008-12-OSDI-KLEE.pdf index.html Message-ID: <200810091819.m99IJpTe009281@zion.cs.uiuc.edu> Changes in directory llvm-www/pubs: 2008-12-OSDI-KLEE.html added (r1.1) 2008-12-OSDI-KLEE.pdf added (r1.1) index.html updated: 1.81 -> 1.82 --- Log message: Add Daniel's paper on KLEE --- Diffs of the changes: (+51 -0) 2008-12-OSDI-KLEE.html | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2008-12-OSDI-KLEE.pdf | 0 index.html | 5 +++++ 3 files changed, 51 insertions(+) Index: llvm-www/pubs/2008-12-OSDI-KLEE.html diff -c /dev/null llvm-www/pubs/2008-12-OSDI-KLEE.html:1.1 *** /dev/null Thu Oct 9 13:18:14 2008 --- llvm-www/pubs/2008-12-OSDI-KLEE.html Thu Oct 9 13:18:04 2008 *************** *** 0 **** --- 1,46 ---- + + + + + + KLEE: Unassisted and Automatic Generation of High-Coverage + Tests for Complex Systems Programs + + + +
    + KLEE: Unassisted and Automatic Generation of High-Coverage + Tests for Complex Systems Programs +
    +
    + Cristian Cadar, Daniel Dunbar, Dawson Engler +
    + +

    Abstract:

    +
    + We present a new symbolic execution tool, KLEE, capable of automatically + generating tests that achieve high coverage on a diverse set of complex and + environmentally-intensive programs. We used KLEE to thoroughly check all + 89 stand-alone programs in the GNU COREUTILS utility suite, which form the core + user-level environment installed on millions of Unix systems, and arguably + are the single most heavily tested set of open-source programs in + existence. KLEE-generated tests achieve high line coverage ??? on average over 90% + per tool (median: over 94%) ??? and significantly beat the coverage of the + developers' own hand-written test suites. When we did the same for 75 + equivalent tools in the BUSYBOX embedded system suite, results were even + better, including 100% coverage on 31 of them. + We also used KLEE as a bug finding tool, applying it to 452 applications (over + 430K total lines of code), where it found 56 serious bugs, including + three in COREUTILS that had been missed for over 15 years. Finally, we + used KLEE to cross-check purportedly identical BUSY-BOX and COREUTILS utilities, + finding functional correctness errors and a myriad of inconsistencies. +
    + +

    Download:

    + + + + Index: llvm-www/pubs/2008-12-OSDI-KLEE.pdf Index: llvm-www/pubs/index.html diff -u llvm-www/pubs/index.html:1.81 llvm-www/pubs/index.html:1.82 --- llvm-www/pubs/index.html:1.81 Fri Sep 5 12:38:35 2008 +++ llvm-www/pubs/index.html Thu Oct 9 13:18:04 2008 @@ -4,6 +4,11 @@
      +
    1. "KLEE: Unassisted and Automatic +Generation of High-Coverage Tests for Complex Systems Programs"
      +Cristian Cadar, Daniel Dunbar, Dawson Engler
      +Proc. 8th USENIX Symposium on Operating Systems Design and Implementation +(OSDI 2008), December 2008
    2. "A Lazy Developer Approach: Building a JVM with Third Party Software"
      From dalej at apple.com Thu Oct 9 13:53:54 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 18:53:54 -0000 Subject: [llvm-commits] [llvm] r57325 - in /llvm/trunk: include/llvm/ADT/ lib/Bitcode/Writer/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/Support/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/MSIL/ lib/VMCore/ Message-ID: <200810091853.m99IruAf010480@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 13:53:47 2008 New Revision: 57325 URL: http://llvm.org/viewvc/llvm-project?rev=57325&view=rev Log: Rename APFloat::convertToAPInt to bitcastToAPInt to make it clearer what the function does. No functional change. Modified: llvm/trunk/include/llvm/ADT/APFloat.h llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/lib/Bitcode/Writer/SerializeAPFloat.cpp llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp llvm/trunk/lib/Support/APFloat.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/MSIL/MSILWriter.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp llvm/trunk/lib/VMCore/ConstantFold.cpp Modified: llvm/trunk/include/llvm/ADT/APFloat.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APFloat.h (original) +++ llvm/trunk/include/llvm/ADT/APFloat.h Thu Oct 9 13:53:47 2008 @@ -129,7 +129,7 @@ static const fltSemantics IEEEquad; static const fltSemantics PPCDoubleDouble; static const fltSemantics x87DoubleExtended; - /* And this psuedo, used to construct APFloats that cannot + /* And this pseudo, used to construct APFloats that cannot conflict with anything real. */ static const fltSemantics Bogus; @@ -226,7 +226,7 @@ opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int, bool, roundingMode); opStatus convertFromString(const char *, roundingMode); - APInt convertToAPInt() const; + APInt bitcastToAPInt() const; double convertToDouble() const; float convertToFloat() const; @@ -239,6 +239,9 @@ compare unordered, 0==-0). */ cmpResult compare(const APFloat &) const; + /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */ + bool bitwiseIsEqual(const APFloat &) const; + /* Write out a hexadecimal representation of the floating point value to DST, which must be of sufficient size, in the C99 form [-]0xh.hhhhp[+-]d. Return the number of characters written, @@ -246,9 +249,6 @@ unsigned int convertToHexString(char *dst, unsigned int hexDigits, bool upperCase, roundingMode) const; - /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */ - bool bitwiseIsEqual(const APFloat &) const; - /* Simple queries. */ fltCategory getCategory() const { return category; } const fltSemantics &getSemantics() const { return *semantics; } Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Thu Oct 9 13:53:47 2008 @@ -542,15 +542,15 @@ Code = bitc::CST_CODE_FLOAT; const Type *Ty = CFP->getType(); if (Ty == Type::FloatTy || Ty == Type::DoubleTy) { - Record.push_back(CFP->getValueAPF().convertToAPInt().getZExtValue()); + Record.push_back(CFP->getValueAPF().bitcastToAPInt().getZExtValue()); } else if (Ty == Type::X86_FP80Ty) { // api needed to prevent premature destruction - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Record.push_back(p[0]); Record.push_back((uint16_t)p[1]); } else if (Ty == Type::FP128Ty || Ty == Type::PPC_FP128Ty) { - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Record.push_back(p[0]); Record.push_back(p[1]); Modified: llvm/trunk/lib/Bitcode/Writer/SerializeAPFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/SerializeAPFloat.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/SerializeAPFloat.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/SerializeAPFloat.cpp Thu Oct 9 13:53:47 2008 @@ -17,5 +17,5 @@ using namespace llvm; void APFloat::Emit(Serializer& S) const { - S.Emit(convertToAPInt()); + S.Emit(bitcastToAPInt()); } Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 9 13:53:47 2008 @@ -969,7 +969,7 @@ // precision... if (CFP->getType() == Type::DoubleTy) { double Val = CFP->getValueAPF().convertToDouble(); // for comment only - uint64_t i = CFP->getValueAPF().convertToAPInt().getZExtValue(); + uint64_t i = CFP->getValueAPF().bitcastToAPInt().getZExtValue(); if (TAI->getData64bitsDirective()) O << TAI->getData64bitsDirective() << i << '\t' << TAI->getCommentString() << " double value: " << Val << '\n'; @@ -992,13 +992,13 @@ } else if (CFP->getType() == Type::FloatTy) { float Val = CFP->getValueAPF().convertToFloat(); // for comment only O << TAI->getData32bitsDirective() - << CFP->getValueAPF().convertToAPInt().getZExtValue() + << CFP->getValueAPF().bitcastToAPInt().getZExtValue() << '\t' << TAI->getCommentString() << " float " << Val << '\n'; return; } else if (CFP->getType() == Type::X86_FP80Ty) { // all long double variants are printed as hex // api needed to prevent premature destruction - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); APFloat DoubleVal = CFP->getValueAPF(); DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven); @@ -1042,7 +1042,7 @@ } else if (CFP->getType() == Type::PPC_FP128Ty) { // all long double variants are printed as hex // api needed to prevent premature destruction - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); if (TD->isBigEndian()) { O << TAI->getData32bitsDirective() << uint32_t(p[0] >> 32) Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Thu Oct 9 13:53:47 2008 @@ -878,7 +878,7 @@ break; } case Type::FloatTyID: { - uint32_t val = cast(PC)->getValueAPF().convertToAPInt(). + uint32_t val = cast(PC)->getValueAPF().bitcastToAPInt(). getZExtValue(); if (TD->isBigEndian()) val = ByteSwap_32(val); @@ -889,7 +889,7 @@ break; } case Type::DoubleTyID: { - uint64_t val = cast(PC)->getValueAPF().convertToAPInt(). + uint64_t val = cast(PC)->getValueAPF().bitcastToAPInt(). getZExtValue(); if (TD->isBigEndian()) val = ByteSwap_64(val); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Oct 9 13:53:47 2008 @@ -4630,7 +4630,7 @@ if ((!AfterLegalize && !ST->isVolatile()) || TLI.isOperationLegal(ISD::STORE, MVT::i32)) { Tmp = DAG.getConstant((uint32_t)CFP->getValueAPF(). - convertToAPInt().getZExtValue(), MVT::i32); + bitcastToAPInt().getZExtValue(), MVT::i32); return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(), ST->getSrcValueOffset(), ST->isVolatile(), ST->getAlignment()); @@ -4639,7 +4639,7 @@ case MVT::f64: if ((!AfterLegalize && !ST->isVolatile()) || TLI.isOperationLegal(ISD::STORE, MVT::i64)) { - Tmp = DAG.getConstant(CFP->getValueAPF().convertToAPInt(). + Tmp = DAG.getConstant(CFP->getValueAPF().bitcastToAPInt(). getZExtValue(), MVT::i64); return DAG.getStore(Chain, Tmp, Ptr, ST->getSrcValue(), ST->getSrcValueOffset(), ST->isVolatile(), @@ -4649,7 +4649,7 @@ // Many FP stores are not made apparent until after legalize, e.g. for // argument passing. Since this is so common, custom legalize the // 64-bit integer store into two 32-bit stores. - uint64_t Val = CFP->getValueAPF().convertToAPInt().getZExtValue(); + uint64_t Val = CFP->getValueAPF().bitcastToAPInt().getZExtValue(); SDValue Lo = DAG.getConstant(Val & 0xFFFFFFFF, MVT::i32); SDValue Hi = DAG.getConstant(Val >> 32, MVT::i32); if (TLI.isBigEndian()) std::swap(Lo, Hi); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Oct 9 13:53:47 2008 @@ -445,7 +445,7 @@ if (!UseCP) { if (VT!=MVT::f64 && VT!=MVT::f32) assert(0 && "Invalid type expansion"); - return DAG.getConstant(LLVMC->getValueAPF().convertToAPInt(), + return DAG.getConstant(LLVMC->getValueAPF().bitcastToAPInt(), (VT == MVT::f64) ? MVT::i64 : MVT::i32); } @@ -2357,7 +2357,7 @@ if (CFP->getValueType(0) == MVT::f32 && getTypeAction(MVT::i32) == Legal) { Tmp3 = DAG.getConstant(CFP->getValueAPF(). - convertToAPInt().zextOrTrunc(32), + bitcastToAPInt().zextOrTrunc(32), MVT::i32); Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), SVOffset, isVolatile, Alignment); @@ -2365,7 +2365,7 @@ } else if (CFP->getValueType(0) == MVT::f64) { // If this target supports 64-bit registers, do a single 64-bit store. if (getTypeAction(MVT::i64) == Legal) { - Tmp3 = DAG.getConstant(CFP->getValueAPF().convertToAPInt(). + Tmp3 = DAG.getConstant(CFP->getValueAPF().bitcastToAPInt(). zextOrTrunc(64), MVT::i64); Result = DAG.getStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), SVOffset, isVolatile, Alignment); @@ -2374,7 +2374,7 @@ // Otherwise, if the target supports 32-bit registers, use 2 32-bit // stores. If the target supports neither 32- nor 64-bits, this // xform is certainly not worth it. - const APInt &IntVal =CFP->getValueAPF().convertToAPInt(); + const APInt &IntVal =CFP->getValueAPF().bitcastToAPInt(); SDValue Lo = DAG.getConstant(APInt(IntVal).trunc(32), MVT::i32); SDValue Hi = DAG.getConstant(IntVal.lshr(32).trunc(32), MVT::i32); if (TLI.isBigEndian()) std::swap(Lo, Hi); @@ -5912,7 +5912,7 @@ case ISD::ConstantFP: { ConstantFPSDNode *CFP = cast(Node); if (CFP->getValueType(0) == MVT::ppcf128) { - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); Lo = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[1])), MVT::f64); Hi = DAG.getConstantFP(APFloat(APInt(64, 1, &api.getRawData()[0])), Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp Thu Oct 9 13:53:47 2008 @@ -93,7 +93,7 @@ } SDValue DAGTypeLegalizer::SoftenFloatRes_ConstantFP(ConstantFPSDNode *N) { - return DAG.getConstant(N->getValueAPF().convertToAPInt(), + return DAG.getConstant(N->getValueAPF().bitcastToAPInt(), TLI.getTypeToTransformTo(N->getValueType(0))); } @@ -586,7 +586,7 @@ MVT NVT = TLI.getTypeToTransformTo(N->getValueType(0)); assert(NVT.getSizeInBits() == integerPartWidth && "Do not know how to expand this float constant!"); - APInt C = cast(N)->getValueAPF().convertToAPInt(); + APInt C = cast(N)->getValueAPF().bitcastToAPInt(); Lo = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1, &C.getRawData()[1])), NVT); Hi = DAG.getConstantFP(APFloat(APInt(integerPartWidth, 1, Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Thu Oct 9 13:53:47 2008 @@ -467,7 +467,7 @@ (void)apf.convertFromAPInt(GV.IntVal, false, APFloat::rmNearestTiesToEven); - GV.IntVal = apf.convertToAPInt(); + GV.IntVal = apf.bitcastToAPInt(); } return GV; } @@ -483,7 +483,7 @@ (void)apf.convertFromAPInt(GV.IntVal, true, APFloat::rmNearestTiesToEven); - GV.IntVal = apf.convertToAPInt(); + GV.IntVal = apf.bitcastToAPInt(); } return GV; } @@ -614,23 +614,23 @@ default: assert(0 && "Invalid long double opcode"); abort(); case Instruction::Add: apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); - GV.IntVal = apfLHS.convertToAPInt(); + GV.IntVal = apfLHS.bitcastToAPInt(); break; case Instruction::Sub: apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); - GV.IntVal = apfLHS.convertToAPInt(); + GV.IntVal = apfLHS.bitcastToAPInt(); break; case Instruction::Mul: apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); - GV.IntVal = apfLHS.convertToAPInt(); + GV.IntVal = apfLHS.bitcastToAPInt(); break; case Instruction::FDiv: apfLHS.divide(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); - GV.IntVal = apfLHS.convertToAPInt(); + GV.IntVal = apfLHS.bitcastToAPInt(); break; case Instruction::FRem: apfLHS.mod(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); - GV.IntVal = apfLHS.convertToAPInt(); + GV.IntVal = apfLHS.bitcastToAPInt(); break; } } @@ -656,7 +656,7 @@ case Type::X86_FP80TyID: case Type::FP128TyID: case Type::PPC_FP128TyID: - Result.IntVal = cast (C)->getValueAPF().convertToAPInt(); + Result.IntVal = cast (C)->getValueAPF().bitcastToAPInt(); break; case Type::IntegerTyID: Result.IntVal = cast(C)->getValue(); Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Thu Oct 9 13:53:47 2008 @@ -695,7 +695,7 @@ // Profile - This method 'profiles' an APFloat for use with FoldingSet. void APFloat::Profile(FoldingSetNodeID& ID) const { - ID.Add(convertToAPInt()); + ID.Add(bitcastToAPInt()); } unsigned int @@ -2617,7 +2617,7 @@ // and treating the result as a normal integer is unlikely to be useful. APInt -APFloat::convertToAPInt() const +APFloat::bitcastToAPInt() const { if (semantics == (const llvm::fltSemantics*)&IEEEsingle) return convertFloatAPFloatToAPInt(); @@ -2637,7 +2637,7 @@ APFloat::convertToFloat() const { assert(semantics == (const llvm::fltSemantics*)&IEEEsingle); - APInt api = convertToAPInt(); + APInt api = bitcastToAPInt(); return api.bitsToFloat(); } @@ -2645,7 +2645,7 @@ APFloat::convertToDouble() const { assert(semantics == (const llvm::fltSemantics*)&IEEEdouble); - APInt api = convertToAPInt(); + APInt api = bitcastToAPInt(); return api.bitsToDouble(); } Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Oct 9 13:53:47 2008 @@ -2028,20 +2028,20 @@ if (FPC->getType() == Type::DoubleTy) { double Val = FPC->getValueAPF().convertToDouble(); - uint64_t i = FPC->getValueAPF().convertToAPInt().getZExtValue(); + uint64_t i = FPC->getValueAPF().bitcastToAPInt().getZExtValue(); Out << "static const ConstantDoubleTy FPConstant" << FPCounter++ << " = 0x" << utohexstr(i) << "ULL; /* " << Val << " */\n"; } else if (FPC->getType() == Type::FloatTy) { float Val = FPC->getValueAPF().convertToFloat(); - uint32_t i = (uint32_t)FPC->getValueAPF().convertToAPInt(). + uint32_t i = (uint32_t)FPC->getValueAPF().bitcastToAPInt(). getZExtValue(); Out << "static const ConstantFloatTy FPConstant" << FPCounter++ << " = 0x" << utohexstr(i) << "U; /* " << Val << " */\n"; } else if (FPC->getType() == Type::X86_FP80Ty) { // api needed to prevent premature destruction - APInt api = FPC->getValueAPF().convertToAPInt(); + APInt api = FPC->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Out << "static const ConstantFP80Ty FPConstant" << FPCounter++ << " = { 0x" @@ -2049,7 +2049,7 @@ << "ULL, 0x" << utohexstr((uint16_t)(p[0] >> 48)) << ",{0,0,0}" << "}; /* Long double constant */\n"; } else if (FPC->getType() == Type::PPC_FP128Ty) { - APInt api = FPC->getValueAPF().convertToAPInt(); + APInt api = FPC->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); Out << "static const ConstantFP128Ty FPConstant" << FPCounter++ << " = { 0x" Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Oct 9 13:53:47 2008 @@ -254,11 +254,12 @@ Out << StrVal << "f"; } else if (CFP->getType() == Type::DoubleTy) Out << "BitsToDouble(0x" - << utohexstr(CFP->getValueAPF().convertToAPInt().getZExtValue()) + << utohexstr(CFP->getValueAPF().bitcastToAPInt().getZExtValue()) << "ULL) /* " << StrVal << " */"; else Out << "BitsToFloat(0x" - << utohexstr((uint32_t)CFP->getValueAPF().convertToAPInt().getZExtValue()) + << utohexstr((uint32_t)CFP->getValueAPF(). + bitcastToAPInt().getZExtValue()) << "U) /* " << StrVal << " */"; Out << ")"; #if HAVE_PRINTF_A Modified: llvm/trunk/lib/Target/MSIL/MSILWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSIL/MSILWriter.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/Target/MSIL/MSILWriter.cpp (original) +++ llvm/trunk/lib/Target/MSIL/MSILWriter.cpp Thu Oct 9 13:53:47 2008 @@ -432,10 +432,10 @@ uint64_t X; unsigned Size; if (FP->getType()->getTypeID()==Type::FloatTyID) { - X = (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue(); + X = (uint32_t)FP->getValueAPF().bitcastToAPInt().getZExtValue(); Size = 4; } else { - X = FP->getValueAPF().convertToAPInt().getZExtValue(); + X = FP->getValueAPF().bitcastToAPInt().getZExtValue(); Size = 8; } Out << "\tldc.r" << Size << "\t( " << utohexstr(X) << ')'; @@ -1477,10 +1477,10 @@ const ConstantFP* FP = cast(C); if (Ty->getTypeID() == Type::FloatTyID) Out << "int32 (" << - (uint32_t)FP->getValueAPF().convertToAPInt().getZExtValue() << ')'; + (uint32_t)FP->getValueAPF().bitcastToAPInt().getZExtValue() << ')'; else Out << "int64 (" << - FP->getValueAPF().convertToAPInt().getZExtValue() << ')'; + FP->getValueAPF().bitcastToAPInt().getZExtValue() << ')'; break; } case Type::ArrayTyID: Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Thu Oct 9 13:53:47 2008 @@ -738,7 +738,7 @@ else assert(0 && "Unsupported floating point type"); // api needed to prevent premature destruction - APInt api = CFP->getValueAPF().convertToAPInt(); + APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t* p = api.getRawData(); uint64_t word = *p; int shiftcount=60; Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=57325&r1=57324&r2=57325&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Thu Oct 9 13:53:47 2008 @@ -160,10 +160,10 @@ if (const ConstantFP *FP = dyn_cast(V)) { // FP -> Integral. if (DestTy == Type::Int32Ty) { - return ConstantInt::get(FP->getValueAPF().convertToAPInt()); + return ConstantInt::get(FP->getValueAPF().bitcastToAPInt()); } else { assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!"); - return ConstantInt::get(FP->getValueAPF().convertToAPInt()); + return ConstantInt::get(FP->getValueAPF().bitcastToAPInt()); } } return 0; From criswell at cs.uiuc.edu Thu Oct 9 15:15:00 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu, 9 Oct 2008 15:15:00 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200810092015.m99KF0W8013434@maute.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.37 -> 1.38 --- Log message: Re-alphabetized list of educational users. Added University of Wisconsin at Madison to the list of educational users. --- Diffs of the changes: (+10 -3) Users.html | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.37 llvm-www/Users.html:1.38 --- llvm-www/Users.html:1.37 Tue Sep 30 14:38:15 2008 +++ llvm-www/Users.html Thu Oct 9 15:14:09 2008 @@ -286,6 +286,12 @@ + University of California, Los Angeles + + + + + University of Illinois at Urbana-Champaign @@ -298,13 +304,14 @@ - University of California, Los Angeles + University of Utah + - University of Utah + University of Wisconsin, Madison @@ -370,6 +377,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
      LLVM Development List
      - Last modified: $Date: 2008/09/30 19:38:15 $ + Last modified: $Date: 2008/10/09 20:14:09 $ From criswell at cs.uiuc.edu Thu Oct 9 15:21:51 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu, 9 Oct 2008 15:21:51 -0500 Subject: [llvm-commits] CVS: llvm-www/Users.html Message-ID: <200810092021.m99KLpMA013621@maute.cs.uiuc.edu> Changes in directory llvm-www: Users.html updated: 1.38 -> 1.39 --- Log message: Added the alias analysis library by Thomas Lenherr from ETH Zurich. --- Diffs of the changes: (+8 -1) Users.html | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm-www/Users.html diff -u llvm-www/Users.html:1.38 llvm-www/Users.html:1.39 --- llvm-www/Users.html:1.38 Thu Oct 9 15:14:09 2008 +++ llvm-www/Users.html Thu Oct 9 15:21:03 2008 @@ -153,6 +153,13 @@ Principled Compilation + + + ETH Zurich + Thomas Lenherr + Language-independent library for alias analysis + + Ghent University @@ -377,6 +384,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
      LLVM Development List
      - Last modified: $Date: 2008/10/09 20:14:09 $ + Last modified: $Date: 2008/10/09 20:21:03 $ From dpatel at apple.com Thu Oct 9 15:56:09 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 09 Oct 2008 20:56:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57326 - in /llvm-gcc-4.2/trunk/gcc: c.opt config/i386/darwin.h config/rs6000/darwin.h Message-ID: <200810092056.m99Ku97A014950@zion.cs.uiuc.edu> Author: dpatel Date: Thu Oct 9 15:56:07 2008 New Revision: 57326 URL: http://llvm.org/viewvc/llvm-project?rev=57326&view=rev Log: Do not enable all formating related warnings on darwin by default. Modified: llvm-gcc-4.2/trunk/gcc/c.opt llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h llvm-gcc-4.2/trunk/gcc/config/rs6000/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/c.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c.opt?rev=57326&r1=57325&r2=57326&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c.opt (original) +++ llvm-gcc-4.2/trunk/gcc/c.opt Thu Oct 9 15:56:07 2008 @@ -246,9 +246,11 @@ C ObjC C++ ObjC++ Var(warn_format_y2k) Warn about strftime formats yielding 2-digit years +; LLVM LOCAL begin enable for C++ Wformat-zero-length -C ObjC Var(warn_format_zero_length) +C ObjC C++ ObjC++ Var(warn_format_zero_length) Warn about zero-length formats +; LLVM LOCAL end enable for C++ Wformat= C ObjC C++ ObjC++ Joined Modified: llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h?rev=57326&r1=57325&r2=57326&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/darwin.h Thu Oct 9 15:56:07 2008 @@ -101,8 +101,13 @@ %{!mmacosx-version-min=*: %{!miphoneos-version-min=*: %(darwin_cc1_minversion)}} \ "/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\ % Author: dpatel Date: Thu Oct 9 16:34:42 2008 New Revision: 57327 URL: http://llvm.org/viewvc/llvm-project?rev=57327&view=rev Log: Creating llvmCore-2075 branch Added: llvm/tags/Apple/llvmCore-2075/ - copied from r57326, llvm/branches/release_24/ From dpatel at apple.com Thu Oct 9 16:34:51 2008 From: dpatel at apple.com (Devang Patel) Date: Thu, 09 Oct 2008 21:34:51 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57328 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2075/ Message-ID: <200810092134.m99LYpi0016337@zion.cs.uiuc.edu> Author: dpatel Date: Thu Oct 9 16:34:50 2008 New Revision: 57328 URL: http://llvm.org/viewvc/llvm-project?rev=57328&view=rev Log: Creating llvmgcc42-2075 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2075/ - copied from r57327, llvm-gcc-4.2/branches/release_24/ From neil at daikokuya.co.uk Thu Oct 9 17:21:38 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Fri, 10 Oct 2008 07:21:38 +0900 Subject: [llvm-commits] [llvm] r57185 - /llvm/trunk/lib/Support/APFloat.cpp In-Reply-To: References: <200810061822.m96IMTgD007250@zion.cs.uiuc.edu> <0C450614-92AA-4337-B0EA-53797DA53326@apple.com> <20081007131921.GF19669@daikokuya.co.uk> <3D552C79-1370-4B36-8A6B-7CEE082AE4DC@apple.com> <20081007221928.GI19669@daikokuya.co.uk> <8932AF70-A8BC-4B51-B297-577ABB16086B@apple.com> Message-ID: <20081009222138.GM19669@daikokuya.co.uk> Dale Johannesen wrote:- > > Dale and I discussed this today and basically came to the conclusion > > that keeping APFloat as close to IEEE semantics is goodness. The > > issue is that we don't really know what we're doing here :), and IEEE > > is common currency among numericists. I think that it's best to > > change the clients of these functions to be implemented in different > > ways (e.g. fptrunc then fpextend and see if we have the same bit > > pattern) or add new methods that do crazy things that are somehow > > different than what IEEE says. > > I'd put it a little differently. What consumers of APFloat > conversions need is not IEEE754-compatible exception codes, and I > think it's unfortunate that we need to add some new mechanism to get > the information that's actually needed, while the IEEE codes are > currently useless. But the argument that IEEE compatibility might be > useful in the future has merit, so I'm OK with doing it this way. I'll > take care of this over the next day or two. Thanks. The current return codes are not useless. In several places APFloat makes use of the IEEE return values of other parts of APFloat in order to get the right answer. Also the fact that clang doesn't use the return values for diagnostics, and LLVM doesn't use them to facilitate optimization, is no fault of APFloat. Neil. From dalej at apple.com Thu Oct 9 18:00:40 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 23:00:40 -0000 Subject: [llvm-commits] [llvm] r57329 - in /llvm/trunk: include/llvm/ADT/ include/llvm/CodeGen/ lib/AsmParser/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/Support/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/X86/ lib/Transforms/Scalar/ lib/VMCore/ Message-ID: <200810092300.m99N0fGb005425@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 18:00:39 2008 New Revision: 57329 URL: http://llvm.org/viewvc/llvm-project?rev=57329&view=rev Log: Add a "loses information" return value to APFloat::convert and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. Modified: llvm/trunk/include/llvm/ADT/APFloat.h llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp llvm/trunk/lib/Support/APFloat.cpp llvm/trunk/lib/Target/CBackend/CBackend.cpp llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp llvm/trunk/lib/VMCore/ConstantFold.cpp llvm/trunk/lib/VMCore/Constants.cpp llvm/trunk/lib/VMCore/Core.cpp Modified: llvm/trunk/include/llvm/ADT/APFloat.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APFloat.h (original) +++ llvm/trunk/include/llvm/ADT/APFloat.h Thu Oct 9 18:00:39 2008 @@ -216,9 +216,9 @@ void copySign(const APFloat &); /* Conversions. */ - opStatus convert(const fltSemantics &, roundingMode); + opStatus convert(const fltSemantics &, roundingMode, bool *); opStatus convertToInteger(integerPart *, unsigned int, bool, - roundingMode) const; + roundingMode, bool *) const; opStatus convertFromAPInt(const APInt &, bool, roundingMode); opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int, @@ -299,7 +299,7 @@ opStatus handleOverflow(roundingMode); bool roundAwayFromZero(roundingMode, lostFraction, unsigned int) const; opStatus convertToSignExtendedInteger(integerPart *, unsigned int, bool, - roundingMode) const; + roundingMode, bool *) const; opStatus convertFromUnsignedParts(const integerPart *, unsigned int, roundingMode); opStatus convertFromHexadecimalString(const char *, roundingMode); Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Oct 9 18:00:39 2008 @@ -1756,12 +1756,13 @@ /// convenient to write "2.0" and the like. Without this function we'd /// have to duplicate its logic everywhere it's called. bool isExactlyValue(double V) const { + bool ignored; // convert is not supported on this type if (&Value->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble) return false; APFloat Tmp(V); Tmp.convert(Value->getValueAPF().getSemantics(), - APFloat::rmNearestTiesToEven); + APFloat::rmNearestTiesToEven, &ignored); return isExactlyValue(Tmp); } bool isExactlyValue(const APFloat& V) const; Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Thu Oct 9 18:00:39 2008 @@ -428,8 +428,11 @@ // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double does not need this. if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble && - Ty==Type::FloatTy) - D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + Ty==Type::FloatTy) { + bool ignored; + D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } return ConstantFP::get(*D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? @@ -1929,8 +1932,11 @@ GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy) - $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy) { + bool ignored; + $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } $$ = ConstantFP::get(*$2); delete $2; CHECK_FOR_ERROR Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 9 18:00:39 2008 @@ -1000,8 +1000,11 @@ // api needed to prevent premature destruction APInt api = CFP->getValueAPF().bitcastToAPInt(); const uint64_t *p = api.getRawData(); + // Convert to double so we can print the approximate val as a comment. APFloat DoubleVal = CFP->getValueAPF(); - DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven); + bool ignored; + DoubleVal.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, + &ignored); if (TD->isBigEndian()) { O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 48) << '\t' << TAI->getCommentString() Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Oct 9 18:00:39 2008 @@ -93,8 +93,10 @@ uint64_t x[2]; uint32_t IntBitWidth = IntVT.getSizeInBits(); - if (!Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, - APFloat::rmTowardZero) != APFloat::opOK) { + bool isExact; + (void) Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, + APFloat::rmTowardZero, &isExact); + if (isExact) { APInt IntVal(IntBitWidth, 2, x); unsigned IntegerReg = getRegForValue(ConstantInt::get(IntVal)); @@ -711,8 +713,10 @@ uint64_t x[2]; uint32_t IntBitWidth = IntVT.getSizeInBits(); - if (Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, - APFloat::rmTowardZero) != APFloat::opOK) + bool isExact; + (void) Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, + APFloat::rmTowardZero, &isExact); + if (!isExact) return 0; APInt IntVal(IntBitWidth, 2, x); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Oct 9 18:00:39 2008 @@ -84,8 +84,10 @@ // convert modifies in place, so make a copy. APFloat Val2 = APFloat(Val); - return Val2.convert(*MVTToAPFloatSemantics(VT), - APFloat::rmNearestTiesToEven) == APFloat::opOK; + bool losesInfo; + (void) Val2.convert(*MVTToAPFloatSemantics(VT), APFloat::rmNearestTiesToEven, + &losesInfo); + return !losesInfo; } //===----------------------------------------------------------------------===// @@ -118,7 +120,7 @@ return false; } else if (isa(NotZero)) { if (!cast(NotZero)->getValueAPF(). - convertToAPInt().isAllOnesValue()) + bitcastToAPInt().isAllOnesValue()) return false; } else return false; @@ -2124,29 +2126,32 @@ V.clearSign(); return getConstantFP(V, VT); case ISD::FP_ROUND: - case ISD::FP_EXTEND: + case ISD::FP_EXTEND: { + bool ignored; // This can return overflow, underflow, or inexact; we don't care. // FIXME need to be more flexible about rounding mode. (void)V.convert(*MVTToAPFloatSemantics(VT), - APFloat::rmNearestTiesToEven); + APFloat::rmNearestTiesToEven, &ignored); return getConstantFP(V, VT); + } case ISD::FP_TO_SINT: case ISD::FP_TO_UINT: { integerPart x; + bool ignored; assert(integerPartWidth >= 64); // FIXME need to be more flexible about rounding mode. APFloat::opStatus s = V.convertToInteger(&x, 64U, Opcode==ISD::FP_TO_SINT, - APFloat::rmTowardZero); + APFloat::rmTowardZero, &ignored); if (s==APFloat::opInvalidOp) // inexact is OK, in fact usual break; return getConstant(x, VT); } case ISD::BIT_CONVERT: if (VT == MVT::i32 && C->getValueType(0) == MVT::f32) - return getConstant((uint32_t)V.convertToAPInt().getZExtValue(), VT); + return getConstant((uint32_t)V.bitcastToAPInt().getZExtValue(), VT); else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64) - return getConstant(V.convertToAPInt().getZExtValue(), VT); + return getConstant(V.bitcastToAPInt().getZExtValue(), VT); break; } } @@ -5245,7 +5250,7 @@ OS << '<' << CSDN->getValueAPF().convertToDouble() << '>'; else { OS << "getValueAPF().convertToAPInt().dump(); + CSDN->getValueAPF().bitcastToAPInt().dump(); OS << ")>"; } } else if (const GlobalAddressSDNode *GADN = Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Thu Oct 9 18:00:39 2008 @@ -498,9 +498,10 @@ else if (Op0->getType() == Type::X86_FP80Ty) { APFloat apf = APFloat(GV.IntVal); uint64_t v; + bool ignored; (void)apf.convertToInteger(&v, BitWidth, CE->getOpcode()==Instruction::FPToSI, - APFloat::rmTowardZero); + APFloat::rmTowardZero, &ignored); GV.IntVal = v; // endian? } return GV; Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Thu Oct 9 18:00:39 2008 @@ -788,6 +788,7 @@ integerPart scratch[4]; integerPart *fullSignificand; lostFraction lost_fraction; + bool ignored; assert(semantics == rhs.semantics); @@ -836,7 +837,7 @@ semantics = &extendedSemantics; APFloat extendedAddend(*addend); - status = extendedAddend.convert(extendedSemantics, rmTowardZero); + status = extendedAddend.convert(extendedSemantics, rmTowardZero, &ignored); assert(status == opOK); lost_fraction = addOrSubtractSignificand(extendedAddend, false); @@ -1528,8 +1529,9 @@ int parts = partCount(); integerPart *x = new integerPart[parts]; + bool ignored; fs = V.convertToInteger(x, parts * integerPartWidth, true, - rmNearestTiesToEven); + rmNearestTiesToEven, &ignored); if (fs==opInvalidOp) return fs; @@ -1670,9 +1672,16 @@ return result; } +/// APFloat::convert - convert a value of one floating point type to another. +/// The return value corresponds to the IEEE754 exceptions. *losesInfo +/// records whether the transformation lost information, i.e. whether +/// converting the result back to the original type will produce the +/// original value (this is almost the same as return value==fsOK, but there +/// are edge cases where this is not so). + APFloat::opStatus APFloat::convert(const fltSemantics &toSemantics, - roundingMode rounding_mode) + roundingMode rounding_mode, bool *losesInfo) { lostFraction lostFraction; unsigned int newPartCount, oldPartCount; @@ -1718,38 +1727,41 @@ exponent += toSemantics.precision - semantics->precision; semantics = &toSemantics; fs = normalize(rounding_mode, lostFraction); + *losesInfo = (fs != opOK); } else if (category == fcNaN) { int shift = toSemantics.precision - semantics->precision; // Do this now so significandParts gets the right answer const fltSemantics *oldSemantics = semantics; semantics = &toSemantics; - fs = opOK; + *losesInfo = false; // No normalization here, just truncate if (shift>0) APInt::tcShiftLeft(significandParts(), newPartCount, shift); else if (shift < 0) { unsigned ushift = -shift; - // We mark this as Inexact if we are losing information. This happens + // Figure out if we are losing information. This happens // if are shifting out something other than 0s, or if the x87 long // double input did not have its integer bit set (pseudo-NaN), or if the // x87 long double input did not have its QNan bit set (because the x87 // hardware sets this bit when converting a lower-precision NaN to // x87 long double). if (APInt::tcLSB(significandParts(), newPartCount) < ushift) - fs = opInexact; + *losesInfo = true; if (oldSemantics == &APFloat::x87DoubleExtended && (!(*significandParts() & 0x8000000000000000ULL) || !(*significandParts() & 0x4000000000000000ULL))) - fs = opInexact; + *losesInfo = true; APInt::tcShiftRight(significandParts(), newPartCount, ushift); } // gcc forces the Quiet bit on, which means (float)(double)(float_sNan) // does not give you back the same bits. This is dubious, and we // don't currently do it. You're really supposed to get // an invalid operation signal at runtime, but nobody does that. + fs = opOK; } else { semantics = &toSemantics; fs = opOK; + *losesInfo = false; } return fs; @@ -1768,7 +1780,8 @@ APFloat::opStatus APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width, bool isSigned, - roundingMode rounding_mode) const + roundingMode rounding_mode, + bool *isExact) const { lostFraction lost_fraction; const integerPart *src; @@ -1776,6 +1789,8 @@ assertArithmeticOK(*semantics); + *isExact = false; + /* Handle the three special cases first. */ if(category == fcInfinity || category == fcNaN) return opInvalidOp; @@ -1785,7 +1800,8 @@ if(category == fcZero) { APInt::tcSet(parts, 0, dstPartsCount); // Negative zero can't be represented as an int. - return sign ? opInexact : opOK; + *isExact = !sign; + return opOK; } src = significandParts(); @@ -1857,24 +1873,31 @@ return opInvalidOp; } - if (lost_fraction == lfExactlyZero) + if (lost_fraction == lfExactlyZero) { + *isExact = true; return opOK; - else + } else return opInexact; } /* Same as convertToSignExtendedInteger, except we provide deterministic values in case of an invalid operation exception, namely zero for NaNs and the minimal or maximal value respectively - for underflow or overflow. */ + for underflow or overflow. + The *isExact output tells whether the result is exact, in the sense + that converting it back to the original floating point type produces + the original value. This is almost equivalent to result==opOK, + except for negative zeroes. +*/ APFloat::opStatus APFloat::convertToInteger(integerPart *parts, unsigned int width, bool isSigned, - roundingMode rounding_mode) const + roundingMode rounding_mode, bool *isExact) const { opStatus fs; - fs = convertToSignExtendedInteger(parts, width, isSigned, rounding_mode); + fs = convertToSignExtendedInteger(parts, width, isSigned, rounding_mode, + isExact); if (fs == opInvalidOp) { unsigned int bits, dstPartsCount; Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original) +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Thu Oct 9 18:00:39 2008 @@ -832,12 +832,13 @@ // only deal in IEEE FP). // static bool isFPCSafeToPrint(const ConstantFP *CFP) { + bool ignored; // Do long doubles in hex for now. if (CFP->getType()!=Type::FloatTy && CFP->getType()!=Type::DoubleTy) return false; APFloat APF = APFloat(CFP->getValueAPF()); // copy if (CFP->getType()==Type::FloatTy) - APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven); + APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); #if HAVE_PRINTF_A && ENABLE_CBE_PRINTF_A char Buffer[100]; sprintf(Buffer, "%a", APF.convertToDouble()); Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original) +++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Thu Oct 9 18:00:39 2008 @@ -218,9 +218,10 @@ // This makes sure that conversion to/from floating yields the same binary // result so that we don't lose precision. void CppWriter::printCFP(const ConstantFP *CFP) { + bool ignored; APFloat APF = APFloat(CFP->getValueAPF()); // copy if (CFP->getType() == Type::FloatTy) - APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven); + APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored); Out << "ConstantFP::get("; Out << "APFloat("; #if HAVE_PRINTF_A Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Oct 9 18:00:39 2008 @@ -482,13 +482,16 @@ setOperationAction(ISD::UNDEF, MVT::f80, Expand); setOperationAction(ISD::FCOPYSIGN, MVT::f80, Expand); { + bool ignored; APFloat TmpFlt(+0.0); - TmpFlt.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven); + TmpFlt.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, + &ignored); addLegalFPImmediate(TmpFlt); // FLD0 TmpFlt.changeSign(); addLegalFPImmediate(TmpFlt); // FLD0/FCHS APFloat TmpFlt2(+1.0); - TmpFlt2.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven); + TmpFlt2.convert(APFloat::x87DoubleExtended, APFloat::rmNearestTiesToEven, + &ignored); addLegalFPImmediate(TmpFlt2); // FLD1 TmpFlt2.changeSign(); addLegalFPImmediate(TmpFlt2); // FLD1/FCHS Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Oct 9 18:00:39 2008 @@ -7856,8 +7856,10 @@ /// FitsInFPType - Return a Constant* for the specified FP constant if it fits /// in the specified FP type without changing its value. static Constant *FitsInFPType(ConstantFP *CFP, const fltSemantics &Sem) { + bool losesInfo; APFloat F = CFP->getValueAPF(); - if (F.convert(Sem, APFloat::rmNearestTiesToEven) == APFloat::opOK) + (void)F.convert(Sem, APFloat::rmNearestTiesToEven, &losesInfo); + if (!losesInfo) return ConstantFP::get(F); return 0; } Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Thu Oct 9 18:00:39 2008 @@ -213,13 +213,14 @@ case Instruction::FPTrunc: case Instruction::FPExt: if (const ConstantFP *FPC = dyn_cast(V)) { + bool ignored; APFloat Val = FPC->getValueAPF(); Val.convert(DestTy == Type::FloatTy ? APFloat::IEEEsingle : DestTy == Type::DoubleTy ? APFloat::IEEEdouble : DestTy == Type::X86_FP80Ty ? APFloat::x87DoubleExtended : DestTy == Type::FP128Ty ? APFloat::IEEEquad : APFloat::Bogus, - APFloat::rmNearestTiesToEven); + APFloat::rmNearestTiesToEven, &ignored); return ConstantFP::get(Val); } return 0; // Can't fold. @@ -227,10 +228,11 @@ case Instruction::FPToSI: if (const ConstantFP *FPC = dyn_cast(V)) { const APFloat &V = FPC->getValueAPF(); + bool ignored; uint64_t x[2]; uint32_t DestBitWidth = cast(DestTy)->getBitWidth(); (void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI, - APFloat::rmTowardZero); + APFloat::rmTowardZero, &ignored); APInt Val(DestBitWidth, 2, x); return ConstantInt::get(Val); } Modified: llvm/trunk/lib/VMCore/Constants.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Constants.cpp (original) +++ llvm/trunk/lib/VMCore/Constants.cpp Thu Oct 9 18:00:39 2008 @@ -373,7 +373,8 @@ /// 2.0/1.0 etc, that are known-valid both as double and as the target format. ConstantFP *ConstantFP::get(const Type *Ty, double V) { APFloat FV(V); - FV.convert(*TypeToFloatSemantics(Ty), APFloat::rmNearestTiesToEven); + bool ignored; + FV.convert(*TypeToFloatSemantics(Ty), APFloat::rmNearestTiesToEven, &ignored); return get(FV); } @@ -955,20 +956,25 @@ bool ConstantFP::isValueValidForType(const Type *Ty, const APFloat& Val) { // convert modifies in place, so make a copy. APFloat Val2 = APFloat(Val); + bool losesInfo; switch (Ty->getTypeID()) { default: return false; // These can't be represented as floating point! // FIXME rounding mode needs to be more flexible - case Type::FloatTyID: - return &Val2.getSemantics() == &APFloat::IEEEsingle || - Val2.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven) == - APFloat::opOK; - case Type::DoubleTyID: - return &Val2.getSemantics() == &APFloat::IEEEsingle || - &Val2.getSemantics() == &APFloat::IEEEdouble || - Val2.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven) == - APFloat::opOK; + case Type::FloatTyID: { + if (&Val2.getSemantics() == &APFloat::IEEEsingle) + return true; + Val2.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &losesInfo); + return !losesInfo; + } + case Type::DoubleTyID: { + if (&Val2.getSemantics() == &APFloat::IEEEsingle || + &Val2.getSemantics() == &APFloat::IEEEdouble) + return true; + Val2.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &losesInfo); + return !losesInfo; + } case Type::X86_FP80TyID: return &Val2.getSemantics() == &APFloat::IEEEsingle || &Val2.getSemantics() == &APFloat::IEEEdouble || Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=57329&r1=57328&r2=57329&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Thu Oct 9 18:00:39 2008 @@ -302,7 +302,9 @@ LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N) { APFloat APN(N); - APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven); + bool ignored; + APN.convert(SemanticsForType(unwrap(RealTy)), APFloat::rmNearestTiesToEven, + &ignored); return wrap(ConstantFP::get(APN)); } From dalej at apple.com Thu Oct 9 18:01:08 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 23:01:08 -0000 Subject: [llvm-commits] [llvm] r57330 - /llvm/trunk/include/llvm/Constants.h Message-ID: <200810092301.m99N18qp005532@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 18:01:07 2008 New Revision: 57330 URL: http://llvm.org/viewvc/llvm-project?rev=57330&view=rev Log: A file missed from previous checkin. Modified: llvm/trunk/include/llvm/Constants.h Modified: llvm/trunk/include/llvm/Constants.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Constants.h?rev=57330&r1=57329&r2=57330&view=diff ============================================================================== --- llvm/trunk/include/llvm/Constants.h (original) +++ llvm/trunk/include/llvm/Constants.h Thu Oct 9 18:01:07 2008 @@ -262,11 +262,12 @@ bool isExactlyValue(const APFloat& V) const; bool isExactlyValue(double V) const { + bool ignored; // convert is not supported on this type if (&Val.getSemantics() == &APFloat::PPCDoubleDouble) return false; APFloat FV(V); - FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven); + FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven, &ignored); return isExactlyValue(FV); } /// Methods for support type inquiry through isa, cast, and dyn_cast: From dalej at apple.com Thu Oct 9 18:01:35 2008 From: dalej at apple.com (Dale Johannesen) Date: Thu, 09 Oct 2008 23:01:35 -0000 Subject: [llvm-commits] [llvm] r57331 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200810092301.m99N1ZP8005692@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 18:01:34 2008 New Revision: 57331 URL: http://llvm.org/viewvc/llvm-project?rev=57331&view=rev Log: Generated files for previous checkin. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=57331&r1=57330&r2=57331&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Thu Oct 9 18:01:34 2008 @@ -394,7 +394,7 @@ /* Copy the first part of user declarations. */ -#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -812,8 +812,11 @@ // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double does not need this. if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble && - Ty==Type::FloatTy) - D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + Ty==Type::FloatTy) { + bool ignored; + D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } return ConstantFP::get(*D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? @@ -1375,7 +1378,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 977 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1424,7 +1427,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 193 of yacc.c. */ -#line 1428 "llvmAsmParser.tab.c" +#line 1431 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1437,7 +1440,7 @@ /* Line 216 of yacc.c. */ -#line 1441 "llvmAsmParser.tab.c" +#line 1444 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1883,42 +1886,42 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, - 1140, 1141, 1141, 1141, 1141, 1141, 1141, 1142, 1142, 1142, - 1142, 1142, 1142, 1143, 1143, 1143, 1143, 1143, 1143, 1146, - 1146, 1147, 1147, 1148, 1148, 1149, 1149, 1150, 1150, 1154, - 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1158, 1158, 1159, - 1159, 1160, 1160, 1161, 1162, 1167, 1168, 1168, 1168, 1168, - 1168, 1170, 1170, 1170, 1171, 1171, 1173, 1174, 1178, 1182, - 1187, 1193, 1193, 1195, 1196, 1201, 1207, 1208, 1209, 1210, - 1211, 1212, 1216, 1217, 1218, 1222, 1223, 1224, 1225, 1229, - 1230, 1231, 1235, 1236, 1237, 1238, 1239, 1243, 1244, 1245, - 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1261, 1262, 1263, - 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1274, 1275, 1280, - 1281, 1282, 1285, 1286, 1292, 1293, 1294, 1295, 1296, 1297, - 1298, 1299, 1300, 1301, 1304, 1305, 1311, 1312, 1319, 1320, - 1326, 1327, 1336, 1344, 1345, 1350, 1351, 1352, 1357, 1370, - 1370, 1370, 1370, 1370, 1370, 1370, 1373, 1377, 1381, 1388, - 1393, 1401, 1436, 1467, 1472, 1482, 1492, 1496, 1506, 1513, - 1522, 1529, 1534, 1539, 1546, 1547, 1554, 1561, 1569, 1575, - 1587, 1615, 1631, 1658, 1686, 1712, 1732, 1758, 1778, 1790, - 1797, 1863, 1873, 1883, 1889, 1899, 1905, 1915, 1921, 1927, - 1940, 1952, 1973, 1981, 1987, 1998, 2003, 2008, 2013, 2018, - 2024, 2030, 2036, 2044, 2055, 2059, 2067, 2067, 2070, 2070, - 2073, 2085, 2106, 2111, 2119, 2120, 2124, 2124, 2128, 2128, - 2131, 2134, 2158, 2170, 2169, 2181, 2180, 2190, 2189, 2200, - 2240, 2243, 2249, 2259, 2263, 2268, 2270, 2275, 2280, 2289, - 2299, 2310, 2314, 2323, 2332, 2337, 2486, 2486, 2488, 2497, - 2497, 2499, 2504, 2516, 2520, 2525, 2529, 2533, 2538, 2543, - 2547, 2551, 2555, 2559, 2563, 2567, 2589, 2611, 2617, 2630, - 2642, 2647, 2659, 2665, 2669, 2679, 2683, 2687, 2692, 2699, - 2699, 2705, 2714, 2719, 2724, 2728, 2737, 2746, 2759, 2768, - 2772, 2780, 2800, 2804, 2809, 2820, 2839, 2848, 2952, 2956, - 2963, 2974, 2987, 2996, 3009, 3020, 3030, 3041, 3049, 3059, - 3066, 3069, 3070, 3078, 3084, 3093, 3097, 3102, 3118, 3135, - 3147, 3159, 3173, 3187, 3199, 3220, 3227, 3233, 3239, 3245, - 3260, 3370, 3375, 3379, 3386, 3393, 3403, 3410, 3420, 3428, - 3442, 3459, 3473, 3488, 3503 + 0, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, + 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 1145, 1145, + 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146, 1149, + 1149, 1150, 1150, 1151, 1151, 1152, 1152, 1153, 1153, 1157, + 1157, 1158, 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162, + 1162, 1163, 1163, 1164, 1165, 1170, 1171, 1171, 1171, 1171, + 1171, 1173, 1173, 1173, 1174, 1174, 1176, 1177, 1181, 1185, + 1190, 1196, 1196, 1198, 1199, 1204, 1210, 1211, 1212, 1213, + 1214, 1215, 1219, 1220, 1221, 1225, 1226, 1227, 1228, 1232, + 1233, 1234, 1238, 1239, 1240, 1241, 1242, 1246, 1247, 1248, + 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1264, 1265, 1266, + 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1277, 1278, 1283, + 1284, 1285, 1288, 1289, 1295, 1296, 1297, 1298, 1299, 1300, + 1301, 1302, 1303, 1304, 1307, 1308, 1314, 1315, 1322, 1323, + 1329, 1330, 1339, 1347, 1348, 1353, 1354, 1355, 1360, 1373, + 1373, 1373, 1373, 1373, 1373, 1373, 1376, 1380, 1384, 1391, + 1396, 1404, 1439, 1470, 1475, 1485, 1495, 1499, 1509, 1516, + 1525, 1532, 1537, 1542, 1549, 1550, 1557, 1564, 1572, 1578, + 1590, 1618, 1634, 1661, 1689, 1715, 1735, 1761, 1781, 1793, + 1800, 1866, 1876, 1886, 1892, 1902, 1908, 1918, 1924, 1930, + 1946, 1958, 1979, 1987, 1993, 2004, 2009, 2014, 2019, 2024, + 2030, 2036, 2042, 2050, 2061, 2065, 2073, 2073, 2076, 2076, + 2079, 2091, 2112, 2117, 2125, 2126, 2130, 2130, 2134, 2134, + 2137, 2140, 2164, 2176, 2175, 2187, 2186, 2196, 2195, 2206, + 2246, 2249, 2255, 2265, 2269, 2274, 2276, 2281, 2286, 2295, + 2305, 2316, 2320, 2329, 2338, 2343, 2492, 2492, 2494, 2503, + 2503, 2505, 2510, 2522, 2526, 2531, 2535, 2539, 2544, 2549, + 2553, 2557, 2561, 2565, 2569, 2573, 2595, 2617, 2623, 2636, + 2648, 2653, 2665, 2671, 2675, 2685, 2689, 2693, 2698, 2705, + 2705, 2711, 2720, 2725, 2730, 2734, 2743, 2752, 2765, 2774, + 2778, 2786, 2806, 2810, 2815, 2826, 2845, 2854, 2958, 2962, + 2969, 2980, 2993, 3002, 3015, 3026, 3036, 3047, 3055, 3065, + 3072, 3075, 3076, 3084, 3090, 3099, 3103, 3108, 3124, 3141, + 3153, 3165, 3179, 3193, 3205, 3226, 3233, 3239, 3245, 3251, + 3266, 3376, 3381, 3385, 3392, 3399, 3409, 3416, 3426, 3434, + 3448, 3465, 3479, 3494, 3509 }; #endif @@ -3661,152 +3664,152 @@ switch (yyn) { case 29: -#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1174 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3814,7 +3817,7 @@ break; case 69: -#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1185 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3822,7 +3825,7 @@ break; case 70: -#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3830,7 +3833,7 @@ break; case 74: -#line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3838,7 +3841,7 @@ break; case 75: -#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3846,157 +3849,157 @@ break; case 76: -#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 77: -#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 78: -#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 79: -#line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 80: -#line 1211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 81: -#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 82: -#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 83: -#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 84: -#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 85: -#line 1222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 87: -#line 1224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 88: -#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 89: -#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 90: -#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 91: -#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 92: -#line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 93: -#line 1236 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 95: -#line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 96: -#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 97: -#line 1243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 98: -#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 99: -#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 100: -#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 102: -#line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 103: -#line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 104: -#line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 105: -#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 106: -#line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -4006,176 +4009,176 @@ break; case 107: -#line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 108: -#line 1262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 109: -#line 1263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 110: -#line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 111: -#line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 112: -#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::StructRet; ;} break; case 113: -#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoAlias; ;} break; case 114: -#line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ByVal; ;} break; case 115: -#line 1269 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::Nest; ;} break; case 116: -#line 1270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 117: -#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 118: -#line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 119: -#line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 120: -#line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1284 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 121: -#line 1282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 122: -#line 1285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 123: -#line 1286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1289 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 124: -#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoReturn; ;} break; case 125: -#line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1296 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoUnwind; ;} break; case 126: -#line 1294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1297 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::InReg; ;} break; case 127: -#line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ZExt; ;} break; case 128: -#line 1296 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::SExt; ;} break; case 129: -#line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadNone; ;} break; case 130: -#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::ReadOnly; ;} break; case 131: -#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::NoInline; ;} break; case 132: -#line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1303 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::AlwaysInline; ;} break; case 133: -#line 1301 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1304 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::OptimizeForSize; ;} break; case 134: -#line 1304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1307 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = Attribute::None; ;} break; case 135: -#line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1308 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes); ;} break; case 136: -#line 1311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1314 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 137: -#line 1312 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1315 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 138: -#line 1319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 139: -#line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1323 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4185,12 +4188,12 @@ break; case 140: -#line 1326 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 141: -#line 1327 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1330 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4200,7 +4203,7 @@ break; case 142: -#line 1336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1339 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4211,27 +4214,27 @@ break; case 143: -#line 1344 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1347 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 144: -#line 1345 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1348 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 145: -#line 1350 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1353 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 146: -#line 1351 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1354 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 147: -#line 1352 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1355 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4240,7 +4243,7 @@ break; case 148: -#line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1360 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4250,7 +4253,7 @@ break; case 156: -#line 1373 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4258,7 +4261,7 @@ break; case 157: -#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4266,7 +4269,7 @@ break; case 158: -#line 1381 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1384 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4277,7 +4280,7 @@ break; case 159: -#line 1388 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1391 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4286,7 +4289,7 @@ break; case 160: -#line 1393 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1396 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4298,7 +4301,7 @@ break; case 161: -#line 1401 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1404 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4337,7 +4340,7 @@ break; case 162: -#line 1436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1439 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4371,7 +4374,7 @@ break; case 163: -#line 1467 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1470 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4380,7 +4383,7 @@ break; case 164: -#line 1472 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1475 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4394,7 +4397,7 @@ break; case 165: -#line 1482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1485 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4408,7 +4411,7 @@ break; case 166: -#line 1492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1495 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4416,7 +4419,7 @@ break; case 167: -#line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1499 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4430,7 +4433,7 @@ break; case 168: -#line 1506 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4438,7 +4441,7 @@ break; case 169: -#line 1513 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1516 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4448,7 +4451,7 @@ break; case 170: -#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1525 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4459,14 +4462,14 @@ break; case 171: -#line 1529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1532 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 172: -#line 1534 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1537 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4475,7 +4478,7 @@ break; case 173: -#line 1539 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1542 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4483,7 +4486,7 @@ break; case 175: -#line 1547 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1550 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4494,7 +4497,7 @@ break; case 176: -#line 1554 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1557 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = Attribute::None; @@ -4505,7 +4508,7 @@ break; case 177: -#line 1561 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1564 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4513,7 +4516,7 @@ break; case 178: -#line 1569 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1572 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4523,7 +4526,7 @@ break; case 179: -#line 1575 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1578 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4532,7 +4535,7 @@ break; case 180: -#line 1587 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1590 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4564,7 +4567,7 @@ break; case 181: -#line 1615 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1618 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4584,7 +4587,7 @@ break; case 182: -#line 1631 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1634 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4615,7 +4618,7 @@ break; case 183: -#line 1658 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1661 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4647,7 +4650,7 @@ break; case 184: -#line 1686 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1689 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4677,7 +4680,7 @@ break; case 185: -#line 1712 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1715 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4701,7 +4704,7 @@ break; case 186: -#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1735 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4731,7 +4734,7 @@ break; case 187: -#line 1758 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1761 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4755,7 +4758,7 @@ break; case 188: -#line 1778 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1781 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4771,7 +4774,7 @@ break; case 189: -#line 1790 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1793 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4782,7 +4785,7 @@ break; case 190: -#line 1797 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1800 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4852,7 +4855,7 @@ break; case 191: -#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1866 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4866,7 +4869,7 @@ break; case 192: -#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1876 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4880,7 +4883,7 @@ break; case 193: -#line 1883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1886 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4890,7 +4893,7 @@ break; case 194: -#line 1889 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1892 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4904,7 +4907,7 @@ break; case 195: -#line 1899 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1902 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4914,7 +4917,7 @@ break; case 196: -#line 1905 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1908 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4928,7 +4931,7 @@ break; case 197: -#line 1915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1918 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant true must have type i1"); @@ -4938,7 +4941,7 @@ break; case 198: -#line 1921 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant false must have type i1"); @@ -4948,14 +4951,17 @@ break; case 199: -#line 1927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1930 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy) - (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy) { + bool ignored; + (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal)); delete (yyvsp[(2) - (2)].FPVal); CHECK_FOR_ERROR @@ -4963,7 +4969,7 @@ break; case 200: -#line 1940 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1946 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4979,7 +4985,7 @@ break; case 201: -#line 1952 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1958 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -5004,7 +5010,7 @@ break; case 202: -#line 1973 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1979 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -5016,7 +5022,7 @@ break; case 203: -#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -5026,7 +5032,7 @@ break; case 204: -#line 1987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1993 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -5041,7 +5047,7 @@ break; case 205: -#line 1998 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2004 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -5050,7 +5056,7 @@ break; case 206: -#line 2003 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2009 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -5059,7 +5065,7 @@ break; case 207: -#line 2008 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2014 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -5068,7 +5074,7 @@ break; case 208: -#line 2013 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2019 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -5077,7 +5083,7 @@ break; case 209: -#line 2018 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5087,7 +5093,7 @@ break; case 210: -#line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2030 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5097,7 +5103,7 @@ break; case 211: -#line 2030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5107,7 +5113,7 @@ break; case 212: -#line 2036 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2042 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5119,7 +5125,7 @@ break; case 213: -#line 2044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2050 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5131,7 +5137,7 @@ break; case 214: -#line 2055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2061 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -5139,7 +5145,7 @@ break; case 215: -#line 2059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5148,27 +5154,27 @@ break; case 216: -#line 2067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2073 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 217: -#line 2067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2073 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 218: -#line 2070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 219: -#line 2070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 220: -#line 2073 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2079 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5184,7 +5190,7 @@ break; case 221: -#line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2091 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5200,7 +5206,7 @@ break; case 222: -#line 2106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2112 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5209,7 +5215,7 @@ break; case 223: -#line 2111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5218,12 +5224,12 @@ break; case 226: -#line 2124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 227: -#line 2124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5231,26 +5237,26 @@ break; case 228: -#line 2128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 229: -#line 2128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 230: -#line 2131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2137 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 231: -#line 2134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5278,7 +5284,7 @@ break; case 232: -#line 2158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5293,7 +5299,7 @@ break; case 233: -#line 2170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5305,14 +5311,14 @@ break; case 234: -#line 2177 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 235: -#line 2181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5322,14 +5328,14 @@ break; case 236: -#line 2186 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2192 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 237: -#line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5340,7 +5346,7 @@ break; case 238: -#line 2196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5348,7 +5354,7 @@ break; case 239: -#line 2200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2206 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5392,21 +5398,21 @@ break; case 240: -#line 2240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 241: -#line 2243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 242: -#line 2249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5419,7 +5425,7 @@ break; case 243: -#line 2259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5427,7 +5433,7 @@ break; case 244: -#line 2263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5435,7 +5441,7 @@ break; case 246: -#line 2270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2276 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5444,7 +5450,7 @@ break; case 247: -#line 2275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2281 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5453,14 +5459,14 @@ break; case 248: -#line 2280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2286 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 249: -#line 2289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5474,7 +5480,7 @@ break; case 250: -#line 2299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2305 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5488,7 +5494,7 @@ break; case 251: -#line 2310 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2316 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5496,7 +5502,7 @@ break; case 252: -#line 2314 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2320 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5509,7 +5515,7 @@ break; case 253: -#line 2323 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5522,7 +5528,7 @@ break; case 254: -#line 2332 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2338 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5530,7 +5536,7 @@ break; case 255: -#line 2338 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2344 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(4) - (11)].StrVal)); delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory! @@ -5681,7 +5687,7 @@ break; case 258: -#line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5693,7 +5699,7 @@ break; case 261: -#line 2499 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2505 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5701,7 +5707,7 @@ break; case 262: -#line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2510 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5712,7 +5718,7 @@ break; case 263: -#line 2516 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2522 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5720,7 +5726,7 @@ break; case 264: -#line 2520 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2526 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5728,7 +5734,7 @@ break; case 265: -#line 2525 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2531 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5736,7 +5742,7 @@ break; case 266: -#line 2529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2535 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5744,7 +5750,7 @@ break; case 267: -#line 2533 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2539 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5753,7 +5759,7 @@ break; case 268: -#line 2538 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2544 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5762,7 +5768,7 @@ break; case 269: -#line 2543 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2549 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5770,7 +5776,7 @@ break; case 270: -#line 2547 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2553 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5778,7 +5784,7 @@ break; case 271: -#line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2557 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5786,7 +5792,7 @@ break; case 272: -#line 2555 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2561 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5794,7 +5800,7 @@ break; case 273: -#line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2565 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5802,7 +5808,7 @@ break; case 274: -#line 2563 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5810,7 +5816,7 @@ break; case 275: -#line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2573 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5836,7 +5842,7 @@ break; case 276: -#line 2589 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2595 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5862,7 +5868,7 @@ break; case 277: -#line 2611 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2617 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5872,7 +5878,7 @@ break; case 278: -#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2623 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5889,7 +5895,7 @@ break; case 279: -#line 2630 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2636 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5905,7 +5911,7 @@ break; case 280: -#line 2642 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2648 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5914,7 +5920,7 @@ break; case 281: -#line 2647 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2653 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5930,7 +5936,7 @@ break; case 282: -#line 2659 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2665 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5940,7 +5946,7 @@ break; case 283: -#line 2665 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2671 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5948,7 +5954,7 @@ break; case 284: -#line 2669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2675 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5958,7 +5964,7 @@ break; case 285: -#line 2679 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2685 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5966,7 +5972,7 @@ break; case 286: -#line 2683 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2689 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5974,7 +5980,7 @@ break; case 287: -#line 2687 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2693 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5983,7 +5989,7 @@ break; case 288: -#line 2692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2698 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5992,7 +5998,7 @@ break; case 291: -#line 2705 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2711 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -6003,7 +6009,7 @@ break; case 292: -#line 2714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2720 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -6012,7 +6018,7 @@ break; case 293: -#line 2719 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2725 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -6020,7 +6026,7 @@ break; case 294: -#line 2724 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2730 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6028,7 +6034,7 @@ break; case 295: -#line 2728 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2734 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -6036,7 +6042,7 @@ break; case 296: -#line 2737 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2743 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -6048,7 +6054,7 @@ break; case 297: -#line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2752 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -6063,7 +6069,7 @@ break; case 298: -#line 2759 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2765 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -6076,7 +6082,7 @@ break; case 299: -#line 2768 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2774 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -6084,7 +6090,7 @@ break; case 300: -#line 2772 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2778 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -6094,7 +6100,7 @@ break; case 301: -#line 2780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2786 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6118,7 +6124,7 @@ break; case 302: -#line 2800 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2806 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -6126,7 +6132,7 @@ break; case 303: -#line 2804 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2810 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6135,7 +6141,7 @@ break; case 304: -#line 2809 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2815 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6150,7 +6156,7 @@ break; case 305: -#line 2820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2826 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6173,7 +6179,7 @@ break; case 306: -#line 2839 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2845 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6186,7 +6192,7 @@ break; case 307: -#line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2855 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6293,7 +6299,7 @@ break; case 308: -#line 2952 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2958 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -6301,7 +6307,7 @@ break; case 309: -#line 2956 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -6309,7 +6315,7 @@ break; case 310: -#line 2963 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2969 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6324,7 +6330,7 @@ break; case 311: -#line 2974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6340,7 +6346,7 @@ break; case 312: -#line 2987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2993 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6352,7 +6358,7 @@ break; case 313: -#line 2996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3002 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6367,7 +6373,7 @@ break; case 314: -#line 3009 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3015 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6382,7 +6388,7 @@ break; case 315: -#line 3020 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3026 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6394,7 +6400,7 @@ break; case 316: -#line 3030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6409,7 +6415,7 @@ break; case 317: -#line 3041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6421,7 +6427,7 @@ break; case 318: -#line 3049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3055 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6435,7 +6441,7 @@ break; case 319: -#line 3059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6446,17 +6452,17 @@ break; case 320: -#line 3066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3072 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 321: -#line 3069 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3075 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 322: -#line 3070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6465,7 +6471,7 @@ break; case 323: -#line 3078 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3084 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6475,7 +6481,7 @@ break; case 324: -#line 3084 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3090 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6486,7 +6492,7 @@ break; case 325: -#line 3093 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6494,7 +6500,7 @@ break; case 326: -#line 3097 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3103 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6502,7 +6508,7 @@ break; case 327: -#line 3102 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3108 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6522,7 +6528,7 @@ break; case 328: -#line 3118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6543,7 +6549,7 @@ break; case 329: -#line 3135 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3141 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6559,7 +6565,7 @@ break; case 330: -#line 3147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6575,7 +6581,7 @@ break; case 331: -#line 3159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6593,7 +6599,7 @@ break; case 332: -#line 3173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6611,7 +6617,7 @@ break; case 333: -#line 3187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6627,7 +6633,7 @@ break; case 334: -#line 3199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (isa((yyvsp[(2) - (6)].ValueVal)->getType())) { // vector select @@ -6652,7 +6658,7 @@ break; case 335: -#line 3220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6663,7 +6669,7 @@ break; case 336: -#line 3227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6673,7 +6679,7 @@ break; case 337: -#line 3233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6683,7 +6689,7 @@ break; case 338: -#line 3239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6693,7 +6699,7 @@ break; case 339: -#line 3245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6712,7 +6718,7 @@ break; case 340: -#line 3261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6825,7 +6831,7 @@ break; case 341: -#line 3370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR @@ -6833,7 +6839,7 @@ break; case 342: -#line 3375 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3381 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -6841,7 +6847,7 @@ break; case 343: -#line 3379 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3385 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -6849,7 +6855,7 @@ break; case 344: -#line 3386 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3392 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6860,7 +6866,7 @@ break; case 345: -#line 3393 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3399 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6874,7 +6880,7 @@ break; case 346: -#line 3403 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3409 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6885,7 +6891,7 @@ break; case 347: -#line 3410 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3416 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6899,7 +6905,7 @@ break; case 348: -#line 3420 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3426 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6910,7 +6916,7 @@ break; case 349: -#line 3428 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3434 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6928,7 +6934,7 @@ break; case 350: -#line 3442 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3448 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6949,7 +6955,7 @@ break; case 351: -#line 3459 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3465 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6967,7 +6973,7 @@ break; case 352: -#line 3473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3479 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6986,7 +6992,7 @@ break; case 353: -#line 3488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -7005,7 +7011,7 @@ break; case 354: -#line 3503 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -7027,7 +7033,7 @@ /* Line 1267 of yacc.c. */ -#line 7031 "llvmAsmParser.tab.c" +#line 7037 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -7241,7 +7247,7 @@ } -#line 3522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3528 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=57331&r1=57330&r2=57331&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Thu Oct 9 18:01:34 2008 @@ -360,7 +360,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 977 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=57331&r1=57330&r2=57331&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Thu Oct 9 18:01:34 2008 @@ -428,8 +428,11 @@ // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double does not need this. if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble && - Ty==Type::FloatTy) - D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + Ty==Type::FloatTy) { + bool ignored; + D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } return ConstantFP::get(*D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? @@ -1929,8 +1932,11 @@ GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy) - $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + if (&$2->getSemantics()==&APFloat::IEEEdouble && $1==Type::FloatTy) { + bool ignored; + $2->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, + &ignored); + } $$ = ConstantFP::get(*$2); delete $2; CHECK_FOR_ERROR From dalej at apple.com Thu Oct 9 20:06:37 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 01:06:37 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57336 - in /llvm-gcc-4.2/trunk/gcc/testsuite: gcc.apple/const-cfstring-3.c gcc.dg/tree-ssa/flatten-2.c gcc.dg/tree-ssa/foldaddr-1.c Message-ID: <200810100106.m9A16b3u017640@zion.cs.uiuc.edu> Author: johannes Date: Thu Oct 9 20:06:35 2008 New Revision: 57336 URL: http://llvm.org/viewvc/llvm-project?rev=57336&view=rev Log: More testcase adjustments for llvm. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c?rev=57336&r1=57335&r2=57336&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/const-cfstring-3.c Thu Oct 9 20:06:35 2008 @@ -26,5 +26,7 @@ s0 = s1; } -/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+4\n" } } */ -/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+10\n" } } */ +/* LLVM LOCAL begin allow for comment after numbers */ +/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992.*\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+4.*\n" } } */ +/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992.*\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+10.*\n" } } */ +/* LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c?rev=57336&r1=57335&r2=57336&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/flatten-2.c Thu Oct 9 20:06:35 2008 @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options -O2 } */ +/* LLVM LOCAL explicitly disable inlining */ +/* { dg-options "-O2 -fno-inline-functions" } */ /* Check that we finish compiling even if instructed to flatten a cyclic callgraph. Verify we correctly Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c?rev=57336&r1=57335&r2=57336&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/tree-ssa/foldaddr-1.c Thu Oct 9 20:06:35 2008 @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-original" } */ +/* LLVM LOCAL llvm doesn't support tree dumps. */ +/* { dg-require-fdump "" } */ char *a; From wangmp at apple.com Thu Oct 9 20:41:25 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 10 Oct 2008 01:41:25 -0000 Subject: [llvm-commits] [llvm] r57338 - /llvm/trunk/include/llvm/Intrinsics.td Message-ID: <200810100141.m9A1fPdn020454@zion.cs.uiuc.edu> Author: wangmp Date: Thu Oct 9 20:41:18 2008 New Revision: 57338 URL: http://llvm.org/viewvc/llvm-project?rev=57338&view=rev Log: Fixed definition of llvm_anyptr_ty Modified: llvm/trunk/include/llvm/Intrinsics.td Modified: llvm/trunk/include/llvm/Intrinsics.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=57338&r1=57337&r2=57338&view=diff ============================================================================== --- llvm/trunk/include/llvm/Intrinsics.td (original) +++ llvm/trunk/include/llvm/Intrinsics.td Thu Oct 9 20:41:18 2008 @@ -89,7 +89,7 @@ def llvm_ppcf128_ty : LLVMType; def llvm_ptr_ty : LLVMPointerType; // i8* def llvm_ptrptr_ty : LLVMPointerType; // i8** -def llvm_anyptr_ty : LLVMPointerType; // (space)i8* +def llvm_anyptr_ty : LLVMAnyPointerType; // (space)i8* def llvm_empty_ty : LLVMType; // { } def llvm_descriptor_ty : LLVMPointerType; // { }* From wangmp at apple.com Thu Oct 9 20:43:55 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 10 Oct 2008 01:43:55 -0000 Subject: [llvm-commits] [llvm] r57339 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp Message-ID: <200810100143.m9A1htMq020545@zion.cs.uiuc.edu> Author: wangmp Date: Thu Oct 9 20:43:55 2008 New Revision: 57339 URL: http://llvm.org/viewvc/llvm-project?rev=57339&view=rev Log: Added missing print functions that take a raw_ostream Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=57339&r1=57338&r2=57339&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Thu Oct 9 20:43:55 2008 @@ -164,6 +164,11 @@ /// print - Print the specified machine operand. /// void MachineOperand::print(std::ostream &OS, const TargetMachine *TM) const { + raw_os_ostream RawOS(OS); + print(RawOS, TM); +} + +void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const { switch (getType()) { case MachineOperand::MO_Register: if (getReg() == 0 || TargetRegisterInfo::isVirtualRegister(getReg())) { @@ -768,6 +773,11 @@ } void MachineInstr::print(std::ostream &OS, const TargetMachine *TM) const { + raw_os_ostream RawOS(OS); + print(RawOS, TM); +} + +void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const { // Specialize printing if op#0 is definition unsigned StartOp = 0; if (getNumOperands() && getOperand(0).isReg() && getOperand(0).isDef()) { @@ -810,8 +820,7 @@ else if (!V->getName().empty()) OS << V->getName(); else if (const PseudoSourceValue *PSV = dyn_cast(V)) { - raw_os_ostream OSS(OS); - PSV->print(OSS); + PSV->print(OS); } else OS << V; From wangmp at apple.com Thu Oct 9 20:47:42 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 10 Oct 2008 01:47:42 -0000 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Message-ID: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> Author: wangmp Date: Thu Oct 9 20:47:42 2008 New Revision: 57340 URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev Log: Moved guard mutex upwards to guard materializing a function in getPointerToFunction Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 2008 @@ -489,6 +489,8 @@ if (void *Addr = getPointerToGlobalIfAvailable(F)) return Addr; // Check if function already code gen'd + MutexGuard locked(lock); + // Make sure we read in the function if it exists in this Module. if (F->hasNotBeenReadFromBitcode()) { // Determine the module provider this function is provided by. @@ -509,13 +511,11 @@ abort(); } } - + if (void *Addr = getPointerToGlobalIfAvailable(F)) { return Addr; } - MutexGuard locked(lock); - if (F->isDeclaration()) { void *Addr = getPointerToNamedFunction(F->getName()); addGlobalMapping(F, Addr); From idadesub at users.sourceforge.net Fri Oct 10 03:13:35 2008 From: idadesub at users.sourceforge.net (Erick Tryzelaar) Date: Fri, 10 Oct 2008 01:13:35 -0700 Subject: [llvm-commits] bug fix to get lto-bugpoint to compile Message-ID: <1ef034530810100113w4bc13df0l5e5b8266ca3c3e8f@mail.gmail.com> Good morning. I was trying to build lto-bugpoint this morning, and it seems that it was missed in revision 55092 changing the argument types for addPassesToEmitFile. This patch copies what happens in llc when calling addPassesToEmitFile, so hopefully it's alright. I'm not sure how to test this to confirm it works though: diff --git tools/lto-bugpoint/LTOBugPoint.cpp tools/lto-bugpoint/LTOBugPoint.cpp index 587e360..96acf4a 100644 --- tools/lto-bugpoint/LTOBugPoint.cpp +++ tools/lto-bugpoint/LTOBugPoint.cpp @@ -24,6 +24,7 @@ #include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Config/config.h" #include @@ -189,7 +190,13 @@ bool LTOBugPoint::assembleBitcode(llvm::Module *M, const char *AsmFileName) { CGPasses->add(new TargetData(*Target->getTargetData())); MachineCodeEmitter* mce = NULL; - std::ofstream *Out = new std::ofstream(AsmFileName, std::ios::out); + std::string error; + raw_ostream *Out = new raw_fd_ostream(AsmFileName, error); + if (!error.empty()) { + std::cerr << error << '\n'; + delete Out; + return false; + } switch (Target->addPassesToEmitFile(*CGPasses, *Out, TargetMachine::AssemblyFile, true)) { From nicolas.geoffray at lip6.fr Fri Oct 10 03:25:32 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 10 Oct 2008 10:25:32 +0200 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> References: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> Message-ID: <48EF117C.1090505@lip6.fr> Hi Mon, We're having a conflict here. Originally, materializing a function was guarded. However, in Java, materializing a function may execute Java code that use locks, hence deadlocks can happen. So I moved the guard after materialization. On a more general note I *don't* think materializing a function should be guarded by the JIT compiler. The JIT's mutex should only protect JIT internal data. Materializing a function does not modify any JIT data. Nicolas Mon P Wang wrote: > Author: wangmp > Date: Thu Oct 9 20:47:42 2008 > New Revision: 57340 > > URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev > Log: > Moved guard mutex upwards to guard materializing a function > in getPointerToFunction > > > Modified: > llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp > > Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff > > ============================================================================== > --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) > +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 2008 > @@ -489,6 +489,8 @@ > if (void *Addr = getPointerToGlobalIfAvailable(F)) > return Addr; // Check if function already code gen'd > > + MutexGuard locked(lock); > + > // Make sure we read in the function if it exists in this Module. > if (F->hasNotBeenReadFromBitcode()) { > // Determine the module provider this function is provided by. > @@ -509,13 +511,11 @@ > abort(); > } > } > - > + > if (void *Addr = getPointerToGlobalIfAvailable(F)) { > return Addr; > } > > - MutexGuard locked(lock); > - > if (F->isDeclaration()) { > void *Addr = getPointerToNamedFunction(F->getName()); > addGlobalMapping(F, Addr); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From resistor at mac.com Fri Oct 10 03:36:26 2008 From: resistor at mac.com (Owen Anderson) Date: Fri, 10 Oct 2008 08:36:26 -0000 Subject: [llvm-commits] [llvm] r57342 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp Message-ID: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> Author: resistor Date: Fri Oct 10 03:36:25 2008 New Revision: 57342 URL: http://llvm.org/viewvc/llvm-project?rev=57342&view=rev Log: Add a basic intra-procedural escape analysis. This hasn't be extensively tested yet, but feedback is welcome. Added: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Added: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h?rev=57342&view=auto ============================================================================== --- llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h (added) +++ llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Fri Oct 10 03:36:25 2008 @@ -0,0 +1,59 @@ +//===------------- EscapeAnalysis.h - Pointer escape analysis -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the interface for the pointer escape analysis. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_LOOPVR_H +#define LLVM_ANALYSIS_LOOPVR_H + +#include "llvm/Pass.h" +#include "llvm/Instructions.h" +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Target/TargetData.h" +#include +#include + +namespace llvm { + +/// EscapeAnalysis - This class determines whether an allocation (a MallocInst +/// or an AllocaInst) can escape from the current function. It performs some +/// precomputation, with the rest of the work happening on-demand. +class EscapeAnalysis : public FunctionPass { +private: + std::set EscapePoints; + +public: + static char ID; // Class identification, replacement for typeinfo + + EscapeAnalysis() : FunctionPass(intptr_t(&ID)) {} + + bool runOnFunction(Function &F); + + void releaseMemory() { + EscapePoints.clear(); + } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredTransitive(); + AU.addRequiredTransitive(); + AU.setPreservesAll(); + } + + //===--------------------------------------------------------------------- + // Client API + + /// escapes - returns true if the AllocationInst can escape. + bool escapes(AllocationInst* A); +}; + +} // end llvm namespace + +#endif Added: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57342&view=auto ============================================================================== --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (added) +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Fri Oct 10 03:36:25 2008 @@ -0,0 +1,131 @@ +//===------------- EscapeAnalysis.h - Pointer escape analysis -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file provides the implementation of the pointer escape analysis. +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "escape-analysis" +#include "llvm/Analysis/EscapeAnalysis.h" +#include "llvm/Module.h" +#include "llvm/Support/InstIterator.h" +#include "llvm/ADT/SmallPtrSet.h" +using namespace llvm; + +char EscapeAnalysis::ID = 0; +static RegisterPass X("escape-analysis", + "Pointer Escape Analysis", true, true); + + +/// runOnFunction - Precomputation for escape analysis. This collects all know +/// "escape points" in the def-use graph of the function. These are +/// instructions which allow their inputs to escape from the current function. +bool EscapeAnalysis::runOnFunction(Function& F) { + EscapePoints.clear(); + + TargetData& TD = getAnalysis(); + AliasAnalysis& AA = getAnalysis(); + Module* M = F.getParent(); + + // Walk through all instructions in the function, identifying those that + // may allow their inputs to escape. + for(inst_iterator II = inst_begin(F), IE = inst_end(F); II != IE; ++II) { + Instruction* I = &*II; + + // The most obvious case is stores. Any store that may write to global + // memory or to a function argument potentially allows its input to escape. + if (StoreInst* S = dyn_cast(I)) { + const Type* StoreType = S->getOperand(0)->getType(); + unsigned StoreSize = TD.getTypeStoreSize(StoreType); + Value* Pointer = S->getPointerOperand(); + + bool inserted = false; + for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end(); + AI != AE; ++AI) { + AliasAnalysis::AliasResult R = AA.alias(Pointer, StoreSize, AI, ~0UL); + if (R != AliasAnalysis::NoAlias) { + EscapePoints.insert(S); + inserted = true; + break; + } + } + + if (inserted) + continue; + + for (Module::global_iterator GI = M->global_begin(), GE = M->global_end(); + GI != GE; ++GI) { + AliasAnalysis::AliasResult R = AA.alias(Pointer, StoreSize, GI, ~0UL); + if (R != AliasAnalysis::NoAlias) { + EscapePoints.insert(S); + break; + } + } + + // Calls and invokes potentially allow their parameters to escape. + // FIXME: This can and should be refined. Intrinsics have known escape + // behavior, and alias analysis may be able to tell us more about callees. + } else if (isa(I) || isa(I)) { + EscapePoints.insert(I); + + // Returns allow the return value to escape. This is mostly important + // for malloc to alloca promotion. + } else if (isa(I)) { + EscapePoints.insert(I); + } + + // FIXME: Are there any other possible escape points? + } + + return false; +} + +/// escapes - Determines whether the passed allocation can escape from the +/// current function. It does this by using a simple worklist algorithm to +/// search for a path in the def-use graph from the allocation to an +/// escape point. +/// FIXME: Once we've discovered a path, it would be a good idea to memoize it, +/// and all of its subpaths, to amortize the cost of future queries. +bool EscapeAnalysis::escapes(AllocationInst* A) { + std::vector worklist; + worklist.push_back(A); + + SmallPtrSet visited; + while (!worklist.empty()) { + Value* curr = worklist.back(); + worklist.pop_back(); + + visited.insert(curr); + + if (Instruction* CurrInst = dyn_cast(curr)) + if (EscapePoints.count(CurrInst)) + return true; + + for (Instruction::use_iterator UI = curr->use_begin(), UE = curr->use_end(); + UI != UE; ++UI) + if (Instruction* U = dyn_cast(UI)) + if (!visited.count(U)) + if (StoreInst* S = dyn_cast(U)) { + // We know this must be an instruction, because constant gep's would + // have been found to alias a global, so stores to them would have + // been in EscapePoints. + worklist.push_back(cast(S->getPointerOperand())); + } else if (isa(U) || isa(U)) { + // Because branches on the pointer value can hide data dependencies, + // we need to track values that were generated by branching on the + // pointer (or some derived value). To do that, we push the block, + // whose uses will be the PHINodes that generate information based + // one it. + worklist.push_back(U->getParent()); + } else + worklist.push_back(U); + } + + return false; +} \ No newline at end of file From resistor at mac.com Fri Oct 10 03:53:07 2008 From: resistor at mac.com (Owen Anderson) Date: Fri, 10 Oct 2008 08:53:07 -0000 Subject: [llvm-commits] [llvm] r57343 - /llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Message-ID: <200810100853.m9A8r7mJ011665@zion.cs.uiuc.edu> Author: resistor Date: Fri Oct 10 03:53:07 2008 New Revision: 57343 URL: http://llvm.org/viewvc/llvm-project?rev=57343&view=rev Log: Fix copy-and-paste-o. Modified: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h?rev=57343&r1=57342&r2=57343&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Fri Oct 10 03:53:07 2008 @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ANALYSIS_LOOPVR_H -#define LLVM_ANALYSIS_LOOPVR_H +#ifndef LLVM_ANALYSIS_ESCAPEANALYSIS_H +#define LLVM_ANALYSIS_ESCAPEANALYSIS_H #include "llvm/Pass.h" #include "llvm/Instructions.h" From asl at math.spbu.ru Fri Oct 10 05:14:27 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 10:14:27 -0000 Subject: [llvm-commits] [llvm] r57344 - /llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200810101014.m9AAESOR014918@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 05:14:15 2008 New Revision: 57344 URL: http://llvm.org/viewvc/llvm-project?rev=57344&view=rev Log: Cleanup Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=57344&r1=57343&r2=57344&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Fri Oct 10 05:14:15 2008 @@ -44,15 +44,15 @@ bool SelectADDRrr(SDValue Op, SDValue N, SDValue &R1, SDValue &R2); bool SelectADDRri(SDValue Op, SDValue N, SDValue &Base, SDValue &Offset); - + /// InstructionSelect - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. virtual void InstructionSelect(); - + virtual const char *getPassName() const { return "SPARC DAG->DAG Pattern Instruction Selection"; - } - + } + // Include the pieces autogenerated from the target description. #include "SparcGenDAGISel.inc" }; @@ -62,7 +62,7 @@ /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. void SparcDAGToDAGISel::InstructionSelect() { DEBUG(BB->dump()); - + // Select target instructions for the DAG. SelectRoot(); CurDAG->RemoveDeadNodes(); @@ -78,11 +78,11 @@ if (Addr.getOpcode() == ISD::TargetExternalSymbol || Addr.getOpcode() == ISD::TargetGlobalAddress) return false; // direct calls. - + if (Addr.getOpcode() == ISD::ADD) { if (ConstantSDNode *CN = dyn_cast(Addr.getOperand(1))) { if (Predicate_simm13(CN)) { - if (FrameIndexSDNode *FIN = + if (FrameIndexSDNode *FIN = dyn_cast(Addr.getOperand(0))) { // Constant offset from frame ref. Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); @@ -115,7 +115,7 @@ if (Addr.getOpcode() == ISD::TargetExternalSymbol || Addr.getOpcode() == ISD::TargetGlobalAddress) return false; // direct calls. - + if (Addr.getOpcode() == ISD::ADD) { if (isa(Addr.getOperand(1)) && Predicate_simm13(Addr.getOperand(1).getNode())) @@ -147,7 +147,7 @@ SDValue DivRHS = N->getOperand(1); AddToISelQueue(DivLHS); AddToISelQueue(DivRHS); - + // Set the Y register to the high-part. SDValue TopPart; if (N->getOpcode() == ISD::SDIV) { @@ -163,7 +163,7 @@ unsigned Opcode = N->getOpcode() == ISD::SDIV ? SP::SDIVrr : SP::UDIVrr; return CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS, TopPart); - } + } case ISD::MULHU: case ISD::MULHS: { // FIXME: Handle mul by immediate. @@ -179,12 +179,12 @@ return NULL; } } - + return SelectCode(Op); } -/// createSparcISelDag - This pass converts a legalized DAG into a +/// createSparcISelDag - This pass converts a legalized DAG into a /// SPARC-specific DAG, ready for instruction scheduling. /// FunctionPass *llvm::createSparcISelDag(SparcTargetMachine &TM) { From asl at math.spbu.ru Fri Oct 10 05:14:47 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 10:14:47 -0000 Subject: [llvm-commits] [llvm] r57345 - /llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200810101014.m9AAElCl014937@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 05:14:47 2008 New Revision: 57345 URL: http://llvm.org/viewvc/llvm-project?rev=57345&view=rev Log: Add dummy 'm' inline asm constraint handler for Sparc. I'm not sure, whether it is correct, however :) Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=57345&r1=57344&r2=57345&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Fri Oct 10 05:14:47 2008 @@ -45,6 +45,12 @@ bool SelectADDRri(SDValue Op, SDValue N, SDValue &Base, SDValue &Offset); + /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for + /// inline asm expressions. + virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op, + char ConstraintCode, + std::vector &OutOps); + /// InstructionSelect - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. virtual void InstructionSelect(); @@ -184,6 +190,26 @@ } +/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for +/// inline asm expressions. +bool +SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op, + char ConstraintCode, + std::vector &OutOps) { + SDValue Op0, Op1; + switch (ConstraintCode) { + default: return true; + case 'm': // memory + if (!SelectADDRrr(Op, Op, Op0, Op1)) + SelectADDRri(Op, Op, Op0, Op1); + break; + } + + OutOps.push_back(Op0); + OutOps.push_back(Op1); + return false; +} + /// createSparcISelDag - This pass converts a legalized DAG into a /// SPARC-specific DAG, ready for instruction scheduling. /// From asl at math.spbu.ru Fri Oct 10 05:15:03 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 10:15:03 -0000 Subject: [llvm-commits] [llvm] r57346 - /llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Message-ID: <200810101015.m9AAF3ix014958@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 05:15:03 2008 New Revision: 57346 URL: http://llvm.org/viewvc/llvm-project?rev=57346&view=rev Log: Add rudimentary asmprinter support for printing inline asm operands for sparc. Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=57346&r1=57345&r2=57346&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Fri Oct 10 05:15:03 2008 @@ -65,6 +65,10 @@ bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); bool doFinalization(Module &M); + bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, + unsigned AsmVariant, const char *ExtraCode); + bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, + unsigned AsmVariant, const char *ExtraCode); }; } // end of anonymous namespace @@ -213,8 +217,6 @@ O << SPARCCondCodeToString((SPCC::CondCodes)CC); } - - bool SparcAsmPrinter::doInitialization(Module &M) { Mang = new Mangler(M); return false; // success @@ -307,3 +309,30 @@ O << name << ":\n"; EmitGlobalConstant(C); } + +/// PrintAsmOperand - Print out an operand for an inline asm expression. +/// +bool SparcAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, + unsigned AsmVariant, + const char *ExtraCode) { + if (ExtraCode && ExtraCode[0]) + return true; // Unknown modifier + + printOperand(MI, OpNo); + + return false; +} + +bool SparcAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, + unsigned OpNo, + unsigned AsmVariant, + const char *ExtraCode) { + if (ExtraCode && ExtraCode[0]) + return true; // Unknown modifier + + O << '['; + printMemOperand(MI, OpNo); + O << ']'; + + return false; +} From asl at math.spbu.ru Fri Oct 10 05:15:18 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 10:15:18 -0000 Subject: [llvm-commits] [llvm] r57347 - /llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll Message-ID: <200810101015.m9AAFINx014978@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 05:15:18 2008 New Revision: 57347 URL: http://llvm.org/viewvc/llvm-project?rev=57347&view=rev Log: This is not failing anymore Modified: llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll Modified: llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll?rev=57347&r1=57346&r2=57347&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2007-04-27-LargeMemObject.ll Fri Oct 10 05:15:18 2008 @@ -1,6 +1,4 @@ ; RUN: llvm-as < %s | llc -; XFAIL: sparc-sun-solaris2 -; PR1557 %struct..0anon = type { [100 x i32] } From asl at math.spbu.ru Fri Oct 10 05:15:33 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 10:15:33 -0000 Subject: [llvm-commits] [llvm] r57348 - /llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll Message-ID: <200810101015.m9AAFY19014995@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 05:15:33 2008 New Revision: 57348 URL: http://llvm.org/viewvc/llvm-project?rev=57348&view=rev Log: Add sparc test for memory operand used in inline asm Added: llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll Added: llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll?rev=57348&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll Fri Oct 10 05:15:33 2008 @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | llc -march=sparc +; PR 1557 + +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:128:128" + at llvm.global_ctors = appending global [1 x { i32, void ()* }] [ { i32, void ()* } { i32 65535, void ()* @set_fast_math } ] ; <[1 x { i32, void ()* }]*> [#uses=0] + +define internal void @set_fast_math() nounwind { +entry: + %fsr = alloca i32 ; [#uses=4] + call void asm "st %fsr, $0", "=*m"(i32* %fsr) nounwind + %0 = load i32* %fsr, align 4 ; [#uses=1] + %1 = or i32 %0, 4194304 ; [#uses=1] + store i32 %1, i32* %fsr, align 4 + call void asm sideeffect "ld $0, %fsr", "*m"(i32* %fsr) nounwind + ret void +} From neil at daikokuya.co.uk Fri Oct 10 09:32:25 2008 From: neil at daikokuya.co.uk (Neil Booth) Date: Fri, 10 Oct 2008 23:32:25 +0900 Subject: [llvm-commits] [llvm] r57329 - in /llvm/trunk: include/llvm/ADT/ include/llvm/CodeGen/ lib/AsmParser/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/Support/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/X86/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: <200810092300.m99N0fGb005425@zion.cs.uiuc.edu> References: <200810092300.m99N0fGb005425@zion.cs.uiuc.edu> Message-ID: <20081010143225.GN19669@daikokuya.co.uk> Dale Johannesen wrote:- > Author: johannes > Date: Thu Oct 9 18:00:39 2008 > New Revision: 57329 > > URL: http://llvm.org/viewvc/llvm-project?rev=57329&view=rev > Log: > Add a "loses information" return value to APFloat::convert > and APFloat::convertToInteger. Restore return value to > IEEE754. Adjust all users accordingly. Why not just adding a bit to the status return value? That would seem less invasive. Neil. From nunoplopes at sapo.pt Fri Oct 10 11:25:52 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Fri, 10 Oct 2008 16:25:52 -0000 Subject: [llvm-commits] [llvm] r57353 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp Message-ID: <200810101625.m9AGPrtS029230@zion.cs.uiuc.edu> Author: nlopes Date: Fri Oct 10 11:25:50 2008 New Revision: 57353 URL: http://llvm.org/viewvc/llvm-project?rev=57353&view=rev Log: fix memleak by cleaning the global sets on pass exit Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=57353&r1=57352&r2=57353&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Fri Oct 10 11:25:50 2008 @@ -739,6 +739,7 @@ bool performPRE(Function& F); Value* lookupNumber(BasicBlock* BB, uint32_t num); bool mergeBlockIntoPredecessor(BasicBlock* BB); + void cleanupGlobalSets(); }; char GVN::ID = 0; @@ -1129,7 +1130,9 @@ changed |= PREChanged; } } - + + cleanupGlobalSets(); + return changed; } @@ -1332,16 +1335,9 @@ // iterateOnFunction - Executes one iteration of GVN bool GVN::iterateOnFunction(Function &F) { - // Clean out global sets from any previous functions - VN.clear(); - phiMap.clear(); - - for (DenseMap::iterator - I = localAvail.begin(), E = localAvail.end(); I != E; ++I) - delete I->second; - localAvail.clear(); - - DominatorTree &DT = getAnalysis(); + DominatorTree &DT = getAnalysis(); + + cleanupGlobalSets(); // Top-down walk of the dominator tree bool changed = false; @@ -1351,3 +1347,13 @@ return changed; } + +void GVN::cleanupGlobalSets() { + VN.clear(); + phiMap.clear(); + + for (DenseMap::iterator + I = localAvail.begin(), E = localAvail.end(); I != E; ++I) + delete I->second; + localAvail.clear(); +} From dalej at apple.com Fri Oct 10 11:51:11 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 09:51:11 -0700 Subject: [llvm-commits] [llvm] r57329 - in /llvm/trunk: include/llvm/ADT/ include/llvm/CodeGen/ lib/AsmParser/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/Support/ lib/Target/CBackend/ lib/Target/CppBackend/ lib/Target/X86/ lib/Transforms/Scalar/ lib/VMCore/ In-Reply-To: <20081010143225.GN19669@daikokuya.co.uk> References: <200810092300.m99N0fGb005425@zion.cs.uiuc.edu> <20081010143225.GN19669@daikokuya.co.uk> Message-ID: On Oct 10, 2008, at 7:32 AMPDT, Neil Booth wrote: > Dale Johannesen wrote:- > >> Author: johannes >> Date: Thu Oct 9 18:00:39 2008 >> New Revision: 57329 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57329&view=rev >> Log: >> Add a "loses information" return value to APFloat::convert >> and APFloat::convertToInteger. Restore return value to >> IEEE754. Adjust all users accordingly. > > Why not just adding a bit to the status return value? That would > seem less invasive. Didn't think of it. Yeah, that would be better. From wangmp at apple.com Fri Oct 10 11:56:13 2008 From: wangmp at apple.com (Mon Ping Wang) Date: Fri, 10 Oct 2008 09:56:13 -0700 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: <48EF117C.1090505@lip6.fr> References: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> <48EF117C.1090505@lip6.fr> Message-ID: <07A688AF-A985-4F69-B8BC-E94FD56D3F94@apple.com> Hi Nicolas, Sorry, I was not aware of Java issues. I moved the locked upwards because if I didn't, I ran into a problem that materialized function got corrupted occasionally and I got some weird errors. I'm not sure if this also could occur in Java as it is possible that it will never call getPointerToFunction twice on the same function by different threads. Is the requirement that materializing the function must be lockless? If no, maybe we can create a local lock around the materialization so we don't try to do it at the same time. Otherwise, clients would need guard calls to getPointerToFunction. -- Mon Ping On Oct 10, 2008, at 1:25 AM, Nicolas Geoffray wrote: > Hi Mon, > > We're having a conflict here. > > Originally, materializing a function was guarded. However, in Java, > materializing a function may execute Java code that use locks, hence > deadlocks can happen. > So I moved the guard after materialization. > > On a more general note I *don't* think materializing a function should > be guarded by the JIT compiler. The JIT's mutex should only protect > JIT > internal data. Materializing a function does not modify any JIT data. > > Nicolas > > > Mon P Wang wrote: >> Author: wangmp >> Date: Thu Oct 9 20:47:42 2008 >> New Revision: 57340 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev >> Log: >> Moved guard mutex upwards to guard materializing a function >> in getPointerToFunction >> >> >> Modified: >> llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >> >> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff >> >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) >> +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 >> 2008 >> @@ -489,6 +489,8 @@ >> if (void *Addr = getPointerToGlobalIfAvailable(F)) >> return Addr; // Check if function already code gen'd >> >> + MutexGuard locked(lock); >> + >> // Make sure we read in the function if it exists in this Module. >> if (F->hasNotBeenReadFromBitcode()) { >> // Determine the module provider this function is provided by. >> @@ -509,13 +511,11 @@ >> abort(); >> } >> } >> - >> + >> if (void *Addr = getPointerToGlobalIfAvailable(F)) { >> return Addr; >> } >> >> - MutexGuard locked(lock); >> - >> if (F->isDeclaration()) { >> void *Addr = getPointerToNamedFunction(F->getName()); >> addGlobalMapping(F, Addr); >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Fri Oct 10 11:58:06 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 10 Oct 2008 09:58:06 -0700 Subject: [llvm-commits] [llvm] r57342 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp In-Reply-To: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> References: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> Message-ID: Hi Owen! On Oct 10, 2008, at 1:36 AM, Owen Anderson wrote: > Author: resistor > Date: Fri Oct 10 03:36:25 2008 > New Revision: 57342 > > URL: http://llvm.org/viewvc/llvm-project?rev=57342&view=rev > Log: > Add a basic intra-procedural escape analysis. This hasn't be > extensively tested yet, but feedback is welcome. > > Added: > llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h > llvm/trunk/lib/Analysis/EscapeAnalysis.cpp > > Added: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h?rev=57342&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h (added) > +++ llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Fri Oct 10 > 03:36:25 2008 > @@ -0,0 +1,59 @@ > +//===------------- EscapeAnalysis.h - Pointer escape analysis > -------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// > +// This file defines the interface for the pointer escape analysis. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +#ifndef LLVM_ANALYSIS_LOOPVR_H > +#define LLVM_ANALYSIS_LOOPVR_H cut-n-pasto :) > > + > +#include "llvm/Pass.h" > +#include "llvm/Instructions.h" > +#include "llvm/Analysis/AliasAnalysis.h" > +#include "llvm/Target/TargetData.h" > +#include > +#include > + > +namespace llvm { > + > +/// EscapeAnalysis - This class determines whether an allocation (a > MallocInst > +/// or an AllocaInst) can escape from the current function. It > performs some > +/// precomputation, with the rest of the work happening on-demand. It'd be useful to briefly describe "some precomputation" here in this external interface. > > +class EscapeAnalysis : public FunctionPass { > +private: > + std::set EscapePoints; > + > +public: > + static char ID; // Class identification, replacement for typeinfo > + > + EscapeAnalysis() : FunctionPass(intptr_t(&ID)) {} > + > + bool runOnFunction(Function &F); > + > + void releaseMemory() { > + EscapePoints.clear(); > + } > + > + void getAnalysisUsage(AnalysisUsage &AU) const { > + AU.addRequiredTransitive(); > + AU.addRequiredTransitive(); > + AU.setPreservesAll(); > + } > + > + // > = > = > =--------------------------------------------------------------------- > + // Client API > + > + /// escapes - returns true if the AllocationInst can escape. > + bool escapes(AllocationInst* A); > +}; > + > +} // end llvm namespace > + > +#endif > > Added: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57342&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (added) > +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Fri Oct 10 03:36:25 > 2008 > @@ -0,0 +1,131 @@ > +//===------------- EscapeAnalysis.h - Pointer escape analysis > -------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// > +// This file provides the implementation of the pointer escape > analysis. > +// > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > +#define DEBUG_TYPE "escape-analysis" > +#include "llvm/Analysis/EscapeAnalysis.h" > +#include "llvm/Module.h" > +#include "llvm/Support/InstIterator.h" > +#include "llvm/ADT/SmallPtrSet.h" > +using namespace llvm; > + > +char EscapeAnalysis::ID = 0; > +static RegisterPass X("escape-analysis", > + "Pointer Escape Analysis", > true, true); > + > + > +/// runOnFunction - Precomputation for escape analysis. This > collects all know > +/// "escape points" in the def-use graph of the function. These are > +/// instructions which allow their inputs to escape from the > current function. > +bool EscapeAnalysis::runOnFunction(Function& F) { > + EscapePoints.clear(); > + > + TargetData& TD = getAnalysis(); > + AliasAnalysis& AA = getAnalysis(); > + Module* M = F.getParent(); > + > + // Walk through all instructions in the function, identifying > those that > + // may allow their inputs to escape. > + for(inst_iterator II = inst_begin(F), IE = inst_end(F); II != IE; > ++II) { > + Instruction* I = &*II; > + > + // The most obvious case is stores. Any store that may write > to global > + // memory or to a function argument potentially allows its > input to escape. > + if (StoreInst* S = dyn_cast(I)) { > + const Type* StoreType = S->getOperand(0)->getType(); > + unsigned StoreSize = TD.getTypeStoreSize(StoreType); > + Value* Pointer = S->getPointerOperand(); > + > + bool inserted = false; > + for (Function::arg_iterator AI = F.arg_begin(), AE = > F.arg_end(); > + AI != AE; ++AI) { > + AliasAnalysis::AliasResult R = AA.alias(Pointer, StoreSize, > AI, ~0UL); > + if (R != AliasAnalysis::NoAlias) { > + EscapePoints.insert(S); > + inserted = true; > + break; > + } > + } > + > + if (inserted) > + continue; > + > + for (Module::global_iterator GI = M->global_begin(), GE = M- > >global_end(); > + GI != GE; ++GI) { > + AliasAnalysis::AliasResult R = AA.alias(Pointer, StoreSize, > GI, ~0UL); > + if (R != AliasAnalysis::NoAlias) { > + EscapePoints.insert(S); > + break; > + } > + } > + > + // Calls and invokes potentially allow their parameters to > escape. > + // FIXME: This can and should be refined. Intrinsics have > known escape > + // behavior, and alias analysis may be able to tell us more > about callees. > + } else if (isa(I) || isa(I)) { > + EscapePoints.insert(I); > + > + // Returns allow the return value to escape. This is mostly > important > + // for malloc to alloca promotion. > + } else if (isa(I)) { > + EscapePoints.insert(I); > + } > + > + // FIXME: Are there any other possible escape points? Inline asm ? > > + } > + > + return false; > +} > + > +/// escapes - Determines whether the passed allocation can escape > from the > +/// current function. It does this by using a simple worklist > algorithm to > +/// search for a path in the def-use graph from the allocation to an > +/// escape point. > +/// FIXME: Once we've discovered a path, it would be a good idea to > memoize it, > +/// and all of its subpaths, to amortize the cost of future queries. > +bool EscapeAnalysis::escapes(AllocationInst* A) { > + std::vector worklist; > + worklist.push_back(A); > + > + SmallPtrSet visited; > + while (!worklist.empty()) { > + Value* curr = worklist.back(); > + worklist.pop_back(); > + > + visited.insert(curr); > + > + if (Instruction* CurrInst = dyn_cast(curr)) > + if (EscapePoints.count(CurrInst)) > + return true; > + > + for (Instruction::use_iterator UI = curr->use_begin(), UE = > curr->use_end(); > + UI != UE; ++UI) This won't work when curr is a Block. > > + if (Instruction* U = dyn_cast(UI)) > + if (!visited.count(U)) > + if (StoreInst* S = dyn_cast(U)) { > + // We know this must be an instruction, because > constant gep's would > + // have been found to alias a global, so stores to them > would have > + // been in EscapePoints. > + worklist.push_back(cast(S- > >getPointerOperand())); > + } else if (isa(U) || isa(U)) { > + // Because branches on the pointer value can hide data > dependencies, > + // we need to track values that were generated by > branching on the > + // pointer (or some derived value). To do that, we > push the block, > + // whose uses will be the PHINodes that generate > information based > + // one it. > + worklist.push_back(U->getParent()); > > + } else > + worklist.push_back(U); > + } > + > + return false; > +} > \ No newline at end of file > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits - Devang From nicolas.geoffray at lip6.fr Fri Oct 10 12:09:33 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 10 Oct 2008 19:09:33 +0200 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: <07A688AF-A985-4F69-B8BC-E94FD56D3F94@apple.com> References: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> <48EF117C.1090505@lip6.fr> <07A688AF-A985-4F69-B8BC-E94FD56D3F94@apple.com> Message-ID: <48EF8C4D.7070702@lip6.fr> Hi Mon, The logic here is that materializing a function has to be guarded because it creates LLVM IR, constants and types. However, it is not the JIT's responsability to guard it, but your module provider implementation. A default implementation of the module provider only locates the the function and creates the IR. So it's ok to let the JIT lock. However (and this is what's happening in Java) we can imagine complex things where materializing a function requires calling some external code. When this complex module provider is able to create the IR after calling this external code, *then* it can take the lock. I acknowledge that it's easier to place the lock in the execution engine, but it's wrong :) Nicolas Mon Ping Wang wrote: > Hi Nicolas, > > Sorry, I was not aware of Java issues. I moved the locked upwards > because if I didn't, I ran into a problem that materialized function > got corrupted occasionally and I got some weird errors. I'm not sure > if this also could occur in Java as it is possible that it will never > call getPointerToFunction twice on the same function by different > threads. Is the requirement that materializing the function must be > lockless? If no, maybe we can create a local lock around the > materialization so we don't try to do it at the same time. Otherwise, > clients would need guard calls to getPointerToFunction. > > -- Mon Ping > > > On Oct 10, 2008, at 1:25 AM, Nicolas Geoffray wrote: > > >> Hi Mon, >> >> We're having a conflict here. >> >> Originally, materializing a function was guarded. However, in Java, >> materializing a function may execute Java code that use locks, hence >> deadlocks can happen. >> So I moved the guard after materialization. >> >> On a more general note I *don't* think materializing a function should >> be guarded by the JIT compiler. The JIT's mutex should only protect >> JIT >> internal data. Materializing a function does not modify any JIT data. >> >> Nicolas >> >> >> Mon P Wang wrote: >> >>> Author: wangmp >>> Date: Thu Oct 9 20:47:42 2008 >>> New Revision: 57340 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev >>> Log: >>> Moved guard mutex upwards to guard materializing a function >>> in getPointerToFunction >>> >>> >>> Modified: >>> llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>> >>> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff >>> >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> = >>> ===================================================================== >>> --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) >>> +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 >>> 2008 >>> @@ -489,6 +489,8 @@ >>> if (void *Addr = getPointerToGlobalIfAvailable(F)) >>> return Addr; // Check if function already code gen'd >>> >>> + MutexGuard locked(lock); >>> + >>> // Make sure we read in the function if it exists in this Module. >>> if (F->hasNotBeenReadFromBitcode()) { >>> // Determine the module provider this function is provided by. >>> @@ -509,13 +511,11 @@ >>> abort(); >>> } >>> } >>> - >>> + >>> if (void *Addr = getPointerToGlobalIfAvailable(F)) { >>> return Addr; >>> } >>> >>> - MutexGuard locked(lock); >>> - >>> if (F->isDeclaration()) { >>> void *Addr = getPointerToNamedFunction(F->getName()); >>> addGlobalMapping(F, Addr); >>> >>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From monping at apple.com Fri Oct 10 12:57:45 2008 From: monping at apple.com (Mon Ping Wang) Date: Fri, 10 Oct 2008 10:57:45 -0700 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: <48EF8C4D.7070702@lip6.fr> References: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> <48EF117C.1090505@lip6.fr> <07A688AF-A985-4F69-B8BC-E94FD56D3F94@apple.com> <48EF8C4D.7070702@lip6.fr> Message-ID: Hi Nicolas, Thanks for the explanations on the Java issues. I'll back out my changes and changed my code to avoid this corruption. It makes sense that the JIT lock only for when it changes its internal state. Anyone who uses the default module provider could run into issue when using it with the JIT. Do we note this somewhere? Out of curiosity, does the Java compiler grab the JIT lock for its own uses? -- Mon Ping On Oct 10, 2008, at 10:09 AM, Nicolas Geoffray wrote: > Hi Mon, > > The logic here is that materializing a function has to be guarded > because it creates LLVM IR, constants and types. However, it is not > the > JIT's responsability to guard it, but your module provider > implementation. > > A default implementation of the module provider only locates the the > function and creates the IR. So it's ok to let the JIT lock. However > (and this is what's happening in Java) we can imagine complex things > where materializing a function requires calling some external code. > When > this complex module provider is able to create the IR after calling > this > external code, *then* it can take the lock. > > I acknowledge that it's easier to place the lock in the execution > engine, but it's wrong :) > > Nicolas > > Mon Ping Wang wrote: >> Hi Nicolas, >> >> Sorry, I was not aware of Java issues. I moved the locked upwards >> because if I didn't, I ran into a problem that materialized function >> got corrupted occasionally and I got some weird errors. I'm not sure >> if this also could occur in Java as it is possible that it will never >> call getPointerToFunction twice on the same function by different >> threads. Is the requirement that materializing the function must be >> lockless? If no, maybe we can create a local lock around the >> materialization so we don't try to do it at the same time. >> Otherwise, >> clients would need guard calls to getPointerToFunction. >> >> -- Mon Ping >> >> >> On Oct 10, 2008, at 1:25 AM, Nicolas Geoffray wrote: >> >> >>> Hi Mon, >>> >>> We're having a conflict here. >>> >>> Originally, materializing a function was guarded. However, in Java, >>> materializing a function may execute Java code that use locks, hence >>> deadlocks can happen. >>> So I moved the guard after materialization. >>> >>> On a more general note I *don't* think materializing a function >>> should >>> be guarded by the JIT compiler. The JIT's mutex should only protect >>> JIT >>> internal data. Materializing a function does not modify any JIT >>> data. >>> >>> Nicolas >>> >>> >>> Mon P Wang wrote: >>> >>>> Author: wangmp >>>> Date: Thu Oct 9 20:47:42 2008 >>>> New Revision: 57340 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev >>>> Log: >>>> Moved guard mutex upwards to guard materializing a function >>>> in getPointerToFunction >>>> >>>> >>>> Modified: >>>> llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>>> >>>> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff >>>> >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> = >>>> =================================================================== >>>> --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) >>>> +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 >>>> 2008 >>>> @@ -489,6 +489,8 @@ >>>> if (void *Addr = getPointerToGlobalIfAvailable(F)) >>>> return Addr; // Check if function already code gen'd >>>> >>>> + MutexGuard locked(lock); >>>> + >>>> // Make sure we read in the function if it exists in this Module. >>>> if (F->hasNotBeenReadFromBitcode()) { >>>> // Determine the module provider this function is provided by. >>>> @@ -509,13 +511,11 @@ >>>> abort(); >>>> } >>>> } >>>> - >>>> + >>>> if (void *Addr = getPointerToGlobalIfAvailable(F)) { >>>> return Addr; >>>> } >>>> >>>> - MutexGuard locked(lock); >>>> - >>>> if (F->isDeclaration()) { >>>> void *Addr = getPointerToNamedFunction(F->getName()); >>>> addGlobalMapping(F, Addr); >>>> >>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>> >>>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Fri Oct 10 12:57:51 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 10 Oct 2008 17:57:51 -0000 Subject: [llvm-commits] [llvm] r57355 - /llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp Message-ID: <200810101757.m9AHvp2X000378@zion.cs.uiuc.edu> Author: dpatel Date: Fri Oct 10 12:57:50 2008 New Revision: 57355 URL: http://llvm.org/viewvc/llvm-project?rev=57355&view=rev Log: Fix build failure. Patch by Erick Tryzelaar. Modified: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp Modified: llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp?rev=57355&r1=57354&r2=57355&view=diff ============================================================================== --- llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp (original) +++ llvm/trunk/tools/lto-bugpoint/LTOBugPoint.cpp Fri Oct 10 12:57:50 2008 @@ -24,6 +24,7 @@ #include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Config/config.h" #include @@ -189,7 +190,13 @@ CGPasses->add(new TargetData(*Target->getTargetData())); MachineCodeEmitter* mce = NULL; - std::ofstream *Out = new std::ofstream(AsmFileName, std::ios::out); + std::string error; + raw_ostream *Out = new raw_fd_ostream(AsmFileName, error); + if (!error.empty()) { + std::cerr << error << '\n'; + delete Out; + return false; + } switch (Target->addPassesToEmitFile(*CGPasses, *Out, TargetMachine::AssemblyFile, true)) { From dpatel at apple.com Fri Oct 10 12:58:29 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 10 Oct 2008 10:58:29 -0700 Subject: [llvm-commits] bug fix to get lto-bugpoint to compile In-Reply-To: <1ef034530810100113w4bc13df0l5e5b8266ca3c3e8f@mail.gmail.com> References: <1ef034530810100113w4bc13df0l5e5b8266ca3c3e8f@mail.gmail.com> Message-ID: <985A9E5C-ABFC-42C5-8199-588E9F3CB3B0@apple.com> Eric, I applied the patch. Thanks! Note, lto-bugpoing is not usable it. It is a work in progress. - Devang On Oct 10, 2008, at 1:13 AM, Erick Tryzelaar wrote: > Good morning. I was trying to build lto-bugpoint this morning, and it > seems that it was missed in revision 55092 changing the argument types > for addPassesToEmitFile. This patch copies what happens in llc when > calling addPassesToEmitFile, so hopefully it's alright. I'm not sure > how to test this to confirm it works though: > > > diff --git tools/lto-bugpoint/LTOBugPoint.cpp tools/lto-bugpoint/ > LTOBugPoint.cpp > index 587e360..96acf4a 100644 > --- tools/lto-bugpoint/LTOBugPoint.cpp > +++ tools/lto-bugpoint/LTOBugPoint.cpp > @@ -24,6 +24,7 @@ > #include "llvm/Target/TargetMachineRegistry.h" > #include "llvm/Support/SystemUtils.h" > #include "llvm/Support/MemoryBuffer.h" > +#include "llvm/Support/raw_ostream.h" > #include "llvm/Bitcode/ReaderWriter.h" > #include "llvm/Config/config.h" > #include > @@ -189,7 +190,13 @@ bool LTOBugPoint::assembleBitcode(llvm::Module > *M, const char *AsmFileName) { > CGPasses->add(new TargetData(*Target->getTargetData())); > MachineCodeEmitter* mce = NULL; > > - std::ofstream *Out = new std::ofstream(AsmFileName, std::ios::out); > + std::string error; > + raw_ostream *Out = new raw_fd_ostream(AsmFileName, error); > + if (!error.empty()) { > + std::cerr << error << '\n'; > + delete Out; > + return false; > + } > > switch (Target->addPassesToEmitFile(*CGPasses, *Out, > TargetMachine::AssemblyFile, > true)) { > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From wangmp at apple.com Fri Oct 10 13:07:10 2008 From: wangmp at apple.com (Mon P Wang) Date: Fri, 10 Oct 2008 18:07:10 -0000 Subject: [llvm-commits] [llvm] r57356 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Message-ID: <200810101807.m9AI7A69000697@zion.cs.uiuc.edu> Author: wangmp Date: Fri Oct 10 13:07:10 2008 New Revision: 57356 URL: http://llvm.org/viewvc/llvm-project?rev=57356&view=rev Log: Revert r57340 move guard mutex in getPointerToFunction as this can cause deadlock issues with java Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57356&r1=57355&r2=57356&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Fri Oct 10 13:07:10 2008 @@ -489,8 +489,6 @@ if (void *Addr = getPointerToGlobalIfAvailable(F)) return Addr; // Check if function already code gen'd - MutexGuard locked(lock); - // Make sure we read in the function if it exists in this Module. if (F->hasNotBeenReadFromBitcode()) { // Determine the module provider this function is provided by. @@ -516,6 +514,8 @@ return Addr; } + MutexGuard locked(lock); + if (F->isDeclaration()) { void *Addr = getPointerToNamedFunction(F->getName()); addGlobalMapping(F, Addr); From resistor at mac.com Fri Oct 10 13:13:22 2008 From: resistor at mac.com (Owen Anderson) Date: Fri, 10 Oct 2008 11:13:22 -0700 Subject: [llvm-commits] [llvm] r57342 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp In-Reply-To: References: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> Message-ID: <97C85F24-30EB-4CE9-A064-6EA062447482@mac.com> On Oct 10, 2008, at 9:58 AM, Devang Patel wrote: >> + >> +#ifndef LLVM_ANALYSIS_LOOPVR_H >> +#define LLVM_ANALYSIS_LOOPVR_H > > cut-n-pasto :) Fixed. >> + // FIXME: Are there any other possible escape points? > > Inline asm ? They get treated as calls, I thought? >> + for (Instruction::use_iterator UI = curr->use_begin(), UE = >> curr->use_end(); >> + UI != UE; ++UI) > > This won't work when curr is a Block. > Why not? Blocks are used by PHINodes, right? Thanks for the feedback! --Owen -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2624 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081010/bd3e7a7a/attachment.bin From ofv at wanadoo.es Fri Oct 10 13:51:39 2008 From: ofv at wanadoo.es (Oscar Fuentes) Date: Fri, 10 Oct 2008 18:51:39 -0000 Subject: [llvm-commits] [llvm] r57357 - /llvm/trunk/lib/Analysis/CMakeLists.txt Message-ID: <200810101851.m9AIpdW1002342@zion.cs.uiuc.edu> Author: ofv Date: Fri Oct 10 13:51:36 2008 New Revision: 57357 URL: http://llvm.org/viewvc/llvm-project?rev=57357&view=rev Log: CMake: updated lib/Analysis/CMakeLists.txt. Modified: llvm/trunk/lib/Analysis/CMakeLists.txt Modified: llvm/trunk/lib/Analysis/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CMakeLists.txt?rev=57357&r1=57356&r2=57357&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/CMakeLists.txt (original) +++ llvm/trunk/lib/Analysis/CMakeLists.txt Fri Oct 10 13:51:36 2008 @@ -8,6 +8,7 @@ BasicAliasAnalysis.cpp CFGPrinter.cpp ConstantFolding.cpp + EscapeAnalysis.cpp InstCount.cpp Interval.cpp IntervalPartition.cpp From asl at math.spbu.ru Fri Oct 10 15:27:37 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:27:37 -0000 Subject: [llvm-commits] [llvm] r57358 - /llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Message-ID: <200810102027.m9AKRcii005686@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:27:31 2008 New Revision: 57358 URL: http://llvm.org/viewvc/llvm-project?rev=57358&view=rev Log: Cleanup Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=57358&r1=57357&r2=57358&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Oct 10 15:27:31 2008 @@ -35,13 +35,13 @@ SmallVector RVLocs; unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv(); bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg(); - + // CCState - Info about the registers and stack slot. CCState CCInfo(CC, isVarArg, DAG.getTarget(), RVLocs); - + // Analize return values of ISD::RET CCInfo.AnalyzeReturn(Op.getNode(), RetCC_Sparc32); - + // If this is the first return lowered for this function, add the regs to the // liveout set for the function. if (DAG.getMachineFunction().getRegInfo().liveout_empty()) { @@ -49,7 +49,7 @@ if (RVLocs[i].isRegLoc()) DAG.getMachineFunction().getRegInfo().addLiveOut(RVLocs[i].getLocReg()); } - + SDValue Chain = Op.getOperand(0); SDValue Flag; @@ -57,15 +57,15 @@ for (unsigned i = 0; i != RVLocs.size(); ++i) { CCValAssign &VA = RVLocs[i]; assert(VA.isRegLoc() && "Can only return in registers!"); - + // ISD::RET => ret chain, (regnum1,val1), ... // So i*2+1 index only the regnums. Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag); - + // Guarantee that all emitted copies are stuck together with flags. Flag = Chain.getValue(1); } - + if (Flag.getNode()) return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain, Flag); return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain); @@ -79,20 +79,20 @@ SmallVectorImpl &ArgValues) { MachineFunction &MF = DAG.getMachineFunction(); MachineRegisterInfo &RegInfo = MF.getRegInfo(); - + static const unsigned ArgRegs[] = { SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5 }; - + const unsigned *CurArgReg = ArgRegs, *ArgRegEnd = ArgRegs+6; unsigned ArgOffset = 68; - + SDValue Root = DAG.getRoot(); std::vector OutChains; for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) { MVT ObjectVT = getValueType(I->getType()); - + switch (ObjectVT.getSimpleVT()) { default: assert(0 && "Unhandled argument type!"); case MVT::i1: @@ -108,7 +108,7 @@ SDValue Arg = DAG.getCopyFromReg(Root, VReg, MVT::i32); if (ObjectVT != MVT::i32) { unsigned AssertOp = ISD::AssertSext; - Arg = DAG.getNode(AssertOp, MVT::i32, Arg, + Arg = DAG.getNode(AssertOp, MVT::i32, Arg, DAG.getValueType(ObjectVT)); Arg = DAG.getNode(ISD::TRUNCATE, ObjectVT, Arg); } @@ -132,7 +132,7 @@ } ArgValues.push_back(Load); } - + ArgOffset += 4; break; case MVT::f32: @@ -173,7 +173,7 @@ SDValue FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32); HiVal = DAG.getLoad(MVT::i32, Root, FIPtr, NULL, 0); } - + SDValue LoVal; if (CurArgReg < ArgRegEnd) { // Lives in an incoming GPR unsigned VRegLo = RegInfo.createVirtualRegister(&SP::IntRegsRegClass); @@ -184,27 +184,27 @@ SDValue FIPtr = DAG.getFrameIndex(FrameIdx, MVT::i32); LoVal = DAG.getLoad(MVT::i32, Root, FIPtr, NULL, 0); } - + // Compose the two halves together into an i64 unit. - SDValue WholeValue = + SDValue WholeValue = DAG.getNode(ISD::BUILD_PAIR, MVT::i64, LoVal, HiVal); - + // If we want a double, do a bit convert. if (ObjectVT == MVT::f64) WholeValue = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, WholeValue); - + ArgValues.push_back(WholeValue); } ArgOffset += 8; break; } } - + // Store remaining ArgRegs to the stack if this is a varargs function. if (F.isVarArg()) { // Remember the vararg offset for the va_start implementation. VarArgsFrameOffset = ArgOffset; - + for (; CurArgReg != ArgRegEnd; ++CurArgReg) { unsigned VReg = RegInfo.createVirtualRegister(&SP::IntRegsRegClass); MF.getRegInfo().addLiveIn(*CurArgReg, VReg); @@ -217,7 +217,7 @@ ArgOffset += 4; } } - + if (!OutChains.empty()) DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, &OutChains[0], OutChains.size())); @@ -235,13 +235,13 @@ SmallVector ArgLocs; CCState CCInfo(CallingConv, isVarArg, DAG.getTarget(), ArgLocs); CCInfo.AnalyzeCallOperands(Op.getNode(), CC_Sparc32); - + // Get the size of the outgoing arguments stack space requirement. unsigned ArgsSize = CCInfo.getNextStackOffset(); // FIXME: We can't use this until f64 is known to take two GPRs. #else (void)CC_Sparc32; - + // Count the size of the outgoing arguments. unsigned ArgsSize = 0; for (unsigned i = 0, e = TheCall->getNumArgs(); i != e; ++i) { @@ -264,21 +264,21 @@ ArgsSize -= 4*6; // Space for first 6 arguments is prereserved. else ArgsSize = 0; -#endif - +#endif + // Keep stack frames 8-byte aligned. ArgsSize = (ArgsSize+7) & ~7; Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(ArgsSize)); - + SmallVector, 8> RegsToPass; SmallVector MemOpChains; - + #if 0 // Walk the register/memloc assignments, inserting copies/loads. for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) { CCValAssign &VA = ArgLocs[i]; - + // Arguments start after the 5 first operands of ISD::CALL SDValue Arg = TheCall->getArg(i); @@ -296,16 +296,16 @@ Arg = DAG.getNode(ISD::ANY_EXTEND, VA.getLocVT(), Arg); break; } - - // Arguments that can be passed on register must be kept at + + // Arguments that can be passed on register must be kept at // RegsToPass vector if (VA.isRegLoc()) { RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); continue; } - + assert(VA.isMemLoc()); - + // Create a store off the stack pointer for this argument. SDValue StackPtr = DAG.getRegister(SP::O6, MVT::i32); // FIXME: VERIFY THAT 68 IS RIGHT. @@ -313,8 +313,8 @@ PtrOff = DAG.getNode(ISD::ADD, MVT::i32, StackPtr, PtrOff); MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0)); } - -#else + +#else static const unsigned ArgRegs[] = { SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5 }; @@ -357,14 +357,14 @@ ValToStore = Val; // Whole thing is passed in memory. break; } - + // Split the value into top and bottom part. Top part goes in a reg. - SDValue Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Val, + SDValue Hi = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Val, DAG.getConstant(1, MVT::i32)); SDValue Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, MVT::i32, Val, DAG.getConstant(0, MVT::i32)); RegsToPass.push_back(std::make_pair(ArgRegs[RegsToPass.size()], Hi)); - + if (RegsToPass.size() >= 6) { ValToStore = Lo; ArgOffset += 4; @@ -374,7 +374,7 @@ } break; } - + if (ValToStore.getNode()) { SDValue StackPtr = DAG.getRegister(SP::O6, MVT::i32); SDValue PtrOff = DAG.getConstant(ArgOffset, MVT::i32); @@ -384,13 +384,13 @@ ArgOffset += ObjSize; } #endif - + // Emit all stores, make sure the occur before any copies into physregs. if (!MemOpChains.empty()) Chain = DAG.getNode(ISD::TokenFactor, MVT::Other, &MemOpChains[0], MemOpChains.size()); - - // Build a sequence of copy-to-reg nodes chained together with token + + // Build a sequence of copy-to-reg nodes chained together with token // chain and flag operands which copy the outgoing args into registers. // The InFlag in necessary since all emited instructions must be // stuck together. @@ -419,33 +419,33 @@ SDValue Ops[] = { Chain, Callee, InFlag }; Chain = DAG.getNode(SPISD::CALL, NodeTys, Ops, InFlag.getNode() ? 3 : 2); InFlag = Chain.getValue(1); - + Chain = DAG.getCALLSEQ_END(Chain, DAG.getConstant(ArgsSize, MVT::i32), DAG.getConstant(0, MVT::i32), InFlag); InFlag = Chain.getValue(1); - + // Assign locations to each value returned by this call. SmallVector RVLocs; CCState RVInfo(CallingConv, isVarArg, DAG.getTarget(), RVLocs); - + RVInfo.AnalyzeCallResult(TheCall, RetCC_Sparc32); SmallVector ResultVals; - + // Copy all of the result registers out of their specified physreg. for (unsigned i = 0; i != RVLocs.size(); ++i) { unsigned Reg = RVLocs[i].getLocReg(); - + // Remap I0->I7 -> O0->O7. if (Reg >= SP::I0 && Reg <= SP::I7) Reg = Reg-SP::I0+SP::O0; - + Chain = DAG.getCopyFromReg(Chain, Reg, RVLocs[i].getValVT(), InFlag).getValue(1); InFlag = Chain.getValue(2); ResultVals.push_back(Chain.getValue(0)); } - + ResultVals.push_back(Chain); // Merge everything together with a MERGE_VALUES node. @@ -508,7 +508,7 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM) : TargetLowering(TM) { - + // Set up the register classes. addRegisterClass(MVT::i32, SP::IntRegsRegisterClass); addRegisterClass(MVT::f32, SP::FPRegsRegisterClass); @@ -525,7 +525,7 @@ setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom); setOperationAction(ISD::ConstantPool , MVT::i32, Custom); - + // Sparc doesn't have sext_inreg, replace them with shl/sra setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i16, Expand); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i8 , Expand); @@ -544,10 +544,10 @@ // Expand fp<->uint setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand); setOperationAction(ISD::UINT_TO_FP, MVT::i32, Expand); - + setOperationAction(ISD::BIT_CONVERT, MVT::f32, Expand); setOperationAction(ISD::BIT_CONVERT, MVT::i32, Expand); - + // Sparc has no select or setcc: expand to SELECT_CC. setOperationAction(ISD::SELECT, MVT::i32, Expand); setOperationAction(ISD::SELECT, MVT::f32, Expand); @@ -555,7 +555,7 @@ setOperationAction(ISD::SETCC, MVT::i32, Expand); setOperationAction(ISD::SETCC, MVT::f32, Expand); setOperationAction(ISD::SETCC, MVT::f64, Expand); - + // Sparc doesn't have BRCOND either, it has BR_CC. setOperationAction(ISD::BRCOND, MVT::Other, Expand); setOperationAction(ISD::BRIND, MVT::Other, Expand); @@ -563,11 +563,11 @@ setOperationAction(ISD::BR_CC, MVT::i32, Custom); setOperationAction(ISD::BR_CC, MVT::f32, Custom); setOperationAction(ISD::BR_CC, MVT::f64, Custom); - + setOperationAction(ISD::SELECT_CC, MVT::i32, Custom); setOperationAction(ISD::SELECT_CC, MVT::f32, Custom); setOperationAction(ISD::SELECT_CC, MVT::f64, Custom); - + // SPARC has no intrinsics for these particular operations. setOperationAction(ISD::MEMBARRIER, MVT::Other, Expand); @@ -594,7 +594,7 @@ // FIXME: Sparc provides these multiplies, but we don't have them yet. setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand); - + // We don't have line number support yet. setOperationAction(ISD::DBG_STOPPOINT, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); @@ -608,11 +608,11 @@ setOperationAction(ISD::VASTART , MVT::Other, Custom); // VAARG needs to be lowered to not do unaligned accesses for doubles. setOperationAction(ISD::VAARG , MVT::Other, Custom); - + // Use the default implementation. setOperationAction(ISD::VACOPY , MVT::Other, Expand); setOperationAction(ISD::VAEND , MVT::Other, Expand); - setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); + setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); setOperationAction(ISD::STACKRESTORE , MVT::Other, Expand); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Custom); @@ -621,12 +621,12 @@ setOperationAction(ISD::DBG_LABEL, MVT::Other, Expand); setOperationAction(ISD::EH_LABEL, MVT::Other, Expand); setOperationAction(ISD::DECLARE, MVT::Other, Expand); - + setStackPointerRegisterToSaveRestore(SP::O6); if (TM.getSubtarget().isV9()) setOperationAction(ISD::CTPOP, MVT::i32, Legal); - + computeRegisterProperties(); } @@ -653,13 +653,13 @@ /// combiner. void SparcTargetLowering::computeMaskedBitsForTargetNode(const SDValue Op, const APInt &Mask, - APInt &KnownZero, + APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth) const { APInt KnownZero2, KnownOne2; KnownZero = KnownOne = APInt(Mask.getBitWidth(), 0); // Don't know anything. - + switch (Op.getOpcode()) { default: break; case SPISD::SELECT_ICC: @@ -668,9 +668,9 @@ Depth+1); DAG.ComputeMaskedBits(Op.getOperand(0), Mask, KnownZero2, KnownOne2, Depth+1); - assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); - assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?"); - + assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); + assert((KnownZero2 & KnownOne2) == 0 && "Bits known to be one AND zero?"); + // Only known if known in both the LHS and RHS. KnownOne &= KnownOne2; KnownZero &= KnownZero2; @@ -684,7 +684,7 @@ ISD::CondCode CC, unsigned &SPCC) { if (isa(RHS) && cast(RHS)->getZExtValue() == 0 && - CC == ISD::SETNE && + CC == ISD::SETNE && ((LHS.getOpcode() == SPISD::SELECT_ICC && LHS.getOperand(3).getOpcode() == SPISD::CMPICC) || (LHS.getOpcode() == SPISD::SELECT_FCC && @@ -738,11 +738,11 @@ SDValue RHS = Op.getOperand(3); SDValue Dest = Op.getOperand(4); unsigned Opc, SPCC = ~0U; - + // If this is a br_cc of a "setcc", and if the setcc got lowered into // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values. LookThroughSetCC(LHS, RHS, CC, SPCC); - + // Get the condition flag. SDValue CompareFlag; if (LHS.getValueType() == MVT::i32) { @@ -769,11 +769,11 @@ SDValue TrueVal = Op.getOperand(2); SDValue FalseVal = Op.getOperand(3); unsigned Opc, SPCC = ~0U; - + // If this is a select_cc of a "setcc", and if the setcc got lowered into // an CMP[IF]CC/SELECT_[IF]CC pair, find the original compared values. LookThroughSetCC(LHS, RHS, CC, SPCC); - + SDValue CompareFlag; if (LHS.getValueType() == MVT::i32) { std::vector VTs; @@ -788,7 +788,7 @@ Opc = SPISD::SELECT_FCC; if (SPCC == ~0U) SPCC = FPCondCCodeToFCC(CC); } - return DAG.getNode(Opc, TrueVal.getValueType(), TrueVal, FalseVal, + return DAG.getNode(Opc, TrueVal.getValueType(), TrueVal, FalseVal, DAG.getConstant(SPCC, MVT::i32), CompareFlag); } @@ -812,7 +812,7 @@ const Value *SV = cast(Node->getOperand(2))->getValue(); SDValue VAList = DAG.getLoad(MVT::i32, InChain, VAListPtr, SV, 0); // Increment the pointer, VAList, to the next vaarg - SDValue NextPtr = DAG.getNode(ISD::ADD, MVT::i32, VAList, + SDValue NextPtr = DAG.getNode(ISD::ADD, MVT::i32, VAList, DAG.getConstant(VT.getSizeInBits()/8, MVT::i32)); // Store the incremented VAList to the legalized pointer @@ -822,10 +822,10 @@ // f64 load. if (VT != MVT::f64) return DAG.getLoad(VT, InChain, VAList, NULL, 0); - + // Otherwise, load it as i64, then do a bitconvert. SDValue V = DAG.getLoad(MVT::i64, InChain, VAList, NULL, 0); - + // Bit-Convert the value to f64. SDValue Ops[2] = { DAG.getNode(ISD::BIT_CONVERT, MVT::f64, V), @@ -837,12 +837,12 @@ static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) { SDValue Chain = Op.getOperand(0); // Legalize the chain. SDValue Size = Op.getOperand(1); // Legalize the size. - + unsigned SPReg = SP::O6; SDValue SP = DAG.getCopyFromReg(Chain, SPReg, MVT::i32); SDValue NewSP = DAG.getNode(ISD::SUB, MVT::i32, SP, Size); // Value Chain = DAG.getCopyToReg(SP.getValue(1), SPReg, NewSP); // Output chain - + // The resultant pointer is actually 16 words from the bottom of the stack, // to provide a register spill area. SDValue NewVal = DAG.getNode(ISD::ADD, MVT::i32, NewSP, @@ -897,7 +897,7 @@ } CC = (SPCC::CondCodes)MI->getOperand(3).getImm(); - + // To "insert" a SELECT_CC instruction, we actually have to insert the diamond // control-flow pattern. The incoming instruction knows the destination vreg // to set, the condition code register to branch on, the true/false values to @@ -905,7 +905,7 @@ const BasicBlock *LLVM_BB = BB->getBasicBlock(); MachineFunction::iterator It = BB; ++It; - + // thisMBB: // ... // TrueVal = ... @@ -924,15 +924,15 @@ // Next, add the true and fallthrough blocks as its successors. BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); - + // copy0MBB: // %FalseValue = ... // # fallthrough to sinkMBB BB = copy0MBB; - + // Update machine-CFG edges BB->addSuccessor(sinkMBB); - + // sinkMBB: // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... @@ -940,8 +940,7 @@ BuildMI(BB, TII.get(SP::PHI), MI->getOperand(0).getReg()) .addReg(MI->getOperand(2).getReg()).addMBB(copy0MBB) .addReg(MI->getOperand(1).getReg()).addMBB(thisMBB); - + F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } - From asl at math.spbu.ru Fri Oct 10 15:28:10 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:28:10 -0000 Subject: [llvm-commits] [llvm] r57359 - in /llvm/trunk/lib/Target/Sparc: SparcISelLowering.cpp SparcISelLowering.h Message-ID: <200810102028.m9AKSAZ7005718@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:28:10 2008 New Revision: 57359 URL: http://llvm.org/viewvc/llvm-project?rev=57359&view=rev Log: Add rudimentary support for 'r' register operand Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcISelLowering.h Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=57359&r1=57358&r2=57359&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Oct 10 15:28:10 2008 @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAG.h" +#include "llvm/ADT/VectorExtras.h" using namespace llvm; @@ -944,3 +945,54 @@ F->DeleteMachineInstr(MI); // The pseudo instruction is gone now. return BB; } + +//===----------------------------------------------------------------------===// +// Sparc Inline Assembly Support +//===----------------------------------------------------------------------===// + +/// getConstraintType - Given a constraint letter, return the type of +/// constraint it is for this target. +SparcTargetLowering::ConstraintType +SparcTargetLowering::getConstraintType(const std::string &Constraint) const { + if (Constraint.size() == 1) { + switch (Constraint[0]) { + default: break; + case 'r': return C_RegisterClass; + } + } + + return TargetLowering::getConstraintType(Constraint); +} + +std::pair +SparcTargetLowering::getRegForInlineAsmConstraint(const std::string &Constraint, + MVT VT) const { + if (Constraint.size() == 1) { + switch (Constraint[0]) { + case 'r': + return std::make_pair(0U, SP::IntRegsRegisterClass); + } + } + + return TargetLowering::getRegForInlineAsmConstraint(Constraint, VT); +} + +std::vector SparcTargetLowering:: +getRegClassForInlineAsmConstraint(const std::string &Constraint, + MVT VT) const { + if (Constraint.size() != 1) + return std::vector(); + + switch (Constraint[0]) { + default: break; + case 'r': + return make_vector(SP::L0, SP::L1, SP::L2, SP::L3, + SP::L4, SP::L5, SP::L6, SP::L7, + SP::I0, SP::I1, SP::I2, SP::I3, + SP::I4, SP::I5, + SP::O0, SP::O1, SP::O2, SP::O3, + SP::O4, SP::O5, SP::O7, 0); + } + + return std::vector(); +} Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.h?rev=57359&r1=57358&r2=57359&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.h (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.h Fri Oct 10 15:28:10 2008 @@ -28,41 +28,48 @@ BRFCC, // Branch to dest on fcc condition SELECT_ICC, // Select between two values using the current ICC flags. SELECT_FCC, // Select between two values using the current FCC flags. - + Hi, Lo, // Hi/Lo operations, typically on a global address. - + FTOI, // FP to Int within a FP register. ITOF, // Int to FP within a FP register. - + CALL, // A call instruction. RET_FLAG // Return with a flag operand. }; } - + class SparcTargetLowering : public TargetLowering { int VarArgsFrameOffset; // Frame offset to start of varargs area. public: SparcTargetLowering(TargetMachine &TM); virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG); - + int getVarArgsFrameOffset() const { return VarArgsFrameOffset; } - - /// computeMaskedBitsForTargetNode - Determine which of the bits specified - /// in Mask are known to be either zero or one and return them in the + + /// computeMaskedBitsForTargetNode - Determine which of the bits specified + /// in Mask are known to be either zero or one and return them in the /// KnownZero/KnownOne bitsets. virtual void computeMaskedBitsForTargetNode(const SDValue Op, const APInt &Mask, - APInt &KnownZero, + APInt &KnownZero, APInt &KnownOne, const SelectionDAG &DAG, unsigned Depth = 0) const; - + virtual void LowerArguments(Function &F, SelectionDAG &DAG, SmallVectorImpl &ArgValues); virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB); - + virtual const char *getTargetNodeName(unsigned Opcode) const; + + ConstraintType getConstraintType(const std::string &Constraint) const; + std::pair + getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const; + std::vector + getRegClassForInlineAsmConstraint(const std::string &Constraint, + MVT VT) const; }; } // end namespace llvm From asl at math.spbu.ru Fri Oct 10 15:28:33 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:28:33 -0000 Subject: [llvm-commits] [llvm] r57360 - /llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll Message-ID: <200810102028.m9AKSXAG005742@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:28:32 2008 New Revision: 57360 URL: http://llvm.org/viewvc/llvm-project?rev=57360&view=rev Log: This does not fail anymore Modified: llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll Modified: llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll?rev=57360&r1=57359&r2=57360&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2007-04-27-InlineAsm-X-Dest.ll Fri Oct 10 15:28:32 2008 @@ -1,6 +1,4 @@ ; RUN: llvm-as < %s | llc -; XFAIL: sparc-sun-solaris2 -; PR1557 ; Test that we can have an "X" output constraint. From asl at math.spbu.ru Fri Oct 10 15:28:59 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:28:59 -0000 Subject: [llvm-commits] [llvm] r57361 - /llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll Message-ID: <200810102028.m9AKSxZI005767@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:28:59 2008 New Revision: 57361 URL: http://llvm.org/viewvc/llvm-project?rev=57361&view=rev Log: Add testcase for 'r' inline asm operand Added: llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll Added: llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll?rev=57361&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll (added) +++ llvm/trunk/test/CodeGen/SPARC/2008-10-10-InlineAsmRegOperand.ll Fri Oct 10 15:28:59 2008 @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | llc -march=sparc +; PR 1557 + +target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f128:128:128" +module asm "\09.section\09\22.ctors\22,#alloc,#write" +module asm "\09.section\09\22.dtors\22,#alloc,#write" + +define void @frame_dummy() nounwind { +entry: + %asmtmp = tail call void (i8*)* (void (i8*)*)* asm "", "=r,0"(void (i8*)* @_Jv_RegisterClasses) nounwind ; [#uses=0] + unreachable +} + +declare void @_Jv_RegisterClasses(i8*) From asl at math.spbu.ru Fri Oct 10 15:29:31 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:29:31 -0000 Subject: [llvm-commits] [llvm] r57362 - /llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Message-ID: <200810102029.m9AKTVcX005799@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:29:31 2008 New Revision: 57362 URL: http://llvm.org/viewvc/llvm-project?rev=57362&view=rev Log: Use expand for smul_lohi for now Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=57362&r1=57361&r2=57362&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Oct 10 15:29:31 2008 @@ -595,6 +595,7 @@ // FIXME: Sparc provides these multiplies, but we don't have them yet. setOperationAction(ISD::UMUL_LOHI, MVT::i32, Expand); + setOperationAction(ISD::SMUL_LOHI, MVT::i32, Expand); // We don't have line number support yet. setOperationAction(ISD::DBG_STOPPOINT, MVT::Other, Expand); From asl at math.spbu.ru Fri Oct 10 15:29:51 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:29:51 -0000 Subject: [llvm-commits] [llvm] r57363 - /llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Message-ID: <200810102029.m9AKTpvd005855@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:29:50 2008 New Revision: 57363 URL: http://llvm.org/viewvc/llvm-project?rev=57363&view=rev Log: Ignore extra 'r' modifier for now Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=57363&r1=57362&r2=57363&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Fri Oct 10 15:29:50 2008 @@ -315,8 +315,15 @@ bool SparcAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode) { - if (ExtraCode && ExtraCode[0]) - return true; // Unknown modifier + if (ExtraCode && ExtraCode[0]) { + if (ExtraCode[1] != 0) return true; // Unknown modifier. + + switch (ExtraCode[0]) { + default: return true; // Unknown modifier. + case 'r': + break; + } + } printOperand(MI, OpNo); From asl at math.spbu.ru Fri Oct 10 15:30:14 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 20:30:14 -0000 Subject: [llvm-commits] [llvm] r57364 - /llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Message-ID: <200810102030.m9AKUEOE005885@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 15:30:14 2008 New Revision: 57364 URL: http://llvm.org/viewvc/llvm-project?rev=57364&view=rev Log: Extend set of return registers on sparc until someone will implement MRV support there. At least, this will allow libgcc compile, however we are not ABI-compatible with stuff compiled with native gcc. Modified: llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Modified: llvm/trunk/lib/Target/Sparc/SparcCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcCallingConv.td?rev=57364&r1=57363&r2=57364&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcCallingConv.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Fri Oct 10 15:30:14 2008 @@ -17,9 +17,9 @@ // Sparc 32-bit C return-value convention. def RetCC_Sparc32 : CallingConv<[ - CCIfType<[i32], CCAssignToReg<[I0, I1]>>, - CCIfType<[f32], CCAssignToReg<[F0]>>, - CCIfType<[f64], CCAssignToReg<[D0]>> + CCIfType<[i32], CCAssignToReg<[I0, I1, I2, I3, I4, I5]>>, + CCIfType<[f32], CCAssignToReg<[F1, F3, F5, F7]>>, + CCIfType<[f64], CCAssignToReg<[D0, D2]>> ]>; // Sparc 32-bit C Calling convention. From dalej at apple.com Fri Oct 10 16:04:42 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 21:04:42 -0000 Subject: [llvm-commits] [llvm] r57365 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Message-ID: <200810102104.m9AL4g93007359@zion.cs.uiuc.edu> Author: johannes Date: Fri Oct 10 16:04:42 2008 New Revision: 57365 URL: http://llvm.org/viewvc/llvm-project?rev=57365&view=rev Log: Remove some overzealous checks that were rejecting valid comments in inline assembly. gcc.target/i386/20011009-1.c Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=57365&r1=57364&r2=57365&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Oct 10 16:04:42 2008 @@ -1246,21 +1246,17 @@ break; case '|': ++LastEmitted; // consume '|' character. - if (CurVariant == -1) { - cerr << "Found '|' character outside of variant in inline asm " - << "string: '" << AsmStr << "'\n"; - exit(1); - } - ++CurVariant; // We're in the next variant. + if (CurVariant == -1) + O << '|'; // this is gcc's behavior for | outside a variant + else + ++CurVariant; // We're in the next variant. break; case ')': // $) -> same as GCC's } char. ++LastEmitted; // consume ')' character. - if (CurVariant == -1) { - cerr << "Found '}' character outside of variant in inline asm " - << "string: '" << AsmStr << "'\n"; - exit(1); - } - CurVariant = -1; + if (CurVariant == -1) + O << '}'; // this is gcc's behavior for } outside a variant + else + CurVariant = -1; break; } if (Done) break; From dalej at apple.com Fri Oct 10 16:09:13 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 21:09:13 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57366 - in /llvm-gcc-4.2/trunk/gcc/testsuite: gcc.apple/5490617.c gcc.apple/ucn-1.c gcc.dg/gomp/atomic-10.c gcc.dg/gomp/atomic-3.c gcc.dg/gomp/atomic-9.c Message-ID: <200810102109.m9AL9Dgx007510@zion.cs.uiuc.edu> Author: johannes Date: Fri Oct 10 16:09:13 2008 New Revision: 57366 URL: http://llvm.org/viewvc/llvm-project?rev=57366&view=rev Log: More testsuite adjustments for llvm. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5490617.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ucn-1.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-10.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-3.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-9.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5490617.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5490617.c?rev=57366&r1=57365&r2=57366&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5490617.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/5490617.c Fri Oct 10 16:09:13 2008 @@ -3,4 +3,5 @@ static char _my_endbss[1]; char *my_endbss_static = _my_endbss; -/* { dg-final { scan-assembler ".lcomm __my_endbss" } } */ +/* LLVM LOCAL allow different spacing */ +/* { dg-final { scan-assembler ".lcomm( |\t)__my_endbss" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ucn-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ucn-1.c?rev=57366&r1=57365&r2=57366&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ucn-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/ucn-1.c Fri Oct 10 16:09:13 2008 @@ -7,4 +7,7 @@ int foobar\u00C0; /* { dg-final { scan-assembler "_foobar" } } */ -/* { dg-final { scan-assembler-not "\[^_\]foobar" } } */ +/* LLVM LOCAL begin for llvm, foobar without the _ appears in a comment. */ +/* No reason it shouldn't so just disable the following test. */ +/* dg-final { scan-assembler-not "\[^_\]foobar" } } */ +/*LLVM LOCAL end */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-10.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-10.c?rev=57366&r1=57365&r2=57366&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-10.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-10.c Fri Oct 10 16:09:13 2008 @@ -1,6 +1,9 @@ /* PR middle-end/28046 */ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-gimple" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ + int a[3], b; struct C { int x; int y; } c; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-3.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-3.c?rev=57366&r1=57365&r2=57366&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-3.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-3.c Fri Oct 10 16:09:13 2008 @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-gimple" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ int *xyzzy; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-9.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-9.c?rev=57366&r1=57365&r2=57366&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-9.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/gomp/atomic-9.c Fri Oct 10 16:09:13 2008 @@ -1,5 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fopenmp -fdump-tree-gimple" } */ +/* LLVM LOCAL test not applicable */ +/* { dg-require-fdump "" } */ volatile int *bar(void); From clattner at apple.com Fri Oct 10 16:31:16 2008 From: clattner at apple.com (Chris Lattner) Date: Fri, 10 Oct 2008 14:31:16 -0700 Subject: [llvm-commits] [llvm] r57364 - /llvm/trunk/lib/Target/Sparc/SparcCallingConv.td In-Reply-To: <200810102030.m9AKUEOE005885@zion.cs.uiuc.edu> References: <200810102030.m9AKUEOE005885@zion.cs.uiuc.edu> Message-ID: <996CEC0D-7874-4C60-BF65-0F327D367B0A@apple.com> On Oct 10, 2008, at 1:30 PM, Anton Korobeynikov wrote: > Author: asl > Date: Fri Oct 10 15:30:14 2008 > New Revision: 57364 > > URL: http://llvm.org/viewvc/llvm-project?rev=57364&view=rev > Log: > Extend set of return registers on sparc until someone will implement > MRV support there. At least, this will allow libgcc compile, however > we are not ABI-compatible with stuff compiled with native gcc. hi Anton, does this change floats to return in F1 instead of F0? That seems wrong. -Chris > > > Modified: > llvm/trunk/lib/Target/Sparc/SparcCallingConv.td > > Modified: llvm/trunk/lib/Target/Sparc/SparcCallingConv.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcCallingConv.td?rev=57364&r1=57363&r2=57364&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/Sparc/SparcCallingConv.td (original) > +++ llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Fri Oct 10 > 15:30:14 2008 > @@ -17,9 +17,9 @@ > > // Sparc 32-bit C return-value convention. > def RetCC_Sparc32 : CallingConv<[ > - CCIfType<[i32], CCAssignToReg<[I0, I1]>>, > - CCIfType<[f32], CCAssignToReg<[F0]>>, > - CCIfType<[f64], CCAssignToReg<[D0]>> > + CCIfType<[i32], CCAssignToReg<[I0, I1, I2, I3, I4, I5]>>, > + CCIfType<[f32], CCAssignToReg<[F1, F3, F5, F7]>>, > + CCIfType<[f64], CCAssignToReg<[D0, D2]>> > ]>; > > // Sparc 32-bit C Calling convention. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dalej at apple.com Fri Oct 10 16:40:41 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 21:40:41 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57367 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Message-ID: <200810102140.m9ALegdu008886@zion.cs.uiuc.edu> Author: johannes Date: Fri Oct 10 16:40:36 2008 New Revision: 57367 URL: http://llvm.org/viewvc/llvm-project?rev=57367&view=rev Log: Handle __builtin_ia32_vec_ext_v16qi. gcc.target/i386/sse2-vec-5.c gcc.target/i386/sse4_1-pextrb.c Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=57367&r1=57366&r2=57367&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Fri Oct 10 16:40:36 2008 @@ -368,6 +368,7 @@ case IX86_BUILTIN_VEC_EXT_V4SI: case IX86_BUILTIN_VEC_EXT_V4SF: case IX86_BUILTIN_VEC_EXT_V8HI: + case IX86_BUILTIN_VEC_EXT_V16QI: Result = Builder.CreateExtractElement(Ops[0], Ops[1], "tmp"); return true; case IX86_BUILTIN_VEC_SET_V4HI: From anton at korobeynikov.info Fri Oct 10 16:45:41 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Sat, 11 Oct 2008 01:45:41 +0400 Subject: [llvm-commits] [llvm] r57364 - /llvm/trunk/lib/Target/Sparc/SparcCallingConv.td In-Reply-To: <996CEC0D-7874-4C60-BF65-0F327D367B0A@apple.com> References: <200810102030.m9AKUEOE005885@zion.cs.uiuc.edu> <996CEC0D-7874-4C60-BF65-0F327D367B0A@apple.com> Message-ID: Hi, Chris > hi Anton, does this change floats to return in F1 instead of F0? That > seems wrong. Ah, right, I misread comment in sparc.c, will fix. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From asl at math.spbu.ru Fri Oct 10 16:47:43 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Fri, 10 Oct 2008 21:47:43 -0000 Subject: [llvm-commits] [llvm] r57368 - /llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Message-ID: <200810102147.m9ALlj34009186@zion.cs.uiuc.edu> Author: asl Date: Fri Oct 10 16:47:37 2008 New Revision: 57368 URL: http://llvm.org/viewvc/llvm-project?rev=57368&view=rev Log: Fix a thinko and unbreak sparc default CC Modified: llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Modified: llvm/trunk/lib/Target/Sparc/SparcCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcCallingConv.td?rev=57368&r1=57367&r2=57368&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcCallingConv.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcCallingConv.td Fri Oct 10 16:47:37 2008 @@ -18,8 +18,8 @@ // Sparc 32-bit C return-value convention. def RetCC_Sparc32 : CallingConv<[ CCIfType<[i32], CCAssignToReg<[I0, I1, I2, I3, I4, I5]>>, - CCIfType<[f32], CCAssignToReg<[F1, F3, F5, F7]>>, - CCIfType<[f64], CCAssignToReg<[D0, D2]>> + CCIfType<[f32], CCAssignToReg<[F0, F1, F2, F3]>>, + CCIfType<[f64], CCAssignToReg<[D0, D1]>> ]>; // Sparc 32-bit C Calling convention. From dpatel at apple.com Fri Oct 10 17:02:58 2008 From: dpatel at apple.com (Devang Patel) Date: Fri, 10 Oct 2008 22:02:58 -0000 Subject: [llvm-commits] [llvm] r57369 - in /llvm/trunk: lib/Transforms/Scalar/LoopIndexSplit.cpp test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll Message-ID: <200810102202.m9AM2xDx009725@zion.cs.uiuc.edu> Author: dpatel Date: Fri Oct 10 17:02:57 2008 New Revision: 57369 URL: http://llvm.org/viewvc/llvm-project?rev=57369&view=rev Log: Check loop exit predicate properly while eliminating one iteration loop. This patch fixes PR 2869 Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=57369&r1=57368&r2=57369&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Fri Oct 10 17:02:57 2008 @@ -585,16 +585,7 @@ // only when index variable is equal to split value. IndVar->replaceAllUsesWith(SD.SplitValue); - // Remove Latch to Header edge. - BasicBlock *LatchSucc = NULL; - Header->removePredecessor(Latch); - for (succ_iterator SI = succ_begin(Latch), E = succ_end(Latch); - SI != E; ++SI) { - if (Header != *SI) - LatchSucc = *SI; - } - BR->setUnconditionalDest(LatchSucc); - + Instruction *LTerminator = Latch->getTerminator(); Instruction *Terminator = Header->getTerminator(); Value *ExitValue = ExitCondition->getOperand(ExitValueNum); @@ -606,12 +597,14 @@ // c2 = icmp ult i32 SplitValue, ExitValue // and i32 c1, c2 bool SignedPredicate = ExitCondition->isSignedPredicate(); + CmpInst::Predicate C2Predicate = ExitCondition->getPredicate(); + if (LTerminator->getOperand(0) != Header) + C2Predicate = CmpInst::getInversePredicate(C2Predicate); Instruction *C1 = new ICmpInst(SignedPredicate ? ICmpInst::ICMP_SGE : ICmpInst::ICMP_UGE, SD.SplitValue, StartValue, "lisplit", Terminator); - Instruction *C2 = new ICmpInst(SignedPredicate ? - ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, + Instruction *C2 = new ICmpInst(C2Predicate, SD.SplitValue, ExitValue, "lisplit", Terminator); Instruction *NSplitCond = BinaryOperator::CreateAnd(C1, C2, "lisplit", @@ -619,9 +612,18 @@ SD.SplitCondition->replaceAllUsesWith(NSplitCond); SD.SplitCondition->eraseFromParent(); + // Remove Latch to Header edge. + BasicBlock *LatchSucc = NULL; + Header->removePredecessor(Latch); + for (succ_iterator SI = succ_begin(Latch), E = succ_end(Latch); + SI != E; ++SI) { + if (Header != *SI) + LatchSucc = *SI; + } + BR->setUnconditionalDest(LatchSucc); + // Now, clear latch block. Remove instructions that are responsible // to increment induction variable. - Instruction *LTerminator = Latch->getTerminator(); for (BasicBlock::iterator LB = Latch->begin(), LE = Latch->end(); LB != LE; ) { Instruction *I = LB; Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll?rev=57369&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll (added) +++ llvm/trunk/test/Transforms/LoopIndexSplit/2008-10-10-OneIteration.ll Fri Oct 10 17:02:57 2008 @@ -0,0 +1,66 @@ +; RUN: llvm-as < %s | opt -loop-index-split | llvm-dis | grep sle | count 1 +; PR 2869 + + at w = external global [2 x [2 x i32]] ; <[2 x [2 x i32]]*> [#uses=5] + +declare i32 @f() nounwind + +define i32 @main() noreturn nounwind { +entry: + br label %bb1.i.outer + +bb1.i.outer: ; preds = %bb5.i, %entry + %i.0.reg2mem.0.ph.i.ph = phi i32 [ 0, %entry ], [ %4, %bb5.i ] ; [#uses=3] + br label %bb1.i + +bb1.i: ; preds = %bb3.i, %bb1.i.outer + %j.0.reg2mem.0.i = phi i32 [ %2, %bb3.i ], [ 0, %bb1.i.outer ] ; [#uses=3] + %0 = icmp eq i32 %i.0.reg2mem.0.ph.i.ph, %j.0.reg2mem.0.i ; [#uses=1] + br i1 %0, label %bb2.i, label %bb3.i + +bb2.i: ; preds = %bb1.i + %1 = getelementptr [2 x [2 x i32]]* @w, i32 0, i32 %i.0.reg2mem.0.ph.i.ph, i32 %j.0.reg2mem.0.i ; [#uses=1] + store i32 1, i32* %1, align 4 + br label %bb3.i + +bb3.i: ; preds = %bb2.i, %bb1.i + %2 = add i32 %j.0.reg2mem.0.i, 1 ; [#uses=2] + %3 = icmp sgt i32 %2, 1 ; [#uses=1] + br i1 %3, label %bb5.i, label %bb1.i + +bb5.i: ; preds = %bb3.i + %4 = add i32 %i.0.reg2mem.0.ph.i.ph, 1 ; [#uses=2] + %5 = icmp sgt i32 %4, 1 ; [#uses=1] + br i1 %5, label %f.exit, label %bb1.i.outer + +f.exit: ; preds = %bb5.i + %6 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 0), align 4 ; [#uses=1] + %7 = icmp eq i32 %6, 1 ; [#uses=1] + br i1 %7, label %bb, label %bb3 + +bb: ; preds = %f.exit + %8 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 1), align 4 ; [#uses=1] + %9 = icmp eq i32 %8, 1 ; [#uses=1] + br i1 %9, label %bb1, label %bb3 + +bb1: ; preds = %bb + %10 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 0), align 4 ; [#uses=1] + %11 = icmp eq i32 %10, 0 ; [#uses=1] + br i1 %11, label %bb2, label %bb3 + +bb2: ; preds = %bb1 + %12 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 1), align 4 ; [#uses=1] + %13 = icmp eq i32 %12, 0 ; [#uses=1] + br i1 %13, label %bb4, label %bb3 + +bb3: ; preds = %bb2, %bb1, %bb, %f.exit + tail call void @abort() noreturn nounwind + unreachable + +bb4: ; preds = %bb2 + ret i32 0 +} + +declare void @abort() noreturn nounwind + +declare void @exit(i32) noreturn nounwind From echristo at apple.com Fri Oct 10 17:05:18 2008 From: echristo at apple.com (Eric Christopher) Date: Fri, 10 Oct 2008 15:05:18 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r57367 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <200810102140.m9ALegdu008886@zion.cs.uiuc.edu> References: <200810102140.m9ALegdu008886@zion.cs.uiuc.edu> Message-ID: <8A8A56B8-F6CA-4CDC-937F-7F7175D14E25@apple.com> On Oct 10, 2008, at 2:40 PM, Dale Johannesen wrote: > Handle __builtin_ia32_vec_ext_v16qi. > gcc.target/i386/sse2-vec-5.c > gcc.target/i386/sse4_1-pextrb.c Is this what it fixes or tests that you were supposed to check in modified? -eric From dalej at apple.com Fri Oct 10 17:09:05 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 15:09:05 -0700 Subject: [llvm-commits] [llvm-gcc-4.2] r57367 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp In-Reply-To: <8A8A56B8-F6CA-4CDC-937F-7F7175D14E25@apple.com> References: <200810102140.m9ALegdu008886@zion.cs.uiuc.edu> <8A8A56B8-F6CA-4CDC-937F-7F7175D14E25@apple.com> Message-ID: <87E7B036-FBE5-45BE-A64C-F62E70AB0FFE@apple.com> On Oct 10, 2008, at 3:05 PMPDT, Eric Christopher wrote: > > On Oct 10, 2008, at 2:40 PM, Dale Johannesen wrote: > >> Handle __builtin_ia32_vec_ext_v16qi. >> gcc.target/i386/sse2-vec-5.c >> gcc.target/i386/sse4_1-pextrb.c > > Is this what it fixes or tests that you were supposed to check in > modified? That's what it fixes. From dalej at apple.com Fri Oct 10 18:51:05 2008 From: dalej at apple.com (Dale Johannesen) Date: Fri, 10 Oct 2008 23:51:05 -0000 Subject: [llvm-commits] [llvm] r57370 - in /llvm/trunk: include/llvm/IntrinsicsX86.td lib/Target/X86/X86InstrSSE.td Message-ID: <200810102351.m9ANp5NH013989@zion.cs.uiuc.edu> Author: johannes Date: Fri Oct 10 18:51:03 2008 New Revision: 57370 URL: http://llvm.org/viewvc/llvm-project?rev=57370&view=rev Log: Fix SSE4.1 roundss, roundsd. While the instructions have the same pattern as roundpd/roundps, the Intel compiler builtins do not: rounds* has an extra operand. Fixes gcc.target/i386/sse4_1-rounds[sd]-[1234].c Modified: llvm/trunk/include/llvm/IntrinsicsX86.td llvm/trunk/lib/Target/X86/X86InstrSSE.td Modified: llvm/trunk/include/llvm/IntrinsicsX86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsX86.td?rev=57370&r1=57369&r2=57370&view=diff ============================================================================== --- llvm/trunk/include/llvm/IntrinsicsX86.td (original) +++ llvm/trunk/include/llvm/IntrinsicsX86.td Fri Oct 10 18:51:03 2008 @@ -685,13 +685,13 @@ // FP rounding ops let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_sse41_round_ss : GCCBuiltin<"__builtin_ia32_roundss">, - Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, + Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>; def int_x86_sse41_round_ps : GCCBuiltin<"__builtin_ia32_roundps">, Intrinsic<[llvm_v4f32_ty, llvm_v4f32_ty, llvm_i32_ty], [IntrNoMem]>; def int_x86_sse41_round_sd : GCCBuiltin<"__builtin_ia32_roundsd">, - Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, + Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, llvm_v2f64_ty, llvm_i32_ty], [IntrNoMem]>; def int_x86_sse41_round_pd : GCCBuiltin<"__builtin_ia32_roundpd">, Intrinsic<[llvm_v2f64_ty, llvm_v2f64_ty, Modified: llvm/trunk/lib/Target/X86/X86InstrSSE.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrSSE.td?rev=57370&r1=57369&r2=57370&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrSSE.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrSSE.td Fri Oct 10 18:51:03 2008 @@ -3169,29 +3169,11 @@ // SSE4.1 Instructions //===----------------------------------------------------------------------===// -multiclass sse41_fp_unop_rm opcss, bits<8> opcps, - bits<8> opcsd, bits<8> opcpd, +multiclass sse41_fp_unop_rm opcps, bits<8> opcpd, string OpcodeStr, - Intrinsic F32Int, Intrinsic V4F32Int, - Intrinsic F64Int, Intrinsic V2F64Int> { // Intrinsic operation, reg. - def SSr_Int : SS4AIi8, - OpSize; - - // Intrinsic operation, mem. - def SSm_Int : SS4AIi8, - OpSize; - // Vector intrinsic operation, reg def PSr_Int : SS4AIi8, OpSize; - // Intrinsic operation, reg. - def SDr_Int : SS4AIi8, - OpSize; - - // Intrinsic operation, mem. - def SDm_Int : SS4AIi8, - OpSize; - // Vector intrinsic operation, reg def PDr_Int : SS4AIi8 opcss, bits<8> opcsd, + string OpcodeStr, + Intrinsic F32Int, + Intrinsic F64Int> { + // Intrinsic operation, reg. + def SSr_Int : SS4AIi8, + OpSize; + + // Intrinsic operation, mem. + def SSm_Int : SS4AIi8, + OpSize; + + // Intrinsic operation, reg. + def SDr_Int : SS4AIi8, + OpSize; + + // Intrinsic operation, mem. + def SDm_Int : SS4AIi8, + OpSize; +} +} + // FP round - roundss, roundps, roundsd, roundpd -defm ROUND : sse41_fp_unop_rm<0x0A, 0x08, 0x0B, 0x09, "round", - int_x86_sse41_round_ss, int_x86_sse41_round_ps, - int_x86_sse41_round_sd, int_x86_sse41_round_pd>; +defm ROUND : sse41_fp_unop_rm<0x08, 0x09, "round", + int_x86_sse41_round_ps, int_x86_sse41_round_pd>; +defm ROUND : sse41_fp_binop_rm<0x0A, 0x0B, "round", + int_x86_sse41_round_ss, int_x86_sse41_round_sd>; // SS41I_unop_rm_int_v16 - SSE 4.1 unary operator whose type is v8i16. multiclass SS41I_unop_rm_int_v16 opc, string OpcodeStr, From sabre at nondot.org Fri Oct 10 19:08:03 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 00:08:03 -0000 Subject: [llvm-commits] [llvm] r57371 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Message-ID: <200810110008.m9B084WZ015872@zion.cs.uiuc.edu> Author: lattner Date: Fri Oct 10 19:08:02 2008 New Revision: 57371 URL: http://llvm.org/viewvc/llvm-project?rev=57371&view=rev Log: simplify comparison Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp?rev=57371&r1=57370&r2=57371&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp Fri Oct 10 19:08:02 2008 @@ -1014,7 +1014,7 @@ // If the leaf of the tree is a comparison, merge the condition into // the caseblock. - if ((isa(Cond) || isa(Cond)) && + if (isa(Cond) && // The operands of the cmp have to be in this block. We don't know // how to export them from some other block. If this is the first block // of the sequence, no exporting is needed. From dalej at apple.com Fri Oct 10 20:08:21 2008 From: dalej at apple.com (Dale Johannesen) Date: Sat, 11 Oct 2008 01:08:21 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57372 - /llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m Message-ID: <200810110108.m9B18LfT017919@zion.cs.uiuc.edu> Author: johannes Date: Fri Oct 10 20:08:20 2008 New Revision: 57372 URL: http://llvm.org/viewvc/llvm-project?rev=57372&view=rev Log: Testcase adjust for (very) different llvm syntax. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m?rev=57372&r1=57371&r2=57372&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/utf16-x86-cfstring-1.m Fri Oct 10 20:08:20 2008 @@ -11,5 +11,7 @@ return 0; } /* { dg-final { scan-assembler ".section __TEXT,__ustring" } } */ -/* { dg-final { scan-assembler "___utf16_string_1:\n\t.byte\t-110\n\t.byte\t33\n\t.byte\t32\n\t.byte\t0" } } */ -/* { dg-final { scan-assembler "___utf16_string_2:\n\t.byte\t1\n\t.byte\t-40\n\t.byte\t0\n\t.byte\t-36" } } */ +/* LLVM LOCAL begin same data, very different syntax */ +/* { dg-final { scan-assembler "___utf16_string_1:.*\n\t(.byte\t-110\n\t.byte\t33\n\t.byte\t32\n\t.byte\t0|.asciz\t\"\\\\622! \\\\000)" } } */ +/* { dg-final { scan-assembler "___utf16_string_2:.*\n\t(.byte\t1\n\t.byte\t-40\n\t.byte\t0\n\t.byte\t-36|.asciz\t\"\\\\001\\\\730\\\\000\\\\734)" } } */ +/* LLVM LOCAL end */ \ No newline at end of file From daniel at zuster.org Sat Oct 11 01:40:57 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Sat, 11 Oct 2008 06:40:57 -0000 Subject: [llvm-commits] [llvm] r57373 - /llvm/trunk/lib/VMCore/IntrinsicInst.cpp Message-ID: <200810110640.m9B6evUW029172@zion.cs.uiuc.edu> Author: ddunbar Date: Sat Oct 11 01:40:56 2008 New Revision: 57373 URL: http://llvm.org/viewvc/llvm-project?rev=57373&view=rev Log: Unbreak DbgStopPointInst::getFileName(). Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?rev=57373&r1=57372&r2=57373&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/IntrinsicInst.cpp (original) +++ llvm/trunk/lib/VMCore/IntrinsicInst.cpp Sat Oct 11 01:40:56 2008 @@ -64,7 +64,7 @@ GlobalVariable *GV = cast(getContext()); if (!GV->hasInitializer()) return NULL; ConstantStruct *CS = cast(GV->getInitializer()); - return CS->getOperand(4); + return CS->getOperand(3); } Value *DbgStopPointInst::getDirectory() const { From daniel at zuster.org Sat Oct 11 01:52:31 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Fri, 10 Oct 2008 23:52:31 -0700 Subject: [llvm-commits] [llvm] r57373 - /llvm/trunk/lib/VMCore/IntrinsicInst.cpp In-Reply-To: <200810110640.m9B6evUW029172@zion.cs.uiuc.edu> References: <200810110640.m9B6evUW029172@zion.cs.uiuc.edu> Message-ID: <6a8523d60810102352x5e5bff75hc8e392751314509a@mail.gmail.com> Tanya, Can you add this to the 2.4 branch. It is an innocuous and obvious bug fix. Pasto in http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?view=diff&r1=52890&r2=52891 Sorry for being late to the 2.4 party... - Daniel On Fri, Oct 10, 2008 at 11:40 PM, Daniel Dunbar wrote: > Author: ddunbar > Date: Sat Oct 11 01:40:56 2008 > New Revision: 57373 > > URL: http://llvm.org/viewvc/llvm-project?rev=57373&view=rev > Log: > Unbreak DbgStopPointInst::getFileName(). > > Modified: > llvm/trunk/lib/VMCore/IntrinsicInst.cpp > > Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?rev=57373&r1=57372&r2=57373&view=diff > > > ============================================================================== > --- llvm/trunk/lib/VMCore/IntrinsicInst.cpp (original) > +++ llvm/trunk/lib/VMCore/IntrinsicInst.cpp Sat Oct 11 01:40:56 2008 > @@ -64,7 +64,7 @@ > GlobalVariable *GV = cast(getContext()); > if (!GV->hasInitializer()) return NULL; > ConstantStruct *CS = cast(GV->getInitializer()); > - return CS->getOperand(4); > + return CS->getOperand(3); > } > > Value *DbgStopPointInst::getDirectory() const { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081010/6a8ebb30/attachment.html From nicolas.geoffray at lip6.fr Sat Oct 11 02:44:12 2008 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 11 Oct 2008 09:44:12 +0200 Subject: [llvm-commits] [llvm] r57340 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp In-Reply-To: References: <200810100147.m9A1lhpA020678@zion.cs.uiuc.edu> <48EF117C.1090505@lip6.fr> <07A688AF-A985-4F69-B8BC-E94FD56D3F94@apple.com> <48EF8C4D.7070702@lip6.fr> Message-ID: <48F0594C.5040601@lip6.fr> Hi Mon, Thanks for reverting! Indeed, we do not point out that the default module provider does not lock by default. I made a patch some time ago, but Chris thinks the locking should be made at a higher level: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-April/013947.html Mon Ping Wang wrote: > Out of curiosity, does the Java compiler grab the JIT lock for its own uses? > Yes it does. What's happening is that the Java compiler will call a classloader.loadClass function (I assume you're familiar with Java?) that will return a class with a bunch of Java functions. The compiler then locates the function in the class, takes the JIT lock and creates the IR. Note that I also take the JIT lock for materializing IR :), but there is no deadlock anymore since it's done at the very last step. Nicolas > -- Mon Ping > > > > On Oct 10, 2008, at 10:09 AM, Nicolas Geoffray wrote: > > >> Hi Mon, >> >> The logic here is that materializing a function has to be guarded >> because it creates LLVM IR, constants and types. However, it is not >> the >> JIT's responsability to guard it, but your module provider >> implementation. >> >> A default implementation of the module provider only locates the the >> function and creates the IR. So it's ok to let the JIT lock. However >> (and this is what's happening in Java) we can imagine complex things >> where materializing a function requires calling some external code. >> When >> this complex module provider is able to create the IR after calling >> this >> external code, *then* it can take the lock. >> >> I acknowledge that it's easier to place the lock in the execution >> engine, but it's wrong :) >> >> Nicolas >> >> Mon Ping Wang wrote: >> >>> Hi Nicolas, >>> >>> Sorry, I was not aware of Java issues. I moved the locked upwards >>> because if I didn't, I ran into a problem that materialized function >>> got corrupted occasionally and I got some weird errors. I'm not sure >>> if this also could occur in Java as it is possible that it will never >>> call getPointerToFunction twice on the same function by different >>> threads. Is the requirement that materializing the function must be >>> lockless? If no, maybe we can create a local lock around the >>> materialization so we don't try to do it at the same time. >>> Otherwise, >>> clients would need guard calls to getPointerToFunction. >>> >>> -- Mon Ping >>> >>> >>> On Oct 10, 2008, at 1:25 AM, Nicolas Geoffray wrote: >>> >>> >>> >>>> Hi Mon, >>>> >>>> We're having a conflict here. >>>> >>>> Originally, materializing a function was guarded. However, in Java, >>>> materializing a function may execute Java code that use locks, hence >>>> deadlocks can happen. >>>> So I moved the guard after materialization. >>>> >>>> On a more general note I *don't* think materializing a function >>>> should >>>> be guarded by the JIT compiler. The JIT's mutex should only protect >>>> JIT >>>> internal data. Materializing a function does not modify any JIT >>>> data. >>>> >>>> Nicolas >>>> >>>> >>>> Mon P Wang wrote: >>>> >>>> >>>>> Author: wangmp >>>>> Date: Thu Oct 9 20:47:42 2008 >>>>> New Revision: 57340 >>>>> >>>>> URL: http://llvm.org/viewvc/llvm-project?rev=57340&view=rev >>>>> Log: >>>>> Moved guard mutex upwards to guard materializing a function >>>>> in getPointerToFunction >>>>> >>>>> >>>>> Modified: >>>>> llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>>>> >>>>> Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp >>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=57340&r1=57339&r2=57340&view=diff >>>>> >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> = >>>>> =================================================================== >>>>> --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) >>>>> +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Thu Oct 9 20:47:42 >>>>> 2008 >>>>> @@ -489,6 +489,8 @@ >>>>> if (void *Addr = getPointerToGlobalIfAvailable(F)) >>>>> return Addr; // Check if function already code gen'd >>>>> >>>>> + MutexGuard locked(lock); >>>>> + >>>>> // Make sure we read in the function if it exists in this Module. >>>>> if (F->hasNotBeenReadFromBitcode()) { >>>>> // Determine the module provider this function is provided by. >>>>> @@ -509,13 +511,11 @@ >>>>> abort(); >>>>> } >>>>> } >>>>> - >>>>> + >>>>> if (void *Addr = getPointerToGlobalIfAvailable(F)) { >>>>> return Addr; >>>>> } >>>>> >>>>> - MutexGuard locked(lock); >>>>> - >>>>> if (F->isDeclaration()) { >>>>> void *Addr = getPointerToNamedFunction(F->getName()); >>>>> addGlobalMapping(F, Addr); >>>>> >>>>> >>>>> _______________________________________________ >>>>> llvm-commits mailing list >>>>> llvm-commits at cs.uiuc.edu >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> llvm-commits mailing list >>>> llvm-commits at cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>>> >>>> >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From alenhar2 at cs.uiuc.edu Sat Oct 11 11:52:05 2008 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Sat, 11 Oct 2008 16:52:05 -0000 Subject: [llvm-commits] [poolalloc] r57375 - in /poolalloc/trunk: include/dsa/DSGraph.h include/dsa/DataStructure.h include/poolalloc/PoolAllocate.h lib/DSA/BottomUpClosure.cpp lib/DSA/CompleteBottomUp.cpp lib/DSA/DataStructure.cpp lib/DSA/EquivClassGraphs.cpp lib/DSA/Printer.cpp lib/DSA/StdLibPass.cpp lib/DSA/TopDownClosure.cpp lib/PoolAllocate/AccessTrace.cpp lib/PoolAllocate/PASimple.cpp lib/PoolAllocate/PointerCompress.cpp lib/PoolAllocate/PoolAllocate.cpp lib/PoolAllocate/TransformFunctionBody.cpp Message-ID: <200810111652.m9BGq6Br030153@zion.cs.uiuc.edu> Author: alenhar2 Date: Sat Oct 11 11:52:04 2008 New Revision: 57375 URL: http://llvm.org/viewvc/llvm-project?rev=57375&view=rev Log: Getting closer. Equiv was redundant with CBU when doing unresolved call merging in Globals during BU due to GlobalEQs. Removed: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Modified: poolalloc/trunk/include/dsa/DSGraph.h poolalloc/trunk/include/dsa/DataStructure.h poolalloc/trunk/include/poolalloc/PoolAllocate.h poolalloc/trunk/lib/DSA/BottomUpClosure.cpp poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp poolalloc/trunk/lib/DSA/DataStructure.cpp poolalloc/trunk/lib/DSA/Printer.cpp poolalloc/trunk/lib/DSA/StdLibPass.cpp poolalloc/trunk/lib/DSA/TopDownClosure.cpp poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp poolalloc/trunk/lib/PoolAllocate/PASimple.cpp poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Modified: poolalloc/trunk/include/dsa/DSGraph.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DSGraph.h (original) +++ poolalloc/trunk/include/dsa/DSGraph.h Sat Oct 11 11:52:04 2008 @@ -327,9 +327,12 @@ // Aux Function Call iteration - typedef std::list::const_iterator afc_iterator; - afc_iterator afc_begin() const { return AuxFunctionCalls.begin(); } - afc_iterator afc_end() const { return AuxFunctionCalls.end(); } + typedef std::list::iterator afc_iterator; + afc_iterator afc_begin() { return AuxFunctionCalls.begin(); } + afc_iterator afc_end() { return AuxFunctionCalls.end(); } + typedef std::list::const_iterator afc_const_iterator; + afc_const_iterator afc_begin() const { return AuxFunctionCalls.begin(); } + afc_const_iterator afc_end() const { return AuxFunctionCalls.end(); } /// getNodeForValue - Given a value that is used or defined in the body of the /// current function, return the DSNode that it points to. Modified: poolalloc/trunk/include/dsa/DataStructure.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/include/dsa/DataStructure.h (original) +++ poolalloc/trunk/include/dsa/DataStructure.h Sat Oct 11 11:52:04 2008 @@ -72,7 +72,7 @@ EquivalenceClasses GlobalECs; - void init(DataStructures* D, bool clone, bool printAuxCalls); + void init(DataStructures* D, bool clone, bool printAuxCalls, bool copyGlobalAuxCalls); void init(TargetData* T); void formGlobalECs(); @@ -83,18 +83,23 @@ } DataStructures(intptr_t id) - :ModulePass(id), TD(0), GraphSource(0), GlobalsGraph(0) {} + :ModulePass(id), TD(0), GraphSource(0), GlobalsGraph(0) { + //a dummy node for empty call sites + ActualCallees[0]; + } public: callee_iterator callee_begin(const Instruction *I) const { ActualCalleesTy::const_iterator ii = ActualCallees.find(I); - assert(ii != ActualCallees.end() && "No calls for instruction"); + if (ii == ActualCallees.end()) + ii = ActualCallees.find(0); return ii->second.begin(); } callee_iterator callee_end(const Instruction *I) const { ActualCalleesTy::const_iterator ii = ActualCallees.find(I); - assert(ii != ActualCallees.end() && "No calls for instruction"); + if (ii == ActualCallees.end()) + ii = ActualCallees.find(0); return ii->second.end(); } @@ -127,7 +132,6 @@ } void setDSGraph(const Function& F, DSGraph* G) { - assert(!DSInfo[&F] && "DSGraph already exists"); DSInfo[&F] = G; } @@ -204,10 +208,16 @@ std::map, std::pair > > IndCallGraphMap; - BUDataStructures(intptr_t id) : DataStructures(id) {} + const char* debugname; + public: static char ID; - BUDataStructures() : DataStructures((intptr_t)&ID) {} + //Child constructor + BUDataStructures(intptr_t CID, const char* name) + : DataStructures(CID), debugname(name) {} + //main constructor + BUDataStructures() + : DataStructures((intptr_t)&ID), debugname("dsa-bu") {} ~BUDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); @@ -225,6 +235,9 @@ AU.addRequired(); } +protected: + bool runOnModuleInternal(Module &M); + private: void calculateGraph(DSGraph &G); @@ -247,7 +260,6 @@ /// class TDDataStructures : public DataStructures { hash_set ArgsRemainIncomplete; - BUDataStructures *BUInfo; /// CallerCallEdges - For a particular graph, we keep a list of these records /// which indicates which graphs call this function and from where. @@ -307,10 +319,12 @@ /// their callers graphs, making the result more useful for things like pool /// allocation. /// -class CompleteBUDataStructures : public DataStructures { +class CompleteBUDataStructures : public BUDataStructures { + void buildIndirectFunctionSets(Module &M); public: static char ID; - CompleteBUDataStructures() : DataStructures((intptr_t)&ID) {} + CompleteBUDataStructures() + : BUDataStructures((intptr_t)&ID, "dsa-cbu") {} ~CompleteBUDataStructures() { releaseMemory(); } virtual bool runOnModule(Module &M); @@ -322,64 +336,6 @@ /// print - Print out the analysis results... /// void print(std::ostream &O, const Module *M) const; - - virtual void releaseMemory(); - -private: - unsigned calculateSCCGraphs(DSGraph &FG, std::vector &Stack, - unsigned &NextID, - hash_map &ValMap); - void processGraph(DSGraph &G); -}; - - -/// EquivClassGraphs - This is the same as the complete bottom-up graphs, but -/// with functions partitioned into equivalence classes and a single merged -/// DS graph for all functions in an equivalence class. After this merging, -/// graphs are inlined bottom-up on the SCCs of the final (CBU) call graph. -/// -struct EquivClassGraphs : public DataStructures { - - // Equivalence class where functions that can potentially be called via the - // same function pointer are in the same class. - EquivalenceClasses FuncECs; - - /// OneCalledFunction - For each indirect call, we keep track of one - /// target of the call. This is used to find equivalence class called by - /// a call site. - std::map OneCalledFunction; - -public: - static char ID; - EquivClassGraphs(); - - /// EquivClassGraphs - Computes the equivalence classes and then the - /// folded DS graphs for each class. - /// - - virtual bool runOnModule(Module &M); - - /// print - Print out the analysis results... - /// - void print(std::ostream &O, const Module *M) const; - - /// getSomeCalleeForCallSite - Return any one callee function at - /// a call site. - /// - const Function *getSomeCalleeForCallSite(const CallSite &CS) const; - - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - } - -private: - void buildIndirectFunctionSets(Module &M); - - unsigned processSCC(DSGraph &FG, std::vector &Stack, - unsigned &NextID, - std::map &ValMap); - void processGraph(DSGraph &FG); - }; } // End llvm namespace Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original) +++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Sat Oct 11 11:52:04 2008 @@ -34,7 +34,6 @@ class DSGraph; class Type; class AllocaInst; -class EquivClassGraphs; class CallTargetFinder; namespace PA { @@ -103,8 +102,7 @@ class PoolAllocateGroup { protected: - EquivClassGraphs *ECGraphs; - TDDataStructures *TDGraphs; + DataStructures *Graphs; public: static char ID; @@ -120,23 +118,23 @@ virtual const Type * getPoolType() {return 0;} virtual bool hasDSGraph (const Function & F) const { - return ECGraphs->hasDSGraph (F); + return Graphs->hasDSGraph (F); } virtual DSGraph & getDSGraph (const Function & F) const { - return ECGraphs->getDSGraph (F); + return Graphs->getDSGraph (F); } virtual DSGraph & getGlobalsGraph () const { - return ECGraphs->getGlobalsGraph (); + return Graphs->getGlobalsGraph (); } virtual Value * getPool (const DSNode * N, Function & F) {return 0;} virtual Value * getGlobalPool (const DSNode * Node) {return 0;} - virtual CompleteBUDataStructures::callee_iterator callee_begin (Instruction *I) { return ECGraphs->callee_begin(I);} - virtual CompleteBUDataStructures::callee_iterator callee_end (Instruction *I) { return ECGraphs->callee_end(I);} + virtual DataStructures::callee_iterator callee_begin (Instruction *I) { return Graphs->callee_begin(I);} + virtual DataStructures::callee_iterator callee_end (Instruction *I) { return Graphs->callee_end(I);} }; /// PoolAllocate - The main pool allocation pass @@ -183,7 +181,7 @@ virtual void getAnalysisUsage(AnalysisUsage &AU) const; - EquivClassGraphs &getECGraphs() const { return *ECGraphs; } + DataStructures &getGraphs() const { return *Graphs; } /// getOrigFunctionFromClone - Given a pointer to a function that was cloned /// from another function, return the original function. If the argument @@ -240,11 +238,11 @@ } virtual DSGraph & getDSGraph (const Function & F) const { - return ECGraphs->getDSGraph (F); + return Graphs->getDSGraph (F); } virtual DSGraph & getGlobalsGraph () const { - return ECGraphs->getGlobalsGraph (); + return Graphs->getGlobalsGraph (); } virtual Value * getPool (const DSNode * N, Function & F) { @@ -265,14 +263,14 @@ return I->second; } - virtual CompleteBUDataStructures::callee_iterator + virtual DataStructures::callee_iterator callee_begin (Instruction * I) { - return ECGraphs->callee_begin(I); + return Graphs->callee_begin(I); } - virtual CompleteBUDataStructures::callee_iterator + virtual DataStructures::callee_iterator callee_end (Instruction * I) { - return ECGraphs->callee_end(I); + return Graphs->callee_end(I); } protected: Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Sat Oct 11 11:52:04 2008 @@ -18,16 +18,13 @@ #include "dsa/DataStructure.h" #include "dsa/DSGraph.h" #include "llvm/Module.h" -#include "llvm/DerivedTypes.h" #include "llvm/ADT/Statistic.h" -#include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Timer.h" using namespace llvm; namespace { STATISTIC (MaxSCC, "Maximum SCC Size in Call Graph"); - STATISTIC (NumBUInlines, "Number of graphs inlined"); + STATISTIC (NumInlines, "Number of graphs inlined"); STATISTIC (NumCallEdges, "Number of 'actual' call edges"); RegisterPass @@ -40,8 +37,12 @@ // program. // bool BUDataStructures::runOnModule(Module &M) { - init(&getAnalysis(), false, true); + init(&getAnalysis(), false, true, false); + return runOnModuleInternal(M); +} + +bool BUDataStructures::runOnModuleInternal(Module& M) { std::vector Stack; hash_map ValMap; unsigned NextID = 1; @@ -50,13 +51,15 @@ if (MainFunc) { calculateGraphs(MainFunc, Stack, NextID, ValMap); CloneAuxIntoGlobal(getDSGraph(*MainFunc)); + } else { + DOUT << debugname << ": No 'main' function found!\n"; } // Calculate the graphs for any functions that are unreachable from main... for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && !hasDSGraph(*I)) { if (MainFunc) - DOUT << "*** BU: Function unreachable from main: " + DOUT << debugname << ": Function unreachable from main: " << I->getName() << "\n"; calculateGraphs(I, Stack, NextID, ValMap); // Calculate all graphs. CloneAuxIntoGlobal(getDSGraph(*I)); @@ -348,8 +351,20 @@ ReachabilityCloner RC(GG, G, 0); for(DSGraph::afc_iterator ii = G.afc_begin(), ee = G.afc_end(); - ii != ee; ++ii) - GG.getAuxFunctionCalls().push_front(RC.cloneCallSite(*ii)); + ii != ee; ++ii) { + //If we can, merge with an existing call site for this instruction + if (GG.hasNodeForValue(ii->getCallSite().getInstruction()->getOperand(0))) { + DSGraph::afc_iterator GGii; + for(GGii = GG.afc_begin(); GGii != GG.afc_end(); ++GGii) + if (GGii->getCallSite().getInstruction()->getOperand(0) == + ii->getCallSite().getInstruction()->getOperand(0)) + break; + assert (GGii != GG.afc_end() && "Callsite should exist but doesn't"); + RC.cloneCallSite(*ii).mergeWith(*GGii); + } else { + GG.getAuxFunctionCalls().push_front(RC.cloneCallSite(*ii)); + } + } } void BUDataStructures::calculateGraph(DSGraph &Graph) { @@ -432,7 +447,7 @@ Graph.mergeInGraph(CS, *Callee, *GI, DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes| (isComplete?0:DSGraph::DontCloneAuxCallNodes)); - ++NumBUInlines; + ++NumInlines; } else { DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); DEBUG(std::cerr << " calls " << CalledFuncs.size() @@ -484,7 +499,7 @@ // bother merging it in again. if (!GI->containsFunction(*I)) { GI->cloneInto(getDSGraph(**I)); - ++NumBUInlines; + ++NumInlines; } std::vector NextArgs; @@ -517,7 +532,7 @@ DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes| (isComplete?0:DSGraph::DontCloneAuxCallNodes)); - ++NumBUInlines; + ++NumInlines; } if (isComplete) TempFCs.erase(TempFCs.begin()); @@ -575,7 +590,7 @@ << Graph.getAuxFunctionCalls().size() << "]\n"; Graph.mergeInGraph(CS, *Callee, *GI, DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes); - ++NumBUInlines; + ++NumInlines; } else { DEBUG(std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"); DEBUG(std::cerr << " calls " << CalledFuncs.size() @@ -627,7 +642,7 @@ // bother merging it in again. if (!GI->containsFunction(*I)) { GI->cloneInto(getDSGraph(**I)); - ++NumBUInlines; + ++NumInlines; } std::vector NextArgs; @@ -659,7 +674,7 @@ Graph.mergeInGraph(CS, IndCallGraph.second, *GI, DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes); - ++NumBUInlines; + ++NumInlines; } } Modified: poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp (original) +++ poolalloc/trunk/lib/DSA/CompleteBottomUp.cpp Sat Oct 11 11:52:04 2008 @@ -15,18 +15,15 @@ #define DEBUG_TYPE "dsa-cbu" #include "dsa/DataStructure.h" -#include "llvm/Module.h" #include "dsa/DSGraph.h" -#include "llvm/Support/Debug.h" -#include "llvm/ADT/SCCIterator.h" +#include "llvm/Module.h" #include "llvm/ADT/Statistic.h" -#include "llvm/ADT/STLExtras.h" +#include "llvm/Support/Debug.h" using namespace llvm; namespace { RegisterPass X("dsa-cbu", "'Complete' Bottom-up Data Structure Analysis"); - STATISTIC (NumCBUInlines, "Number of graphs inlined"); } char CompleteBUDataStructures::ID; @@ -35,177 +32,28 @@ // program. // bool CompleteBUDataStructures::runOnModule(Module &M) { - init(&getAnalysis(), false, true); - - std::vector Stack; - hash_map ValMap; - unsigned NextID = 1; - - Function *MainFunc = M.getFunction("main"); - if (MainFunc) { - if (!MainFunc->isDeclaration()) - calculateSCCGraphs(getOrCreateGraph(MainFunc), Stack, NextID, ValMap); - } else { - DOUT << "CBU-DSA: No 'main' function found!\n"; - } + init(&getAnalysis(), false, true, false); - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && !hasDSGraph(*I)) { - if (MainFunc) { - DOUT << "*** CBU: Function unreachable from main: " - << I->getName() << "\n"; - } - calculateSCCGraphs(getOrCreateGraph(I), Stack, NextID, ValMap); - } - - GlobalsGraph->removeTriviallyDeadNodes(); - - - // Merge the globals variables (not the calls) from the globals graph back - // into the main function's graph so that the main function contains all of - // the information about global pools and GV usage in the program. - if (MainFunc && !MainFunc->isDeclaration()) { - DSGraph &MainGraph = getOrCreateGraph(MainFunc); - const DSGraph &GG = *MainGraph.getGlobalsGraph(); - ReachabilityCloner RC(MainGraph, GG, - DSGraph::DontCloneCallNodes | - DSGraph::DontCloneAuxCallNodes); - - // Clone the global nodes into this graph. - for (DSScalarMap::global_iterator I = GG.getScalarMap().global_begin(), - E = GG.getScalarMap().global_end(); I != E; ++I) - if (isa(*I)) - RC.getClonedNH(GG.getNodeForValue(*I)); - - MainGraph.maskIncompleteMarkers(); - MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs | - DSGraph::IgnoreGlobals); - } + buildIndirectFunctionSets(M); - return false; + return runOnModuleInternal(M); } -unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG, - std::vector &Stack, - unsigned &NextID, - hash_map &ValMap) { - assert(!ValMap.count(&FG) && "Shouldn't revisit functions!"); - unsigned Min = NextID++, MyID = Min; - ValMap[&FG] = Min; - Stack.push_back(&FG); - - // The edges out of the current node are the call site targets... - for (DSGraph::fc_iterator CI = FG.fc_begin(), CE = FG.fc_end(); - CI != CE; ++CI) { - Instruction *Call = CI->getCallSite().getInstruction(); - - // Loop over all of the actually called functions... - for (callee_iterator I = callee_begin(Call), E = callee_end(Call); - I != E ; ++I) { - if (!(*I)->isDeclaration()) { - DSGraph &Callee = getOrCreateGraph(*I); - unsigned M; - // Have we visited the destination function yet? - hash_map::iterator It = ValMap.find(&Callee); - if (It == ValMap.end()) // No, visit it now. - M = calculateSCCGraphs(Callee, Stack, NextID, ValMap); - else // Yes, get it's number. - M = It->second; - if (M < Min) Min = M; - } +void CompleteBUDataStructures::buildIndirectFunctionSets(Module &M) { + // Loop over all of the indirect calls in the program. If a call site can + // call multiple different functions, we need to unify all of the callees into + // the same equivalence class. + std::vector keys; + callee_get_keys(keys); + + //mege nodes in the global graph for these functions + for (std::vector::iterator ii = keys.begin(), ee = keys.end(); + ii != ee; ++ii) { + callee_iterator base = callee_begin(*ii); + for (callee_iterator csi = callee_begin(*ii), cse = callee_end(*ii); + csi != cse; ++csi) { + GlobalECs.unionSets(*base, *csi); + GlobalsGraph->getNodeForValue(*base).mergeWith(GlobalsGraph->getNodeForValue(*csi)); } } - - assert(ValMap[&FG] == MyID && "SCC construction assumption wrong!"); - if (Min != MyID) - return Min; // This is part of a larger SCC! - - // If this is a new SCC, process it now. - bool IsMultiNodeSCC = false; - while (Stack.back() != &FG) { - DSGraph *NG = Stack.back(); - ValMap[NG] = ~0U; - - FG.cloneInto(*NG); - - // Update the DSInfo map and delete the old graph... - for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); - I != NG->retnodes_end(); ++I) - setDSGraph(*I->first, &FG); - - // Remove NG from the ValMap since the pointer may get recycled. - ValMap.erase(NG); - delete NG; - - Stack.pop_back(); - IsMultiNodeSCC = true; - } - - // Clean up the graph before we start inlining a bunch again... - if (IsMultiNodeSCC) - FG.removeTriviallyDeadNodes(); - - Stack.pop_back(); - processGraph(FG); - ValMap[&FG] = ~0U; - return MyID; -} - - -/// processGraph - Process the BU graphs for the program in bottom-up order on -/// the SCC of the __ACTUAL__ call graph. This builds "complete" BU graphs. -void CompleteBUDataStructures::processGraph(DSGraph &G) { - hash_set calls; - - // The edges out of the current node are the call site targets... - unsigned i = 0; - for (DSGraph::fc_iterator CI = G.fc_begin(), CE = G.fc_end(); CI != CE; - ++CI, ++i) { - const DSCallSite &CS = *CI; - Instruction *TheCall = CS.getCallSite().getInstruction(); - - assert(calls.insert(TheCall).second && - "Call instruction occurs multiple times in graph??"); - - // Fast path for noop calls. Note that we don't care about merging globals - // in the callee with nodes in the caller here. - if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) - continue; - - // Loop over all of the potentially called functions... - // Inline direct calls as well as indirect calls because the direct - // callee may have indirect callees and so may have changed. - // - unsigned TNum = 0, Num = 0; - DEBUG(Num = std::distance(callee_begin(TheCall), callee_end(TheCall))); - for (callee_iterator I = callee_begin(TheCall), E = callee_end(TheCall); - I != E; ++I, ++TNum) { - const Function *CalleeFunc = *I; - if (!CalleeFunc->isDeclaration()) { - // Merge the callee's graph into this graph. This works for normal - // calls or for self recursion within an SCC. - DSGraph &GI = getOrCreateGraph(CalleeFunc); - ++NumCBUInlines; - G.mergeInGraph(CS, *CalleeFunc, GI, - DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes | - DSGraph::DontCloneAuxCallNodes); - DOUT << " Inlining graph [" << i << "/" - << G.getFunctionCalls().size()-1 - << ":" << TNum << "/" << Num-1 << "] for " - << CalleeFunc->getName() << "[" - << GI.getGraphSize() << "+" << GI.getAuxFunctionCalls().size() - << "] into '" /*<< G.getFunctionNames()*/ << "' [" - << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size() - << "]\n"; - } - } - } - - // Recompute the Incomplete markers - G.maskIncompleteMarkers(); - G.markIncompleteNodes(DSGraph::MarkFormalArgs); - - // Delete dead nodes. Treat globals that are unreachable but that can - // reach live nodes as live. - G.removeDeadNodes(DSGraph::KeepUnreachableGlobals); } Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/DataStructure.cpp (original) +++ poolalloc/trunk/lib/DSA/DataStructure.cpp Sat Oct 11 11:52:04 2008 @@ -1607,7 +1607,7 @@ RHS.ReturnNodes.clear(); } - // Merge the scalar map in. + // Merge the scalar map in. ScalarMap.spliceFrom(RHS.ScalarMap); } @@ -1810,7 +1810,7 @@ HackedGraphSCCFinder SCCFinder(RC); if (!(CloneFlags & DontCloneAuxCallNodes)) - for (afc_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I) + for (afc_const_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I) if (SCCFinder.PathExistsToClonedNode(*I)) AuxCallToCopy.push_back(&*I); // else if (I->isIndirectCall()){ @@ -2493,7 +2493,7 @@ AssertCallSiteInGraph(*I); } void DSGraph::AssertAuxCallNodesInGraph() const { - for (afc_iterator I = afc_begin(), E = afc_end(); I != E; ++I) + for (afc_const_iterator I = afc_begin(), E = afc_end(); I != E; ++I) AssertCallSiteInGraph(*I); } @@ -2840,14 +2840,16 @@ DEBUG(if(MadeChange) G.AssertGraphOK()); } -void DataStructures::init(DataStructures* D, bool clone, bool printAuxCalls) { +void DataStructures::init(DataStructures* D, bool clone, bool printAuxCalls, + bool copyGlobalAuxCalls) { assert (!GraphSource && "Already init"); GraphSource = D; Clone = clone; TD = D->TD; ActualCallees = D->ActualCallees; GlobalECs = D->getGlobalECs(); - GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs); + GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs, + copyGlobalAuxCalls?0:DSGraph::DontCloneAuxCallNodes); if (printAuxCalls) GlobalsGraph->setPrintAuxCalls(); } Removed: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=57374&view=auto ============================================================================== --- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original) +++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (removed) @@ -1,427 +0,0 @@ -//===- EquivClassGraphs.cpp - Merge equiv-class graphs & inline bottom-up -===// -// -// The LLVM Compiler Infrastructure -// -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This pass is the same as the complete bottom-up graphs, but -// with functions partitioned into equivalence classes and a single merged -// DS graph for all functions in an equivalence class. After this merging, -// graphs are inlined bottom-up on the SCCs of the final (CBU) call graph. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "ECGraphs" -#include "dsa/DataStructure.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" -#include "dsa/DSGraph.h" -#include "llvm/Support/CallSite.h" -#include "llvm/Support/Debug.h" -#include "llvm/ADT/SCCIterator.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/ADT/EquivalenceClasses.h" -#include "llvm/ADT/STLExtras.h" -using namespace llvm; - -namespace { - RegisterPass X("dsa-eq", - "Equivalence-class Bottom-up Data Structure Analysis"); - STATISTIC (NumEquivBUInlines, - "Number of graphs inlined"); - STATISTIC (NumFoldGraphInlines, - "Number of graphs inlined"); -} - -char EquivClassGraphs::ID = 0; - -EquivClassGraphs::EquivClassGraphs() : DataStructures((intptr_t)&ID) {} - -#ifndef NDEBUG -template -static void CheckAllGraphs(Module *M, GT &ECGraphs) { - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isDeclaration()) { - DSGraph &G = ECGraphs.getDSGraph(*I); - if (G.retnodes_begin()->first != I) - continue; // Only check a graph once. - - DSGraph::NodeMapTy GlobalsGraphNodeMapping; - G.computeGToGGMapping(GlobalsGraphNodeMapping); - } -} -#endif - -// getSomeCalleeForCallSite - Return any one callee function at a call site. -// -const Function *EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const{ - Function *thisFunc = CS.getCaller(); - assert(thisFunc && "getSomeCalleeForCallSite(): Not a valid call site?"); - DSGraph &DSG = getDSGraph(*thisFunc); - DSNode *calleeNode = DSG.getNodeForValue(CS.getCalledValue()).getNode(); - std::map::const_iterator I = - OneCalledFunction.find(calleeNode); - return (I == OneCalledFunction.end())? NULL : I->second; -} - -// runOnModule - Calculate the bottom up data structure graphs for each function -// in the program. -// -bool EquivClassGraphs::runOnModule(Module &M) { - init(&getAnalysis(), false, true); - - // Find equivalence classes of functions called from common call sites. - // Fold the CBU graphs for all functions in an equivalence class. - buildIndirectFunctionSets(M); - - // Stack of functions used for Tarjan's SCC-finding algorithm. - std::vector Stack; - std::map ValMap; - unsigned NextID = 1; - - const Function *MainFunc = M.getFunction("main"); - if (MainFunc && !MainFunc->isDeclaration()) { - processSCC(getOrCreateGraph(MainFunc), Stack, NextID, ValMap); - } else { - cerr << "Fold Graphs: No 'main' function found!\n"; - } - - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration()) - processSCC(getOrCreateGraph(I), Stack, NextID, ValMap); - - DEBUG(CheckAllGraphs(&M, *this)); - - getGlobalsGraph().removeTriviallyDeadNodes(); - getGlobalsGraph().markIncompleteNodes(DSGraph::IgnoreGlobals); - - // Merge the globals variables (not the calls) from the globals graph back - // into the main function's graph so that the main function contains all of - // the information about global pools and GV usage in the program. - if (MainFunc && !MainFunc->isDeclaration()) { - DSGraph &MainGraph = getOrCreateGraph(MainFunc); - const DSGraph &GG = *MainGraph.getGlobalsGraph(); - ReachabilityCloner RC(MainGraph, GG, - DSGraph::DontCloneCallNodes | - DSGraph::DontCloneAuxCallNodes); - - // Clone the global nodes into this graph. - for (DSScalarMap::global_iterator I = GG.getScalarMap().global_begin(), - E = GG.getScalarMap().global_end(); I != E; ++I) - if (isa(*I)) - RC.getClonedNH(GG.getNodeForValue(*I)); - - MainGraph.maskIncompleteMarkers(); - MainGraph.markIncompleteNodes(DSGraph::MarkFormalArgs | - DSGraph::IgnoreGlobals); - } - - // Final processing. Note that dead node elimination may actually remove - // globals from a function graph that are immediately used. If there are no - // scalars pointing to the node (e.g. because the only use is a direct store - // to a scalar global) we have to make sure to rematerialize the globals back - // into the graphs here, or clients will break! - for (Module::global_iterator GI = M.global_begin(), E = M.global_end(); - GI != E; ++GI) - // This only happens to first class typed globals. - if (GI->getType()->getElementType()->isFirstClassType()) - for (Value::use_iterator UI = GI->use_begin(), E = GI->use_end(); - UI != E; ++UI) - // This only happens to direct uses by instructions. - if (Instruction *User = dyn_cast(*UI)) { - DSGraph &DSG = getOrCreateGraph(User->getParent()->getParent()); - if (!DSG.getScalarMap().count(GI)) { - // If this global does not exist in the graph, but it is immediately - // used by an instruction in the graph, clone it over from the - // globals graph. - ReachabilityCloner RC(DSG, *GlobalsGraph, 0); - RC.getClonedNH(GlobalsGraph->getNodeForValue(GI)); - } - } - - return false; -} - - -// buildIndirectFunctionSets - Iterate over the module looking for indirect -// calls to functions. If a call site can invoke any functions [F1, F2... FN], -// unify the N functions together in the FuncECs set. -// -void EquivClassGraphs::buildIndirectFunctionSets(Module &M) { - // Loop over all of the indirect calls in the program. If a call site can - // call multiple different functions, we need to unify all of the callees into - // the same equivalence class. - std::vector keys; - callee_get_keys(keys); - - for (std::vector::iterator ii = keys.begin(), ee = keys.end(); - ii != ee; ++ii) { - const Function* F = 0; - for (callee_iterator csi = callee_begin(*ii), cse = callee_end(*ii); - csi != cse; ++csi) { - if (F != *csi) { - F = *csi; - FuncECs.insert(*csi); - const Function *thisFunc = (*ii)->getParent()->getParent(); - DSGraph &TFG = getOrCreateGraph(thisFunc); - DSNode *calleeNode = TFG.getNodeForValue((*ii)->getOperand(0)).getNode(); - OneCalledFunction[calleeNode] = *csi; - } else { - FuncECs.unionSets(*csi, F); - } - } - - // Now include all functions that share a graph with any function in the - // equivalence class. More precisely, if F is in the class, and G(F) is - // its graph, then we include all other functions that are also in G(F). - // Currently, that is just the functions in the same call-graph-SCC as F. - // - DSGraph& funcDSGraph = getOrCreateGraph(F); - for (DSGraph::retnodes_iterator RI = funcDSGraph.retnodes_begin(), - RE = funcDSGraph.retnodes_end(); RI != RE; ++RI) - FuncECs.unionSets(F, RI->first); - } - - // Now that all of the equivalences have been built, merge the graphs for - // each equivalence class. - // - DOUT << "\nIndirect Function Equivalence Sets:\n"; - for (EquivalenceClasses::iterator EQSI = FuncECs.begin(), E = - FuncECs.end(); EQSI != E; ++EQSI) { - if (!EQSI->isLeader()) continue; - - EquivalenceClasses::member_iterator SI = - FuncECs.member_begin(EQSI); - assert(SI != FuncECs.member_end() && "Empty equiv set??"); - EquivalenceClasses::member_iterator SN = SI; - ++SN; - if (SN == FuncECs.member_end()) - continue; // Single function equivalence set, no merging to do. - - const Function* LF = *SI; - -#ifndef NDEBUG - DOUT <<" Equivalence set for leader " << LF->getName() <<" = "; - for (SN = SI; SN != FuncECs.member_end(); ++SN) - DOUT << " " << (*SN)->getName() << "," ; - DOUT << "\n"; -#endif - - // This equiv class has multiple functions: merge their graphs. First, - // clone the CBU graph for the leader and make it the common graph for the - // equivalence graph. - DSGraph &MergedG = getOrCreateGraph(LF); - - // Record the argument nodes for use in merging later below. - std::vector ArgNodes; - - for (Function::const_arg_iterator AI = LF->arg_begin(), E = LF->arg_end(); - AI != E; ++AI) - if (DS::isPointerType(AI->getType())) - ArgNodes.push_back(MergedG.getNodeForValue(AI)); - - // Merge in the graphs of all other functions in this equiv. class. Note - // that two or more functions may have the same graph, and it only needs - // to be merged in once. - std::set GraphsMerged; - GraphsMerged.insert(&getOrCreateGraph(LF)); - - for (++SI; SI != FuncECs.member_end(); ++SI) { - const Function *F = *SI; - DSGraph &CBUGraph = getOrCreateGraph(F); - if (GraphsMerged.insert(&CBUGraph).second) { - // Record the "folded" graph for the function. - for (DSGraph::retnodes_iterator I = CBUGraph.retnodes_begin(), - E = CBUGraph.retnodes_end(); I != E; ++I) - setDSGraph(*I->first, &MergedG); - - // Clone this member of the equivalence class into MergedG. - MergedG.cloneInto(CBUGraph); - } - - // Merge the return nodes of all functions together. - MergedG.getReturnNodes()[LF].mergeWith(MergedG.getReturnNodes()[F]); - - // Merge the function arguments with all argument nodes found so far. - // If there are extra function args, add them to the vector of argNodes - Function::const_arg_iterator AI2 = F->arg_begin(), AI2end = F->arg_end(); - for (unsigned arg = 0, numArgs = ArgNodes.size(); - arg != numArgs && AI2 != AI2end; ++AI2, ++arg) - if (DS::isPointerType(AI2->getType())) - ArgNodes[arg].mergeWith(MergedG.getNodeForValue(AI2)); - - for ( ; AI2 != AI2end; ++AI2) - if (DS::isPointerType(AI2->getType())) - ArgNodes.push_back(MergedG.getNodeForValue(AI2)); - DEBUG(MergedG.AssertGraphOK()); - } - } - DOUT << "\n"; -} - - -unsigned EquivClassGraphs:: -processSCC(DSGraph &FG, std::vector &Stack, unsigned &NextID, - std::map &ValMap) { - std::map::iterator It = ValMap.lower_bound(&FG); - if (It != ValMap.end() && It->first == &FG) - return It->second; - - DOUT << " ProcessSCC for function " << FG.getFunctionNames() << "\n"; - - unsigned Min = NextID++, MyID = Min; - ValMap[&FG] = Min; - Stack.push_back(&FG); - - // The edges out of the current node are the call site targets... - for (DSGraph::fc_iterator CI = FG.fc_begin(), CE = FG.fc_end(); - CI != CE; ++CI) { - Instruction *Call = CI->getCallSite().getInstruction(); - - // Loop over all of the actually called functions... - for (callee_iterator I = callee_begin(Call), E = callee_end(Call); - I != E; ++I) - if (!(*I)->isDeclaration()) { - // Process the callee as necessary. - unsigned M = processSCC(getOrCreateGraph(*I), - Stack, NextID, ValMap); - if (M < Min) Min = M; - } - } - - assert(ValMap[&FG] == MyID && "SCC construction assumption wrong!"); - if (Min != MyID) - return Min; // This is part of a larger SCC! - - // If this is a new SCC, process it now. - bool MergedGraphs = false; - while (Stack.back() != &FG) { - DSGraph *NG = Stack.back(); - ValMap[NG] = ~0U; - - // If the SCC found is not the same as those found in CBU, make sure to - // merge the graphs as appropriate. - FG.cloneInto(*NG); - - // Update the DSInfo map and delete the old graph... - for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); - I != NG->retnodes_end(); ++I) - setDSGraph(*I->first, &FG); - - // Remove NG from the ValMap since the pointer may get recycled. - ValMap.erase(NG); - delete NG; - MergedGraphs = true; - Stack.pop_back(); - } - - // Clean up the graph before we start inlining a bunch again. - if (MergedGraphs) - FG.removeTriviallyDeadNodes(); - - Stack.pop_back(); - - processGraph(FG); - ValMap[&FG] = ~0U; - return MyID; -} - - -/// processGraph - Process the CBU graphs for the program in bottom-up order on -/// the SCC of the __ACTUAL__ call graph. This builds final folded CBU graphs. -void EquivClassGraphs::processGraph(DSGraph &G) { - DOUT << " ProcessGraph for function " << G.getFunctionNames() << "\n"; - - hash_set calls; - - // Else we need to inline some callee graph. Visit all call sites. - // The edges out of the current node are the call site targets... - unsigned i = 0; - for (DSGraph::fc_iterator CI = G.fc_begin(), CE = G.fc_end(); CI != CE; - ++CI, ++i) { - const DSCallSite &CS = *CI; - Instruction *TheCall = CS.getCallSite().getInstruction(); - - assert(calls.insert(TheCall).second && - "Call instruction occurs multiple times in graph??"); - - if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) - continue; - - // Inline the common callee graph into the current graph, if the callee - // graph has not changed. Note that all callees should have the same - // graph so we only need to do this once. - // - DSGraph* CalleeGraph = NULL; - callee_iterator I = callee_begin(TheCall), E = callee_end(TheCall); - unsigned TNum, Num; - - // Loop over all potential callees to find the first non-external callee. - for (TNum = 0, Num = std::distance(I, E); I != E; ++I, ++TNum) - if (!(*I)->isDeclaration()) - break; - - // Now check if the graph has changed and if so, clone and inline it. - if (I != E) { - const Function *CalleeFunc = *I; - - // Merge the callee's graph into this graph, if not already the same. - // Callees in the same equivalence class (which subsumes those - // in the same SCCs) have the same graph. Note that all recursion - // including self-recursion have been folded in the equiv classes. - // - CalleeGraph = &getOrCreateGraph(CalleeFunc); - if (CalleeGraph != &G) { - ++NumFoldGraphInlines; - G.mergeInGraph(CS, *CalleeFunc, *CalleeGraph, - DSGraph::StripAllocaBit | - DSGraph::DontCloneCallNodes | - DSGraph::DontCloneAuxCallNodes); - DOUT << " Inlining graph [" << i << "/" - << G.getFunctionCalls().size()-1 - << ":" << TNum << "/" << Num-1 << "] for " - << CalleeFunc->getName() << "[" - << CalleeGraph->getGraphSize() << "+" - << CalleeGraph->getAuxFunctionCalls().size() - << "] into '" /*<< G.getFunctionNames()*/ << "' [" - << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size() - << "]\n"; - } - } - -#ifndef NDEBUG - // Now loop over the rest of the callees and make sure they have the - // same graph as the one inlined above. - if (CalleeGraph) - for (++I, ++TNum; I != E; ++I, ++TNum) - if (!(*I)->isDeclaration()) - assert(CalleeGraph == &getOrCreateGraph(*I) && - "Callees at a call site have different graphs?"); -#endif - } - - // Recompute the Incomplete markers. - G.maskIncompleteMarkers(); - G.markIncompleteNodes(DSGraph::MarkFormalArgs); - - // Delete dead nodes. Treat globals that are unreachable but that can - // reach live nodes as live. - G.removeDeadNodes(DSGraph::KeepUnreachableGlobals); - - // When this graph is finalized, clone the globals in the graph into the - // globals graph to make sure it has everything, from all graphs. - ReachabilityCloner RC(*G.getGlobalsGraph(), G, DSGraph::StripAllocaBit); - - // Clone everything reachable from globals in the function graph into the - // globals graph. - DSScalarMap &MainSM = G.getScalarMap(); - for (DSScalarMap::global_iterator I = MainSM.global_begin(), - E = MainSM.global_end(); I != E; ++I) - RC.getClonedNH(MainSM[*I]); - - DOUT << " -- DONE ProcessGraph for function " << G.getFunctionNames() <<"\n"; -} Modified: poolalloc/trunk/lib/DSA/Printer.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/Printer.cpp (original) +++ poolalloc/trunk/lib/DSA/Printer.cpp Sat Oct 11 11:52:04 2008 @@ -358,10 +358,3 @@ if (DontPrintAnything) return; printCollection(*this, O, M, "cbu."); } - - -void EquivClassGraphs::print(std::ostream &O, const Module *M) const { - if (DontPrintAnything) return; - printCollection(*this, O, M, "eq."); -} - Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original) +++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Sat Oct 11 11:52:04 2008 @@ -164,7 +164,7 @@ } bool StdLibDataStructures::runOnModule(Module &M) { - init(&getAnalysis(), false, true); + init(&getAnalysis(), false, true, false); //Clone Module for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original) +++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Sat Oct 11 11:52:04 2008 @@ -61,7 +61,7 @@ // program. // bool TDDataStructures::runOnModule(Module &M) { - init(&getAnalysis(), true, true); + init(&getAnalysis(), true, true, true); // Figure out which functions must not mark their arguments complete because // they are accessible outside this compilation unit. Currently, these Modified: poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp Sat Oct 11 11:52:04 2008 @@ -27,7 +27,7 @@ /// descriptor loaded from. class PoolAccessTrace : public ModulePass { PoolAllocate *PoolAlloc; - EquivClassGraphs *ECG; + DataStructures *G; Constant *AccessTraceInitFn, *PoolAccessTraceFn; const Type *VoidPtrTy; public: @@ -39,7 +39,7 @@ void getAnalysisUsage(AnalysisUsage &AU) const; const DSGraph &getGraphForFunc(PA::FuncInfo *FI) const { - return ECG->getDSGraph(FI->F); + return G->getDSGraph(FI->F); } static char ID; @@ -59,7 +59,7 @@ AU.addRequired(); // Need information from DSA. - AU.addRequired(); + AU.addRequired(); } void PoolAccessTrace::InitializeLibraryFunctions(Module &M) { @@ -100,7 +100,7 @@ bool PoolAccessTrace::runOnModule(Module &M) { PoolAlloc = &getAnalysis(); - ECG = &getAnalysis(); + G = &getAnalysis(); // Create the function prototypes for runtime library. InitializeLibraryFunctions(M); @@ -124,7 +124,7 @@ continue; // Get the DSGraph for this function. - DSGraph &DSG = ECG->getDSGraph(FI->F); + DSGraph &DSG = G->getDSGraph(FI->F); for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Sat Oct 11 11:52:04 2008 @@ -73,9 +73,9 @@ void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); - AU.addRequiredTransitive(); + AU.addRequiredTransitive(); - AU.addPreserved(); + AU.addPreserved(); AU.setPreservesAll(); } @@ -100,9 +100,9 @@ bool PoolAllocateSimple::runOnModule(Module &M) { if (M.begin() == M.end()) return false; - // Get the Target Data information and the ECGraphs - ECGraphs = &getAnalysis(); // folded inlined CBU graphs - assert (ECGraphs && "No ECGraphs pass available!\n"); + // Get the Target Data information and the Graphs + Graphs = &getAnalysis(); // folded inlined CBU graphs + assert (Graphs && "No ECGraphs pass available!\n"); TargetData & TD = getAnalysis(); // Add the pool* prototypes to the module @@ -120,14 +120,14 @@ // // Merge all of the DSNodes in the DSGraphs. // - GlobalECs = ECGraphs->getGlobalECs(); - CombinedDSGraph = new DSGraph (GlobalECs, TD, &(ECGraphs->getGlobalsGraph())); + GlobalECs = Graphs->getGlobalECs(); + CombinedDSGraph = new DSGraph (GlobalECs, TD, &(Graphs->getGlobalsGraph())); //CombinedDSGraph.cloneInto (getGlobalsGraph()); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { - if (ECGraphs->hasDSGraph (*I)) - CombinedDSGraph->cloneInto (ECGraphs->getDSGraph(*I)); + if (Graphs->hasDSGraph (*I)) + CombinedDSGraph->cloneInto (Graphs->getDSGraph(*I)); } - CombinedDSGraph->cloneInto (ECGraphs->getGlobalsGraph()); + CombinedDSGraph->cloneInto (Graphs->getGlobalsGraph()); MergeNodesInDSGraph (*CombinedDSGraph); // @@ -161,7 +161,7 @@ // // Get the DSGraph for this function. // - DSGraph &ECG = ECGraphs->getDSGraph(F); + DSGraph &ECG = Graphs->getDSGraph(F); for (Function::iterator i = F.begin(), e = F.end(); i != e; ++i) for (BasicBlock::iterator ii = i->begin(), ee = i->end(); ii != ee; ++ii) { Modified: poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp Sat Oct 11 11:52:04 2008 @@ -95,7 +95,7 @@ /// data structures to reduce the size of pointers in the program. class PointerCompress : public ModulePass { PoolAllocate *PoolAlloc; - EquivClassGraphs *ECG; + CompleteBUDataStructures *ECG; /// ClonedFunctionMap - Every time we clone a function to compress its /// arguments, keep track of the clone and which arguments are compressed. @@ -918,7 +918,7 @@ void InstructionRewriter::visitCallInst(CallInst &CI) { - if (Function *F = CI.getCalledFunction()) + if (Function *F = CI.getCalledFunction()) { // These functions are handled specially. if (F->getName() == "poolinit") { visitPoolInit(CI); @@ -930,7 +930,8 @@ visitPoolAlloc(CI); return; } - + } + // Normal function call: check to see if this call produces or uses a pointer // into a compressed pool. If so, we will need to transform the callee or use // a previously transformed version. @@ -1136,7 +1137,7 @@ AU.addRequired(); // Need information from DSA. - AU.addRequired(); + AU.addRequired(); } /// PoolIsCompressible - Return true if we can pointer compress this node. @@ -1190,7 +1191,7 @@ // Ignore potential pools that the pool allocation heuristic decided not to // pool allocated. - if (!isa(FI->PoolDescriptors[N])) + if (!isa(FI->PoolDescriptors[N])) { if (PoolIsCompressible(N)) { Pools.insert(N); ++NumCompressed; @@ -1198,6 +1199,7 @@ DEBUG(std::cerr << "PCF: "; N->dump()); ++NumNotCompressed; } + } } // If there are no compressed global pools, don't bother to look for them. @@ -1482,7 +1484,7 @@ // Ignore potential pools that the pool allocation heuristic decided not to // pool allocated. - if (!isa(I->second)) + if (!isa(I->second)) { if (PoolIsCompressible(N)) { CompressedGlobalPools.insert(std::make_pair(N, cast(I->second))); @@ -1491,6 +1493,7 @@ DEBUG(std::cerr << "PCF: "; N->dump()); ++NumNotCompressed; } + } } } @@ -1512,7 +1515,7 @@ bool PointerCompress::runOnModule(Module &M) { PoolAlloc = &getAnalysis(); - ECG = &getAnalysis(); + ECG = &getAnalysis(); if (SmallIntCompress) MEMUINTTYPE = Type::Int16Ty; Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Sat Oct 11 11:52:04 2008 @@ -85,35 +85,26 @@ DisablePoolFreeOpt("poolalloc-force-all-poolfrees", cl::desc("Do not try to elide poolfree's where possible")); - cl::opt - UseTDResolve("poolalloc-usetd-resolve", - cl::desc("Use Top-Down Graph as a resolve source")); } void PoolAllocate::getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredTransitive(); - AU.addPreserved(); + AU.addRequiredTransitive(); + AU.addPreserved(); // Preserve the pool information across passes if (SAFECodeEnabled) AU.setPreservesAll(); AU.addRequired(); - if (UseTDResolve) - AU.addRequired(); } bool PoolAllocate::runOnModule(Module &M) { if (M.begin() == M.end()) return false; CurModule = &M; - ECGraphs = &getAnalysis(); // folded inlined CBU graphs - if (UseTDResolve) - CTF = &getAnalysis(); - else - CTF = 0; + Graphs = &getAnalysis(); // folded inlined CBU graphs CurHeuristic = Heuristic::create(); - CurHeuristic->Initialize(M, ECGraphs->getGlobalsGraph(), *this); + CurHeuristic->Initialize(M, Graphs->getGlobalsGraph(), *this); // Add the pool* prototypes to the module AddPoolPrototypes(&M); @@ -125,7 +116,7 @@ // Loop over the functions in the original program finding the pool desc. // arguments necessary for each function that is indirectly callable. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (!I->isDeclaration() && ECGraphs->hasDSGraph(*I)) + if (!I->isDeclaration() && Graphs->hasDSGraph(*I)) FindFunctionPoolArgs(*I); std::map FuncMap; @@ -138,7 +129,7 @@ {TIME_REGION(X, "MakeFunctionClone"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && !ClonedFunctions.count(I) && - ECGraphs->hasDSGraph(*I)) + Graphs->hasDSGraph(*I)) if (Function *Clone = MakeFunctionClone(*I)) { FuncMap[I] = Clone; ClonedFunctions.insert(Clone); @@ -150,7 +141,7 @@ {TIME_REGION(X, "ProcessFunctionBody"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && !ClonedFunctions.count(I) && - ECGraphs->hasDSGraph(*I)) { + Graphs->hasDSGraph(*I)) { std::map::iterator FI = FuncMap.find(I); ProcessFunctionBody(*I, FI != FuncMap.end() ? *FI->second : *I); } @@ -344,7 +335,7 @@ /// arguments will have to be added for each function, build the FunctionInfo /// map and recording this info in the ArgNodes set. void PoolAllocate::FindFunctionPoolArgs(Function &F) { - DSGraph &G = ECGraphs->getDSGraph(F); + DSGraph &G = Graphs->getDSGraph(F); // Create a new entry for F. FuncInfo &FI = @@ -367,7 +358,7 @@ // necessary, and return it. If not, just return null. // Function *PoolAllocate::MakeFunctionClone(Function &F) { - DSGraph &G = ECGraphs->getDSGraph(F); + DSGraph &G = Graphs->getDSGraph(F); if (G.node_begin() == G.node_end()) return 0; FuncInfo &FI = *getFuncInfo(F); @@ -472,7 +463,7 @@ // bool PoolAllocate::SetupGlobalPools(Module &M) { // Get the globals graph for the program. - DSGraph &GG = ECGraphs->getGlobalsGraph(); + DSGraph &GG = Graphs->getGlobalsGraph(); // Get all of the nodes reachable from globals. hash_set GlobalHeapNodes; @@ -558,7 +549,7 @@ CurModule); // Update the global DSGraph to include this. - DSNode *GNode = ECGraphs->getGlobalsGraph().addObjectToGraph(GV); + DSNode *GNode = Graphs->getGlobalsGraph().addObjectToGraph(GV); GNode->setModifiedMarker()->setReadMarker(); Function *MainFunc = CurModule->getFunction("main"); @@ -648,7 +639,7 @@ // the specified function. // void PoolAllocate::ProcessFunctionBody(Function &F, Function &NewF) { - DSGraph &G = ECGraphs->getDSGraph(F); + DSGraph &G = Graphs->getDSGraph(F); if (G.node_begin() == G.node_end()) return; // Quick exit if nothing to do. @@ -658,7 +649,7 @@ // Calculate which DSNodes are reachable from globals. If a node is reachable // from a global, we will create a global pool for it, so no argument passage // is required. - ECGraphs->getGlobalsGraph(); + Graphs->getGlobalsGraph(); // Map all node reachable from this global to the corresponding nodes in // the globals graph. @@ -670,7 +661,7 @@ for (DSGraph::node_iterator I = G.node_begin(), E = G.node_end(); I != E;++I){ // We only need to make a pool if there is a heap object in it... DSNode *N = I; - if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArray()))) + if ((N->isHeapNode()) || (BoundsChecksEnabled && (N->isArray()))) { if (GlobalsGraphNodeMapping.count(N)) { // If it is a global pool, set up the pool descriptor appropriately. DSNode *GGN = GlobalsGraphNodeMapping[N].getNode(); @@ -682,6 +673,7 @@ assert(!N->isGlobalNode() && "Should be in global mapping!"); FI.NodesToPA.push_back(N); } + } } if (!FI.NodesToPA.empty()) { Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=57375&r1=57374&r2=57375&view=diff ============================================================================== --- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original) +++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Sat Oct 11 11:52:04 2008 @@ -556,7 +556,7 @@ // If this function is one of the memory manipulating functions built into // libc, emulate it with pool calls as appropriate. - if (CF && CF->isDeclaration()) + if (CF && CF->isDeclaration()) { if (CF->getName() == "calloc") { visitCallocCall(CS); return; @@ -576,6 +576,7 @@ std::cerr << "VALLOC USED BUT NOT HANDLED!\n"; abort(); } + } // We need to figure out which local pool descriptors correspond to the pool // descriptor arguments passed into the function call. Calculate a mapping @@ -583,7 +584,7 @@ // between the graphs to figure out which pool descriptors need to be passed // in. The roots of this mapping is found from arguments and return values. // - EquivClassGraphs& ECGraphs = PAInfo.getECGraphs(); + DataStructures& Graphs = PAInfo.getGraphs(); DSGraph::NodeMapTy NodeMapping; Instruction *NewCall; Value *NewCallee; @@ -602,8 +603,8 @@ NewCallee = CFI->Clone; ArgNodes = CFI->ArgNodes; - assert ((ECGraphs.hasDSGraph (*CF)) && "Function has no ECGraph!\n"); - CalleeGraph = &ECGraphs.getDSGraph(*CF); + assert ((Graphs.hasDSGraph (*CF)) && "Function has no ECGraph!\n"); + CalleeGraph = &Graphs.getDSGraph(*CF); } else { DEBUG(std::cerr << " Handling indirect call: " << *TheCall); @@ -614,28 +615,24 @@ // in CS back to the original call instruction.) Instruction *OrigInst = cast(getOldValueIfAvailable(CS.getInstruction())); - CF = isa(OrigInst)? - ECGraphs.getSomeCalleeForCallSite(cast(OrigInst)) : - ECGraphs.getSomeCalleeForCallSite(cast(OrigInst)); - - if (!CF) - for (EquivClassGraphs::callee_iterator I = ECGraphs.callee_begin(OrigInst), - E = ECGraphs.callee_end(OrigInst); I != E; ++I) { - CF = *I; - break; - } + + for (DataStructures::callee_iterator I = Graphs.callee_begin(OrigInst), + E = Graphs.callee_end(OrigInst); I != E; ++I) { + CF = *I; + break; + } // If we didn't find the callee in the constructed call graph, try // checking in the DSNode itself. // This isn't ideal as it means that this call site didn't have inlining // happen. if (!CF) { - DSGraph* dg = &ECGraphs.getDSGraph(*OrigInst->getParent()->getParent()); + DSGraph* dg = &Graphs.getDSGraph(*OrigInst->getParent()->getParent()); DSNode* d = dg->getNodeForValue(OrigInst->getOperand(0)).getNode(); const std::vector &g = d->getGlobalsList(); for(std::vector::const_iterator ii = g.begin(), ee = g.end(); !CF && ii != ee; ++ii) { - EquivalenceClasses< const GlobalValue *> & EC = ECGraphs.getGlobalECs(); + EquivalenceClasses< const GlobalValue *> & EC = Graphs.getGlobalECs(); for (EquivalenceClasses::member_iterator MI = EC.findLeader(*ii); MI != EC.member_end(); ++MI) // Loop over members in this set. if ((CF = dyn_cast(*MI))) { @@ -664,15 +661,15 @@ } // Get the common graph for the set of functions this call may invoke. - CalleeGraph = &ECGraphs.getDSGraph(*CF); + CalleeGraph = &Graphs.getDSGraph(*CF); #ifndef NDEBUG // Verify that all potential callees at call site have the same DS graph. - EquivClassGraphs::callee_iterator I = - ECGraphs.callee_begin(OrigInst), E = ECGraphs.callee_end(OrigInst); + DataStructures::callee_iterator I = + Graphs.callee_begin(OrigInst), E = Graphs.callee_end(OrigInst); for (; I != E; ++I) if (!(*I)->isDeclaration()) - assert(CalleeGraph == &ECGraphs.getDSGraph(**I) && + assert(CalleeGraph == &Graphs.getDSGraph(**I) && "Callees at call site do not have a common graph!"); #endif From clattner at apple.com Sat Oct 11 12:28:31 2008 From: clattner at apple.com (Chris Lattner) Date: Sat, 11 Oct 2008 10:28:31 -0700 Subject: [llvm-commits] [llvm] r57373 - /llvm/trunk/lib/VMCore/IntrinsicInst.cpp In-Reply-To: <6a8523d60810102352x5e5bff75hc8e392751314509a@mail.gmail.com> References: <200810110640.m9B6evUW029172@zion.cs.uiuc.edu> <6a8523d60810102352x5e5bff75hc8e392751314509a@mail.gmail.com> Message-ID: On Oct 10, 2008, at 11:52 PM, Daniel Dunbar wrote: > Tanya, > > Can you add this to the 2.4 branch. It is an innocuous and obvious > bug fix. Pasto > in > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?view=diff&r1=52890&r2=52891 > > Sorry for being late to the 2.4 party... Looks fine to me for 2.4, -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20081011/d48ee7c7/attachment.html From sabre at nondot.org Sat Oct 11 13:18:29 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 18:18:29 -0000 Subject: [llvm-commits] [llvm] r57376 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810111818.m9BIIUCL032563@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 13:18:28 2008 New Revision: 57376 URL: http://llvm.org/viewvc/llvm-project?rev=57376&view=rev Log: Strip out 2.3 info, make space for 2.4 info. I'd appreciate it if various component owners could look through and update their areas in the known-problems section. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57376&r1=57375&r2=57376&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sat Oct 11 13:18:28 2008 @@ -1,15 +1,14 @@ - - LLVM 2.3 Release Notes + LLVM 2.4 Release Notes -
      LLVM 2.3 Release Notes
      +
      LLVM 2.4 Release Notes
      1. Introduction
      2. @@ -36,7 +35,7 @@

        This document contains the release notes for the LLVM compiler -infrastructure, release 2.3. Here we describe the status of LLVM, including +infrastructure, release 2.4. Here we describe the status of LLVM, including major improvements from the previous release and any known problems. All LLVM releases may be downloaded from the LLVM releases web site.

        @@ -62,12 +61,12 @@
        -

        This is the fourteenth public release of the LLVM Compiler Infrastructure. -It includes a large number of features and refinements from LLVM 2.2.

        +

        This is the fifteenth public release of the LLVM Compiler Infrastructure. +It includes a large number of features and refinements from LLVM 2.3.

        -
        -

        LLVM 2.3 no longer supports llvm-gcc 4.0, it has been replaced with - llvm-gcc 4.2.

        - -

        LLVM 2.3 no longer includes the llvm-upgrade tool. It was useful - for upgrading LLVM 1.9 files to LLVM 2.x syntax, but you can always use a - previous LLVM release to do this. One nice impact of this is that the LLVM - regression test suite no longer depends on llvm-upgrade, which makes it run - faster.

        - -

        The llvm2cpp tool has been folded into llc, use - llc -march=cpp instead of llvm2cpp.

        +

        ....

        LLVM API Changes:

          -
        • Several core LLVM IR classes have migrated to use the - 'FOOCLASS::Create(...)' pattern instead of 'new - FOOCLASS(...)' (e.g. where FOOCLASS=BasicBlock). We hope to - standardize on FOOCLASS::Create for all IR classes in the future, - but not all of them have been moved over yet.
        • -
        • LLVM 2.3 renames the LLVMBuilder and LLVMFoldingBuilder classes to - IRBuilder. -
        • -
        • MRegisterInfo was renamed to - - TargetRegisterInfo.
        • -
        • The MappedFile class is gone, please use - - MemoryBuffer instead.
        • -
        • The '-enable-eh' flag to llc has been removed. Now code should - encode whether it is safe to omit unwind information for a function by - tagging the Function object with the 'nounwind' attribute.
        • -
        • The ConstantFP::get method that uses APFloat now takes one argument - instead of two. The type argument has been removed, and the type is - now inferred from the size of the given APFloat value.
        • - +
        • ....
        @@ -126,12 +95,12 @@

        -The core LLVM 2.3 distribution currently consists of code from the core LLVM +The core LLVM 2.4 distribution currently consists of code from the core LLVM repository (which roughly contains the LLVM optimizer, code generators and supporting tools) and the llvm-gcc repository. In addition to this code, the LLVM Project includes other sub-projects that are in development. The two which -are the most actively developed are the new vmkit Project -and the Clang Project. +are the most actively developed are the Clang Project and +vmkit Project.

        @@ -142,28 +111,11 @@

        -The "vmkit" project is a new addition to the LLVM family. It is an -implementation of a JVM and a CLI Virtual Machines (Microsoft .NET is an +The "vmkit" project is an implementation of +a JVM and a CLI Virtual Machines (Microsoft .NET is an implementation of the CLI) using the Just-In-Time compiler of LLVM.

        -

        The JVM, called JnJVM, executes real-world applications such as Apache -projects (e.g. Felix and Tomcat) and the SpecJVM98 benchmark. It uses the GNU -Classpath project for the base classes. The CLI implementation, called N3, is -its in early stages but can execute simple applications and the "pnetmark" -benchmark. It uses the pnetlib project as its core library.

        - -

        The 'vmkit' VMs compare in performance with industrial and top open-source -VMs on scientific applications. Besides the JIT, the VMs use many features of -the LLVM framework, including the standard set of optimizations, atomic -operations, custom function provider and memory manager for JITed methods, and -specific virtual machine optimizations. vmkit is not an official part of LLVM -2.3 release. It is publicly available under the LLVM license and can be -downloaded from: -

        - -
        -
        svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit
        -
        +

        ...

        @@ -182,12 +134,12 @@ yet production quality, it is progressing very nicely. In addition, C++ front-end work has started to make significant progress.

        -

        At this point, Clang is most useful if you are interested in source-to-source -transformations (such as refactoring) and other source-level tools for C and -Objective-C. Clang now also includes tools for turning C code into pretty HTML, -and includes a new static -analysis tool in development. This tool focuses on automatically finding -bugs in C and Objective-C code.

        +

        Codegen progress/state +

        + +

        +static analysis tool +

        @@ -200,7 +152,7 @@
        -

        LLVM 2.3 includes a huge number of bug fixes, performance tweaks and minor +

        LLVM 2.4 includes a huge number of bug fixes, performance tweaks and minor improvements. Some of the major improvements and new features are listed in this section.

        @@ -213,52 +165,18 @@
        -

        LLVM 2.3 includes several major new capabilities:

        +

        LLVM 2.4 includes several major new capabilities:

          -
        • The biggest change in LLVM 2.3 is Multiple Return Value (MRV) support. - MRVs allow LLVM IR to directly represent functions that return multiple - values without having to pass them "by reference" in the LLVM IR. This - allows a front-end to generate more efficient code, as MRVs are generally - returned in registers if a target supports them. See the LLVM IR Reference for more details.

          +
        • +

          MRVs got generalized to FCAs.

          +
        • + +
        • fast isel, -O0 compile times

        • -

          MRVs are fully supported in the LLVM IR, but are not yet fully supported in - on all targets. However, it is generally safe to return up to 2 values from - a function: most targets should be able to handle at least that. MRV - support is a critical requirement for X86-64 ABI support, as X86-64 requires - the ability to return multiple registers from functions, and we use MRVs to - accomplish this in a direct way.

          - -
        • LLVM 2.3 includes a complete reimplementation of the "llvmc" - tool. It is designed to overcome several problems with the original - llvmc and to provide a superset of the features of the - 'gcc' driver.

          - -

          The main features of llvmc2 are: -

            -
          • Extended handling of command line options and smart rules for - dispatching them to different tools.
          • -
          • Flexible (and extensible) rules for defining different tools.
          • -
          • The different intermediate steps performed by tools are represented - as edges in the abstract graph.
          • -
          • The 'language' for driver behavior definition is tablegen and thus - it's relatively easy to add new features.
          • -
          • The definition of driver is transformed into set of C++ classes, thus - no runtime interpretation is needed.
          • -
          -
        • +
        • Attrs changes?

        • -
        • LLVM 2.3 includes a completely rewritten interface for Link Time Optimization. This interface - is written in C, which allows for easier integration with C code bases, and - incorporates improvements we learned about from the first incarnation of the - interface.

        • - -
        • The Kaleidoscope tutorial now - includes a "port" of the tutorial that uses the Ocaml bindings to implement - the Kaleidoscope language.

        • +
        • ...

        @@ -272,19 +190,12 @@
        -

        LLVM 2.3 fully supports the llvm-gcc 4.2 front-end, and includes support +

        LLVM 2.4 fully supports the llvm-gcc 4.2 front-end, and includes support for the C, C++, Objective-C, Ada, and Fortran front-ends.

          -
        • llvm-gcc 4.2 includes numerous fixes to better support the Objective-C -front-end. Objective-C now works very well on Mac OS/X.
        • - -
        • Fortran EQUIVALENCEs are now supported by the gfortran -front-end.
        • - -
        • llvm-gcc 4.2 includes many other fixes which improve conformance with the -relevant parts of the GCC testsuite.
        • +
        • ...
        @@ -301,17 +212,7 @@

          -
        • LLVM IR now directly represents "common" linkage, instead of representing it -as a form of weak linkage.
        • - -
        • LLVM IR now has support for atomic operations, and this functionality can be -accessed through the llvm-gcc "__sync_synchronize", -"__sync_val_compare_and_swap", and related builtins. Support for -atomics are available in the Alpha, X86, X86-64, and PowerPC backends.
        • - -
        • The C and Ocaml bindings have extended to cover pass managers, several -transformation passes, iteration over the LLVM IR, target data, and parameter -attribute lists.
        • +
        • ...
        @@ -324,64 +225,11 @@

        In addition to a huge array of bug fixes and minor performance tweaks, the -LLVM 2.3 optimizers support a few major enhancements:

        +LLVM 2.4 optimizers support a few major enhancements:

          -
        • Loop index set splitting on by default. -This transformation hoists conditions from loop bodies and reduces a loop's -iteration space to improve performance. For example,

          - -
          -
          -for (i = LB; i < UB; ++i)
          -  if (i <= NV)
          -    LOOP_BODY
          -
          -
          - -

          is transformed into:

          - -

          -
          -NUB = min(NV+1, UB)
          -for (i = LB; i < NUB; ++i)
          -  LOOP_BODY
          -
          -
          -

          -
        • - -
        • LLVM now includes a new memcpy optimization pass which removes -dead memcpy calls, unneeded copies of aggregates, and performs -return slot optimization. The LLVM optimizer now notices long sequences of -consecutive stores and merges them into memcpy's where profitable.
        • - -
        • Alignment detection for vector memory references and for memcpy and -memset is now more aggressive.
        • - -
        • The Aggressive Dead Code Elimination (ADCE) optimization has been rewritten -to make it both faster and safer in the presence of code containing infinite -loops. Some of its prior functionality has been factored out into the loop -deletion pass, which is safe for infinite loops. The new ADCE pass is -no longer based on control dependence, making it run faster.
        • - -
        • The 'SimplifyLibCalls' pass, which optimizes calls to libc and libm - functions for C-based languages, has been rewritten to be a FunctionPass - instead a ModulePass. This allows it to be run more often and to be - included at -O1 in llvm-gcc. It was also extended to include more - optimizations and several corner case bugs were fixed.
        • - -
        • LLVM now includes a simple 'Jump Threading' pass, which attempts to simplify - conditional branches using information about predecessor blocks, simplifying - the control flow graph. This pass is pretty basic at this point, but - catches some important cases and provides a foundation to build on.
        • - -
        • Several corner case bugs which could lead to deleting volatile memory - accesses have been fixed.
        • - -
        • Several optimizations have been sped up, leading to faster code generation - with the same code quality.
        • +
        • .
        @@ -399,45 +247,9 @@ faster:

          -
        • The code generator now has support for carrying information about memory - references throughout the entire code generation process, via the - - MachineMemOperand class. In the future this will be used to improve - both pre-pass and post-pass scheduling, and to improve compiler-debugging - output.
        • - -
        • The target-independent code generator infrastructure now uses LLVM's - APInt - class to handle integer values, which allows it to support integer types - larger than 64 bits (for example i128). Note that support for such types is - also dependent on target-specific support. Use of APInt is also a step - toward support for non-power-of-2 integer sizes.
        • - -
        • LLVM 2.3 includes several compile time speedups for code with large basic - blocks, particularly in the instruction selection phase, register - allocation, scheduling, and tail merging/jump threading.
        • - -
        • LLVM 2.3 includes several improvements which make llc's - --view-sunit-dags visualization of scheduling dependency graphs - easier to understand.
        • - -
        • The code generator allows targets to write patterns that generate subreg - references directly in .td files now.
        • - -
        • memcpy lowering in the backend is more aggressive, particularly for - memcpy calls introduced by the code generator when handling - pass-by-value structure argument copies.
        • - -
        • Inline assembly with multiple register results now returns those results - directly in the appropriate registers, rather than going through memory. - Inline assembly that uses constraints like "ir" with immediates now use the - 'i' form when possible instead of always loading the value in a register. - This saves an instruction and reduces register use.
        • - -
        • Added support for PIC/GOT style tail calls on X86/32 and initial - support for tail calls on PowerPC 32 (it may also work on PowerPC 64 but is - not thoroughly tested).
        • +
        • Selection dag speedups
        • +
        • ...
        • +
        @@ -453,48 +265,7 @@

          -
        • llvm-gcc's X86-64 ABI conformance is far improved, particularly in the - area of passing and returning structures by value. llvm-gcc compiled code - now interoperates very well on X86-64 systems with other compilers.
        • - -
        • Support for Win64 was added. This includes code generation itself, JIT - support, and necessary changes to llvm-gcc.
        • - -
        • The LLVM X86 backend now supports the support SSE 4.1 instruction set, and - the llvm-gcc 4.2 front-end supports the SSE 4.1 compiler builtins. Various - generic vector operations (insert/extract/shuffle) are much more efficient - when SSE 4.1 is enabled. The JIT automatically takes advantage of these - instructions, but llvm-gcc must be explicitly told to use them, e.g. with - -march=penryn.
        • - -
        • The X86 backend now does a number of optimizations that aim to avoid - converting numbers back and forth from SSE registers to the X87 floating - point stack. This is important because most X86 ABIs require return values - to be on the X87 Floating Point stack, but most CPUs prefer computation in - the SSE units.
        • - -
        • The X86 backend supports stack realignment, which is particularly useful for - vector code on OS's without 16-byte aligned stacks, such as Linux and - Windows.
        • - -
        • The X86 backend now supports the "sseregparm" options in GCC, which allow - functions to be tagged as passing floating point values in SSE - registers.
        • - -
        • Trampolines (taking the address of a nested function) now work on - Linux/X86-64.
        • - -
        • __builtin_prefetch is now compiled into the appropriate prefetch - instructions instead of being ignored.
        • - -
        • 128-bit integers are now supported on X86-64 targets. This can be used - through __attribute__((TImode)) in llvm-gcc.
        • - -
        • The register allocator can now rematerialize PIC-base computations, which is - an important optimization for register use.
        • - -
        • The "t" and "f" inline assembly constraints for the X87 floating point stack - now work. However, the "u" constraint is still not fully supported.
        • +
        • ...
        @@ -510,9 +281,7 @@

          -
        • The LLVM C backend now supports vector code.
        • -
        • The Cell SPU backend includes a number of improvements. It generates better - code and its stability/completeness is improving.
        • +
        • ....
        @@ -529,10 +298,7 @@

          -
        • LLVM now builds with GCC 4.3.
        • -
        • Bugpoint now supports running custom scripts (with the -run-custom - option) to determine how to execute the command and whether it is making - forward process.
        • +
        • ...
        From asl at math.spbu.ru Sat Oct 11 13:27:01 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 11 Oct 2008 18:27:01 -0000 Subject: [llvm-commits] [llvm] r57377 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810111827.m9BIR1q8000362@zion.cs.uiuc.edu> Author: asl Date: Sat Oct 11 13:27:00 2008 New Revision: 57377 URL: http://llvm.org/viewvc/llvm-project?rev=57377&view=rev Log: We do support PIC on x86-64/linux Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57377&r1=57376&r2=57377&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sat Oct 11 13:27:00 2008 @@ -391,8 +391,6 @@ to several bugs due to lack of support for the 'u' inline assembly constraint and X87 floating point inline assembly. -
      3. The X86-64 backend does not yet support position-independent code (PIC) - generation on Linux targets.
      4. The X86-64 backend does not yet support the LLVM IR instruction va_arg. Currently, the llvm-gcc front-end supports variadic argument constructs on X86-64 by lowering them manually.
      5. From asl at math.spbu.ru Sat Oct 11 13:27:17 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 11 Oct 2008 18:27:17 -0000 Subject: [llvm-commits] [llvm] r57378 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810111827.m9BIRH7J000380@zion.cs.uiuc.edu> Author: asl Date: Sat Oct 11 13:27:16 2008 New Revision: 57378 URL: http://llvm.org/viewvc/llvm-project?rev=57378&view=rev Log: Note EH stuff for x86-64/linux Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57378&r1=57377&r2=57378&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sat Oct 11 13:27:16 2008 @@ -265,6 +265,7 @@

          +
        • Exception handling is supported by default on x86-64 linux platform.
        • ...
        @@ -529,9 +530,8 @@ itself, Qt, Mozilla, etc.

          -
        • Exception handling works well on the X86 and PowerPC targets, including -X86-64 darwin. This works when linking to a libstdc++ compiled by GCC. It is -supported on X86-64 linux, but that is disabled by default in this release.
        • +
        • Exception handling works well on the X86 and PowerPC targets. Currently + only linux and darwin targets are supported (both 32 and 64 bit).
        From daniel at zuster.org Sat Oct 11 13:40:33 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Sat, 11 Oct 2008 18:40:33 -0000 Subject: [llvm-commits] [llvm] r57379 - /llvm/trunk/docs/GettingStarted.html Message-ID: <200810111840.m9BIeYLX000798@zion.cs.uiuc.edu> Author: ddunbar Date: Sat Oct 11 13:40:33 2008 New Revision: 57379 URL: http://llvm.org/viewvc/llvm-project?rev=57379&view=rev Log: Add GCC 4.1.2 from Debian to known bad GCC list. Modified: llvm/trunk/docs/GettingStarted.html Modified: llvm/trunk/docs/GettingStarted.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.html?rev=57379&r1=57378&r2=57379&view=diff ============================================================================== --- llvm/trunk/docs/GettingStarted.html (original) +++ llvm/trunk/docs/GettingStarted.html Sat Oct 11 13:40:33 2008 @@ -556,6 +556,10 @@ portions of its testsuite.

        GCC 4.1.2 on OpenSUSE: Seg faults during libstdc++ build and on x86_64 platforms compiling md5.c gets a mangled constant.

        +

        GCC 4.1.2 (20061115 (prerelease) (Debian 4.1.1-21)) on Debian: Appears +to miscompile parts of LLVM 2.4. One symptom is ValueSymbolTable complaining +about symbols remaining in the table on destruction.

        +

        GNU ld 2.16.X. Some 2.16.X versions of the ld linker will produce very long warning messages complaining that some ".gnu.linkonce.t.*" symbol was defined in a discarded section. You can safely ignore these messages as they are From asl at math.spbu.ru Sat Oct 11 14:09:16 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sat, 11 Oct 2008 19:09:16 -0000 Subject: [llvm-commits] [llvm] r57380 - in /llvm/trunk/lib/Target/X86: X86.td X86CodeEmitter.cpp X86InstrFormats.td X86InstrInfo.h Message-ID: <200810111909.m9BJ9Gw7001731@zion.cs.uiuc.edu> Author: asl Date: Sat Oct 11 14:09:15 2008 New Revision: 57380 URL: http://llvm.org/viewvc/llvm-project?rev=57380&view=rev Log: Add ability to override segment (mostly for code emitter purposes). Modified: llvm/trunk/lib/Target/X86/X86.td llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86InstrFormats.td llvm/trunk/lib/Target/X86/X86InstrInfo.h Modified: llvm/trunk/lib/Target/X86/X86.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.td?rev=57380&r1=57379&r2=57380&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86.td (original) +++ llvm/trunk/lib/Target/X86/X86.td Sat Oct 11 14:09:15 2008 @@ -116,6 +116,7 @@ "ImmTypeBits", "FPFormBits", "hasLockPrefix", + "SegOvrBits", "Opcode"]; let TSFlagsShifts = [0, 6, @@ -125,6 +126,7 @@ 13, 16, 19, + 20, 24]; } Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=57380&r1=57379&r2=57380&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sat Oct 11 14:09:15 2008 @@ -412,6 +412,16 @@ // Emit the lock opcode prefix as needed. if (Desc->TSFlags & X86II::LOCK) MCE.emitByte(0xF0); + // Emit segment overrid opcode prefix as needed. + switch (Desc->TSFlags & X86II::SegOvrMask) { + case X86II::FS: + MCE.emitByte(0x64); + break; + case X86II::GS: + MCE.emitByte(0x65); + break; + } + // Emit the repeat opcode prefix as needed. if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) MCE.emitByte(0xF3); Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=57380&r1=57379&r2=57380&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Sat Oct 11 14:09:15 2008 @@ -63,6 +63,8 @@ class AdSize { bit hasAdSizePrefix = 1; } class REX_W { bit hasREX_WPrefix = 1; } class LOCK { bit hasLockPrefix = 1; } +class SegFS { bits<2> SegOvrBits = 1; } +class SegGS { bits<2> SegOvrBits = 2; } class TB { bits<4> Prefix = 1; } class REP { bits<4> Prefix = 2; } class D8 { bits<4> Prefix = 3; } @@ -104,6 +106,7 @@ FPFormat FPForm; // What flavor of FP instruction is this? bits<3> FPFormBits = 0; bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix? + bits<2> SegOvrBits = 0; // Segment override prefix. } class I o, Format f, dag outs, dag ins, string asm, list pattern> Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=57380&r1=57379&r2=57380&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Sat Oct 11 14:09:15 2008 @@ -221,7 +221,14 @@ LOCKShift = 19, LOCK = 1 << LOCKShift, - // Bits 20 -> 23 are unused + // Segment override prefixes. Currently we just need ability to address + // stuff in gs and fs segments. + SegOvrShift = 20, + SegOvrMask = 3 << SegOvrShift, + FS = 1 << SegOvrShift, + GS = 2 << SegOvrShift, + + // Bits 22 -> 23 are unused OpcodeShift = 24, OpcodeMask = 0xFF << OpcodeShift }; From baldrick at free.fr Sat Oct 11 14:34:25 2008 From: baldrick at free.fr (Duncan Sands) Date: Sat, 11 Oct 2008 19:34:25 -0000 Subject: [llvm-commits] [llvm] r57381 - /llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Message-ID: <200810111934.m9BJYPmD002578@zion.cs.uiuc.edu> Author: baldrick Date: Sat Oct 11 14:34:24 2008 New Revision: 57381 URL: http://llvm.org/viewvc/llvm-project?rev=57381&view=rev Log: Fix comment typo. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=57381&r1=57380&r2=57381&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sat Oct 11 14:34:24 2008 @@ -412,7 +412,7 @@ // Emit the lock opcode prefix as needed. if (Desc->TSFlags & X86II::LOCK) MCE.emitByte(0xF0); - // Emit segment overrid opcode prefix as needed. + // Emit segment override opcode prefix as needed. switch (Desc->TSFlags & X86II::SegOvrMask) { case X86II::FS: MCE.emitByte(0x64); From baldrick at free.fr Sat Oct 11 15:17:28 2008 From: baldrick at free.fr (Duncan Sands) Date: Sat, 11 Oct 2008 22:17:28 +0200 Subject: [llvm-commits] [llvm] r57342 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp In-Reply-To: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> References: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> Message-ID: <200810112217.28940.baldrick@free.fr> Hi Owen, > + // FIXME: Are there any other possible escape points? if M is a malloced pointer, this would cause M to escape: if (M & 1) bits[0]=1; if (M & 2) bits[1]=1; if (M & 4) bits[2]=1; ... Export the "bits" array somehow (eg: write to a global, a parameter, return it). Then other parts of the program can reconstruct M from bits, so it would be wrong to convert it to an alloca. > +/// escapes - Determines whether the passed allocation can escape from the > +/// current function. It does this by using a simple worklist algorithm to > +/// search for a path in the def-use graph from the allocation to an > +/// escape point. As the above example shows, you also have to watch out for control flow. This may not involve phi nodes. Ciao, Duncan. From daniel at zuster.org Sat Oct 11 16:26:57 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Sat, 11 Oct 2008 21:26:57 -0000 Subject: [llvm-commits] [llvm] r57382 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810112126.m9BLQwFk006558@zion.cs.uiuc.edu> Author: ddunbar Date: Sat Oct 11 16:26:56 2008 New Revision: 57382 URL: http://llvm.org/viewvc/llvm-project?rev=57382&view=rev Log: Add API changes which affected me to release notes: - DbgStopPointInst - Attributes (needs filling in) Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57382&r1=57381&r2=57382&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sat Oct 11 16:26:56 2008 @@ -85,6 +85,11 @@

        • ....
        • + +
        • ... Attributes changes ...
        • + +
        • The DbgStopPointInst methods getDirectory and getFileName now return Value* instead of strings. These can be converted to strings using llvm::GetConstantStringInfo defined via "llvm/Analysis/ValueTracking.h". +
        From sabre at nondot.org Sat Oct 11 17:06:50 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 22:06:50 -0000 Subject: [llvm-commits] [llvm] r57383 - /llvm/trunk/include/llvm/ADT/APInt.h Message-ID: <200810112206.m9BM6oV5008360@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 17:06:50 2008 New Revision: 57383 URL: http://llvm.org/viewvc/llvm-project?rev=57383&view=rev Log: random cleanup Modified: llvm/trunk/include/llvm/ADT/APInt.h Modified: llvm/trunk/include/llvm/ADT/APInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=57383&r1=57382&r2=57383&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APInt.h (original) +++ llvm/trunk/include/llvm/ADT/APInt.h Sat Oct 11 17:06:50 2008 @@ -458,7 +458,6 @@ /// @param numBits the bitwidth of the result /// @param loBitsSet the number of low-order bits set in the result. /// @brief Get a value with low bits set - // XXX why isn't this inlining? static APInt getLowBitsSet(uint32_t numBits, uint32_t loBitsSet) { assert(loBitsSet <= numBits && "Too many bits to set!"); // Handle a degenerate case, to avoid shifting by word size @@ -466,7 +465,7 @@ return APInt(numBits, 0); if (loBitsSet == APINT_BITS_PER_WORD) return APInt(numBits, -1ULL); - // For small values, return quickly + // For small values, return quickly. if (numBits < APINT_BITS_PER_WORD) return APInt(numBits, (1ULL << loBitsSet) - 1); return (~APInt(numBits, 0)).lshr(numBits - loBitsSet); From sabre at nondot.org Sat Oct 11 17:07:19 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 22:07:19 -0000 Subject: [llvm-commits] [llvm] r57384 - /llvm/trunk/lib/Support/APInt.cpp Message-ID: <200810112207.m9BM7Jur008383@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 17:07:19 2008 New Revision: 57384 URL: http://llvm.org/viewvc/llvm-project?rev=57384&view=rev Log: rearrange some code. Modified: llvm/trunk/lib/Support/APInt.cpp Modified: llvm/trunk/lib/Support/APInt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=57384&r1=57383&r2=57384&view=diff ============================================================================== --- llvm/trunk/lib/Support/APInt.cpp (original) +++ llvm/trunk/lib/Support/APInt.cpp Sat Oct 11 17:07:19 2008 @@ -50,6 +50,12 @@ pVal[i] = -1ULL; } +void APInt::initSlowCase(const APInt& that) { + pVal = getMemory(getNumWords()); + memcpy(pVal, that.pVal, getNumWords() * APINT_WORD_SIZE); +} + + APInt::APInt(uint32_t numBits, uint32_t numWords, const uint64_t bigVal[]) : BitWidth(numBits), VAL(0) { assert(BitWidth && "bitwidth too small"); @@ -75,12 +81,6 @@ fromString(numbits, StrStart, slen, radix); } -void APInt::initSlowCase(const APInt& that) -{ - pVal = getMemory(getNumWords()); - memcpy(pVal, that.pVal, getNumWords() * APINT_WORD_SIZE); -} - APInt& APInt::AssignSlowCase(const APInt& RHS) { // Don't do anything for X = X if (this == &RHS) From sabre at nondot.org Sat Oct 11 17:08:30 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 22:08:30 -0000 Subject: [llvm-commits] [llvm] r57385 - in /llvm/trunk: lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ test/CodeGen/X86/ Message-ID: <200810112208.m9BM8VUD008471@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 17:08:30 2008 New Revision: 57385 URL: http://llvm.org/viewvc/llvm-project?rev=57385&view=rev Log: Change CALLSEQ_BEGIN and CALLSEQ_END to take TargetConstant's as parameters instead of raw Constants. This prevents the constants from being selected by the isel pass, fixing PR2735. Added: llvm/trunk/test/CodeGen/X86/2008-10-11-CallCrash.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMInstrInfo.td llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp llvm/trunk/lib/Target/Mips/MipsInstrInfo.td llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td llvm/trunk/lib/Target/TargetSelectionDAG.td llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrInfo.td Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Oct 11 17:08:30 2008 @@ -1678,8 +1678,7 @@ // Chain the dynamic stack allocation so that it doesn't modify the stack // pointer when other instructions are using the stack. - Chain = DAG.getCALLSEQ_START(Chain, - DAG.getConstant(0, TLI.getPointerTy())); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(0, true)); SDValue Size = Tmp2.getOperand(1); SDValue SP = DAG.getCopyFromReg(Chain, SPReg, VT); @@ -1693,11 +1692,8 @@ Tmp1 = DAG.getNode(ISD::SUB, VT, SP, Size); // Value Chain = DAG.getCopyToReg(Chain, SPReg, Tmp1); // Output chain - Tmp2 = - DAG.getCALLSEQ_END(Chain, - DAG.getConstant(0, TLI.getPointerTy()), - DAG.getConstant(0, TLI.getPointerTy()), - SDValue()); + Tmp2 = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(0, true), + DAG.getIntPtrConstant(0, true), SDValue()); Tmp1 = LegalizeOp(Tmp1); Tmp2 = LegalizeOp(Tmp2); Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -430,8 +430,7 @@ // Adjust the stack pointer for the new arguments... // These operations are automatically eliminated by the prolog/epilog pass - Chain = DAG.getCALLSEQ_START(Chain, - DAG.getConstant(NumBytes, MVT::i32)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); SDValue StackPtr = DAG.getRegister(ARM::SP, MVT::i32); @@ -603,10 +602,8 @@ &Ops[0], Ops.size()); InFlag = Chain.getValue(1); - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumBytes, MVT::i32), - DAG.getConstant(0, MVT::i32), - InFlag); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(0, true), InFlag); if (RetVT != MVT::Other) InFlag = Chain.getValue(1); Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -452,12 +452,12 @@ def ADJCALLSTACKUP : PseudoInst<(outs), (ins i32imm:$amt1, i32imm:$amt2, pred:$p), "@ ADJCALLSTACKUP $amt1", - [(ARMcallseq_end imm:$amt1, imm:$amt2)]>; + [(ARMcallseq_end timm:$amt1, timm:$amt2)]>; def ADJCALLSTACKDOWN : PseudoInst<(outs), (ins i32imm:$amt, pred:$p), "@ ADJCALLSTACKDOWN $amt", - [(ARMcallseq_start imm:$amt)]>; + [(ARMcallseq_start timm:$amt)]>; } def DWARF_LOC : Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -360,8 +360,7 @@ if (Args.size() > 6) NumBytes = (Args.size() - 6) * 8; - Chain = DAG.getCALLSEQ_START(Chain, - DAG.getConstant(NumBytes, getPointerTy())); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); std::vector args_to_use; for (unsigned i = 0, e = Args.size(); i != e; ++i) { @@ -404,10 +403,8 @@ Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end()); SDValue TheCall = DAG.getNode(AlphaISD::CALL, RetVals, &Ops[0], Ops.size()); Chain = TheCall.getValue(RetTyVT != MVT::isVoid); - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumBytes, getPointerTy()), - DAG.getConstant(0, getPointerTy()), - SDValue()); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(0, true), SDValue()); SDValue RetVal = TheCall; if (RetTyVT != ActualRetTyVT) { Modified: llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td (original) +++ llvm/trunk/lib/Target/Alpha/AlphaInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -151,10 +151,10 @@ let hasCtrlDep = 1, Defs = [R30], Uses = [R30] in { def ADJUSTSTACKUP : PseudoInstAlpha<(outs), (ins s64imm:$amt), "; ADJUP $amt", - [(callseq_start imm:$amt)], s_pseudo>; + [(callseq_start timm:$amt)], s_pseudo>; def ADJUSTSTACKDOWN : PseudoInstAlpha<(outs), (ins s64imm:$amt1, s64imm:$amt2), "; ADJDOWN $amt1", - [(callseq_end imm:$amt1, imm:$amt2)], s_pseudo>; + [(callseq_end timm:$amt1, timm:$amt2)], s_pseudo>; } def ALTENT : PseudoInstAlpha<(outs), (ins s64imm:$TARGET), "$$$TARGET..ng:\n", [], s_pseudo>; Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -1171,7 +1171,8 @@ // Update number of stack bytes actually used, insert a call sequence start NumStackBytes = (ArgOffset - SPUFrameInfo::minStackSize()); - Chain = DAG.getCALLSEQ_START(Chain, DAG.getConstant(NumStackBytes, PtrVT)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumStackBytes, + true)); if (!MemOpChains.empty()) { // Adjust the stack pointer for the stack arguments. @@ -1243,10 +1244,8 @@ &Ops[0], Ops.size()); InFlag = Chain.getValue(1); - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumStackBytes, PtrVT), - DAG.getConstant(0, PtrVT), - InFlag); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumStackBytes, true), + DAG.getIntPtrConstant(0, true), InFlag); if (TheCall->getValueType(0) != MVT::Other) InFlag = Chain.getValue(1); Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -24,10 +24,10 @@ let hasCtrlDep = 1, Defs = [R1], Uses = [R1] in { def ADJCALLSTACKDOWN : Pseudo<(outs), (ins u16imm_i32:$amt), "${:comment} ADJCALLSTACKDOWN", - [(callseq_start imm:$amt)]>; + [(callseq_start timm:$amt)]>; def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm_i32:$amt), "${:comment} ADJCALLSTACKUP", - [(callseq_end imm:$amt)]>; + [(callseq_end timm:$amt)]>; } //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -333,7 +333,7 @@ // "stack frame not 16-byte aligned!"); NumBytes = (NumBytes+15) & ~15; - Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes, getPointerTy())); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); SDValue StackPtr; std::vector Stores; @@ -543,10 +543,8 @@ } } - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumBytes, getPointerTy()), - DAG.getConstant(0, getPointerTy()), - SDValue()); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(0, true), SDValue()); return std::make_pair(RetVal, Chain); } Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -608,8 +608,7 @@ // Get a count of how many bytes are to be pushed on the stack. unsigned NumBytes = CCInfo.getNextStackOffset(); - Chain = DAG.getCALLSEQ_START(Chain,DAG.getConstant(NumBytes, - getPointerTy())); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); // With EABI is it possible to have 16 args on registers. SmallVector, 16> RegsToPass; @@ -715,10 +714,8 @@ InFlag = Chain.getValue(1); // Create the CALLSEQ_END node. - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumBytes, getPointerTy()), - DAG.getConstant(0, getPointerTy()), - InFlag); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(0, true), InFlag); InFlag = Chain.getValue(1); // Create a stack location to hold GP when PIC is used. This stack Modified: llvm/trunk/lib/Target/Mips/MipsInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Mips/MipsInstrInfo.td (original) +++ llvm/trunk/lib/Target/Mips/MipsInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -393,10 +393,10 @@ let Defs = [SP], Uses = [SP] in { def ADJCALLSTACKDOWN : MipsPseudo<(outs), (ins uimm16:$amt), "!ADJCALLSTACKDOWN $amt", - [(callseq_start imm:$amt)]>; + [(callseq_start timm:$amt)]>; def ADJCALLSTACKUP : MipsPseudo<(outs), (ins uimm16:$amt1, uimm16:$amt2), "!ADJCALLSTACKUP $amt1", - [(callseq_end imm:$amt1, imm:$amt2)]>; + [(callseq_end timm:$amt1, timm:$amt2)]>; } // Some assembly macros need to avoid pseudoinstructions and assembler Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -2142,8 +2142,7 @@ // Adjust the stack pointer for the new arguments... // These operations are automatically eliminated by the prolog/epilog pass - Chain = DAG.getCALLSEQ_START(Chain, - DAG.getConstant(NumBytes, PtrVT)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); SDValue CallSeqStart = Chain; // Load the return address and frame pointer so it can be move somewhere else @@ -2476,8 +2475,8 @@ SmallVector CallSeqOps; SDVTList CallSeqNodeTys = DAG.getVTList(MVT::Other, MVT::Flag); CallSeqOps.push_back(Chain); - CallSeqOps.push_back(DAG.getIntPtrConstant(NumBytes)); - CallSeqOps.push_back(DAG.getIntPtrConstant(0)); + CallSeqOps.push_back(DAG.getIntPtrConstant(NumBytes, true)); + CallSeqOps.push_back(DAG.getIntPtrConstant(0, true)); if (InFlag.getNode()) CallSeqOps.push_back(InFlag); Chain = DAG.getNode(ISD::CALLSEQ_END, CallSeqNodeTys, &CallSeqOps[0], @@ -2564,9 +2563,8 @@ Chain = DAG.getNode(CallOpc, NodeTys, &Ops[0], Ops.size()); InFlag = Chain.getValue(1); - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(NumBytes, PtrVT), - DAG.getConstant(BytesCalleePops, PtrVT), + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(BytesCalleePops, true), InFlag); if (TheCall->getValueType(0) != MVT::Other) InFlag = Chain.getValue(1); Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td (original) +++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -342,10 +342,10 @@ let Defs = [R1], Uses = [R1] in { def ADJCALLSTACKDOWN : Pseudo<(outs), (ins u16imm:$amt), "${:comment} ADJCALLSTACKDOWN", - [(callseq_start imm:$amt)]>; + [(callseq_start timm:$amt)]>; def ADJCALLSTACKUP : Pseudo<(outs), (ins u16imm:$amt1, u16imm:$amt2), "${:comment} ADJCALLSTACKUP", - [(callseq_end imm:$amt1, imm:$amt2)]>; + [(callseq_end timm:$amt1, timm:$amt2)]>; } def UPDATE_VRSAVE : Pseudo<(outs GPRC:$rD), (ins GPRC:$rS), Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -270,7 +270,7 @@ // Keep stack frames 8-byte aligned. ArgsSize = (ArgsSize+7) & ~7; - Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(ArgsSize)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(ArgsSize, true)); SmallVector, 8> RegsToPass; SmallVector MemOpChains; @@ -421,9 +421,8 @@ Chain = DAG.getNode(SPISD::CALL, NodeTys, Ops, InFlag.getNode() ? 3 : 2); InFlag = Chain.getValue(1); - Chain = DAG.getCALLSEQ_END(Chain, - DAG.getConstant(ArgsSize, MVT::i32), - DAG.getConstant(0, MVT::i32), InFlag); + Chain = DAG.getCALLSEQ_END(Chain, DAG.getIntPtrConstant(ArgsSize, true), + DAG.getIntPtrConstant(0, true), InFlag); InFlag = Chain.getValue(1); // Assign locations to each value returned by this call. Modified: llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td (original) +++ llvm/trunk/lib/Target/Sparc/SparcInstrInfo.td Sat Oct 11 17:08:30 2008 @@ -210,10 +210,10 @@ let Defs = [O6], Uses = [O6] in { def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt), "!ADJCALLSTACKDOWN $amt", - [(callseq_start imm:$amt)]>; + [(callseq_start timm:$amt)]>; def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2), "!ADJCALLSTACKUP $amt1", - [(callseq_end imm:$amt1, imm:$amt2)]>; + [(callseq_end timm:$amt1, timm:$amt2)]>; } // FpMOVD/FpNEGD/FpABSD - These are lowered to single-precision ops by the Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetSelectionDAG.td (original) +++ llvm/trunk/lib/Target/TargetSelectionDAG.td Sat Oct 11 17:08:30 2008 @@ -240,6 +240,7 @@ def srcvalue; def imm : SDNode<"ISD::Constant" , SDTIntLeaf , [], "ConstantSDNode">; +def timm : SDNode<"ISD::TargetConstant", SDTIntLeaf , [], "ConstantSDNode">; def fpimm : SDNode<"ISD::ConstantFP", SDTFPLeaf , [], "ConstantFPSDNode">; def vt : SDNode<"ISD::VALUETYPE" , SDTOther , [], "VTSDNode">; def bb : SDNode<"ISD::BasicBlock", SDTOther , [], "BasicBlockSDNode">; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Oct 11 17:08:30 2008 @@ -1501,7 +1501,7 @@ MF.getInfo()->setTCReturnAddrDelta(FPDiff); } - Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(NumBytes, true)); SDValue RetAddrFrIdx; // Load return adress for tail calls. @@ -1717,8 +1717,8 @@ if (IsTailCall) { Ops.push_back(Chain); - Ops.push_back(DAG.getIntPtrConstant(NumBytes)); - Ops.push_back(DAG.getIntPtrConstant(0)); + Ops.push_back(DAG.getIntPtrConstant(NumBytes, true)); + Ops.push_back(DAG.getIntPtrConstant(0, true)); if (InFlag.getNode()) Ops.push_back(InFlag); Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0], Ops.size()); @@ -1780,8 +1780,9 @@ // Returns a flag for retval copy to use. Chain = DAG.getCALLSEQ_END(Chain, - DAG.getIntPtrConstant(NumBytes), - DAG.getIntPtrConstant(NumBytesForCalleeToPush), + DAG.getIntPtrConstant(NumBytes, true), + DAG.getIntPtrConstant(NumBytesForCalleeToPush, + true), InFlag); InFlag = Chain.getValue(1); @@ -5115,7 +5116,7 @@ MVT IntPtr = getPointerTy(); MVT SPTy = Subtarget->is64Bit() ? MVT::i64 : MVT::i32; - Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(0)); + Chain = DAG.getCALLSEQ_START(Chain, DAG.getIntPtrConstant(0, true)); Chain = DAG.getCopyToReg(Chain, X86::EAX, Size, Flag); Flag = Chain.getValue(1); @@ -5130,8 +5131,8 @@ Flag = Chain.getValue(1); Chain = DAG.getCALLSEQ_END(Chain, - DAG.getIntPtrConstant(0), - DAG.getIntPtrConstant(0), + DAG.getIntPtrConstant(0, true), + DAG.getIntPtrConstant(0, true), Flag); Chain = DAG.getCopyFromReg(Chain, X86StackPtr, SPTy).getValue(1); Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Sat Oct 11 17:08:30 2008 @@ -94,11 +94,11 @@ let Defs = [RSP, EFLAGS], Uses = [RSP] in { def ADJCALLSTACKDOWN64 : I<0, Pseudo, (outs), (ins i32imm:$amt), "#ADJCALLSTACKDOWN", - [(X86callseq_start imm:$amt)]>, + [(X86callseq_start timm:$amt)]>, Requires<[In64BitMode]>; def ADJCALLSTACKUP64 : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKUP", - [(X86callseq_end imm:$amt1, imm:$amt2)]>, + [(X86callseq_end timm:$amt1, timm:$amt2)]>, Requires<[In64BitMode]>; } Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=57385&r1=57384&r2=57385&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Sat Oct 11 17:08:30 2008 @@ -345,11 +345,11 @@ let Defs = [ESP, EFLAGS], Uses = [ESP] in { def ADJCALLSTACKDOWN32 : I<0, Pseudo, (outs), (ins i32imm:$amt), "#ADJCALLSTACKDOWN", - [(X86callseq_start imm:$amt)]>, + [(X86callseq_start timm:$amt)]>, Requires<[In32BitMode]>; def ADJCALLSTACKUP32 : I<0, Pseudo, (outs), (ins i32imm:$amt1, i32imm:$amt2), "#ADJCALLSTACKUP", - [(X86callseq_end imm:$amt1, imm:$amt2)]>, + [(X86callseq_end timm:$amt1, timm:$amt2)]>, Requires<[In32BitMode]>; } Added: llvm/trunk/test/CodeGen/X86/2008-10-11-CallCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-10-11-CallCrash.ll?rev=57385&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-10-11-CallCrash.ll (added) +++ llvm/trunk/test/CodeGen/X86/2008-10-11-CallCrash.ll Sat Oct 11 17:08:30 2008 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | llc +; PR2735 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin7" + at g_385 = external global i32 ; [#uses=1] + +define i32 @func_45(i64 %p_46, i32 %p_48) nounwind { +entry: + %0 = tail call i32 (...)* @lshift_s_u(i64 %p_46, i64 0) nounwind ; [#uses=0] + %1 = load i32* @g_385, align 4 ; [#uses=1] + %2 = shl i32 %1, 1 ; [#uses=1] + %3 = and i32 %2, 32 ; [#uses=1] + %4 = tail call i32 (...)* @func_87(i32 undef, i32 %p_48, i32 1) nounwind ; [#uses=1] + %5 = add i32 %3, %4 ; [#uses=1] + %6 = tail call i32 (...)* @div_rhs(i32 %5) nounwind ; [#uses=0] + ret i32 undef +} + +declare i32 @lshift_s_u(...) +declare i32 @func_87(...) +declare i32 @div_rhs(...) From sabre at nondot.org Sat Oct 11 17:15:00 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 22:15:00 -0000 Subject: [llvm-commits] [llvm] r57386 - /llvm/trunk/win32/CodeGen/CodeGen.vcproj Message-ID: <200810112215.m9BMF0BA008781@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 17:14:59 2008 New Revision: 57386 URL: http://llvm.org/viewvc/llvm-project?rev=57386&view=rev Log: update win32 project file, patch provided by OvermindDL1 on llvmdev. Modified: llvm/trunk/win32/CodeGen/CodeGen.vcproj Modified: llvm/trunk/win32/CodeGen/CodeGen.vcproj URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/win32/CodeGen/CodeGen.vcproj?rev=57386&r1=57385&r2=57386&view=diff ============================================================================== --- llvm/trunk/win32/CodeGen/CodeGen.vcproj (original) +++ llvm/trunk/win32/CodeGen/CodeGen.vcproj Sat Oct 11 17:14:59 2008 @@ -425,6 +425,10 @@ > + + @@ -453,6 +457,10 @@ > + + @@ -739,6 +747,10 @@ > + + From sabre at nondot.org Sat Oct 11 17:55:01 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 22:55:01 -0000 Subject: [llvm-commits] [llvm] r57387 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll Message-ID: <200810112255.m9BMt2sj010403@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 17:55:00 2008 New Revision: 57387 URL: http://llvm.org/viewvc/llvm-project?rev=57387&view=rev Log: Fix PR2697 by rewriting the '(X / pos) op neg' logic. This also changes a couple other cases for clarity, but shouldn't affect correctness. Patch by Eli Friedman! Added: llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=57387&r1=57386&r2=57387&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sat Oct 11 17:55:00 2008 @@ -5784,6 +5784,11 @@ return 0; if (DivRHS->isZero()) return 0; // The ProdOV computation fails on divide by zero. + if (DivIsSigned && DivRHS->isAllOnesValue()) + return 0; // The overflow computation also screws up here + if (DivRHS->isOne()) + return 0; // Not worth bothering, and eliminates some funny cases + // with INT_MIN. // Compute Prod = CI * DivRHS. We are essentially solving an equation // of form X/C1=C2. We solve for X by multiplying C1 (DivRHS) and @@ -5810,7 +5815,6 @@ int LoOverflow = 0, HiOverflow = 0; ConstantInt *LoBound = 0, *HiBound = 0; - if (!DivIsSigned) { // udiv // e.g. X/5 op 3 --> [15, 20) LoBound = Prod; @@ -5829,11 +5833,13 @@ HiOverflow = AddWithOverflow(HiBound, Prod, DivRHS, true); } else { // (X / pos) op neg // e.g. X/5 op -3 --> [-15-4, -15+1) --> [-19, -14) - Constant *DivRHSH = ConstantExpr::getNeg(SubOne(DivRHS)); - LoOverflow = AddWithOverflow(LoBound, Prod, - cast(DivRHSH), true) ? -1 : 0; HiBound = AddOne(Prod); - HiOverflow = ProdOV ? -1 : 0; + LoOverflow = HiOverflow = ProdOV ? -1 : 0; + if (!LoOverflow) { + ConstantInt* DivNeg = cast(ConstantExpr::getNeg(DivRHS)); + LoOverflow = AddWithOverflow(LoBound, HiBound, DivNeg, + true) ? -1 : 0; + } } } else if (DivRHS->getValue().isNegative()) { // Divisor is < 0. if (CmpRHSV == 0) { // (X / neg) op 0 @@ -5846,14 +5852,13 @@ } } else if (CmpRHSV.isStrictlyPositive()) { // (X / neg) op pos // e.g. X/-5 op 3 --> [-19, -14) + HiBound = AddOne(Prod); HiOverflow = LoOverflow = ProdOV ? -1 : 0; if (!LoOverflow) - LoOverflow = AddWithOverflow(LoBound, Prod, AddOne(DivRHS), true) ?-1:0; - HiBound = AddOne(Prod); + LoOverflow = AddWithOverflow(LoBound, HiBound, DivRHS, true) ? -1 : 0; } else { // (X / neg) op neg - // e.g. X/-5 op -3 --> [15, 20) - LoBound = Prod; - LoOverflow = HiOverflow = ProdOV ? 1 : 0; + LoBound = Prod; // e.g. X/-5 op -3 --> [15, 20) + LoOverflow = HiOverflow = ProdOV; if (!HiOverflow) HiOverflow = SubWithOverflow(HiBound, Prod, DivRHS, true); } Added: llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll?rev=57387&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-10-11-DivCompareFold.ll Sat Oct 11 17:55:00 2008 @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false} +; PR2697 + +define i1 @x(i32 %x) nounwind { + %div = sdiv i32 %x, 65536 ; [#uses=1] + %cmp = icmp slt i32 %div, -65536 + ret i1 %cmp +} From sabre at nondot.org Sat Oct 11 18:59:06 2008 From: sabre at nondot.org (Chris Lattner) Date: Sat, 11 Oct 2008 23:59:06 -0000 Subject: [llvm-commits] [llvm] r57388 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Message-ID: <200810112359.m9BNx7jQ012457@zion.cs.uiuc.edu> Author: lattner Date: Sat Oct 11 18:59:03 2008 New Revision: 57388 URL: http://llvm.org/viewvc/llvm-project?rev=57388&view=rev Log: fix typo Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=57388&r1=57387&r2=57388&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Sat Oct 11 18:59:03 2008 @@ -465,7 +465,7 @@ MachineBasicBlock *MBB = CopyMI->getParent(); tii_->reMaterialize(*MBB, MII, DstReg, DefMI); MachineInstr *NewMI = prior(MII); - // CopyMI may have implicit instructions, transfer them over to the newly + // CopyMI may have implicit operands, transfer them over to the newly // rematerialized instruction. And update implicit def interval valnos. for (unsigned i = CopyMI->getDesc().getNumOperands(), e = CopyMI->getNumOperands(); i != e; ++i) { From monping at apple.com Sat Oct 11 21:33:59 2008 From: monping at apple.com (Mon Ping Wang) Date: Sat, 11 Oct 2008 19:33:59 -0700 Subject: [llvm-commits] [llvm] r57380 - in /llvm/trunk/lib/Target/X86: X86.td X86CodeEmitter.cpp X86InstrFormats.td X86InstrInfo.h In-Reply-To: <200810111909.m9BJ9Gw7001731@zion.cs.uiuc.edu> References: <200810111909.m9BJ9Gw7001731@zion.cs.uiuc.edu> Message-ID: <97BA5A4B-8902-44A7-AC97-A73A0E2D415C@apple.com> Hi Anton, Shouldn't we also increment the size for the overside segment in X86InstrInfo.cpp? static unsigned GetInstSizeWithDesc(const MachineInstr &MI, const TargetInstrDesc *Desc, bool IsPIC, bool Is64BitMode) { ... // Emit the operand size opcode prefix as needed. switch (Desc->TSFlags & X86II::SegOvrMask) { case X86II::FS: ++FinalSize; break; case X86II::GS: ++FinalSize; break; } ... -- Mon Ping On Oct 11, 2008, at 12:09 PM, Anton Korobeynikov wrote: > Author: asl > Date: Sat Oct 11 14:09:15 2008 > New Revision: 57380 > > URL: http://llvm.org/viewvc/llvm-project?rev=57380&view=rev > Log: > Add ability to override segment (mostly for code emitter purposes). > > Modified: > llvm/trunk/lib/Target/X86/X86.td > llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp > llvm/trunk/lib/Target/X86/X86InstrFormats.td > llvm/trunk/lib/Target/X86/X86InstrInfo.h > > Modified: llvm/trunk/lib/Target/X86/X86.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86.td?rev=57380&r1=57379&r2=57380&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86.td (original) > +++ llvm/trunk/lib/Target/X86/X86.td Sat Oct 11 14:09:15 2008 > @@ -116,6 +116,7 @@ > "ImmTypeBits", > "FPFormBits", > "hasLockPrefix", > + "SegOvrBits", > "Opcode"]; > let TSFlagsShifts = [0, > 6, > @@ -125,6 +126,7 @@ > 13, > 16, > 19, > + 20, > 24]; > } > > > Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=57380&r1=57379&r2=57380&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sat Oct 11 14:09:15 > 2008 > @@ -412,6 +412,16 @@ > // Emit the lock opcode prefix as needed. > if (Desc->TSFlags & X86II::LOCK) MCE.emitByte(0xF0); > > + // Emit segment overrid opcode prefix as needed. > + switch (Desc->TSFlags & X86II::SegOvrMask) { > + case X86II::FS: > + MCE.emitByte(0x64); > + break; > + case X86II::GS: > + MCE.emitByte(0x65); > + break; > + } > + > // Emit the repeat opcode prefix as needed. > if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) MCE.emitByte > (0xF3); > > > Modified: llvm/trunk/lib/Target/X86/X86InstrFormats.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFormats.td?rev=57380&r1=57379&r2=57380&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrFormats.td (original) > +++ llvm/trunk/lib/Target/X86/X86InstrFormats.td Sat Oct 11 14:09:15 > 2008 > @@ -63,6 +63,8 @@ > class AdSize { bit hasAdSizePrefix = 1; } > class REX_W { bit hasREX_WPrefix = 1; } > class LOCK { bit hasLockPrefix = 1; } > +class SegFS { bits<2> SegOvrBits = 1; } > +class SegGS { bits<2> SegOvrBits = 2; } > class TB { bits<4> Prefix = 1; } > class REP { bits<4> Prefix = 2; } > class D8 { bits<4> Prefix = 3; } > @@ -104,6 +106,7 @@ > FPFormat FPForm; // What flavor of FP instruction is this? > bits<3> FPFormBits = 0; > bit hasLockPrefix = 0; // Does this inst have a 0xF0 prefix? > + bits<2> SegOvrBits = 0; // Segment override prefix. > } > > class I o, Format f, dag outs, dag ins, string asm, > list pattern> > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=57380&r1=57379&r2=57380&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Sat Oct 11 14:09:15 2008 > @@ -221,7 +221,14 @@ > LOCKShift = 19, > LOCK = 1 << LOCKShift, > > - // Bits 20 -> 23 are unused > + // Segment override prefixes. Currently we just need ability to > address > + // stuff in gs and fs segments. > + SegOvrShift = 20, > + SegOvrMask = 3 << SegOvrShift, > + FS = 1 << SegOvrShift, > + GS = 2 << SegOvrShift, > + > + // Bits 22 -> 23 are unused > OpcodeShift = 24, > OpcodeMask = 0xFF << OpcodeShift > }; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From resistor at mac.com Sat Oct 11 22:59:46 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 03:59:46 -0000 Subject: [llvm-commits] [llvm] r57400 - /llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Message-ID: <200810120359.m9C3xkSc021862@zion.cs.uiuc.edu> Author: resistor Date: Sat Oct 11 22:59:45 2008 New Revision: 57400 URL: http://llvm.org/viewvc/llvm-project?rev=57400&view=rev Log: Duncan convinced me that it's not possible to transform control-based escapes into data-based ones. Just be conservative when analyzing control-based escapes. Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57400&r1=57399&r2=57400&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Sat Oct 11 22:59:45 2008 @@ -78,6 +78,11 @@ // for malloc to alloca promotion. } else if (isa(I)) { EscapePoints.insert(I); + + // Branching on the value of a pointer may allow the value to escape through + // methods not discoverable via def-use chaining. + } else if(isa(I) || isa(I)) { + EscapePoints.insert(I); } // FIXME: Are there any other possible escape points? @@ -93,19 +98,18 @@ /// FIXME: Once we've discovered a path, it would be a good idea to memoize it, /// and all of its subpaths, to amortize the cost of future queries. bool EscapeAnalysis::escapes(AllocationInst* A) { - std::vector worklist; + std::vector worklist; worklist.push_back(A); - SmallPtrSet visited; + SmallPtrSet visited; while (!worklist.empty()) { - Value* curr = worklist.back(); + Instruction* curr = worklist.back(); worklist.pop_back(); visited.insert(curr); - if (Instruction* CurrInst = dyn_cast(curr)) - if (EscapePoints.count(CurrInst)) - return true; + if (EscapePoints.count(curr)) + return true; for (Instruction::use_iterator UI = curr->use_begin(), UE = curr->use_end(); UI != UE; ++UI) @@ -116,13 +120,6 @@ // have been found to alias a global, so stores to them would have // been in EscapePoints. worklist.push_back(cast(S->getPointerOperand())); - } else if (isa(U) || isa(U)) { - // Because branches on the pointer value can hide data dependencies, - // we need to track values that were generated by branching on the - // pointer (or some derived value). To do that, we push the block, - // whose uses will be the PHINodes that generate information based - // one it. - worklist.push_back(U->getParent()); } else worklist.push_back(U); } From resistor at mac.com Sun Oct 12 01:03:40 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 06:03:40 -0000 Subject: [llvm-commits] [llvm] r57408 - /llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Message-ID: <200810120603.m9C63eu0026268@zion.cs.uiuc.edu> Author: resistor Date: Sun Oct 12 01:03:38 2008 New Revision: 57408 URL: http://llvm.org/viewvc/llvm-project?rev=57408&view=rev Log: Fix crashes and infinite loops. Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57408&r1=57407&r2=57408&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Sun Oct 12 01:03:38 2008 @@ -48,6 +48,7 @@ bool inserted = false; for (Function::arg_iterator AI = F.arg_begin(), AE = F.arg_end(); AI != AE; ++AI) { + if (!isa(AI->getType())) continue; AliasAnalysis::AliasResult R = AA.alias(Pointer, StoreSize, AI, ~0UL); if (R != AliasAnalysis::NoAlias) { EscapePoints.insert(S); @@ -102,26 +103,27 @@ worklist.push_back(A); SmallPtrSet visited; + visited.insert(A); while (!worklist.empty()) { Instruction* curr = worklist.back(); worklist.pop_back(); - visited.insert(curr); - if (EscapePoints.count(curr)) return true; - for (Instruction::use_iterator UI = curr->use_begin(), UE = curr->use_end(); - UI != UE; ++UI) - if (Instruction* U = dyn_cast(UI)) - if (!visited.count(U)) - if (StoreInst* S = dyn_cast(U)) { - // We know this must be an instruction, because constant gep's would - // have been found to alias a global, so stores to them would have - // been in EscapePoints. - worklist.push_back(cast(S->getPointerOperand())); - } else + if (StoreInst* S = dyn_cast(curr)) { + // We know this must be an instruction, because constant gep's would + // have been found to alias a global, so stores to them would have + // been in EscapePoints. + if (visited.insert(cast(S->getPointerOperand()))) + worklist.push_back(cast(S->getPointerOperand())); + } else { + for (Instruction::use_iterator UI = curr->use_begin(), + UE = curr->use_end(); UI != UE; ++UI) + if (Instruction* U = dyn_cast(UI)) + if (visited.insert(U)) worklist.push_back(U); + } } return false; From dalej at apple.com Sun Oct 12 01:20:47 2008 From: dalej at apple.com (Dale Johannesen) Date: Sun, 12 Oct 2008 06:20:47 -0000 Subject: [llvm-commits] [llvm] r57410 - /llvm/trunk/lib/Support/Dwarf.cpp Message-ID: <200810120620.m9C6Kl1W026812@zion.cs.uiuc.edu> Author: johannes Date: Sun Oct 12 01:20:47 2008 New Revision: 57410 URL: http://llvm.org/viewvc/llvm-project?rev=57410&view=rev Log: Change Dwarf comments starting with AT_ to DW_AT_ to match gcc. Helps with the testsuite. Modified: llvm/trunk/lib/Support/Dwarf.cpp Modified: llvm/trunk/lib/Support/Dwarf.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Dwarf.cpp?rev=57410&r1=57409&r2=57410&view=diff ============================================================================== --- llvm/trunk/lib/Support/Dwarf.cpp (original) +++ llvm/trunk/lib/Support/Dwarf.cpp Sun Oct 12 01:20:47 2008 @@ -102,102 +102,102 @@ /// const char *AttributeString(unsigned Attribute) { switch(Attribute) { - case DW_AT_sibling: return "AT_sibling"; - case DW_AT_location: return "AT_location"; - case DW_AT_name: return "AT_name"; - case DW_AT_ordering: return "AT_ordering"; - case DW_AT_byte_size: return "AT_byte_size"; - case DW_AT_bit_offset: return "AT_bit_offset"; - case DW_AT_bit_size: return "AT_bit_size"; - case DW_AT_stmt_list: return "AT_stmt_list"; - case DW_AT_low_pc: return "AT_low_pc"; - case DW_AT_high_pc: return "AT_high_pc"; - case DW_AT_language: return "AT_language"; - case DW_AT_discr: return "AT_discr"; - case DW_AT_discr_value: return "AT_discr_value"; - case DW_AT_visibility: return "AT_visibility"; - case DW_AT_import: return "AT_import"; - case DW_AT_string_length: return "AT_string_length"; - case DW_AT_common_reference: return "AT_common_reference"; - case DW_AT_comp_dir: return "AT_comp_dir"; - case DW_AT_const_value: return "AT_const_value"; - case DW_AT_containing_type: return "AT_containing_type"; - case DW_AT_default_value: return "AT_default_value"; - case DW_AT_inline: return "AT_inline"; - case DW_AT_is_optional: return "AT_is_optional"; - case DW_AT_lower_bound: return "AT_lower_bound"; - case DW_AT_producer: return "AT_producer"; - case DW_AT_prototyped: return "AT_prototyped"; - case DW_AT_return_addr: return "AT_return_addr"; - case DW_AT_start_scope: return "AT_start_scope"; - case DW_AT_bit_stride: return "AT_bit_stride"; - case DW_AT_upper_bound: return "AT_upper_bound"; - case DW_AT_abstract_origin: return "AT_abstract_origin"; - case DW_AT_accessibility: return "AT_accessibility"; - case DW_AT_address_class: return "AT_address_class"; - case DW_AT_artificial: return "AT_artificial"; - case DW_AT_base_types: return "AT_base_types"; - case DW_AT_calling_convention: return "AT_calling_convention"; - case DW_AT_count: return "AT_count"; - case DW_AT_data_member_location: return "AT_data_member_location"; - case DW_AT_decl_column: return "AT_decl_column"; - case DW_AT_decl_file: return "AT_decl_file"; - case DW_AT_decl_line: return "AT_decl_line"; - case DW_AT_declaration: return "AT_declaration"; - case DW_AT_discr_list: return "AT_discr_list"; - case DW_AT_encoding: return "AT_encoding"; - case DW_AT_external: return "AT_external"; - case DW_AT_frame_base: return "AT_frame_base"; - case DW_AT_friend: return "AT_friend"; - case DW_AT_identifier_case: return "AT_identifier_case"; - case DW_AT_macro_info: return "AT_macro_info"; - case DW_AT_namelist_item: return "AT_namelist_item"; - case DW_AT_priority: return "AT_priority"; - case DW_AT_segment: return "AT_segment"; - case DW_AT_specification: return "AT_specification"; - case DW_AT_static_link: return "AT_static_link"; - case DW_AT_type: return "AT_type"; - case DW_AT_use_location: return "AT_use_location"; - case DW_AT_variable_parameter: return "AT_variable_parameter"; - case DW_AT_virtuality: return "AT_virtuality"; - case DW_AT_vtable_elem_location: return "AT_vtable_elem_location"; - case DW_AT_allocated: return "AT_allocated"; - case DW_AT_associated: return "AT_associated"; - case DW_AT_data_location: return "AT_data_location"; - case DW_AT_byte_stride: return "AT_byte_stride"; - case DW_AT_entry_pc: return "AT_entry_pc"; - case DW_AT_use_UTF8: return "AT_use_UTF8"; - case DW_AT_extension: return "AT_extension"; - case DW_AT_ranges: return "AT_ranges"; - case DW_AT_trampoline: return "AT_trampoline"; - case DW_AT_call_column: return "AT_call_column"; - case DW_AT_call_file: return "AT_call_file"; - case DW_AT_call_line: return "AT_call_line"; - case DW_AT_description: return "AT_description"; - case DW_AT_binary_scale: return "AT_binary_scale"; - case DW_AT_decimal_scale: return "AT_decimal_scale"; - case DW_AT_small: return "AT_small"; - case DW_AT_decimal_sign: return "AT_decimal_sign"; - case DW_AT_digit_count: return "AT_digit_count"; - case DW_AT_picture_string: return "AT_picture_string"; - case DW_AT_mutable: return "AT_mutable"; - case DW_AT_threads_scaled: return "AT_threads_scaled"; - case DW_AT_explicit: return "AT_explicit"; - case DW_AT_object_pointer: return "AT_object_pointer"; - case DW_AT_endianity: return "AT_endianity"; - case DW_AT_elemental: return "AT_elemental"; - case DW_AT_pure: return "AT_pure"; - case DW_AT_recursive: return "AT_recursive"; - case DW_AT_MIPS_linkage_name: return "AT_MIPS_linkage_name"; - case DW_AT_sf_names: return "AT_sf_names"; - case DW_AT_src_info: return "AT_src_info"; - case DW_AT_mac_info: return "AT_mac_info"; - case DW_AT_src_coords: return "AT_src_coords"; - case DW_AT_body_begin: return "AT_body_begin"; - case DW_AT_body_end: return "AT_body_end"; - case DW_AT_GNU_vector: return "AT_GNU_vector"; - case DW_AT_lo_user: return "AT_lo_user"; - case DW_AT_hi_user: return "AT_hi_user"; + case DW_AT_sibling: return "DW_AT_sibling"; + case DW_AT_location: return "DW_AT_location"; + case DW_AT_name: return "DW_AT_name"; + case DW_AT_ordering: return "DW_AT_ordering"; + case DW_AT_byte_size: return "DW_AT_byte_size"; + case DW_AT_bit_offset: return "DW_AT_bit_offset"; + case DW_AT_bit_size: return "DW_AT_bit_size"; + case DW_AT_stmt_list: return "DW_AT_stmt_list"; + case DW_AT_low_pc: return "DW_AT_low_pc"; + case DW_AT_high_pc: return "DW_AT_high_pc"; + case DW_AT_language: return "DW_AT_language"; + case DW_AT_discr: return "DW_AT_discr"; + case DW_AT_discr_value: return "DW_AT_discr_value"; + case DW_AT_visibility: return "DW_AT_visibility"; + case DW_AT_import: return "DW_AT_import"; + case DW_AT_string_length: return "DW_AT_string_length"; + case DW_AT_common_reference: return "DW_AT_common_reference"; + case DW_AT_comp_dir: return "DW_AT_comp_dir"; + case DW_AT_const_value: return "DW_AT_const_value"; + case DW_AT_containing_type: return "DW_AT_containing_type"; + case DW_AT_default_value: return "DW_AT_default_value"; + case DW_AT_inline: return "DW_AT_inline"; + case DW_AT_is_optional: return "DW_AT_is_optional"; + case DW_AT_lower_bound: return "DW_AT_lower_bound"; + case DW_AT_producer: return "DW_AT_producer"; + case DW_AT_prototyped: return "DW_AT_prototyped"; + case DW_AT_return_addr: return "DW_AT_return_addr"; + case DW_AT_start_scope: return "DW_AT_start_scope"; + case DW_AT_bit_stride: return "DW_AT_bit_stride"; + case DW_AT_upper_bound: return "DW_AT_upper_bound"; + case DW_AT_abstract_origin: return "DW_AT_abstract_origin"; + case DW_AT_accessibility: return "DW_AT_accessibility"; + case DW_AT_address_class: return "DW_AT_address_class"; + case DW_AT_artificial: return "DW_AT_artificial"; + case DW_AT_base_types: return "DW_AT_base_types"; + case DW_AT_calling_convention: return "DW_AT_calling_convention"; + case DW_AT_count: return "DW_AT_count"; + case DW_AT_data_member_location: return "DW_AT_data_member_location"; + case DW_AT_decl_column: return "DW_AT_decl_column"; + case DW_AT_decl_file: return "DW_AT_decl_file"; + case DW_AT_decl_line: return "DW_AT_decl_line"; + case DW_AT_declaration: return "DW_AT_declaration"; + case DW_AT_discr_list: return "DW_AT_discr_list"; + case DW_AT_encoding: return "DW_AT_encoding"; + case DW_AT_external: return "DW_AT_external"; + case DW_AT_frame_base: return "DW_AT_frame_base"; + case DW_AT_friend: return "DW_AT_friend"; + case DW_AT_identifier_case: return "DW_AT_identifier_case"; + case DW_AT_macro_info: return "DW_AT_macro_info"; + case DW_AT_namelist_item: return "DW_AT_namelist_item"; + case DW_AT_priority: return "DW_AT_priority"; + case DW_AT_segment: return "DW_AT_segment"; + case DW_AT_specification: return "DW_AT_specification"; + case DW_AT_static_link: return "DW_AT_static_link"; + case DW_AT_type: return "DW_AT_type"; + case DW_AT_use_location: return "DW_AT_use_location"; + case DW_AT_variable_parameter: return "DW_AT_variable_parameter"; + case DW_AT_virtuality: return "DW_AT_virtuality"; + case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location"; + case DW_AT_allocated: return "DW_AT_allocated"; + case DW_AT_associated: return "DW_AT_associated"; + case DW_AT_data_location: return "DW_AT_data_location"; + case DW_AT_byte_stride: return "DW_AT_byte_stride"; + case DW_AT_entry_pc: return "DW_AT_entry_pc"; + case DW_AT_use_UTF8: return "DW_AT_use_UTF8"; + case DW_AT_extension: return "DW_AT_extension"; + case DW_AT_ranges: return "DW_AT_ranges"; + case DW_AT_trampoline: return "DW_AT_trampoline"; + case DW_AT_call_column: return "DW_AT_call_column"; + case DW_AT_call_file: return "DW_AT_call_file"; + case DW_AT_call_line: return "DW_AT_call_line"; + case DW_AT_description: return "DW_AT_description"; + case DW_AT_binary_scale: return "DW_AT_binary_scale"; + case DW_AT_decimal_scale: return "DW_AT_decimal_scale"; + case DW_AT_small: return "DW_AT_small"; + case DW_AT_decimal_sign: return "DW_AT_decimal_sign"; + case DW_AT_digit_count: return "DW_AT_digit_count"; + case DW_AT_picture_string: return "DW_AT_picture_string"; + case DW_AT_mutable: return "DW_AT_mutable"; + case DW_AT_threads_scaled: return "DW_AT_threads_scaled"; + case DW_AT_explicit: return "DW_AT_explicit"; + case DW_AT_object_pointer: return "DW_AT_object_pointer"; + case DW_AT_endianity: return "DW_AT_endianity"; + case DW_AT_elemental: return "DW_AT_elemental"; + case DW_AT_pure: return "DW_AT_pure"; + case DW_AT_recursive: return "DW_AT_recursive"; + case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; + case DW_AT_sf_names: return "DW_AT_sf_names"; + case DW_AT_src_info: return "DW_AT_src_info"; + case DW_AT_mac_info: return "DW_AT_mac_info"; + case DW_AT_src_coords: return "DW_AT_src_coords"; + case DW_AT_body_begin: return "DW_AT_body_begin"; + case DW_AT_body_end: return "DW_AT_body_end"; + case DW_AT_GNU_vector: return "DW_AT_GNU_vector"; + case DW_AT_lo_user: return "DW_AT_lo_user"; + case DW_AT_hi_user: return "DW_AT_hi_user"; } assert(0 && "Unknown Dwarf Attribute"); return ""; From resistor at mac.com Sun Oct 12 01:49:22 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 06:49:22 -0000 Subject: [llvm-commits] [llvm] r57411 - /llvm/trunk/include/llvm/LinkAllPasses.h Message-ID: <200810120649.m9C6nNjh027783@zion.cs.uiuc.edu> Author: resistor Date: Sun Oct 12 01:49:21 2008 New Revision: 57411 URL: http://llvm.org/viewvc/llvm-project?rev=57411&view=rev Log: Add EscapeAnalysis. Modified: llvm/trunk/include/llvm/LinkAllPasses.h Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=57411&r1=57410&r2=57411&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Sun Oct 12 01:49:21 2008 @@ -16,6 +16,7 @@ #define LLVM_LINKALLPASSES_H #include "llvm/Analysis/AliasSetTracker.h" +#include "llvm/Analysis/EscapeAnalysis.h" #include "llvm/Analysis/FindUsedTypes.h" #include "llvm/Analysis/IntervalPartition.h" #include "llvm/Analysis/LoopVR.h" @@ -124,6 +125,7 @@ (void)new llvm::FindUsedTypes(); (void)new llvm::ScalarEvolution(); (void)new llvm::LoopVR(); + (void)new llvm::EscapeAnalysis(); ((llvm::Function*)0)->viewCFGOnly(); llvm::AliasSetTracker X(*(llvm::AliasAnalysis*)0); X.add((llvm::Value*)0, 0); // for -print-alias-sets From baldrick at free.fr Sun Oct 12 02:09:33 2008 From: baldrick at free.fr (Duncan Sands) Date: Sun, 12 Oct 2008 09:09:33 +0200 Subject: [llvm-commits] [llvm] r57342 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp In-Reply-To: <200810112217.28940.baldrick@free.fr> References: <200810100836.m9A8aQoG011049@zion.cs.uiuc.edu> <200810112217.28940.baldrick@free.fr> Message-ID: <200810120909.34055.baldrick@free.fr> Hi Owen, > if M is a malloced pointer, this would cause M to escape: > > if (M & 1) > bits[0]=1; > if (M & 2) > bits[1]=1; > if (M & 4) > bits[2]=1; > ... > > Export the "bits" array somehow (eg: write to a global, > a parameter, return it). Then other parts of the program > can reconstruct M from bits, so it would be wrong to > convert it to an alloca. this also applies to AllocaInst: suppose bits is a global array, and A is an alloca. if (A & 1) bits[0]=1; ... call_someone_that_reconstructs_A_from_bits In fact it seems to me that you might as well treat the general case as well as allocation instructions, since there's not going to be much difference. By the general case I mean an arbitrary value (maybe restricted to being of pointer type - though that doesn't seem relevant), or at least pointer parameters. Then your escape analysis could be used for calculating nocapture function attributes too. Ciao, Duncan. From resistor at mac.com Sun Oct 12 02:33:33 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 07:33:33 -0000 Subject: [llvm-commits] [llvm] r57412 - in /llvm/trunk: include/llvm/Analysis/EscapeAnalysis.h lib/Analysis/EscapeAnalysis.cpp Message-ID: <200810120733.m9C7XXW8029481@zion.cs.uiuc.edu> Author: resistor Date: Sun Oct 12 02:33:29 2008 New Revision: 57412 URL: http://llvm.org/viewvc/llvm-project?rev=57412&view=rev Log: Make Escape Analysis work for any pointer. Modified: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Modified: llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h?rev=57412&r1=57411&r2=57412&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/EscapeAnalysis.h Sun Oct 12 02:33:29 2008 @@ -50,8 +50,9 @@ //===--------------------------------------------------------------------- // Client API - /// escapes - returns true if the AllocationInst can escape. - bool escapes(AllocationInst* A); + /// escapes - returns true if the value, which must have a pointer type, + /// can escape. + bool escapes(Value* A); }; } // end llvm namespace Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57412&r1=57411&r2=57412&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Sun Oct 12 02:33:29 2008 @@ -98,18 +98,22 @@ /// escape point. /// FIXME: Once we've discovered a path, it would be a good idea to memoize it, /// and all of its subpaths, to amortize the cost of future queries. -bool EscapeAnalysis::escapes(AllocationInst* A) { - std::vector worklist; +bool EscapeAnalysis::escapes(Value* A) { + assert(isa(A->getType()) && + "Can't do escape analysis on non-pointer types!"); + + std::vector worklist; worklist.push_back(A); - SmallPtrSet visited; + SmallPtrSet visited; visited.insert(A); while (!worklist.empty()) { - Instruction* curr = worklist.back(); + Value* curr = worklist.back(); worklist.pop_back(); - if (EscapePoints.count(curr)) - return true; + if (Instruction* I = dyn_cast(curr)) + if (EscapePoints.count(I)) + return true; if (StoreInst* S = dyn_cast(curr)) { // We know this must be an instruction, because constant gep's would From resistor at mac.com Sun Oct 12 03:10:48 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 08:10:48 -0000 Subject: [llvm-commits] [llvm] r57413 - /llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Message-ID: <200810120810.m9C8AmUm007282@zion.cs.uiuc.edu> Author: resistor Date: Sun Oct 12 03:10:46 2008 New Revision: 57413 URL: http://llvm.org/viewvc/llvm-project?rev=57413&view=rev Log: Add special-case code to allow null-guards on calls to malloc. Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Modified: llvm/trunk/lib/Analysis/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/EscapeAnalysis.cpp?rev=57413&r1=57412&r2=57413&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/EscapeAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/EscapeAnalysis.cpp Sun Oct 12 03:10:46 2008 @@ -13,6 +13,7 @@ #define DEBUG_TYPE "escape-analysis" #include "llvm/Analysis/EscapeAnalysis.h" +#include "llvm/Constants.h" #include "llvm/Module.h" #include "llvm/Support/InstIterator.h" #include "llvm/ADT/SmallPtrSet.h" @@ -112,8 +113,21 @@ worklist.pop_back(); if (Instruction* I = dyn_cast(curr)) - if (EscapePoints.count(I)) - return true; + if (EscapePoints.count(I)) { + BranchInst* B = dyn_cast(I); + if (!B) return true; + Value* condition = B->getCondition(); + ICmpInst* C = dyn_cast(condition); + if (!C) return true; + Value* O1 = C->getOperand(0); + Value* O2 = C->getOperand(1); + if (isa(O1->stripPointerCasts())) { + if (!isa(O2)) return true; + } else if(isa(O2->stripPointerCasts())) { + if (!isa(O1)) return true; + } else + return true; + } if (StoreInst* S = dyn_cast(curr)) { // We know this must be an instruction, because constant gep's would From asl at math.spbu.ru Sun Oct 12 05:30:13 2008 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Sun, 12 Oct 2008 10:30:13 -0000 Subject: [llvm-commits] [llvm] r57414 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86InstrInfo.cpp Message-ID: <200810121030.m9CAUEE6003793@zion.cs.uiuc.edu> Author: asl Date: Sun Oct 12 05:30:11 2008 New Revision: 57414 URL: http://llvm.org/viewvc/llvm-project?rev=57414&view=rev Log: Update size of inst correctly with segment override. Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=57414&r1=57413&r2=57414&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sun Oct 12 05:30:11 2008 @@ -420,6 +420,8 @@ case X86II::GS: MCE.emitByte(0x65); break; + default: assert(0 && "Invalid segment!"); + case 0: break; // No segment override! } // Emit the repeat opcode prefix as needed. Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=57414&r1=57413&r2=57414&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Sun Oct 12 05:30:11 2008 @@ -2668,6 +2668,16 @@ // Emit the lock opcode prefix as needed. if (Desc->TSFlags & X86II::LOCK) ++FinalSize; + // Emit segment overrid opcode prefix as needed. + switch (Desc->TSFlags & X86II::SegOvrMask) { + case X86II::FS: + case X86II::GS: + ++FinalSize; + break; + default: assert(0 && "Invalid segment!"); + case 0: break; // No segment override! + } + // Emit the repeat opcode prefix as needed. if ((Desc->TSFlags & X86II::Op0Mask) == X86II::REP) ++FinalSize; From anton at korobeynikov.info Sun Oct 12 05:31:56 2008 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Sun, 12 Oct 2008 14:31:56 +0400 Subject: [llvm-commits] [llvm] r57380 - in /llvm/trunk/lib/Target/X86: X86.td X86CodeEmitter.cpp X86InstrFormats.td X86InstrInfo.h In-Reply-To: <97BA5A4B-8902-44A7-AC97-A73A0E2D415C@apple.com> References: <200810111909.m9BJ9Gw7001731@zion.cs.uiuc.edu> <97BA5A4B-8902-44A7-AC97-A73A0E2D415C@apple.com> Message-ID: Hi Mon Ping, > Shouldn't we also increment the size for the overside segment in > X86InstrInfo.cpp? Nice catch! Fixed. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From baldrick at free.fr Sun Oct 12 09:31:49 2008 From: baldrick at free.fr (Duncan Sands) Date: Sun, 12 Oct 2008 16:31:49 +0200 Subject: [llvm-commits] [llvm] r57413 - /llvm/trunk/lib/Analysis/EscapeAnalysis.cpp In-Reply-To: <200810120810.m9C8AmUm007282@zion.cs.uiuc.edu> References: <200810120810.m9C8AmUm007282@zion.cs.uiuc.edu> Message-ID: <200810121631.49801.baldrick@free.fr> Hi Owen, > Add special-case code to allow null-guards on calls to malloc. how about adding some comments describing all the evil situations you are dealing with? For example, here it would be tempting to use getUnderlyingObject rather than stripPointerCasts, yet that would be wrong. Explaining why will help later when we've all forgotten why things were done this way :) Ciao, Duncan. From sabre at nondot.org Sun Oct 12 13:30:35 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 12 Oct 2008 18:30:35 -0000 Subject: [llvm-commits] [llvm] r57416 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810121830.m9CIUZWm019492@zion.cs.uiuc.edu> Author: lattner Date: Sun Oct 12 13:30:33 2008 New Revision: 57416 URL: http://llvm.org/viewvc/llvm-project?rev=57416&view=rev Log: add some notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57416&r1=57415&r2=57416&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sun Oct 12 13:30:33 2008 @@ -88,8 +88,12 @@
      6. ... Attributes changes ...
      7. -
      8. The DbgStopPointInst methods getDirectory and getFileName now return Value* instead of strings. These can be converted to strings using llvm::GetConstantStringInfo defined via "llvm/Analysis/ValueTracking.h". +
      9. The DbgStopPointInst methods getDirectory and +getFileName now return Value* instead of strings. These can be +converted to strings using llvm::GetConstantStringInfo defined via +"llvm/Analysis/ValueTracking.h".
      10. +
      11. API change: BinaryOperator::create -> Create (CmpInst, CastInst too)
      12. @@ -174,13 +178,19 @@
        • -

          MRVs got generalized to FCAs.

          +

          MRVs got generalized to FCAs. getresult is gone, ret with multiple values + is gone.

        • fast isel, -O0 compile times

        • Attrs changes?

        • + +
        • Initial PIC16 port

        • + +
        • builtin sync_compare_and_swap builtins + intrinsics

        • +
        • ...

        @@ -217,6 +227,10 @@

          +
        • use diet patch landed: saved 15% IR memory footprint
        • +
        • LLVM IR now directly represents "common" linkage, instead of + representing it as a form of weak linkage.
        • +
        • ...
        @@ -234,8 +248,16 @@
          -
        • .
        • - +
        • Old-ADCE used control dependence and deleted output-free infinite loops. +Added a new Loop deletion pass (for deleting output free provably-finite loops) +and rewrote ADCE to be simpler faster, and not need control dependence.
        • + +
        • SparsePropagation framework for lattice-based dataflow solvers.
        • + +
        • LoadVN and GCSE finally bit the dust?
        • + +
        • Tail duplication was is removed from the standard optimizer sequence.
        • +
        From dalej at apple.com Sun Oct 12 13:40:49 2008 From: dalej at apple.com (Dale Johannesen) Date: Sun, 12 Oct 2008 18:40:49 -0000 Subject: [llvm-commits] [llvm] r57418 - in /llvm/trunk/test/FrontendC: Atomics-no64bit.c Atomics.c Message-ID: <200810121840.m9CIenLf019808@zion.cs.uiuc.edu> Author: johannes Date: Sun Oct 12 13:40:49 2008 New Revision: 57418 URL: http://llvm.org/viewvc/llvm-project?rev=57418&view=rev Log: Remove "long" variants so these will pass on a 64-bit host. Modified: llvm/trunk/test/FrontendC/Atomics-no64bit.c llvm/trunk/test/FrontendC/Atomics.c Modified: llvm/trunk/test/FrontendC/Atomics-no64bit.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/Atomics-no64bit.c?rev=57418&r1=57417&r2=57418&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/Atomics-no64bit.c (original) +++ llvm/trunk/test/FrontendC/Atomics-no64bit.c Sun Oct 12 13:40:49 2008 @@ -1,10 +1,10 @@ // Test frontend handling of __sync builtins. // Modified from a gcc testcase. -// RUN: %llvmgcc -S %s -o - | grep atomic | count 192 +// RUN: %llvmgcc -S %s -o - | grep atomic | count 150 // RUN: %llvmgcc -S %s -o - | grep p0i8 | count 50 // RUN: %llvmgcc -S %s -o - | grep p0i16 | count 50 -// RUN: %llvmgcc -S %s -o - | grep p0i32 | count 92 -// RUN: %llvmgcc -S %s -o - | grep volatile | count 8 +// RUN: %llvmgcc -S %s -o - | grep p0i32 | count 50 +// RUN: %llvmgcc -S %s -o - | grep volatile | count 6 // Currently this is implemented only for Alpha, X86, PowerPC. // Add your target here if it doesn't work. @@ -17,8 +17,6 @@ unsigned short us; signed int si; unsigned int ui; -signed long sl; -unsigned long ul; void test_op_ignore (void) { @@ -28,8 +26,6 @@ (void) __sync_fetch_and_add (&us, 1); (void) __sync_fetch_and_add (&si, 1); (void) __sync_fetch_and_add (&ui, 1); - (void) __sync_fetch_and_add (&sl, 1); - (void) __sync_fetch_and_add (&ul, 1); (void) __sync_fetch_and_sub (&sc, 1); (void) __sync_fetch_and_sub (&uc, 1); @@ -37,8 +33,6 @@ (void) __sync_fetch_and_sub (&us, 1); (void) __sync_fetch_and_sub (&si, 1); (void) __sync_fetch_and_sub (&ui, 1); - (void) __sync_fetch_and_sub (&sl, 1); - (void) __sync_fetch_and_sub (&ul, 1); (void) __sync_fetch_and_or (&sc, 1); (void) __sync_fetch_and_or (&uc, 1); @@ -46,8 +40,6 @@ (void) __sync_fetch_and_or (&us, 1); (void) __sync_fetch_and_or (&si, 1); (void) __sync_fetch_and_or (&ui, 1); - (void) __sync_fetch_and_or (&sl, 1); - (void) __sync_fetch_and_or (&ul, 1); (void) __sync_fetch_and_xor (&sc, 1); (void) __sync_fetch_and_xor (&uc, 1); @@ -55,8 +47,6 @@ (void) __sync_fetch_and_xor (&us, 1); (void) __sync_fetch_and_xor (&si, 1); (void) __sync_fetch_and_xor (&ui, 1); - (void) __sync_fetch_and_xor (&sl, 1); - (void) __sync_fetch_and_xor (&ul, 1); (void) __sync_fetch_and_and (&sc, 1); (void) __sync_fetch_and_and (&uc, 1); @@ -64,8 +54,6 @@ (void) __sync_fetch_and_and (&us, 1); (void) __sync_fetch_and_and (&si, 1); (void) __sync_fetch_and_and (&ui, 1); - (void) __sync_fetch_and_and (&sl, 1); - (void) __sync_fetch_and_and (&ul, 1); (void) __sync_fetch_and_nand (&sc, 1); (void) __sync_fetch_and_nand (&uc, 1); @@ -73,8 +61,6 @@ (void) __sync_fetch_and_nand (&us, 1); (void) __sync_fetch_and_nand (&si, 1); (void) __sync_fetch_and_nand (&ui, 1); - (void) __sync_fetch_and_nand (&sl, 1); - (void) __sync_fetch_and_nand (&ul, 1); } void test_fetch_and_op (void) @@ -85,8 +71,6 @@ us = __sync_fetch_and_add (&us, 11); si = __sync_fetch_and_add (&si, 11); ui = __sync_fetch_and_add (&ui, 11); - sl = __sync_fetch_and_add (&sl, 11); - ul = __sync_fetch_and_add (&ul, 11); sc = __sync_fetch_and_sub (&sc, 11); uc = __sync_fetch_and_sub (&uc, 11); @@ -94,8 +78,6 @@ us = __sync_fetch_and_sub (&us, 11); si = __sync_fetch_and_sub (&si, 11); ui = __sync_fetch_and_sub (&ui, 11); - sl = __sync_fetch_and_sub (&sl, 11); - ul = __sync_fetch_and_sub (&ul, 11); sc = __sync_fetch_and_or (&sc, 11); uc = __sync_fetch_and_or (&uc, 11); @@ -103,8 +85,6 @@ us = __sync_fetch_and_or (&us, 11); si = __sync_fetch_and_or (&si, 11); ui = __sync_fetch_and_or (&ui, 11); - sl = __sync_fetch_and_or (&sl, 11); - ul = __sync_fetch_and_or (&ul, 11); sc = __sync_fetch_and_xor (&sc, 11); uc = __sync_fetch_and_xor (&uc, 11); @@ -112,8 +92,6 @@ us = __sync_fetch_and_xor (&us, 11); si = __sync_fetch_and_xor (&si, 11); ui = __sync_fetch_and_xor (&ui, 11); - sl = __sync_fetch_and_xor (&sl, 11); - ul = __sync_fetch_and_xor (&ul, 11); sc = __sync_fetch_and_and (&sc, 11); uc = __sync_fetch_and_and (&uc, 11); @@ -121,8 +99,6 @@ us = __sync_fetch_and_and (&us, 11); si = __sync_fetch_and_and (&si, 11); ui = __sync_fetch_and_and (&ui, 11); - sl = __sync_fetch_and_and (&sl, 11); - ul = __sync_fetch_and_and (&ul, 11); sc = __sync_fetch_and_nand (&sc, 11); uc = __sync_fetch_and_nand (&uc, 11); @@ -130,8 +106,6 @@ us = __sync_fetch_and_nand (&us, 11); si = __sync_fetch_and_nand (&si, 11); ui = __sync_fetch_and_nand (&ui, 11); - sl = __sync_fetch_and_nand (&sl, 11); - ul = __sync_fetch_and_nand (&ul, 11); } void test_op_and_fetch (void) @@ -142,8 +116,6 @@ us = __sync_add_and_fetch (&us, uc); si = __sync_add_and_fetch (&si, uc); ui = __sync_add_and_fetch (&ui, uc); - sl = __sync_add_and_fetch (&sl, uc); - ul = __sync_add_and_fetch (&ul, uc); sc = __sync_sub_and_fetch (&sc, uc); uc = __sync_sub_and_fetch (&uc, uc); @@ -151,8 +123,6 @@ us = __sync_sub_and_fetch (&us, uc); si = __sync_sub_and_fetch (&si, uc); ui = __sync_sub_and_fetch (&ui, uc); - sl = __sync_sub_and_fetch (&sl, uc); - ul = __sync_sub_and_fetch (&ul, uc); sc = __sync_or_and_fetch (&sc, uc); uc = __sync_or_and_fetch (&uc, uc); @@ -160,8 +130,6 @@ us = __sync_or_and_fetch (&us, uc); si = __sync_or_and_fetch (&si, uc); ui = __sync_or_and_fetch (&ui, uc); - sl = __sync_or_and_fetch (&sl, uc); - ul = __sync_or_and_fetch (&ul, uc); sc = __sync_xor_and_fetch (&sc, uc); uc = __sync_xor_and_fetch (&uc, uc); @@ -169,8 +137,6 @@ us = __sync_xor_and_fetch (&us, uc); si = __sync_xor_and_fetch (&si, uc); ui = __sync_xor_and_fetch (&ui, uc); - sl = __sync_xor_and_fetch (&sl, uc); - ul = __sync_xor_and_fetch (&ul, uc); sc = __sync_and_and_fetch (&sc, uc); uc = __sync_and_and_fetch (&uc, uc); @@ -178,8 +144,6 @@ us = __sync_and_and_fetch (&us, uc); si = __sync_and_and_fetch (&si, uc); ui = __sync_and_and_fetch (&ui, uc); - sl = __sync_and_and_fetch (&sl, uc); - ul = __sync_and_and_fetch (&ul, uc); sc = __sync_nand_and_fetch (&sc, uc); uc = __sync_nand_and_fetch (&uc, uc); @@ -187,8 +151,6 @@ us = __sync_nand_and_fetch (&us, uc); si = __sync_nand_and_fetch (&si, uc); ui = __sync_nand_and_fetch (&ui, uc); - sl = __sync_nand_and_fetch (&sl, uc); - ul = __sync_nand_and_fetch (&ul, uc); } void test_compare_and_swap (void) @@ -199,8 +161,6 @@ us = __sync_val_compare_and_swap (&us, uc, sc); si = __sync_val_compare_and_swap (&si, uc, sc); ui = __sync_val_compare_and_swap (&ui, uc, sc); - sl = __sync_val_compare_and_swap (&sl, uc, sc); - ul = __sync_val_compare_and_swap (&ul, uc, sc); ui = __sync_bool_compare_and_swap (&sc, uc, sc); ui = __sync_bool_compare_and_swap (&uc, uc, sc); @@ -208,8 +168,6 @@ ui = __sync_bool_compare_and_swap (&us, uc, sc); ui = __sync_bool_compare_and_swap (&si, uc, sc); ui = __sync_bool_compare_and_swap (&ui, uc, sc); - ui = __sync_bool_compare_and_swap (&sl, uc, sc); - ui = __sync_bool_compare_and_swap (&ul, uc, sc); } void test_lock (void) @@ -220,8 +178,6 @@ us = __sync_lock_test_and_set (&us, 1); si = __sync_lock_test_and_set (&si, 1); ui = __sync_lock_test_and_set (&ui, 1); - sl = __sync_lock_test_and_set (&sl, 1); - ul = __sync_lock_test_and_set (&ul, 1); __sync_synchronize (); @@ -231,6 +187,4 @@ __sync_lock_release (&us); __sync_lock_release (&si); __sync_lock_release (&ui); - __sync_lock_release (&sl); - __sync_lock_release (&ul); } Modified: llvm/trunk/test/FrontendC/Atomics.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/Atomics.c?rev=57418&r1=57417&r2=57418&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/Atomics.c (original) +++ llvm/trunk/test/FrontendC/Atomics.c Sun Oct 12 13:40:49 2008 @@ -1,10 +1,10 @@ // Test frontend handling of __sync builtins. // Modified from a gcc testcase. -// RUN: %llvmgcc -S %s -o - | grep atomic | count 242 +// RUN: %llvmgcc -S %s -o - | grep atomic | count 200 // RUN: %llvmgcc -S %s -o - | grep p0i8 | count 50 // RUN: %llvmgcc -S %s -o - | grep p0i16 | count 50 -// RUN: %llvmgcc -S %s -o - | grep p0i32 | count 92 -// RUN: %llvmgcc -S %s -o - | grep volatile | count 10 +// RUN: %llvmgcc -S %s -o - | grep p0i32 | count 50 +// RUN: %llvmgcc -S %s -o - | grep volatile | count 8 // Currently this is implemented only for Alpha, X86, PowerPC. // Add your target here if it doesn't work. @@ -17,8 +17,6 @@ unsigned short us; signed int si; unsigned int ui; -signed long sl; -unsigned long ul; signed long long sll; unsigned long long ull; @@ -30,8 +28,6 @@ (void) __sync_fetch_and_add (&us, 1); (void) __sync_fetch_and_add (&si, 1); (void) __sync_fetch_and_add (&ui, 1); - (void) __sync_fetch_and_add (&sl, 1); - (void) __sync_fetch_and_add (&ul, 1); (void) __sync_fetch_and_add (&sll, 1); (void) __sync_fetch_and_add (&ull, 1); @@ -41,8 +37,6 @@ (void) __sync_fetch_and_sub (&us, 1); (void) __sync_fetch_and_sub (&si, 1); (void) __sync_fetch_and_sub (&ui, 1); - (void) __sync_fetch_and_sub (&sl, 1); - (void) __sync_fetch_and_sub (&ul, 1); (void) __sync_fetch_and_sub (&sll, 1); (void) __sync_fetch_and_sub (&ull, 1); @@ -52,8 +46,6 @@ (void) __sync_fetch_and_or (&us, 1); (void) __sync_fetch_and_or (&si, 1); (void) __sync_fetch_and_or (&ui, 1); - (void) __sync_fetch_and_or (&sl, 1); - (void) __sync_fetch_and_or (&ul, 1); (void) __sync_fetch_and_or (&sll, 1); (void) __sync_fetch_and_or (&ull, 1); @@ -63,8 +55,6 @@ (void) __sync_fetch_and_xor (&us, 1); (void) __sync_fetch_and_xor (&si, 1); (void) __sync_fetch_and_xor (&ui, 1); - (void) __sync_fetch_and_xor (&sl, 1); - (void) __sync_fetch_and_xor (&ul, 1); (void) __sync_fetch_and_xor (&sll, 1); (void) __sync_fetch_and_xor (&ull, 1); @@ -74,8 +64,6 @@ (void) __sync_fetch_and_and (&us, 1); (void) __sync_fetch_and_and (&si, 1); (void) __sync_fetch_and_and (&ui, 1); - (void) __sync_fetch_and_and (&sl, 1); - (void) __sync_fetch_and_and (&ul, 1); (void) __sync_fetch_and_and (&sll, 1); (void) __sync_fetch_and_and (&ull, 1); @@ -85,8 +73,6 @@ (void) __sync_fetch_and_nand (&us, 1); (void) __sync_fetch_and_nand (&si, 1); (void) __sync_fetch_and_nand (&ui, 1); - (void) __sync_fetch_and_nand (&sl, 1); - (void) __sync_fetch_and_nand (&ul, 1); (void) __sync_fetch_and_nand (&sll, 1); (void) __sync_fetch_and_nand (&ull, 1); } @@ -99,8 +85,6 @@ us = __sync_fetch_and_add (&us, 11); si = __sync_fetch_and_add (&si, 11); ui = __sync_fetch_and_add (&ui, 11); - sl = __sync_fetch_and_add (&sl, 11); - ul = __sync_fetch_and_add (&ul, 11); sll = __sync_fetch_and_add (&sll, 11); ull = __sync_fetch_and_add (&ull, 11); @@ -110,8 +94,6 @@ us = __sync_fetch_and_sub (&us, 11); si = __sync_fetch_and_sub (&si, 11); ui = __sync_fetch_and_sub (&ui, 11); - sl = __sync_fetch_and_sub (&sl, 11); - ul = __sync_fetch_and_sub (&ul, 11); sll = __sync_fetch_and_sub (&sll, 11); ull = __sync_fetch_and_sub (&ull, 11); @@ -121,8 +103,6 @@ us = __sync_fetch_and_or (&us, 11); si = __sync_fetch_and_or (&si, 11); ui = __sync_fetch_and_or (&ui, 11); - sl = __sync_fetch_and_or (&sl, 11); - ul = __sync_fetch_and_or (&ul, 11); sll = __sync_fetch_and_or (&sll, 11); ull = __sync_fetch_and_or (&ull, 11); @@ -132,8 +112,6 @@ us = __sync_fetch_and_xor (&us, 11); si = __sync_fetch_and_xor (&si, 11); ui = __sync_fetch_and_xor (&ui, 11); - sl = __sync_fetch_and_xor (&sl, 11); - ul = __sync_fetch_and_xor (&ul, 11); sll = __sync_fetch_and_xor (&sll, 11); ull = __sync_fetch_and_xor (&ull, 11); @@ -143,8 +121,6 @@ us = __sync_fetch_and_and (&us, 11); si = __sync_fetch_and_and (&si, 11); ui = __sync_fetch_and_and (&ui, 11); - sl = __sync_fetch_and_and (&sl, 11); - ul = __sync_fetch_and_and (&ul, 11); sll = __sync_fetch_and_and (&sll, 11); ull = __sync_fetch_and_and (&ull, 11); @@ -154,8 +130,6 @@ us = __sync_fetch_and_nand (&us, 11); si = __sync_fetch_and_nand (&si, 11); ui = __sync_fetch_and_nand (&ui, 11); - sl = __sync_fetch_and_nand (&sl, 11); - ul = __sync_fetch_and_nand (&ul, 11); sll = __sync_fetch_and_nand (&sll, 11); ull = __sync_fetch_and_nand (&ull, 11); } @@ -168,8 +142,6 @@ us = __sync_add_and_fetch (&us, uc); si = __sync_add_and_fetch (&si, uc); ui = __sync_add_and_fetch (&ui, uc); - sl = __sync_add_and_fetch (&sl, uc); - ul = __sync_add_and_fetch (&ul, uc); sll = __sync_add_and_fetch (&sll, uc); ull = __sync_add_and_fetch (&ull, uc); @@ -179,8 +151,6 @@ us = __sync_sub_and_fetch (&us, uc); si = __sync_sub_and_fetch (&si, uc); ui = __sync_sub_and_fetch (&ui, uc); - sl = __sync_sub_and_fetch (&sl, uc); - ul = __sync_sub_and_fetch (&ul, uc); sll = __sync_sub_and_fetch (&sll, uc); ull = __sync_sub_and_fetch (&ull, uc); @@ -190,8 +160,6 @@ us = __sync_or_and_fetch (&us, uc); si = __sync_or_and_fetch (&si, uc); ui = __sync_or_and_fetch (&ui, uc); - sl = __sync_or_and_fetch (&sl, uc); - ul = __sync_or_and_fetch (&ul, uc); sll = __sync_or_and_fetch (&sll, uc); ull = __sync_or_and_fetch (&ull, uc); @@ -201,8 +169,6 @@ us = __sync_xor_and_fetch (&us, uc); si = __sync_xor_and_fetch (&si, uc); ui = __sync_xor_and_fetch (&ui, uc); - sl = __sync_xor_and_fetch (&sl, uc); - ul = __sync_xor_and_fetch (&ul, uc); sll = __sync_xor_and_fetch (&sll, uc); ull = __sync_xor_and_fetch (&ull, uc); @@ -212,8 +178,6 @@ us = __sync_and_and_fetch (&us, uc); si = __sync_and_and_fetch (&si, uc); ui = __sync_and_and_fetch (&ui, uc); - sl = __sync_and_and_fetch (&sl, uc); - ul = __sync_and_and_fetch (&ul, uc); sll = __sync_and_and_fetch (&sll, uc); ull = __sync_and_and_fetch (&ull, uc); @@ -223,8 +187,6 @@ us = __sync_nand_and_fetch (&us, uc); si = __sync_nand_and_fetch (&si, uc); ui = __sync_nand_and_fetch (&ui, uc); - sl = __sync_nand_and_fetch (&sl, uc); - ul = __sync_nand_and_fetch (&ul, uc); sll = __sync_nand_and_fetch (&sll, uc); ull = __sync_nand_and_fetch (&ull, uc); } @@ -237,8 +199,6 @@ us = __sync_val_compare_and_swap (&us, uc, sc); si = __sync_val_compare_and_swap (&si, uc, sc); ui = __sync_val_compare_and_swap (&ui, uc, sc); - sl = __sync_val_compare_and_swap (&sl, uc, sc); - ul = __sync_val_compare_and_swap (&ul, uc, sc); sll = __sync_val_compare_and_swap (&sll, uc, sc); ull = __sync_val_compare_and_swap (&ull, uc, sc); @@ -248,8 +208,6 @@ ui = __sync_bool_compare_and_swap (&us, uc, sc); ui = __sync_bool_compare_and_swap (&si, uc, sc); ui = __sync_bool_compare_and_swap (&ui, uc, sc); - ui = __sync_bool_compare_and_swap (&sl, uc, sc); - ui = __sync_bool_compare_and_swap (&ul, uc, sc); ui = __sync_bool_compare_and_swap (&sll, uc, sc); ui = __sync_bool_compare_and_swap (&ull, uc, sc); } @@ -262,8 +220,6 @@ us = __sync_lock_test_and_set (&us, 1); si = __sync_lock_test_and_set (&si, 1); ui = __sync_lock_test_and_set (&ui, 1); - sl = __sync_lock_test_and_set (&sl, 1); - ul = __sync_lock_test_and_set (&ul, 1); sll = __sync_lock_test_and_set (&sll, 1); ull = __sync_lock_test_and_set (&ull, 1); @@ -275,8 +231,6 @@ __sync_lock_release (&us); __sync_lock_release (&si); __sync_lock_release (&ui); - __sync_lock_release (&sl); - __sync_lock_release (&ul); __sync_lock_release (&sll); __sync_lock_release (&ull); } From sabre at nondot.org Sun Oct 12 13:57:09 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 12 Oct 2008 18:57:09 -0000 Subject: [llvm-commits] [llvm] r57422 - /llvm/trunk/include/llvm/ADT/iterator Message-ID: <200810121857.m9CIv9rc020495@zion.cs.uiuc.edu> Author: lattner Date: Sun Oct 12 13:57:09 2008 New Revision: 57422 URL: http://llvm.org/viewvc/llvm-project?rev=57422&view=rev Log: this was to be removed after 2.4 branched. Removed: llvm/trunk/include/llvm/ADT/iterator Removed: llvm/trunk/include/llvm/ADT/iterator URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/iterator?rev=57421&view=auto ============================================================================== --- llvm/trunk/include/llvm/ADT/iterator (original) +++ llvm/trunk/include/llvm/ADT/iterator (removed) @@ -1,32 +0,0 @@ -//===-- llvm/ADT/iterator - Portable wrapper around --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file provides a wrapper around the mysterious header file. -// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other -// friends), instead of the standard iterator class. In GCC 3.1, the -// bidirectional_iterator class got moved out and the new, standards compliant, -// iterator<> class was added. Because there is nothing that we can do to get -// correct behavior on both compilers, we have this header with #ifdef's. Gross -// huh? -// -// By #includ'ing this file, you get the contents of plus the -// following classes in the global namespace: -// -// 1. bidirectional_iterator -// 2. forward_iterator -// -// The #if directives' expressions are filled in by Autoconf. -// -//===----------------------------------------------------------------------===// - -#warning This files includes old 'llvm/ADT/iterator' file, which was replaced \ -by 'llvm/ADT/iterator.h'. Please consider upgrading the source. - -#include "llvm/ADT/iterator.h" - From sabre at nondot.org Sun Oct 12 14:47:50 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 12 Oct 2008 19:47:50 -0000 Subject: [llvm-commits] [llvm] r57423 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810121947.m9CJlovv021986@zion.cs.uiuc.edu> Author: lattner Date: Sun Oct 12 14:47:48 2008 New Revision: 57423 URL: http://llvm.org/viewvc/llvm-project?rev=57423&view=rev Log: add some more notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57423&r1=57422&r2=57423&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sun Oct 12 14:47:48 2008 @@ -24,8 +24,6 @@

        Written by the LLVM Team

        - -

        Introduction @@ -70,7 +68,14 @@ Machine LICM Machine Sinking LegalizeDAGTypes + llc -enable-value-prop, propagation of value info (sign/zero ext info) from + one MBB to another --> + +
        @@ -79,7 +84,11 @@
        -

        ....

        +

        The LLVM IR generated by llvm-gcc now doesn't name instructions. Use the + instnamer pass if you want them.

        + + +

        LLVM API Changes:

        @@ -94,6 +103,8 @@ "llvm/Analysis/ValueTracking.h".
      13. API change: BinaryOperator::create -> Create (CmpInst, CastInst too)
      14. +
      15. Various header files like "llvm/ADT/iterator" were given a .h suffix. + Change your code to #include "llvm/ADT/iterator.h" instead.
      16. @@ -182,14 +193,14 @@ is gone.

        -
      17. fast isel, -O0 compile times

      18. +
      19. -O0 compile times overall much faster

      20. Attrs changes?

      21. Initial PIC16 port

      22. -
      23. builtin sync_compare_and_swap builtins + intrinsics

      24. +
      25. Support the rest of the atomic __sync builtins

      26. ...

      27. @@ -230,7 +241,7 @@
      28. use diet patch landed: saved 15% IR memory footprint
      29. LLVM IR now directly represents "common" linkage, instead of representing it as a form of weak linkage.
      30. - +
      31. DebugInfoBuilder
      32. ...
      33. @@ -248,6 +259,10 @@
          +
        • GVN now does local PRE?
        • + +
        • Matthijs' Dead argument elimination rewrite
        • +
        • Old-ADCE used control dependence and deleted output-free infinite loops. Added a new Loop deletion pass (for deleting output free provably-finite loops) and rewrote ADCE to be simpler faster, and not need control dependence.
        • @@ -258,6 +273,10 @@
        • Tail duplication was is removed from the standard optimizer sequence.
        • +
        • Various helper functions (ComputeMaskedBits, ComputeNumSignBits, etc) were +pulled out of instcombine and put into a new ValueTracking.h file, where they +can be reused by other passes.
        • +
        @@ -274,7 +293,15 @@ faster:

          +
        • 2-addr pass can now remat trivial insts to avoid a copy.
        • +
        • spiller to commute instructions in order to fold a reload
        • +
        • Stack slot coloring?
        • +
        • Live intervals renumbering? Is this useful to external people?
        • +
        • 'is as cheap as a move' instruction flag
        • +
        • Improvements to selection dag viewing
        • +
        • fast isel
        • Selection dag speedups
        • +
        • asmwriter + raw_ostream -> fastah
        • ...
        @@ -292,7 +319,8 @@

          -
        • Exception handling is supported by default on x86-64 linux platform.
        • +
        • Exception handling is supported by default on Linux/x86-64.
        • +
        • Position Independent Code (PIC) is now support on Linux/x86-64.
        • ...
        @@ -326,6 +354,7 @@

          +
        • raw_ostream + formatting
        • ...
        From resistor at mac.com Sun Oct 12 15:39:30 2008 From: resistor at mac.com (Owen Anderson) Date: Sun, 12 Oct 2008 20:39:30 -0000 Subject: [llvm-commits] [llvm] r57424 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Message-ID: <200810122039.m9CKdUb5023513@zion.cs.uiuc.edu> Author: resistor Date: Sun Oct 12 15:39:30 2008 New Revision: 57424 URL: http://llvm.org/viewvc/llvm-project?rev=57424&view=rev Log: Fix a bug in live-in detection that caused lost-copy problems to show up. Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=57424&r1=57423&r2=57424&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original) +++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Sun Oct 12 15:39:30 2008 @@ -295,7 +295,7 @@ LiveIntervals& LI) { LiveInterval& I = LI.getOrCreateInterval(r); unsigned idx = LI.getMBBStartIdx(MBB); - return I.liveBeforeAndAt(idx); + return I.liveAt(idx); } /// isLiveOut - help method that determines, from a regno, if a register is From dalej at apple.com Sun Oct 12 16:23:02 2008 From: dalej at apple.com (Dale Johannesen) Date: Sun, 12 Oct 2008 21:23:02 -0000 Subject: [llvm-commits] [llvm] r57425 - /llvm/trunk/lib/Support/Dwarf.cpp Message-ID: <200810122123.m9CLN2vk024802@zion.cs.uiuc.edu> Author: johannes Date: Sun Oct 12 16:23:01 2008 New Revision: 57425 URL: http://llvm.org/viewvc/llvm-project?rev=57425&view=rev Log: Change TAG_ names to DW_TAG for gcc (testsuite) compatibility. Modified: llvm/trunk/lib/Support/Dwarf.cpp Modified: llvm/trunk/lib/Support/Dwarf.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Dwarf.cpp?rev=57425&r1=57424&r2=57425&view=diff ============================================================================== --- llvm/trunk/lib/Support/Dwarf.cpp (original) +++ llvm/trunk/lib/Support/Dwarf.cpp Sun Oct 12 16:23:01 2008 @@ -23,65 +23,65 @@ /// const char *TagString(unsigned Tag) { switch(Tag) { - case DW_TAG_array_type: return "TAG_array_type"; - case DW_TAG_class_type: return "TAG_class_type"; - case DW_TAG_entry_point: return "TAG_entry_point"; - case DW_TAG_enumeration_type: return "TAG_enumeration_type"; - case DW_TAG_formal_parameter: return "TAG_formal_parameter"; - case DW_TAG_imported_declaration: return "TAG_imported_declaration"; - case DW_TAG_label: return "TAG_label"; - case DW_TAG_lexical_block: return "TAG_lexical_block"; - case DW_TAG_member: return "TAG_member"; - case DW_TAG_pointer_type: return "TAG_pointer_type"; - case DW_TAG_reference_type: return "TAG_reference_type"; - case DW_TAG_compile_unit: return "TAG_compile_unit"; - case DW_TAG_string_type: return "TAG_string_type"; - case DW_TAG_structure_type: return "TAG_structure_type"; - case DW_TAG_subroutine_type: return "TAG_subroutine_type"; - case DW_TAG_typedef: return "TAG_typedef"; - case DW_TAG_union_type: return "TAG_union_type"; - case DW_TAG_unspecified_parameters: return "TAG_unspecified_parameters"; - case DW_TAG_variant: return "TAG_variant"; - case DW_TAG_common_block: return "TAG_common_block"; - case DW_TAG_common_inclusion: return "TAG_common_inclusion"; - case DW_TAG_inheritance: return "TAG_inheritance"; - case DW_TAG_inlined_subroutine: return "TAG_inlined_subroutine"; - case DW_TAG_module: return "TAG_module"; - case DW_TAG_ptr_to_member_type: return "TAG_ptr_to_member_type"; - case DW_TAG_set_type: return "TAG_set_type"; - case DW_TAG_subrange_type: return "TAG_subrange_type"; - case DW_TAG_with_stmt: return "TAG_with_stmt"; - case DW_TAG_access_declaration: return "TAG_access_declaration"; - case DW_TAG_base_type: return "TAG_base_type"; - case DW_TAG_catch_block: return "TAG_catch_block"; - case DW_TAG_const_type: return "TAG_const_type"; - case DW_TAG_constant: return "TAG_constant"; - case DW_TAG_enumerator: return "TAG_enumerator"; - case DW_TAG_file_type: return "TAG_file_type"; - case DW_TAG_friend: return "TAG_friend"; - case DW_TAG_namelist: return "TAG_namelist"; - case DW_TAG_namelist_item: return "TAG_namelist_item"; - case DW_TAG_packed_type: return "TAG_packed_type"; - case DW_TAG_subprogram: return "TAG_subprogram"; - case DW_TAG_template_type_parameter: return "TAG_template_type_parameter"; - case DW_TAG_template_value_parameter: return "TAG_template_value_parameter"; - case DW_TAG_thrown_type: return "TAG_thrown_type"; - case DW_TAG_try_block: return "TAG_try_block"; - case DW_TAG_variant_part: return "TAG_variant_part"; - case DW_TAG_variable: return "TAG_variable"; - case DW_TAG_volatile_type: return "TAG_volatile_type"; - case DW_TAG_dwarf_procedure: return "TAG_dwarf_procedure"; - case DW_TAG_restrict_type: return "TAG_restrict_type"; - case DW_TAG_interface_type: return "TAG_interface_type"; - case DW_TAG_namespace: return "TAG_namespace"; - case DW_TAG_imported_module: return "TAG_imported_module"; - case DW_TAG_unspecified_type: return "TAG_unspecified_type"; - case DW_TAG_partial_unit: return "TAG_partial_unit"; - case DW_TAG_imported_unit: return "TAG_imported_unit"; - case DW_TAG_condition: return "TAG_condition"; - case DW_TAG_shared_type: return "TAG_shared_type"; - case DW_TAG_lo_user: return "TAG_lo_user"; - case DW_TAG_hi_user: return "TAG_hi_user"; + case DW_TAG_array_type: return "DW_TAG_array_type"; + case DW_TAG_class_type: return "DW_TAG_class_type"; + case DW_TAG_entry_point: return "DW_TAG_entry_point"; + case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type"; + case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter"; + case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration"; + case DW_TAG_label: return "DW_TAG_label"; + case DW_TAG_lexical_block: return "DW_TAG_lexical_block"; + case DW_TAG_member: return "DW_TAG_member"; + case DW_TAG_pointer_type: return "DW_TAG_pointer_type"; + case DW_TAG_reference_type: return "DW_TAG_reference_type"; + case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; + case DW_TAG_string_type: return "DW_TAG_string_type"; + case DW_TAG_structure_type: return "DW_TAG_structure_type"; + case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type"; + case DW_TAG_typedef: return "DW_TAG_typedef"; + case DW_TAG_union_type: return "DW_TAG_union_type"; + case DW_TAG_unspecified_parameters: return "DW_TAG_unspecified_parameters"; + case DW_TAG_variant: return "DW_TAG_variant"; + case DW_TAG_common_block: return "DW_TAG_common_block"; + case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion"; + case DW_TAG_inheritance: return "DW_TAG_inheritance"; + case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine"; + case DW_TAG_module: return "DW_TAG_module"; + case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type"; + case DW_TAG_set_type: return "DW_TAG_set_type"; + case DW_TAG_subrange_type: return "DW_TAG_subrange_type"; + case DW_TAG_with_stmt: return "DW_TAG_with_stmt"; + case DW_TAG_access_declaration: return "DW_TAG_access_declaration"; + case DW_TAG_base_type: return "DW_TAG_base_type"; + case DW_TAG_catch_block: return "DW_TAG_catch_block"; + case DW_TAG_const_type: return "DW_TAG_const_type"; + case DW_TAG_constant: return "DW_TAG_constant"; + case DW_TAG_enumerator: return "DW_TAG_enumerator"; + case DW_TAG_file_type: return "DW_TAG_file_type"; + case DW_TAG_friend: return "DW_TAG_friend"; + case DW_TAG_namelist: return "DW_TAG_namelist"; + case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; + case DW_TAG_packed_type: return "DW_TAG_packed_type"; + case DW_TAG_subprogram: return "DW_TAG_subprogram"; + case DW_TAG_template_type_parameter: return "DW_TAG_template_type_parameter"; + case DW_TAG_template_value_parameter: return "DW_TAG_template_value_parameter"; + case DW_TAG_thrown_type: return "DW_TAG_thrown_type"; + case DW_TAG_try_block: return "DW_TAG_try_block"; + case DW_TAG_variant_part: return "DW_TAG_variant_part"; + case DW_TAG_variable: return "DW_TAG_variable"; + case DW_TAG_volatile_type: return "DW_TAG_volatile_type"; + case DW_TAG_dwarf_procedure: return "DW_TAG_dwarf_procedure"; + case DW_TAG_restrict_type: return "DW_TAG_restrict_type"; + case DW_TAG_interface_type: return "DW_TAG_interface_type"; + case DW_TAG_namespace: return "DW_TAG_namespace"; + case DW_TAG_imported_module: return "DW_TAG_imported_module"; + case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type"; + case DW_TAG_partial_unit: return "DW_TAG_partial_unit"; + case DW_TAG_imported_unit: return "DW_TAG_imported_unit"; + case DW_TAG_condition: return "DW_TAG_condition"; + case DW_TAG_shared_type: return "DW_TAG_shared_type"; + case DW_TAG_lo_user: return "DW_TAG_lo_user"; + case DW_TAG_hi_user: return "DW_TAG_hi_user"; } assert(0 && "Unknown Dwarf Tag"); return ""; From dalej at apple.com Sun Oct 12 16:24:35 2008 From: dalej at apple.com (Dale Johannesen) Date: Sun, 12 Oct 2008 21:24:35 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r57426 - in /llvm-gcc-4.2/trunk/gcc/testsuite: obj-c++.dg/dwarf-1.mm obj-c++.dg/dwarf-3.mm obj-c++.dg/property-dwarf-1.mm objc.dg/dwarf-1.m objc.dg/dwarf-3.m objc.dg/property-dwarf-1.m Message-ID: <200810122124.m9CLOaXb024858@zion.cs.uiuc.edu> Author: johannes Date: Sun Oct 12 16:24:35 2008 New Revision: 57426 URL: http://llvm.org/viewvc/llvm-project?rev=57426&view=rev Log: Testcase adjustments for different llvm-gcc syntax. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-3.mm llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-dwarf-1.mm llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-1.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-3.m llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-dwarf-1.m Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/dwarf-1.mm?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-1.mm Sun Oct 12 16:24:35 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file radar 4734562 */ /* { dg-options "-gdwarf-2 -dA" } */ -/* { dg-final { scan-assembler "\"main\\\\0\".*DW_AT_name" } } */ +/* LLVM LOCAL allow for asciz instead of ascii */ +/* { dg-final { scan-assembler "\"main(\\\\0)?\".*DW_AT_name" } } */ #include /* APPLE LOCAL radar 4894756 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-3.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/dwarf-3.mm?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-3.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/dwarf-3.mm Sun Oct 12 16:24:35 2008 @@ -1,7 +1,9 @@ /* APPLE LOCAL file radar 4477797 */ /* { dg-options "-gdwarf-2 -dA" } */ -/* { dg-final { scan-assembler "\"Object\\\\0\".*DW_AT_name" } } */ -/* { dg-final { scan-assembler "\"MyObject\\\\0\".*DW_AT_name.*DW_TAG_inheritance" } } */ +/* LLVM LOCAL begin allow for asciz instead of ascii */ +/* { dg-final { scan-assembler "\"Object(\\\\0)?\".*DW_AT_name" } } */ +/* { dg-final { scan-assembler "\"MyObject(\\\\0)?\".*DW_AT_name.*DW_TAG_inheritance" } } */ +/* LLVM LOCAL end */ #include /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-dwarf-1.mm URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/obj-c%2B%2B.dg/property-dwarf-1.mm?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-dwarf-1.mm (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/obj-c++.dg/property-dwarf-1.mm Sun Oct 12 16:24:35 2008 @@ -3,7 +3,8 @@ /* { dg-options "-mmacosx-version-min=10.5 -gdwarf-2 -dA" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-gdwarf-2 -dA" { target arm*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-final { scan-assembler "\"_prop\\\\0\".*DW_AT_name" } } */ +/* LLVM LOCAL begin allow for asciz instead of ascii */ +/* { dg-final { scan-assembler "\"_prop(\\\\0)?\".*DW_AT_name" } } */ @interface Foo { id isa; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-1.m?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-1.m Sun Oct 12 16:24:35 2008 @@ -1,5 +1,6 @@ /* { dg-options "-gdwarf-2 -dA" } */ -/* { dg-final { scan-assembler "\"id.0\".*DW_AT_name" } } */ +/* LLVM LOCAL allow for asciz instead of ascii */ +/* { dg-final { scan-assembler "\"id(.0)?\".*DW_AT_name" } } */ /* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* *-*-solaris2.[56]* } && { ! hppa*64*-*-* } } { "*" } { "" } } */ @interface foo id x; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-3.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-3.m?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-3.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/dwarf-3.m Sun Oct 12 16:24:35 2008 @@ -1,7 +1,9 @@ /* APPLE LOCAL file radar 4477797 */ /* { dg-options "-gdwarf-2 -dA" } */ -/* { dg-final { scan-assembler "\"Object\\\\0\".*DW_AT_name" } } */ -/* { dg-final { scan-assembler "\"MyObject\\\\0\".*DW_AT_name.*DW_TAG_inheritance" } } */ +/* LLVM LOCAL begin allow for asciz rather than ascii */ +/* { dg-final { scan-assembler "\"Object(\\\\0)?\".*DW_AT_name" } } */ +/* { dg-final { scan-assembler "\"MyObject(\\\\0)?\".*DW_AT_name.*DW_TAG_inheritance" } } */ +/* LLVM LOCAL end */ #include /* APPLE LOCAL radar 4894756 */ #include "../objc/execute/Object2.h" Modified: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-dwarf-1.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-dwarf-1.m?rev=57426&r1=57425&r2=57426&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-dwarf-1.m (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/property-dwarf-1.m Sun Oct 12 16:24:35 2008 @@ -3,7 +3,8 @@ /* { dg-options "-mmacosx-version-min=10.5 -gdwarf-2 -dA" { target powerpc*-*-darwin* i?86*-*-darwin* } } */ /* { dg-options "-gdwarf-2 -dA" { target arm*-*-darwin* } } */ /* { dg-do compile { target *-*-darwin* } } */ -/* { dg-final { scan-assembler "\"_prop\\\\0\".*DW_AT_name" } } */ +/* LLVM LOCAL allow for asciz not ascii */ +/* { dg-final { scan-assembler "\"_prop(\\\\0)?\".*DW_AT_name" } } */ @interface Foo { id isa; From sabre at nondot.org Sun Oct 12 17:58:01 2008 From: sabre at nondot.org (Chris Lattner) Date: Sun, 12 Oct 2008 22:58:01 -0000 Subject: [llvm-commits] [llvm] r57427 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810122258.m9CMw2fY031106@zion.cs.uiuc.edu> Author: lattner Date: Sun Oct 12 17:57:58 2008 New Revision: 57427 URL: http://llvm.org/viewvc/llvm-project?rev=57427&view=rev Log: more notes Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57427&r1=57426&r2=57427&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sun Oct 12 17:57:58 2008 @@ -74,7 +74,7 @@ @@ -87,7 +87,7 @@

        The LLVM IR generated by llvm-gcc now doesn't name instructions. Use the instnamer pass if you want them.

        - +
      34. LoadVN and GCSE are completely gone.
      35. LLVM API Changes:

        @@ -105,7 +105,9 @@
      36. API change: BinaryOperator::create -> Create (CmpInst, CastInst too)
      37. Various header files like "llvm/ADT/iterator" were given a .h suffix. Change your code to #include "llvm/ADT/iterator.h" instead.
      38. + +
        @@ -238,10 +240,12 @@

          +
        • vector shifts in the IR: no codegen support yet
        • use diet patch landed: saved 15% IR memory footprint
        • LLVM IR now directly represents "common" linkage, instead of representing it as a form of weak linkage.
        • DebugInfoBuilder
        • +
        • .ll printing format change: %3 = add i32 4, 2
        • ...
        @@ -269,14 +273,13 @@
      39. SparsePropagation framework for lattice-based dataflow solvers.
      40. -
      41. LoadVN and GCSE finally bit the dust?
      42. - -
      43. Tail duplication was is removed from the standard optimizer sequence.
      44. +
      45. Tail duplication was removed from the standard optimizer sequence.
      46. Various helper functions (ComputeMaskedBits, ComputeNumSignBits, etc) were pulled out of instcombine and put into a new ValueTracking.h file, where they can be reused by other passes.
      47. +
      48. MarkModRef etc
      49. @@ -293,7 +296,10 @@ faster:

          -
        • 2-addr pass can now remat trivial insts to avoid a copy.
        • +
        • asm writers split out to their own library to avoid JITs having to link + them in.
        • +
        • Big asm writer refactoring + TargetAsmInfo
        • +
        • 2-addr pass and coalescer can now remat trivial insts to avoid a copy.
        • spiller to commute instructions in order to fold a reload
        • Stack slot coloring?
        • Live intervals renumbering? Is this useful to external people?
        • @@ -337,6 +343,7 @@

            +
          • MIPS floating point support?
          • ....
          @@ -355,6 +362,7 @@
          • raw_ostream + formatting
          • +
          • Recycler + pool allocation stuff?
          • ...
          From sabre at nondot.org Sun Oct 12 20:59:14 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 13 Oct 2008 01:59:14 -0000 Subject: [llvm-commits] [llvm] r57428 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <200810130159.m9D1xFms008359@zion.cs.uiuc.edu> Author: lattner Date: Sun Oct 12 20:59:13 2008 New Revision: 57428 URL: http://llvm.org/viewvc/llvm-project?rev=57428&view=rev Log: calls can be supported. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=57428&r1=57427&r2=57428&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Sun Oct 12 20:59:13 2008 @@ -11,30 +11,30 @@ // // "Fast" instruction selection is designed to emit very poor code quickly. // Also, it is not designed to be able to do much lowering, so most illegal -// types (e.g. i64 on 32-bit targets) and operations (e.g. calls) are not -// supported. It is also not intended to be able to do much optimization, -// except in a few cases where doing optimizations reduces overall compile -// time (e.g. folding constants into immediate fields, because it's cheap -// and it reduces the number of instructions later phases have to examine). +// types (e.g. i64 on 32-bit targets) and operations are not supported. It is +// also not intended to be able to do much optimization, except in a few cases +// where doing optimizations reduces overall compile time. For example, folding +// constants into immediate fields is often done, because it's cheap and it +// reduces the number of instructions later phases have to examine. // // "Fast" instruction selection is able to fail gracefully and transfer // control to the SelectionDAG selector for operations that it doesn't -// support. In many cases, this allows us to avoid duplicating a lot of +// support. In many cases, this allows us to avoid duplicating a lot of // the complicated lowering logic that SelectionDAG currently has. // // The intended use for "fast" instruction selection is "-O0" mode // compilation, where the quality of the generated code is irrelevant when -// weighed against the speed at which the code can be generated. Also, +// weighed against the speed at which the code can be generated. Also, // at -O0, the LLVM optimizers are not running, and this makes the // compile time of codegen a much higher portion of the overall compile -// time. Despite its limitations, "fast" instruction selection is able to +// time. Despite its limitations, "fast" instruction selection is able to // handle enough code on its own to provide noticeable overall speedups // in -O0 compiles. // // Basic operations are supported in a target-independent way, by reading // the same instruction descriptions that the SelectionDAG selector reads, // and identifying simple arithmetic operations that can be directly selected -// from simple operators. More complicated operations currently require +// from simple operators. More complicated operations currently require // target-specific code. // //===----------------------------------------------------------------------===// From foldr at codedgers.com Sun Oct 12 21:08:35 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 13 Oct 2008 02:08:35 -0000 Subject: [llvm-commits] [llvm] r57429 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810130208.m9D28ZEE008839@zion.cs.uiuc.edu> Author: foldr Date: Sun Oct 12 21:08:34 2008 New Revision: 57429 URL: http://llvm.org/viewvc/llvm-project?rev=57429&view=rev Log: Add a note on llvmc2 plugins + remove some trailing whitespace (my Emacs does this automatically). Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57429&r1=57428&r2=57429&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sun Oct 12 21:08:34 2008 @@ -9,7 +9,7 @@
          LLVM 2.4 Release Notes
          - +
          1. Introduction
          2. Major Changes and Sub-project Status
          3. @@ -44,7 +44,7 @@ href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM developer's mailing list is a good place to send them.

            -

            Note that if you are reading this file from a Subversion checkout or the +

            Note that if you are reading this file from a Subversion checkout or the main LLVM web page, this document applies to the next release, not the current one. To see the release notes for a specific releases, please see the releases page.

            @@ -59,7 +59,7 @@
            -

            This is the fifteenth public release of the LLVM Compiler Infrastructure. +

            This is the fifteenth public release of the LLVM Compiler Infrastructure. It includes a large number of features and refinements from LLVM 2.3.

            @@ -71,7 +71,7 @@ llc -enable-value-prop, propagation of value info (sign/zero ext info) from one MBB to another --> - + @@ -258,7 +258,7 @@
            -

            In addition to a huge array of bug fixes and minor performance tweaks, the +

            In addition to a huge array of bug fixes and minor performance tweaks, the LLVM 2.4 optimizers support a few major enhancements:

              @@ -330,7 +330,7 @@
            • ...
            - +
            @@ -346,9 +346,8 @@
          4. MIPS floating point support?
          5. ....
        - - + @@ -361,11 +360,14 @@

          +
        • llvmc2(the generic compiler driver) gained plugin + support. It is now easier to experiment with llvmc2 and + build your own tools based on it.
        • raw_ostream + formatting
        • Recycler + pool allocation stuff?
        • ...
        - + @@ -379,7 +381,7 @@

        LLVM is known to work on the following platforms:

          -
        • Intel and AMD machines (IA32) running Red Hat Linux, Fedora Core and FreeBSD +
        • Intel and AMD machines (IA32) running Red Hat Linux, Fedora Core and FreeBSD (and probably other unix-like systems).
        • PowerPC and X86-based Mac OS X systems, running 10.3 and above in 32-bit and 64-bit modes.
        • From foldr at codedgers.com Sun Oct 12 21:46:01 2008 From: foldr at codedgers.com (Mikhail Glushenkov) Date: Mon, 13 Oct 2008 02:46:01 -0000 Subject: [llvm-commits] [llvm] r57430 - /llvm/trunk/docs/ReleaseNotes.html Message-ID: <200810130246.m9D2k171010519@zion.cs.uiuc.edu> Author: foldr Date: Sun Oct 12 21:46:01 2008 New Revision: 57430 URL: http://llvm.org/viewvc/llvm-project?rev=57430&view=rev Log: Add whitespace before a parenthesis. Modified: llvm/trunk/docs/ReleaseNotes.html Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=57430&r1=57429&r2=57430&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Sun Oct 12 21:46:01 2008 @@ -360,7 +360,7 @@

            -
          • llvmc2(the generic compiler driver) gained plugin +
          • llvmc2 (the generic compiler driver) gained plugin support. It is now easier to experiment with llvmc2 and build your own tools based on it.
          • raw_ostream + formatting
          • From nicholas at mxc.ca Sun Oct 12 22:58:04 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 13 Oct 2008 03:58:04 -0000 Subject: [llvm-commits] [llvm] r57431 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp Message-ID: <200810130358.m9D3w5JF013601@zion.cs.uiuc.edu> Author: nicholas Date: Sun Oct 12 22:58:02 2008 New Revision: 57431 URL: http://llvm.org/viewvc/llvm-project?rev=57431&view=rev Log: Disallow the construction of SCEVs with could-not-compute operands. Catch CNCs returned by BinomialCoefficient and don't try to operate with them. This replaces the previous fix for PR2857. Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=57431&r1=57430&r2=57431&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original) +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Oct 12 22:58:02 2008 @@ -644,11 +644,12 @@ // The computation is correct in the face of overflow provided that the // multiplication is performed _after_ the evaluation of the binomial // coefficient. - SCEVHandle Val = - SE.getMulExpr(getOperand(i), - BinomialCoefficient(It, i, SE, - cast(getType()))); - Result = SE.getAddExpr(Result, Val); + SCEVHandle Coeff = BinomialCoefficient(It, i, SE, + cast(getType())); + if (isa(Coeff)) + return Coeff; + + Result = SE.getAddExpr(Result, SE.getMulExpr(getOperand(i), Coeff)); } return Result; } @@ -676,9 +677,6 @@ return getAddRecExpr(Operands, AddRec->getLoop()); } - if (isa(Op)) - return new SCEVCouldNotCompute(); - SCEVTruncateExpr *&Result = (*SCEVTruncates)[std::make_pair(Op, Ty)]; if (Result == 0) Result = new SCEVTruncateExpr(Op, Ty); return Result; @@ -694,9 +692,6 @@ // operands (often constants). This would allow analysis of something like // this: for (unsigned char X = 0; X < 100; ++X) { int Y = X; } - if (isa(Op)) - return new SCEVCouldNotCompute(); - SCEVZeroExtendExpr *&Result = (*SCEVZeroExtends)[std::make_pair(Op, Ty)]; if (Result == 0) Result = new SCEVZeroExtendExpr(Op, Ty); return Result; @@ -712,9 +707,6 @@ // operands (often constants). This would allow analysis of something like // this: for (signed char X = 0; X < 100; ++X) { int Y = X; } - if (isa(Op)) - return new SCEVCouldNotCompute(); - SCEVSignExtendExpr *&Result = (*SCEVSignExtends)[std::make_pair(Op, Ty)]; if (Result == 0) Result = new SCEVSignExtendExpr(Op, Ty); return Result; @@ -743,10 +735,6 @@ // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops); - // Could not compute plus anything equals could not compute. - if (isa(Ops.back())) - return new SCEVCouldNotCompute(); - // If there are any constants, fold them together. unsigned Idx = 0; if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { @@ -972,21 +960,6 @@ // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops); - if (isa(Ops.back())) { - // CNC * 0 = 0 - for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { - if (Ops[i]->getSCEVType() != scConstant) - break; - - SCEVConstant *SC = cast(Ops[i]); - if (SC->getValue()->isMinValue(false)) - return SC; - } - - // Otherwise, we can't compute it. - return new SCEVCouldNotCompute(); - } - // If there are any constants, fold them together. unsigned Idx = 0; if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { @@ -1152,9 +1125,6 @@ // FIXME: implement folding of (X*4)/4 when we know X*4 doesn't overflow. - if (isa(LHS) || isa(RHS)) - return new SCEVCouldNotCompute(); - SCEVUDivExpr *&Result = (*SCEVUDivs)[std::make_pair(LHS, RHS)]; if (Result == 0) Result = new SCEVUDivExpr(LHS, RHS); return Result; @@ -1202,12 +1172,6 @@ } } - // Refuse to build an AddRec out of SCEVCouldNotCompute. - for (unsigned i = 0, e = Operands.size(); i != e; ++i) { - if (isa(Operands[i])) - return new SCEVCouldNotCompute(); - } - SCEVAddRecExpr *&Result = (*SCEVAddRecExprs)[std::make_pair(L, std::vector(Operands.begin(), Operands.end()))]; @@ -1230,21 +1194,6 @@ // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops); - if (isa(Ops.back())) { - // CNC smax +inf = +inf. - for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { - if (Ops[i]->getSCEVType() != scConstant) - break; - - SCEVConstant *SC = cast(Ops[i]); - if (SC->getValue()->isMaxValue(true)) - return SC; - } - - // Otherwise, we can't compute it. - return new SCEVCouldNotCompute(); - } - // If there are any constants, fold them together. unsigned Idx = 0; if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { @@ -1325,21 +1274,6 @@ // Sort by complexity, this groups all similar expression types together. GroupByComplexity(Ops); - if (isa(Ops[0])) { - // CNC umax inf = inf. - for (unsigned i = 0, e = Ops.size() - 1; i != e; ++i) { - if (Ops[i]->getSCEVType() != scConstant) - break; - - SCEVConstant *SC = cast(Ops[i]); - if (SC->getValue()->isMaxValue(false)) - return SC; - } - - // Otherwise, we can't compute it. - return new SCEVCouldNotCompute(); - } - // If there are any constants, fold them together. unsigned Idx = 0; if (SCEVConstant *LHSC = dyn_cast(Ops[0])) { From sam at rfc1149.net Wed Oct 8 16:18:31 2008 From: sam at rfc1149.net (Samuel Tardieu) Date: Wed, 08 Oct 2008 23:18:31 +0200 Subject: [llvm-commits] [PATCH] Use template to distinguish between variants of function References: <20081007153053.15951.34438.stgit@arrakis.enst.fr> Message-ID: <877i8ilra0.fsf@willow.rfc1149.net> >>>>> "Chris" == Chris Lattner writes: Chris> Ok, this seems reasonable. However, it and hte Chris> patches are less trivial than the other ones, so I can't apply Chris> them manually. Please regenerate the patch and send them as Chris> attachments to the email, thanks Samuel! It looks like Duncan took care of applying them, so I guess the issue is moot. Sam -- Samuel Tardieu -- sam at rfc1149.net -- http://www.rfc1149.net/