Commit Graph

11215 Commits

Author SHA1 Message Date
Chris Lattner
0e7ab8cb07 ugh, my last patch just sped up a method and changed all the clients
that I want to completely eliminate.  Add fixme's so I remember this
in the future, and add the missing helper that they should be upgraded
to use instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:01:09 +00:00
Chris Lattner
4813035b72 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:38:18 +00:00
Chris Lattner
36e69ae3c1 my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 05:02:57 +00:00
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
Jim Grosbach
e27d205d5d Factor the stack alignment calculations out into a target independent pass.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:30:24 +00:00
Devang Patel
e3a18de4f6 Add utility routine to create subprogram definition entry from subprogram declaration entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:09:02 +00:00
Dan Gohman
5b69fe767c Add edge source labels to SelectionDAG graphs, now that the graph printing
framework omits differentiated edge sources in the case where the labels
are empty strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 19:20:00 +00:00
Jakob Stoklund Olesen
8f72235a77 Move PHIElimination::isLiveOut method to LiveVariables.
We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:13:31 +00:00
Gabor Greif
074fe8324d typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 15:53:33 +00:00
Gabor Greif
6c2a7a04da demonstrate usage of Cases() mapping several strings to the same value; remove trailing spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 12:53:56 +00:00
Eric Christopher
a9256d0780 Remove the gcc builtins from the intrinsics, we'll lower them
explicitly so we can check arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:18:26 +00:00
Evan Cheng
a4025df42d Fix PR5614: parts of a physical register def may be killed the rest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:44:45 +00:00
Dan Gohman
15e7122a13 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:30:43 +00:00
Bob Wilson
15217e63bc Remove isProfitableToDuplicateIndirectBranch target hook. It is profitable
for all the processors where I have tried it, and even when it might not help
performance, the cost is quite low.  The opportunities for duplicating
indirect branches are limited by other factors so code size does not change
much due to tail duplicating indirect branches aggressively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 18:35:03 +00:00
Benjamin Kramer
795eb2ae8e Fix odd declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 15:52:29 +00:00
Tobias Grosser
b5eedf2c1c Remove forgotten ShortNames in Trie and CompilationGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 13:14:13 +00:00
Tobias Grosser
56f4ef3232 Remove ShortNames from getNodeLabel in DOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:47 +00:00
Tobias Grosser
a10d598602 Instantiate DefaultDOTGraphTraits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:38:13 +00:00
Tobias Grosser
ce4edd647b Do not point edge heads to source labels
If no destination label is available, just point to the node itself
instead of pointing to some source label. Source and destination labels are
not related in any way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:37:39 +00:00
Tobias Grosser
c500566d9f Only print edgeSourceLabels if they are not empty
Graphviz can layout the graphs better if a node does not contain source
ports. Therefore only print the ports if the source ports are useful,
that means are not labeled with the empty string "".
This patch also simplifies graphs without any edgeSourceLabels e.g. the
dominance trees.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90131 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:24:40 +00:00
Tobias Grosser
2833fac273 Small PostDominatorTree improvements
* Do not SEGFAULT if tree entryNode() is NULL
 * Print function names in dotty printer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 12:06:37 +00:00
