Commit Graph

11062 Commits

Author SHA1 Message Date
Chris Lattner
1cb75460b6 change makeNameProper to take a stringref instead of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 04:55:33 +00:00
Chris Lattner
af2a8361e4 give StringRef a const_iterator member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 04:50:20 +00:00
Dale Johannesen
c49a10aca1 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 01:39:38 +00:00
Evan Cheng
7da9ecf967 Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.
For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:30:23 +00:00
Dale Johannesen
5f72a5ebc8 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:00:24 +00:00
Chris Lattner
acb4722856 use consistent tag kinds for ilist_traits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 22:00:04 +00:00
Chris Lattner
e234a30a28 add a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 19:40:54 +00:00
Devang Patel
d77fdba573 Use Twine, instead of StringRef, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:57:56 +00:00
Devang Patel
26028f27dd Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:34:06 +00:00
Dale Johannesen
68c3def126 Add MO_Metadata as an operand kind. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 02:01:53 +00:00
Evan Cheng
a5a81d7072 Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified
instruction is copy like where the source and destination registers can
overlap. This is to be used by the coalescable to coalesce the source and
destination registers of instructions like X86::MOVSX64rr32. Apparently
some crazy people believe the coalescer is too simple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:09:37 +00:00
Tobias Grosser
d53e42efe9 Remove trailing white spaces in post dominators header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:22:46 +00:00
Tobias Grosser
af4421d6ef Add getNode() to post dominators.
Implement the same interface as already available for dominators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:22:32 +00:00
Benjamin Kramer
7dd6107fcc Remove unused string functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 20:33:12 +00:00
Benjamin Kramer
7462b5dd99 Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 19:45:18 +00:00
Benjamin Kramer
c30837d6c1 Turns out llvm-gcc still uses SplitString with a vector. Add it back until I
have a fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:44:35 +00:00
Benjamin Kramer
d4f195999a Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:03:24 +00:00
Victor Hernandez
5b7e48b56c Respond to Chris' review:
Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t.
Get constness correct for getVariable() and getValue().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 07:45:19 +00:00
Victor Hernandez
24e64df7ec Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-10 07:14:18 +00:00
Chris Lattner
10bc755d9f hopefully unbreak the ocaml bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 23:25:21 +00:00
Chris Lattner
d686c8e73f "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 22:27:07 +00:00
Devang Patel
87df867fd7 Delete NamedMDSymTable while destrucing Module.
Disable  copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 01:44:59 +00:00
Dale Johannesen
d2035203a0 Add DEBUG_DECLARE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 01:24:25 +00:00
Devang Patel
8fba578be7 Derive NamedMDNode from Value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 00:30:14 +00:00
Dale Johannesen
87563b3937 Add DEBUG_VALUE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 23:51:25 +00:00
Tobias Grosser
fde781b8d6 Add assert to check dominance dfs numbers.
Compare the dominance information calculated using a dominance tree walk to the
information calculated based on DFS numbers, if XDEBUG is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:41 +00:00
Tobias Grosser
365ccd3a91 Remove workaround in PostDominators
Remove a FIXME and unify code that was necessary to work around broken
updateDFSNumbers().  Before updateDFSNumbers() did not work correctly for post
dominators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:25 +00:00
Tobias Grosser
ecd4694458 Fix DFS number calculation for postdominators
The DFS number calculation for postdominators was broken. In the case of
multiple exits that form the post dominator root nodes, do not iterate over
all exits, but start from the virtual root node. Otherwise bbs, that are not
post dominated by any exit but by the virtual root node, will never be assigned
a DFS number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:06 +00:00
David Greene
60dd36592f Revert r92939. These intrinsics get matched to LLVM instructions,
so removing at Chris' request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 21:43:58 +00:00
David Greene
0d2856aa19 Add some "missing" instrinsics to make the SSE intrinsic set a bit more
orthogonal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:47:43 +00:00
Devang Patel
0386f01e06 Use separate namespace for named metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:39:36 +00:00
Kovarththanan Rajaratnam
3c37bb8dbe Fix occurrence typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 18:46:52 +00:00
Duncan Sands
452394d812 Correct spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 09:05:26 +00:00
Jakob Stoklund Olesen
d1862037f0 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:51:04 +00:00
Jakob Stoklund Olesen
30ac0467ce Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:47:07 +00:00
Evan Cheng
d40d03e1bd Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 19:38:29 +00:00
Douglas Gregor
b419a5cfe9 Fix struct/class mismatch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 17:16:00 +00:00
Duncan Sands
7c422ac216 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 08:45:52 +00:00
Jakob Stoklund Olesen
8efadf94b5 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.
An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 00:29:28 +00:00
Dan Gohman
7c3ecb6838 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 22:26:32 +00:00
Dan Gohman
dda30cd4af Restore dump() methods to Loop and MachineLoop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 21:08:02 +00:00
Devang Patel
3e30c2a3c5 NamedMDNode is a collection MDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:41:31 +00:00
Benjamin Kramer
13be48701d Add a new predicate for integer type equality tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:04:48 +00:00
Dan Gohman
90fe0bd68c Make RecursivelyDeleteTriviallyDeadInstructions,
RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag
indicating whether they made any changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:45:31 +00:00
Dan Gohman
ad2cee44e0 Some versions of GCC don't like non-static data members in sizeof
in this context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:28:21 +00:00
Dan Gohman
cb89afc965 Add a SmallBitVector class, which mimics BitVector but uses only
a single pointer (PointerIntPair) member. In "small" mode, the
pointer field is reinterpreted as a set of bits. In "large" mode,
the pointer points to a heap-allocated object.