Tobias Grosser
e8a81da98d Remove ":" after BB name in -view-cfg-only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 11:55:24 +00:00
Mon P Wang
cd6e725f21 Added support to allow clients to custom widen. For X86, custom widen vectors for
divide/remainder since these operations can trap by unroll them and adding undefs
for the resulting vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 02:42:02 +00:00
Chris Lattner
f4538795fe mark all the 'foo with overflow' intrinsics as readnone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 02:44:33 +00:00
Chris Lattner
dd696052f0 Enhance InsertPHITranslatedPointer to be able to return a list of newly
inserted instructions.  No functionality change until someone starts using it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-28 15:39:14 +00:00
Chris Lattner
6f7b210b25 Rework InsertPHITranslatedPointer to handle the recursive case, this
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 22:05:15 +00:00
Chris Lattner
8aee8efc0c factor some logic out of instcombine into a new SimplifyAddInst method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 17:42:22 +00:00
Chris Lattner
616613d7a4 teach GVN's load PRE to insert computations of the address in predecessors
where it is not available.  It's unclear how to get this inserted 
computation into GVN's scalar availability sets, Owen, help? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 08:25:10 +00:00
Chris Lattner
62deff066c Fix phi translation in load PRE to agree with the phi
translation done by memdep, and reenable gep translation 
again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 06:31:14 +00:00
Chris Lattner
c514c1f521 factor some instcombine simplifications for getelementptr out to a new
SimplifyGEPInst method in InstructionSimplify.h.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89980 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-27 00:29:05 +00:00
Bob Wilson
2d521e51ac Rename new TailDuplicationPass to avoid name conflict with the old one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 21:38:41 +00:00
Chris Lattner
1ce0eaa25f Implement PR1143 (at -m64) by making basicaa look through extensions. We
previously already handled it at -m32 because there were no i32->i64 
extensions for addressing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 18:53:33 +00:00
Chris Lattner
e405c64f6b move DecomposeGEPExpression out into ValueTracking.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 17:12:50 +00:00
Bob Wilson
15acadde5f Split tail duplication into a separate pass. This is needed to avoid
running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems.  Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89904 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 00:32:21 +00:00
Viktor Kutuzov
308f6630a3 Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 22:44:18 +00:00
Devang Patel
65dbc909f5 Use StringRef (again) in DebugInfo interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89866 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 17:36:49 +00:00
Edward O'Callaghan
5b512fe527 Adjust comments to new semantics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 12:00:34 +00:00
Edward O'Callaghan
e49a8e4db9 API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 06:32:19 +00:00
Daniel Dunbar
f87ea4dd9a Add the rest of the build system logic for optional target disassemblers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 04:46:58 +00:00
Daniel Dunbar
fa3f0b9bc2 Add CMake and configure logic to create llvm/Config/Disassemblers.defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 04:30:13 +00:00
Bob Wilson
f8c4cfb7cc Refactor target hook for tail duplication as requested by Chris.
Make tail duplication of indirect branches much more aggressive (for targets
that indicate that it is profitable), based on further experience with
this transformation.  I compiled 3 large applications with and without
this more aggressive tail duplication and measured minimal changes in code
size.  ("size" on Darwin seems to round the text size up to the nearest
page boundary, so I can only say that any code size increase was less than
one 4k page.) Radar 7421267.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 23:35:49 +00:00
Devang Patel
e9a059714e Use StringRef instead of std::string in DIEString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 19:42:17 +00:00
Devang Patel
f5a7a2c84a Remove DebugLabelFolder pass. It is not used by dwarf writer anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 19:37:07 +00:00
Edward O'Callaghan
3d8f87969b Fix comments as pre-post review for rev.89765.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 16:29:23 +00:00
Edward O'Callaghan
d41e944501 Provide Path::isSpecialFile interface for PR5568.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 15:19:10 +00:00
Devang Patel
193f720f11 Emit pubtypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-24 01:14:22 +00:00
Jeffrey Yasskin
108c838093 * Move stub allocation inside the JITEmitter, instead of exposing a
way for each TargetJITInfo subclass to allocate its own stubs. This
means stubs aren't as exactly-sized anymore, but it lets us get rid of
TargetJITInfo::emitFunctionStubAtAddr(), which lets ARM and PPC
support the eager JIT, fixing http://llvm.org/PR4816.

* Rename the JITEmitter's stub creation functions to describe the kind
of stub they create. So far, all of them create lazy-compilation
stubs, but they sometimes get used when far-call stubs are needed.
Fixing http://llvm.org/PR5201 will involve fixing this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 23:35:19 +00:00
Dan Gohman
735afe14ee Remove ISD::DEBUG_LOC and ISD::DBG_LABEL, which are no longer used.
Note that "hasDotLocAndDotFile"-style debug info was already broken;
people wanting this functionality should implement it in the
AsmPrinter/DwarfWriter code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 23:20:51 +00:00
Jeffrey Yasskin
0261d795f8 Allow more than one stub to be being generated at the same time.
It's probably better in the long run to replace the
indirect-GlobalVariable system. That'll be done after a subsequent
patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 22:49:00 +00:00
Devang Patel
e54a5e88a5 Add CreateLocation varinat that accepts MDNode (with a default value).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 19:11:20 +00:00
Dan Gohman
2048b85c7c Rename SelectionDAGLowering to SelectionDAGBuilder, and rename
SelectionDAGBuild.cpp to SelectionDAGBuilder.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 18:04:58 +00:00
Chris Lattner
c46530b6a3 add a helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 16:38:54 +00:00
Duncan Sands
e8e01b600c I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter.  However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL!  Some other C function needs to be introduced for the general
case of signed or unsigned casts.  This hopefully unbreaks the ocaml
binding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 10:49:03 +00:00
Nick Lewycky
ce2c51b670 Pull LLVMContext out of PromoteMemToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 03:50:44 +00:00
Nick Lewycky
ae3d802953 Remove unused LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 03:29:18 +00:00
Daniel Dunbar
4153982375 SourceMgr: Add ShowLine argument to PrintMessage, to allow suppressing the source line output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 22:08:00 +00:00
Jim Grosbach
a2f20b20a8 Add getFrameIndexReference() to TargetRegisterInfo, which allows targets to
tell debug info which base register to use to reference a frame index on a
per-index basis. This is useful, for example, in the presence of dynamic
stack realignment when local variables are indexed via the stack pointer and
stack-based arguments via the frame pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 20:14:00 +00:00
Daniel Dunbar
5a325e3663 Use ExtractElementInst::Create instead of new; patch by Artur Pietrek!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89606 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 18:27:43 +00:00
Chris Lattner
66e08cf79a Remove the AliasAnalysis::getMustAliases method, which is dead.
The hasNoModRefInfoForCalls isn't worth it as a filter because 
basicaa provides m/r info and everything chains to it, so remove
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 16:01:44 +00:00
Evan Cheng
e54cb16308 Allow target to disable if-converting predicable instructions. e.g. NEON instructions under ARM mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 06:20:26 +00:00
Devang Patel
bef8888a91 We are not using DBG_STOPPOINT anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 02:46:55 +00:00
Evan Cheng
1f8f4d2db7 Maintain stylistic consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 02:32:35 +00:00
Jakob Stoklund Olesen
323d8c3ed7 Be more clever about calculating live variables through new basic blocks.
When splitting a critical edge, the registers live through the edge are:

- Used in a PHI instruction, or
- Live out from the predecessor, and
- Live in to the successor.