Also, give BitVector empty and swap functions.

And, add some simple unittests for BitVector and SmallBitVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:04:49 +00:00
Chris Lattner
43fd9017a6 convert various IntrinsicInst's to use class instead of struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 05:21:26 +00:00
Devang Patel
614d2ad0af Delete renaming use of dead dbg intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start
 Intrinsic::dbg_region_end
 Intrinsic::dbg_func_start



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92672 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:47:06 +00:00
David Greene
acc935986d Fix a build error by adding a missing commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:36:30 +00:00
Dan Gohman
eeb3a00b84 Change SelectCode's argument from SDValue to SDNode *, to make it more
clear what information these functions are actually using.

This is also a micro-optimization, as passing a SDNode * around is
simpler than passing a { SDNode *, int } by value or reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:24:18 +00:00
Devang Patel
44a29e066a Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start 
 Intrinsic::dbg_region_end 
 Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:10:40 +00:00
Dan Gohman
26b1b1fd11 Simplify this code; avoid duplicating the low-level implementation code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 00:42:54 +00:00
Dan Gohman
0f73d3fb09 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 00:30:22 +00:00
Dan Gohman
537ab90d8d Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 20:31:55 +00:00
Mikhail Glushenkov
710632d07b Fix the Emacs mode string.
Also trailing whitespace & 80-col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 07:16:12 +00:00
Chris Lattner
5fadf17709 remove the random sampling framework, which is not maintained anymore.
If there is interest, it can be resurrected from SVN.  PR4912.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-02 20:07:03 +00:00
Chris Lattner
f2ebc682d1 teach instcombine to optimize pointer difference idioms involving constant
expressions.  This is a step towards comment #4 in PR3351.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 22:29:12 +00:00
Ted Kremenek
371da99e64 Remove old header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 00:04:49 +00:00
Ted Kremenek
43afbce8ba Remove derelict serialization code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 23:40:17 +00:00
Chris Lattner
210d0febc2 this #include is ok.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:02:42 +00:00
Chris Lattner
f0908a351a fix Analysis/DebugInfo.h to not include Metadata.h. Do this
by moving one method out of line and eliminating redundant checks
from other methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:02:08 +00:00
Chris Lattner
183912af79 Remove #include of metadata.h from intrinsicinst.h. The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:32:41 +00:00
Chris Lattner
5d0cacdbb6 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:22:29 +00:00
Chris Lattner
b76359e36e Optimize MDNode to coallocate the operand list immediately
after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:05:46 +00:00
Chris Lattner
54a1f9f9c1 do not bother reuniquing mdnodes whose operands drop to null. Doing
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway.  This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g

from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 21:42:11 +00:00
Douglas Gregor
441c8b4ad1 Implement edit distance for StringRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 17:23:44 +00:00
Chris Lattner
bf0ca2b477 remove a bunch of unneeded functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:32:19 +00:00
Chris Lattner
784b850e32 one pass of cleanup over DebugInfo.h. Much more is still needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:15:46 +00:00
Chris Lattner
081134741b Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:01:33 +00:00
Chris Lattner
e3e38ea9fb just cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 08:06:56 +00:00
Chris Lattner
b17f65829c privatize another interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:56:15 +00:00
Chris Lattner
44f3d23b60 the only call to this function (from clang) has been removed, zap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:50:09 +00:00
Chris Lattner
508b19a5a4 remove some unneeded Metadata interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:44:16 +00:00
Chris Lattner
5a96f93573 sink twine.h down out of Value.h. It is annoying that you need
to #include Twine.h just to give a twine a default value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:12:03 +00:00
Chris Lattner
a43a3f2379 When doing v1->RAUW(v2), don't do anything to metadata. We don't know
why one was replaced with the other.  Even in the specific case of 
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:53:52 +00:00
Chris Lattner
b2406d9895 sink the Instruction::HasMetadata bit into SubclassData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:46:09 +00:00
Chris Lattner
cafe9bba32 add a layer of accessors around the Value::SubClassData member, and use
a convention (shadowing the setter with private forwarding function) to
prevent subclasses from accidentally using it.

This exposed some bogosity in ConstantExprs, which was propaging the
opcode of the constant expr into the NUW/NSW/Exact field in the
getWithOperands/getWithOperandReplaced methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:14:09 +00:00
Chris Lattner
3990b121cf This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27.  Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte.  Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about 
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 23:41:32 +00:00
Chris Lattner
f309880ad8 rearrange some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:56:07 +00:00
Chris Lattner
66e89df188 remove #include that comes in from ConstantFolder.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:52:06 +00:00
Chris Lattner
2ad32752b9 remove #include of Function.h from IRBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:50:56 +00:00
Chris Lattner
43469b6957 move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:45:40 +00:00
Chris Lattner
a53cfd16f0 split code that doesn't need to be templated out of IRBuilder into a new
non-templated IRBuilderBase class.  Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:28:46 +00:00
Chris Lattner
aca8d54c4f rename ivar to be more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:12:29 +00:00
Chris Lattner
0eb419800a rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:45:51 +00:00
Chris Lattner
7d05c46d60 rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:10:43 +00:00
Chris Lattner
df58389ef1 avoid a completely unneeded linear walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 09:32:10 +00:00
Chris Lattner
b241b37031 Rewrite the function-local validation logic for MDNodes (most of r91708).
Among other benefits, this doesn't leak the SmallPtrSet, has the verifier
code in the verifier pass, actually does the verification at the end,
and is considerably simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 09:07:21 +00:00
Chris Lattner
dfdb5dcf56 rename MDNode instance variables to something meaningful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:48:12 +00:00
Chris Lattner
5e9cd43423 snip one more #include from Metadata.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:30:43 +00:00
Chris Lattner
fc252dae10 prune #includes more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:26:43 +00:00
Chris Lattner
5660846f15 Metadata.h doesn't need to include ValueHandle.h anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:20:46 +00:00
Chris Lattner
bcb18538c2 change the strange MetadataContext::getMDs function to expose less
irrelevant internal implementation details to clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:14:54 +00:00
Chris Lattner
5710969728 change NamedMDNode to use a pimpl for its operand list instead
of making it a declared part of the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:07:14 +00:00
Chris Lattner
a327524b69 eliminate the elem_* iterator stuff from NamedMDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 07:57:01 +00:00
Chris Lattner
c5e08a9639 move ElementVH out of the MDNode class into the MDNode.cpp file. Among
other things, this avoids vtable and rtti data for it being splatted in 
every translation unit that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 07:41:54 +00:00
Sanjiv Gupta
8f17a36d31 Allow targets to specify the return type of libcalls that are generated for floating point comparisons, rather than hard-coding them as i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 02:40:33 +00:00
Bill Wendling
079b6f5ee5 Add an "ATTRIBUTE_UNUSED" macro (and use it). It's for variables which are
mainly used in debugging and/or assert situations. It should make the compiler
and the static analyzer stop nagging us about them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 01:20:29 +00:00
John McCall
6a09affdf6 Implement support for converting to string at "natural precision", and fix some
major bugs in long-precision conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 23:18:09 +00:00
John McCall
00e65de9d8 Add accessors for the largest-magnitude, smallest-magnitude, and
smallest-normalized-magnitude values in a given FP semantics.
Provide an APFloat-to-string conversion which I am quite ready to admit could
be much more efficient.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 08:56:26 +00:00
David Greene
001762bb25 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:19:43 +00:00
David Greene
63c9463c62 Remove dump routine and the associated Debug.h from a header. Patch up
other files to compensate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:58:38 +00:00
David Greene
0ff129f061 Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:25:37 +00:00
David Greene
49f253315d Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:55:11 +00:00
David Greene
3fb10ac22f Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:24:22 +00:00
David Greene
64d3973169 Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:18:22 +00:00
David Greene
b5d568cc70 Provide dbgs(), a circular-buffering debug output stream. By default it
simply passes output to errs().  If -debug-buffer-size=N is set N > 0,
dbgs() buffers its output until program termination and dumps the last N
characters sent to it.  This is handy when debugging very large inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 16:39:06 +00:00
David Greene
e59011e7d9 Add circular_raw_ostream, which buffers its output in a circular queue
and outputs it when explicitly flushed.  The intent is to use it in
situations such as debug output logging where a signal handler can take
care of flushing the buffer at program termination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 16:08:15 +00:00
Eric Christopher
d060b2576a Update objectsize intrinsic and associated dependencies. Fix
lowering code and update testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 02:51:48 +00:00
Anton Korobeynikov
4935a02101 Restore snprintf weirdness for VCPP only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 20:11:00 +00:00
Chris Lattner
508355c982 don't run GVN at -O1, GCC doesn't do it's equivalent at that optimization level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 04:47:41 +00:00
Chris Lattner
0ee443d169 The phi translated pointer can be computed when returning a partially cached result
instead of stored.  This reduces memdep memory usage, and also eliminates a bunch of
weakvh's.  This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x)
on a different machine than earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 04:25:02 +00:00
Bill Wendling
3ea3c24619 Add more plumbing. This time in the LowerArguments and "get" functions which
return partial registers. This affected the back-end lowering code some.