This allows the coalescer to eliminate even more phi joins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 02:05:21 +00:00
Daniel Dunbar
983c7fe847 Allow SmallString to implicitly convert to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 02:01:24 +00:00
Viktor Kutuzov
054b52c366 Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21 00:00:02 +00:00
David Goodwin
00621efb40 Restructure code to allow renaming of multiple-register groups for anti-dep breaking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 23:33:54 +00:00
Dan Gohman
29cbade25a Target-independent support for TargetFlags on BlockAddress operands,
and support for blockaddresses in x86-32 PIC mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 23:18:13 +00:00
Sean Callanan
b9e6b34e1e Recommitting PALIGNR shift width fixes.
Thanks to Daniel Dunbar for fixing clang intrinsics:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=89499


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 22:28:42 +00:00
Sean Callanan
1bbf6d1a6f Reverting PALIGNR fix until I figure out how this
broke the Clang testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 22:09:28 +00:00
Sean Callanan
201dfa7432 Fixed PALIGNR to take 8-bit rotations in all cases.
Also fixed the corresponding testcase, and the PALIGNR
  intrinsic (tested for correctness with llvm-gcc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 21:40:28 +00:00
Dan Gohman
a58a04921d Make Loop::getLoopLatch() work on loops which don't have preheaders, as
it may be used in contexts where preheader insertion may have failed due
to an indirectbr.

Make LoopSimplify's LoopSimplify::SeparateNestedLoop properly fail in
the case that it would require splitting an indirectbr edge.

These fix PR5502.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 20:51:18 +00:00
David Goodwin
557bbe6b5d Remove some old experimental code that is no longer needed. Remove additional, speculative scheduling pass as its cost did not translate into significant performance improvement. Minor tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 19:32:48 +00:00
Dan Gohman
b4afb137ef Fix fast-isel to avoid selecting the return instruction if a
tail call has been encountered.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 02:51:26 +00:00
Jakob Stoklund Olesen
324da7647c Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.
Fix debug code that assumes getBasicBlock never returns NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 01:17:03 +00:00
Dan Gohman
f94b5edc45 Extend CaptureTracking to indicate when a value is never stored, even
if it is not ultimately captured. Teach BasicAliasAnalysis that a 
local object address which does not escape and is never stored does
not alias with a value resulting from a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 21:57:48 +00:00
Benjamin Kramer
90c583fff0 cstdlib is not automatically included with StringRef anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 16:08:04 +00:00
Benjamin Kramer
1acdcd5b0d Remove the now obsolete algorithm include from StringRef.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 15:48:14 +00:00
Torok Edwin
2fe05d80d3 Workaround PR5482, because all the gcc versions that I had were miscompiling StringRef:
4.2.4, 4.3.4, 4.4.2.
The workaround is to use a local min/max implementation that takes an integer
param, and not a reference to integer param (like std::min does).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 15:39:50 +00:00
Edward O'Callaghan
cc9fa81fe1 Add PS3 Triple class, Credit to John Thompson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 11:59:00 +00:00
Jim Grosbach
20f4d34fe3 Make EliminateDuplicatePHINodes() available as a utility function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 02:02:10 +00:00
Daniel Dunbar
b80077aae9 Twine: Stores kinds as uchar instead of bitfield to be friendlier to the
optimizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 00:04:43 +00:00
Jeffrey Yasskin
f605773869 Remove spurious @verbatim. Patch by Timo Juhani Lindfors!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 22:04:44 +00:00
Jakob Stoklund Olesen
8f16e02fc9 Allow the machine verifier to be run outside the PassManager.
Verify LiveVariables information when present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:36:57 +00:00
Jakob Stoklund Olesen
1e78aa445c Remove the -early-coalescing option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:36:47 +00:00
Viktor Kutuzov
e823db8bae Added getDefaultSubtargetFeatures method to SubtargetFeatures class which returns a correct feature string for given triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 20:20:05 +00:00
Bob Wilson
834b08af8d Add a target hook to allow changing the tail duplication limit based on the
contents of the block to be duplicated.  Use this for ARM Cortex A8/9 to
be more aggressive tail duplicating indirect branches, since it makes it
much more likely that they will be predicted in the branch target buffer.
Testcase coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 03:34:27 +00:00
Bill Wendling
5eea342673 The llvm-gcc front-end and the pass manager use two separate TargetData objects.
This is probably not confined to *just* these two things.

Anyway, the llvm-gcc front-end may look up the structure layout information for
an abstract type. That information will be stored into a table with the FE's
TD. Instruction combine can come along and also ask for information on that
abstract type, but for a separate TD (the one associated with the pass manager).

After the type is refined, the old structure layout information in the pass
manager's TD file is out of date. If a new type is allocated in the same space
as the old-unrefined type, then the structure type information in the pass
manager's TD file will be wrong, but won't know it.

Fix this by making the TD's structure type information an abstract type user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 01:03:56 +00:00
Dan Gohman
3dbb9e64d6 Simplify ComputeMultiple so that it doesn't depend on TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 00:58:27 +00:00
Devang Patel
427ef4e35f Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 22:39:08 +00:00
Eric Christopher
88b5aca20a Add ability to set code model within the execution engine builders
and creation interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 21:58:16 +00:00
Evan Cheng
2a085c3493 Add a WriteAsOperand for MachineBasicBlock so MachineLoopInfo dump looks sane.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89130 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 19:19:59 +00:00
Viktor Kutuzov
51cdac02c4 Added getArchNameForAssembler method to the Triple class for which returns OS and Vendor independent target assembler arch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 18:48:27 +00:00
Nuno Lopes
2cd8abbf86 add Case() with 5 args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 15:35:39 +00:00
Duncan Sands
4a20c7a0a9 1. Allow SCCIterator to work with GraphT types that are constant.
2.  Allow SCCIterator to work with inverse graphs.
3.  Fix an incorrect comment in GraphTraits.h (the type in the comment 
was given as GraphType* when it is actually const GraphType &).
Patch by Patrick Alexander Simmons.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 10:54:25 +00:00
Duncan Sands
8dc071a6e5 Following a suggestion of Daniel Dunbar, stop people passing the name
as the isSigned bool to CreateIntCast by having this resolve to a call
to a private method, rather than by using a gcc attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 08:34:52 +00:00
Lang Hames
ff1b61f2d3 Fixed call to wrong constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 07:19:50 +00:00
Jeffrey Yasskin
dc1472b6d9 In GlobalVariable::setInitializer, assert that the initializer has the
right type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 00:43:13 +00:00
Eric Christopher
4c269e2feb Fix unused variables warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:34:32 +00:00
Dan Gohman
21b8bddea5 Revert 88957. This file uses CodeGenOpt, which is defined in TargetMachine.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:45:50 +00:00
Dan Gohman
81344503bc Remove an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:41:12 +00:00
Dan Gohman
6ac0e76ff4 Sink a #include <map> to where it's actually needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:40:47 +00:00
Dan Gohman
aec15e8456 Make PseudoSourceValue's classof recognize
FixedStackPseudoSourceValueVal, to respect this isa relationship.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 20:40:06 +00:00
Rafael Espindola
420d23c3d6 Add configure options for specifying where to look for libstdc++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88943 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 19:46:55 +00:00
Douglas Gregor
1546b11140 Make ERROR_IF_USED macro work with GCC <= 4.2, Apple GCCs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 16:56:48 +00:00
Duncan Sands
4007324b58 Make sure that if anyone passes a name by accident for the isSigned
parameter of CreateIntCast then they get an error from the compiler
(or from the linker with a non-gcc compiler).  Another possibility
is to flip the order of the DestTy and isSigned parameters, since you
should then get a compiler warning if you try to use a char* for a
Type*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88913 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 15:28:17 +00:00
Chris Lattner
ac57410a56 disable copying, enforce some invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 20:03:53 +00:00
Chris Lattner
5415127330 mark getIntrinsicID() 'readonly'. This allows various classof methods
(like DbgDeclareInst's) to shrink substantially.  It sucks that we have
to pull Compiler.h into such a public header, but at least Compiler.h
doesn't pull anything else in.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 19:56:28 +00:00
Chris Lattner
6f0c67d4ff add attributes for readnone/readonly functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 19:54:31 +00:00
Chris Lattner
9806f833a6 add a version of array_pod_sort that takes a custom comparator function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 19:52:43 +00:00
Edward O'Callaghan
e0fb75d586 Add PSP OS Target to Triple, Credit to Bruno Cardoso Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 10:18:17 +00:00
Jim Grosbach
68bb60f6a4 Add function to replace a destination MBB in a single jump table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 20:09:13 +00:00
Benjamin Kramer
1b226abcd9 Remove dead variable found by clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 19:51:20 +00:00
Benjamin Kramer
f2a39bd24f Implement DISABLE_INLINE for MSVC. This required changing the position in all
forward declaration and patching tblgen to emit it right. Patch by Amine Khaldi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 16:37:18 +00:00
Benjamin Kramer
7b068610eb Make NORETURN working with MSVC. MSVC only accepts NORETURN in front of the
decl so move it there. GCC accepts it both in front and after decls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 14:14:58 +00:00
Daniel Dunbar
067d024b05 Add llvm::sys::getHostCPUName, for detecting the LLVM name for the host CPU.
- This is an initial step towards -march=native support in Clang, and towards
   eliminating host dependencies in the targets. See PR5389.

 - Patch by Roman Divacky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 10:09:12 +00:00
Evan Cheng
fae3e92345 Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 03:42:17 +00:00
Evan Cheng
d57cdd5683 - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the
  sub-register instead.
This fixes PR5423.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:55:43 +00:00
Dan Gohman
4ec01b268e Add an option for running GVN with redundant load processing disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 02:27:51 +00:00
Lang Hames
b3661585c0 Added an API to the SlotIndexes pass to allow new instructions to be inserted into the numbering.
PreAllocSplitting is now using this API to insert code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88725 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 00:02:51 +00:00
Dan Gohman
ce8447ccfe Move the FixedStackPseudoSourceValueVal enum value before InstructionVal
so that isa<Instructon> doesn't return true for FixedStackPseudoSourceValue
values. This fixes a variety of problems, including crashes with -debug
and -print-machineinstrs. Also, add a comment to warn about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 22:24:13 +00:00
Jakob Stoklund Olesen
ce727d0da0 Add MachineFunction::verify() to call the machine code verifier directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:56:09 +00:00
Dan Gohman
24f8e29b4e Use .data() instead of .c_str() when nul-termination is not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:55:31 +00:00
Devang Patel
a2b3cdc21f Do not use value handle to wrap MDNode in DIDescriptor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 21:45:04 +00:00
David Goodwin
87d21b92fc Allow target to specify regclass for which antideps will only be broken along the critical path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 19:52:48 +00:00
David Greene
0d1680a7d8 Remove duplicate APIs and state WRT spill objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 14:42:06 +00:00
Devang Patel
3ddf70442f Revert r87059 for now. It is failing clang tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 02:27:33 +00:00
Rafael Espindola
c78c0c99a0 Switch to smallvector. Also fix issue with using unsigend for MaxSplit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 02:18:25 +00:00
Dale Johannesen
1e608819aa Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:45:18 +00:00
Victor Hernandez
0418c102dd Remove unnecessary llvm.dbg.declare bitcast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:44:55 +00:00
Rafael Espindola
5ccac24726 Add a new split method to StringRef that puts the substrings in a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 01:24:40 +00:00
David Greene
dda3978d78 Fix a bootstrap failure.
Provide special isLoadFromStackSlotPostFE and isStoreToStackSlotPostFE
interfaces to explicitly request checking for post-frame ptr elimination
operands.  This uses a heuristic so it isn't reliable for correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 00:29:53 +00:00
David Greene
b3bc115a24 Do some cleanups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:49:55 +00:00
Daniel Dunbar
89fccca4b0 StringRef(const char*) should not be used to turn null pointers into empty
strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:26:11 +00:00
Daniel Dunbar
efae4d379d Remove my Value.h build fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:07:02 +00:00
David Greene
d7a18e420e Fix a build error by providing a missing enum value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:04:19 +00:00
David Greene
b9c2fd964e Make the MachineFunction argument of getFrameRegister const.
This also fixes a build error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 21:00:03 +00:00
David Greene
b87bc95db0 Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
machine instruction loads or stores from/to a stack slot.  Unlike
isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be
something other than a pure load/store (e.g. it may be an arithmetic
operation with a memory operand).  This helps AsmPrinter determine when
to print a spill/reload comment.

This is only a hint since we may not be able to figure this out in all
cases.  As such, it should not be relied upon for correctness.

Implement for X86.  Return false by default for other architectures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:55:29 +00:00
Daniel Dunbar
db99095cfe Attempt to unbreak LLVM build, David G. please check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:53:56 +00:00
David Greene
3f2bf85d14 Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:49:22 +00:00
Benjamin Kramer
05872ea804 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:36:59 +00:00
David Greene
cf62632d83 Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by
making it visible to clients and adding LLVM-style cast capability.
This will be used by AsmPrinter to determine when to emit spill comments
for an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:25:07 +00:00
David Greene
1251443929 Add AsmPrinter comment flags to machine instructions so that AsmPrinter
can emit extra information in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87018 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:21:09 +00:00
David Greene
e55abe5cd0 Add comment flags so AsmPrinter can output additional information when
emitting comments.  These flags carry semantic information not otherwise
easily derivable from the IR text.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 20:13:34 +00:00
Devang Patel
70d75ca310 "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 19:02:56 +00:00
Dan Gohman
777bdad579 Mark DBG_LABEL, EH_LABEL, and GC_LABEL as not-duplicable, since
they really are not duplicable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 18:36:19 +00:00
Benjamin Kramer
7f82fdb9bc Silence a warning on targets with unsigned chars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 17:59:45 +00:00
Nuno Lopes
34e992da38 implement shl, ashr, and lshr methods. shl is not fully implemented as it is quite tricky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 14:53:53 +00:00
Evan Cheng
586f69a118 - Teach LSR to avoid changing cmp iv stride if it will create an immediate that
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
  later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
  users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
  iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:35:05 +00:00
Evan Cheng
06b53c0d51 isLegalICmpImmediate should take a signed integer; code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 07:13:11 +00:00
Oscar Fuentes
8e3c16917c CMake: Hopefully unbreak the build by mimicking the changes on the
other build system about the new C_INCLUDE_DIRS configure option.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 06:48:09 +00:00
Rafael Espindola
7f9ec910a3 Add the --with-c-include-dirs to llvm's configure.
The clang patch is next.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 05:46:09 +00:00