Also patch up some places I missed before in the "get" functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:10:19 +00:00
Chris Lattner
336e06bd0f fix unit test that I broke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:38:23 +00:00
Chris Lattner
8a8f818595 types don't need atomic inc/dec, they are local to an llvmcontext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:17:43 +00:00
Chris Lattner
a25bc44663 comment fix: weakvh -> tracking vh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:51:57 +00:00
Lang Hames
74ab5eeffb Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:11:50 +00:00
Bill Wendling
0777e92721 - Add a bit more plumbing assigning an order to SDNodes.
- Modify the "dump" method to emit the order of an SDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 21:59:52 +00:00
Anton Korobeynikov
7b1eb8a409 Remove uber-gross hack. The define _snprintf to snprintf is invalid due to two reasons: 1. Accroding to C++ standard snprintf should be available in std namespace (and __gnu_cxx in case of GCC to). Such ifdef will change all snprintf's to _snprintf's, but won't bring snprintf to all necessary namespaces. Thus e.g. any locale-using code on mingw will yield an error (include this file + string to see the result) 2. MSVCRT's _snprintf does not comply with C99 standard. Standard one is snprintf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 20:19:37 +00:00
Bill Wendling
e36025ec18 Place SDNodeOrdering.h in the directory it's used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 19:34:59 +00:00
Eric Christopher
f4f43cb501 Fix setting and default setting of code model for jit. Do this
by allowing backends to override routines that will default
the JIT and Static code generation to an appropriate code model
for the architecture.

Should fix PR 5773.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 08:15:29 +00:00
Chris Lattner
b6219ba3d6 improve compatibility with SWIG, patch by James Knight!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 07:52:40 +00:00
Chris Lattner
6a363782fe add a helper ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 07:15:15 +00:00
Eli Friedman
d5b1f8a842 Change StringRef::startswith and StringRef::endswith to versions which are a
bit more verbose, but optimize to much shorter code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 06:49:24 +00:00
Lang Hames
0d9c12539a Fixed use of phi param in SlotIndex constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 23:32:32 +00:00
Douglas Gregor
cabdd7425d Fix a bunch of little errors that Clang complains about when its being pedantic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 07:05:23 +00:00
Douglas Gregor
f8ca42ff59 Remove spurious semicolon. Thanks, Clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:21:36 +00:00
Dan Gohman
1fef0c4962 Delete unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:47:13 +00:00
Chris Lattner
cd0129f5a6 Make some methods const. The only interesting change here is that
it changes raw_fd_ostream::preferred_buffer_size to return zero on
a scary stat failure instead of setting the stream to an error state.
This method really should not mutate the stream.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:38:42 +00:00
Bill Wendling
29b49fc6aa Forgot forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 00:05:07 +00:00
Dan Gohman
43ea505fb0 Eliminate unnecessary LLVMContexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:42:08 +00:00
Bill Wendling
b4e6a5df5d Changes from review:
- Move DisableScheduling flag into TargetOption.h
- Move SDNodeOrdering into its own header file. Give it a minimal interface that
  doesn't conflate construction with storage.
- Move assigning the ordering into the SelectionDAGBuilder.

This isn't used yet, so there should be no functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:32:53 +00:00
Victor Hernandez
5d30162150 Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:09:14 +00:00
Dan Gohman
411984810e Add utility routines for NSW multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 03:10:26 +00:00
Dan Gohman
bdc46c6af5 Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 02:58:50 +00:00
Dan Gohman
d281ed2d03 Preserve NSW information in more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 02:09:29 +00:00
Dan Gohman
92329c7fbe Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 01:24:09 +00:00
Dan Gohman
6bec5bb344 Reapply LoopStrengthReduce and IVUsers cleanups, excluding the part
of 91296 that caused trouble -- the Processed list needs to be
preserved for the livetime of the pass, as AddUsersIfInteresting
is called from other passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 00:06:20 +00:00
John McCall
a692313103 Sundry dependent-name fixes flagged by clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 23:49:16 +00:00
Chris Lattner
b63bb1615b tabs -> spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:23:46 +00:00
Jeffrey Yasskin
88cd3582b6 Make Path use StringRef instead of std::string where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:02:39 +00:00
Steve Naroff
b2273d50bc Fix Windows build breakage...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 20:39:34 +00:00
Ken Dyck
bceddbdc91 Introduce EVT::getHalfSizedIntegerVT() for use in ExpandUnalignedStore() in
LegalizeDAG.cpp. Unlike the code it replaces, which simply decrements the simple
type by one, getHalfSizedIntegerVT() searches for the smallest simple integer
type that is at least half the size of the type it is called on. This approach
has the advantage that it will continue working if a new value type (such as
i24) is added to MVT.

Also, in preparation for new value types, remove the assertions that
non-power-of-2 8-bit-mutiple types are Extended when legalizing extload and
truncstore operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 20:09:43 +00:00
Jeffrey Yasskin
ad715f86c9 This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 19:55:06 +00:00
Eric Christopher
af15ffb912 Fix unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 19:07:19 +00:00
Evan Cheng
04149f7ffd Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 09:39:49 +00:00
Mikhail Glushenkov
994dbe0073 Add a 'set_option' action for use in OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:49:16 +00:00
Bob Wilson
b24890b520 BIT_CONVERT nodes are used for vector types, too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 05:05:36 +00:00
Daniel Dunbar
819309efec Reapply r91392, it was only unmasking the bug, and since TOT is still broken having it reverted does no good.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 20:10:05 +00:00
Jim Grosbach
06801722a4 Add @earlyclobber TableGen constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 19:43:02 +00:00
Daniel Dunbar
4eeeb4767c Fix one more missing this-> to placate that picky clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 11:38:03 +00:00
Daniel Dunbar
222518d0bb Revert "Initial work on disabling the scheduler. This is a work in progress, and
this", this broke llvm-gcc bootstrap for release builds on
x86_64-apple-darwin10.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 10:56:02 +00:00
Chris Lattner
acf8723b8e fix more missing this->'s to placate clang++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 09:17:12 +00:00
Chris Lattner
2e376a87de Fix a missing this-> that clang++ notices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 09:09:54 +00:00
Chris Lattner
b3649db102 now that libsystem no longer uses SmallVector, we can move
SmallVectorBase::grow_pod out of line, finally satisfying PR3758.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:44:24 +00:00
Chris Lattner
99ea87a48a factor out the grow() method for all pod implementations into one
common function.  It is still an inline method, which will be fixed next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:34:40 +00:00
Victor Hernandez
6bc2b8b215 Use different name for argument and field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:10:57 +00:00
Chris Lattner
2676f18312 pull destroy_range and uninitialized_copy up to the
SmallVectorTemplateBase class, which allows us to statically
dispatch on isPodLike instead of dynamically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:09:23 +00:00
Chris Lattner
e6e55d7959 sink most of the meat in smallvector back from SmallVectorTemplateCommon
down into SmallVectorImpl.  This requires sprinking a ton of this->'s in,
but gives us a place to factor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:05:48 +00:00
Chris Lattner
de576fa579 substantial refactoring of SmallVector, now most code is in SmallVectorTemplateCommon,
and there is a new SmallVectorTemplateBase class in between it and SmallVectorImpl.
SmallVectorTemplateBase can be specialized based on isPodLike.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 06:55:45 +00:00
Victor Hernandez
57c0f20601 MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 02:52:09 +00:00
Jeffrey Yasskin
32d7e6ebde Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:42:46 +00:00
Devang Patel
6404e4e795 Add support to emit debug info for C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 19:16:48 +00:00
Chris Lattner
4a5129c700 a few improvements:
1. Use std::equal instead of reinventing it.
2. don't run dtors in destroy_range if element is pod-like.
3. Use isPodLike to decide between memcpy/uninitialized_copy 
   instead of is_class.  isPodLike is more generous in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 08:34:01 +00:00
Chris Lattner
10aaf05c30 hoist the begin/end/capacity members and a few trivial methods
up into the non-templated SmallVectorBase class.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 08:29:22 +00:00
Chris Lattner
dc2e570411 improve isPodLike to know that all non-class types are pod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:40:44 +00:00
Chris Lattner
729a8acc9f Lang verified that SlotIndex is "pod like" even though it isn't a pod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:27:58 +00:00
Chris Lattner
4bbf4ee149 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:26:43 +00:00
Chris Lattner
96c7ae5e97 add an ALWAYS_INLINE macro, which does the obvious thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 06:14:33 +00:00
John McCall
eb751d8c2d Names from dependent base classes are not found by unqualified lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:10:26 +00:00
Mikhail Glushenkov
e4ac23a0ff Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:52 +00:00
Bill Wendling
614407a9d2 Initial work on disabling the scheduler. This is a work in progress, and this
stuff isn't used just yet.

We want to model the GCC `-fno-schedule-insns' and `-fno-schedule-insns2'
flags. The hypothesis is that the people who use these flags know what they are
doing, and have hand-optimized the C code to reduce latencies and other
conflicts.

The idea behind our scheme to turn off scheduling is to create a map "on the
side" during DAG generation. It will order the nodes by how they appeared in the
code. This map is then used during scheduling to get the ordering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 01:54:51 +00:00
Bill Wendling
43cf6c3939 Revert these. They may have been causing 483_xalancbmk to fail:
$ svn merge -c -91161 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91161 into '.':
U    lib/CodeGen/BranchFolding.cpp
U    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91113 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91113 into '.':
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91101 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91101 into '.':
U    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91092 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91092 into '.':
G    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:39:24 +00:00
Dan Gohman
e3040e4ae5 Move Flag and isVoid after the vector types, since bit arithmetic with
those enum values is less common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:36:03 +00:00
Dan Gohman
83644f6b6d Fix these asserts to check the invariant that the code actually
depends on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:34:36 +00:00
Dan Gohman
80d8930d28 Update this comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:13:31 +00:00
Dan Gohman
eda23faedb Move several function bodies which are rarely inlined out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:43:09 +00:00
Dan Gohman
a4f8ecd85d Micro-optimize these functions in the case where they are not inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:32:31 +00:00
Dan Gohman
35d913e6f3 Make the IVUses member private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:14:32 +00:00
Dan Gohman
440b40d865 Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
former was just exposing a LoopInfoBase implementation detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:06:50 +00:00
Bill Wendling
85de1e5bad Whitespace changes, comment clarification. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:51:19 +00:00
Lang Hames
a937f220e1 Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:49:42 +00:00
Anton Korobeynikov
60283f9bc9 Fix weird typo which leads to unallocated memory access for nodes with 4 results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 01:00:59 +00:00
Jeffrey Yasskin
66b856683f Make it easier to use the llvm_unreachable and DEBUG macros without "using
namespace llvm" by qualifying their implementations with ::llvm::.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 04:08:32 +00:00
Dan Gohman
87862e77bb Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:31:27 +00:00
Dan Gohman
050959cd08 Make getUniqueExitBlocks's precondition assert more precise, to
avoid spurious failures. This fixes PR5758.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 20:05:23 +00:00
Gabor Greif
d01518630a Simplify this class by removing the result cache.
This change removes the DefaultConstructible
and CopyAssignable constraints on the template
parameter T (the first one).

The second template parameter (R) is defaulted to be
identical to the first and controls the result type.
By specifying it to be (const T&) additionally the
CopyConstructible constraint on T can be removed.

This allows to use StringSwitch e.g. for llvm::Constant
instances.

Regarding the other review feedback regarding performance
because of taking pointers, this class should be completely
optimizable like before, since all methods are inline and
the pointer dereferencing and result value caching should be
possible behind the scenes by the "as-if" rule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 15:30:07 +00:00
Duncan Sands
be1ce0a867 Add utility method for determining whether a function argument
has the 'nest' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 08:36:17 +00:00
Bill Wendling
64bdde2093 Address comments on last patch:
- Loosen the restrictions when checking of it branches to a landing pad.
- Make the loop more efficient by checking the '.insert' return value.
- Do cheaper checks first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 03:14:18 +00:00
Bill Wendling
4bde1ab82d A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However,
some of them may branch to exception handling landing pads. If we remove those
successors, then the landing pads could go away if all predecessors to it are
removed. Before, it was checking if the direct successor was the landing
pad. But it could be the result of jumping through multiple basic blocks to get
to it. If we were to only check for the existence of an EH_LABEL in the basic
block and not remove successors if it's in there, then it could stop actually
dead basic blocks from being removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:49:14 +00:00
Anders Carlsson
da920fa4f9 Add qualifiers for calls to member functions in dependent bases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:04:42 +00:00
Douglas Gregor
e4a70cd19c Remove a broken, unused header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:52:22 +00:00
Jakob Stoklund Olesen
cf97036675 Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch is more conservative than r90502, and does not break
483.xalancbmk/i686. It still breaks the PowerPC bootstrap, so it is disabled
by default, and can be enabled with the -trivial-coalesce-ends option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 17:48:32 +00:00
Eric Christopher
1e8c6934f2 Silence conversion warning from 64 to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 08:29:32 +00:00
Chris Lattner
dad451cb7c enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:31:04 +00:00
Daniel Dunbar
022840e960 DeltaAlgorithm: Add a virtual destructor and home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:19:48 +00:00
Chris Lattner
e18b97121c change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:08:01 +00:00
Lang Hames
6194569d22 Added a new "splitting" spiller.
When a call is placed to spill an interval this spiller will first try to
break the interval up into its component values. Single value intervals and
intervals which have already been split (or are the result of previous splits)
are spilled by the default spiller.

Splitting intervals as described above may improve the performance of generated
code in some circumstances. This work is experimental however, and it still
miscompiles many benchmarks. It's not recommended for general use yet.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 05:39:12 +00:00
Daniel Dunbar
e854273892 Remove unneeded ';' and a class/struct mismatch (noticed by clang).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:58:09 +00:00
Chris Lattner
05e15f8897 Switch GVN and memdep to use PHITransAddr, which correctly handles
phi translation of complex expressions like &A[i+1].  This has the
following benefits:

1. The phi translation logic is all contained in its own class with
   a strong interface and verification that it is self consistent.

2. The logic is more correct than before.  Previously, if intermediate
   expressions got PHI translated, we'd miss the update and scan for
   the wrong pointers in predecessor blocks.  @phi_trans2 is a testcase
   for this.

3. We have a lot less code in memdep.

We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).

This patch should fix the miscompiles of 255.vortex, and I tested it 
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:59:31 +00:00
Evan Cheng
64fa4a9584 Move isConsecutiveLoad to SelectionDAG. It's not target dependent and it's primary used by selectdag passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:36:00 +00:00
Evan Cheng
7ced2e0b30 Add const qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:10:37 +00:00
Evan Cheng
f2dc5c785d Refactor InferAlignment out of DAGCombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90917 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 01:04:59 +00:00
Chris Lattner
6200e53f55 fix many input tracking bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:56:14 +00:00
Chris Lattner
af50315a29 instructions defined in CurBB may be intermediate nodes of the computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:10:55 +00:00
Chris Lattner
7dedbf4ce3 add dumping and sanity checking support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 00:01:00 +00:00
Chris Lattner
43678f41a3 make sure that PHITransAddr keeps its 'InstInputs' list up to
date when instsimplify kicks in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90901 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:42:51 +00:00
Devang Patel
0000fadb00 Revert 90858 90875 and 90805 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:21:45 +00:00
Evan Cheng
e8b0915b21 Revert 90789 for now. It caused massive compile time regression. Post-ra scheduler slowed down dramatically with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 19:34:53 +00:00
Chris Lattner
34f849098b fix a typo (and -> add) and fix GetAvailablePHITranslatedSubExpr to not
side-effect the current object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 06:06:26 +00:00
Oscar Fuentes
e019be7d4b Removed VC++ compatibility code from DataTypes.h.in.
This header file is not used on VC++ builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90829 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 02:49:54 +00:00
Oscar Fuentes
350dd4a6a6 For VC++, define the ?INT*_C macros only it they are not yet defined.
Some compatibility updates like the Boost TR1 compatibility headers
define them.

Patch contributed by OvermindDL1!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 02:40:09 +00:00
Victor Hernandez
c59b33562c Rename DIFactory::InsertValue() as DIFactory::InsertDbgValueIntrinsic()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 21:54:43 +00:00
Devang Patel
4063f6bcc7 Add support to emit debug info for c++ style namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 21:41:32 +00:00
Chris Lattner
e05a188cd6 add accessor, improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:45:30 +00:00
Dan Gohman
fb28579c56 Apply Pekka Jääskeläinen's patch to raise the first virtual register
number in order to accomodate targets with more than 1024 registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:38:26 +00:00
Victor Hernandez
2f9dac721d Introduce the "@llvm.dbg.value" debug intrinsic.
The semantics of llvm.dbg.value are that starting from where it is executed, an offset into the specified user source variable is specified to get a new value.

An example:
  call void @llvm.dbg.value(metadata !{ i32 7 }, i64 0, metadata !2)
Here the user source variable associated with metadata #2 gets the value "i32 7" at offset 0.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 19:36:34 +00:00
Chris Lattner
9a8641201b checkpoint of the new PHITransAddr code, still not done and not used by
anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:36:53 +00:00
Mikhail Glushenkov
5b9b3ba2ba Deprecate 'unpack_values'.
Use 'forward_values' + 'comma_separated' instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
8245a1dd53 Implement 'forward_value' and 'forward_transformed_value'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:03:05 +00:00
Evan Cheng
75eb535843 Pre-regalloc tale duplication. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90759 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 10:15:19 +00:00
John Mosby
4650d92748 fixed some typos in method comments, reworded some comments for clarity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 09:06:37 +00:00
Oscar Fuentes
bcc2e45840 Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).

Patch by Michael Beck!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 05:29:59 +00:00
Anton Korobeynikov
211a14e476 Add MSP430 interrupt calling conv. No functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 02:27:35 +00:00
Chris Lattner
9000242cca remove extraneous comma clang warns about
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 16:58:41 +00:00
Chris Lattner
90ec9680a9 Add helper methods for forming shift operations with a constant
shift amount.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 01:56:22 +00:00
Dan Gohman
87bad707ed Remove old DBG_LABEL code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 17:56:26 +00:00
Dan Gohman
714efc63d4 Remove the unused DisableLegalizeTypes option and related code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 17:51:33 +00:00
Bill Wendling
dc492e0370 Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 07:30:23 +00:00
Nick Lewycky
750e0e0ad0 Document that memory use intrinsics may also return Def results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 06:37:52 +00:00
Dan Gohman
6e3ff37547 Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:27:58 +00:00
Dan Gohman
864e2efce2 Remove the target hook TargetInstrInfo::BlockHasNoFallThrough in favor of
MachineBasicBlock::canFallThrough(), which is target-independent and more
thorough.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:44:40 +00:00
David Greene
63be493b52 Remove an unneeded include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:03:24 +00:00
David Greene
03c8406fc1 Fix a bad merge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90616 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:08:02 +00:00
David Greene
5e33632559 Update the TargetInstrInfo interfaces so hasLoad/StoreFrom/ToStackSlot
can return a MachineMemOperand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:00:50 +00:00
Bob Wilson
ea7bfc5aa0 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:46:47 +00:00
Evan Cheng
79fc6f44b6 Add a pre-regalloc tail duplication pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 09:42:45 +00:00
Chris Lattner
210e45af3a add the start of a class used to handle phi translation in memdep and
gvn (this is just a skeleton so far).  This will ultimately be used
to fix a nasty miscompilation with GVN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:10:16 +00:00
Mike Stump
9b195eaefd Create yet another helper for Invoke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:53:15 +00:00
Mike Stump
b39a407576 Add some helpers for Invoke to mirror CreateCall helpers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:26:26 +00:00
Jakob Stoklund Olesen
6b74e505be Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch takes care of a few more cases that r90163 missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:16:04 +00:00
Devang Patel
5d11eb0ed5 Add support to emit debug info for virtual functions and virtual base classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 19:11:07 +00:00
Daniel Dunbar
a6d5e40e25 Add an implementation of the delta debugging algorithm.
- This is a pretty slow / memory intensive implementation, and I will likely
   change it to an iterative model, but it works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 11:12:42 +00:00
Andreas Neustifter
44299c9507 Use ProfileInfo-API in ProfileInfo Loader and do more assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 11:00:37 +00:00
Andreas Neustifter
e2baf6b455 Converted ProfileInfo to template, added more API for ProfileInfo-preserving.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:30:12 +00:00
Evan Cheng
229694f0ee Fill out codegen SSA updater. It's not yet tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:31:43 +00:00
Chris Lattner
35e86af8e5 remove some dead std::ostream using code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:55:04 +00:00
Chris Lattner
7896c9f436 improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:50:42 +00:00
Bill Wendling
dd5eb02304 This initial code is meant to convert TargetData to use an AbstractTypesUser so
that it doesn't have dangling pointers when abstract types are resolved. This
modifies it somewhat to address comments: making the "StructLayoutMap" an
anonymous structure, calling "removeAbstractTypeUser" when appropriate, and
adding asserts where helpful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:17:12 +00:00
Evan Cheng
651ea5376c Skeleton for MachineInstr level SSA updater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 22:02:52 +00:00