Commit Graph

10900 Commits

Author SHA1 Message Date
Chris Lattner fedff0f67d remove the string form of printVisibility.
llvm-svn: 93609
2010-01-16 01:17:26 +00:00
Bill Wendling efda1e4f0f Temporarily revert r93581. It was causing failures in the ExecutionEngine tests
on the build bots.

llvm-svn: 93606
2010-01-16 01:06:58 +00:00
Chris Lattner ae9b9eed18 supplement CurrentFnName with CurrentFnSym, which will eventually
replace it.  Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore.  CellSPU needs more invasive surgery.

llvm-svn: 93589
2010-01-15 23:55:16 +00:00
Chris Lattner 7fec180909 add a version of AsmPrinter::printVisibility that takes an MCSymbol.
llvm-svn: 93587
2010-01-15 23:38:51 +00:00
Ted Kremenek 12821816c6 BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>.
llvm-svn: 93581
2010-01-15 23:29:34 +00:00
Dale Johannesen 617603aaee Remove unneeded argument per review.
llvm-svn: 93579
2010-01-15 23:28:49 +00:00
Chris Lattner 0dca0a9650 add another helper
llvm-svn: 93577
2010-01-15 23:25:11 +00:00
Chris Lattner 91687f6e28 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code.

llvm-svn: 93575
2010-01-15 23:18:17 +00:00
Dan Gohman 8ea3acbb3d Add comments to the dump() and dumpr() routines.
llvm-svn: 93566
2010-01-15 22:22:58 +00:00
Dale Johannesen 188fa96cf9 DEBUG_VALUE is now variable sized, as it has a
target-dependent memory address representation in it.
Restore X86 printing of DEBUG_VALUE; lowering is
done in X86RegisterInfo using the normal algorithm.

llvm-svn: 93565
2010-01-15 22:22:35 +00:00
Eric Christopher 8444d7536c Remove the InlineHint attribute. There are no current or planned
users.

llvm-svn: 93558
2010-01-15 21:36:30 +00:00
David Greene 554039a914 Add some debug routines to SelectionDAG to dump full DAGs.
print/dumpWithDepth allows one to dump a DAG up to N levels deep.
dump/printWithFullDepth prints the whole DAG, subject to a depth limit
on 100 in the default case (to prevent infinite recursion).

Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly
what the non-matching DAG looks like.

llvm-svn: 93538
2010-01-15 19:43:23 +00:00
Chris Lattner e17df0b7f0 fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.

llvm-svn: 93536
2010-01-15 19:39:23 +00:00
Chris Lattner 528d00b913 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.

llvm-svn: 93534
2010-01-15 19:28:38 +00:00
Victor Hernandez b324e66f4c Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.

llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Nate Begeman d232150b83 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.

llvm-svn: 93527
2010-01-15 18:51:18 +00:00
Victor Hernandez 8d4904b639 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Victor Hernandez 5d6551816b Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Dale Johannesen 881ba0bb92 Remove DEBUG_DECLARE, looks like we don't need it.
Also, DEBUG_VALUE has side effects.

llvm-svn: 93498
2010-01-15 01:50:44 +00:00
Jeffrey Yasskin 1dae4e6c2a Make sure include/llvm/MC/MCParsedAsmOperand.h can be compiled alone.
llvm-svn: 93492
2010-01-15 00:41:53 +00:00
Chris Lattner 14bf521792 add virtual methods to get the start/end of a MCParsedAsmOperand,
the default implementation returns "unknown".

llvm-svn: 93470
2010-01-14 22:29:57 +00:00
Chris Lattner f29c0b6880 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 

llvm-svn: 93469
2010-01-14 22:21:20 +00:00
Chris Lattner 77fd677111 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.

llvm-svn: 93457
2010-01-14 21:32:45 +00:00
Chris Lattner 872501b6e0 introduce the MCParsedAsmOperand class.
llvm-svn: 93454
2010-01-14 21:20:55 +00:00
Victor Hernandez 8c85e25589 Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.
llvm-svn: 93400
2010-01-14 01:45:14 +00:00
Tobias Grosser e77d17b73a Add getSource() to SuccIterator
Get the source BB of an iterator.

llvm-svn: 93364
2010-01-13 22:21:43 +00:00
Tobias Grosser ad3f4bd6f9 Extend SuccIterator
Implement most of the missing methods to make SuccIterator random access.
operator[] is still missing.

llvm-svn: 93363
2010-01-13 22:21:28 +00:00
Chris Lattner 4cfd5835c9 makeNameProper is now private!
llvm-svn: 93357
2010-01-13 21:31:39 +00:00
Chris Lattner 8361006264 expose a static function as a static method on the MCSymbol class.
llvm-svn: 93350
2010-01-13 21:09:59 +00:00
Benjamin Kramer 2e06b93f43 Introduce Twine::toStringRef, a variant of toVector which avoids the copy if the
twine can be represented as a single StringRef. Use the new methode to simplify
some twine users.

llvm-svn: 93317
2010-01-13 12:45:23 +00:00
Chris Lattner 1126534dce add new isSingleStringRef()/getSingleStringRef() methods to twine,
and use them to avoid a copy of a string in getNameWithPrefix in
the common case.  It seems like Value::setName and other places 
should use this as well?

llvm-svn: 93301
2010-01-13 07:12:06 +00:00
Chris Lattner 33535b3250 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.

llvm-svn: 93300
2010-01-13 07:01:09 +00:00
Chris Lattner 209aecad0c 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.

llvm-svn: 93298
2010-01-13 06:38:18 +00:00
Chris Lattner b252cbb04c my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!
llvm-svn: 93296
2010-01-13 05:02:57 +00:00
Chris Lattner 04a7ce850d change makeNameProper to take a stringref instead of std::string.
llvm-svn: 93295
2010-01-13 04:55:33 +00:00
Chris Lattner e192d377c5 give StringRef a const_iterator member.
llvm-svn: 93294
2010-01-13 04:50:20 +00:00
Dale Johannesen 93e42c5435 Fix a comment.
llvm-svn: 93284
2010-01-13 01:39:38 +00:00
Evan Cheng 30bebff456 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.

llvm-svn: 93278
2010-01-13 00:30:23 +00:00
Dale Johannesen 7b1a7ed330 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.

llvm-svn: 93272
2010-01-13 00:00:24 +00:00
Chris Lattner 3b96c8ae1d use consistent tag kinds for ilist_traits
llvm-svn: 93259
2010-01-12 22:00:04 +00:00
Chris Lattner 7c743f2c74 add a helper function.
llvm-svn: 93251
2010-01-12 19:40:54 +00:00
Devang Patel f76941ed83 Use Twine, instead of StringRef, for consistency.
llvm-svn: 93249
2010-01-12 18:57:56 +00:00
Devang Patel 943ddf666d Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
llvm-svn: 93247
2010-01-12 18:34:06 +00:00
Dale Johannesen 585f82b6f6 Add MO_Metadata as an operand kind. Not used yet.
llvm-svn: 93220
2010-01-12 02:01:53 +00:00
Evan Cheng 4216615f99 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.

llvm-svn: 93210
2010-01-12 00:09:37 +00:00
Tobias Grosser b53e826103 Remove trailing white spaces in post dominators header file
llvm-svn: 93195
2010-01-11 22:22:46 +00:00
Tobias Grosser 829e8a75a1 Add getNode() to post dominators.
Implement the same interface as already available for dominators.

llvm-svn: 93194
2010-01-11 22:22:32 +00:00
Benjamin Kramer 93ad708a46 Remove unused string functions.
llvm-svn: 93183
2010-01-11 20:33:12 +00:00
Benjamin Kramer 6bf8240762 Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
llvm-svn: 93174
2010-01-11 19:45:18 +00:00
Benjamin Kramer 0ef736fef2 Turns out llvm-gcc still uses SplitString with a vector. Add it back until I
have a fix.

llvm-svn: 93163
2010-01-11 18:44:35 +00:00
Benjamin Kramer c6fe3c3273 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.

llvm-svn: 93161
2010-01-11 18:03:24 +00:00
Victor Hernandez 9ce5b5134d Respond to Chris' review:
Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t.
Get constness correct for getVariable() and getValue().

llvm-svn: 93149
2010-01-11 07:45:19 +00:00
Victor Hernandez b8fd152d94 Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().

llvm-svn: 93108
2010-01-10 07:14:18 +00:00
Chris Lattner 51c49960a5 hopefully unbreak the ocaml bindings.
llvm-svn: 93082
2010-01-09 23:25:21 +00:00
Chris Lattner 25963c6113 "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!

llvm-svn: 93079
2010-01-09 22:27:07 +00:00
Devang Patel 71ff547575 Delete NamedMDSymTable while destrucing Module.
Disable  copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.

llvm-svn: 93041
2010-01-09 01:44:59 +00:00
Dale Johannesen 237254dcab Add DEBUG_DECLARE. Not used yet.
llvm-svn: 93040
2010-01-09 01:24:25 +00:00
Devang Patel 99ff5a864b Derive NamedMDNode from Value.
llvm-svn: 93032
2010-01-09 00:30:14 +00:00
Dale Johannesen 8f04740650 Add DEBUG_VALUE. Not used yet.
llvm-svn: 93030
2010-01-08 23:51:25 +00:00
Tobias Grosser bd9f372f0a 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.

llvm-svn: 92969
2010-01-07 23:50:41 +00:00
Tobias Grosser bbe375e2fe 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.

llvm-svn: 92968
2010-01-07 23:50:25 +00:00
Tobias Grosser 35e234bf24 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.

llvm-svn: 92967
2010-01-07 23:50:06 +00:00
David Greene 0b09877c3d Revert r92939. These intrinsics get matched to LLVM instructions,
so removing at Chris' request.

llvm-svn: 92947
2010-01-07 21:43:58 +00:00
David Greene 5b053c5278 Add some "missing" instrinsics to make the SSE intrinsic set a bit more
orthogonal.

llvm-svn: 92939
2010-01-07 19:47:43 +00:00
Devang Patel fcfee0ff35 Use separate namespace for named metadata.
llvm-svn: 92931
2010-01-07 19:39:36 +00:00
Kovarththanan Rajaratnam d4ca3e3f06 Fix occurrence typo
llvm-svn: 92926
2010-01-07 18:46:52 +00:00
Duncan Sands 1949de7b81 Correct spelling.
llvm-svn: 92910
2010-01-07 09:05:26 +00:00
Jakob Stoklund Olesen f1522d612f Add comments.
llvm-svn: 92883
2010-01-07 00:51:04 +00:00
Jakob Stoklund Olesen 29a64c9575 Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

llvm-svn: 92873
2010-01-06 23:47:07 +00:00
Evan Cheng 166a4e6caa 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.

llvm-svn: 92849
2010-01-06 19:38:29 +00:00
Douglas Gregor 3e38656da4 Fix struct/class mismatch
llvm-svn: 92841
2010-01-06 17:16:00 +00:00
Duncan Sands 78376ad7e1 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.

llvm-svn: 92829
2010-01-06 08:45:52 +00:00
Jakob Stoklund Olesen 7725526de1 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>

llvm-svn: 92812
2010-01-06 00:29:28 +00:00
Dan Gohman 404a984780 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.

llvm-svn: 92794
2010-01-05 22:26:32 +00:00
Dan Gohman c3f2137c06 Restore dump() methods to Loop and MachineLoop.
llvm-svn: 92772
2010-01-05 21:08:02 +00:00
Devang Patel e307348325 NamedMDNode is a collection MDNodes.
llvm-svn: 92761
2010-01-05 20:41:31 +00:00
Benjamin Kramer 76aa677ec3 Add a new predicate for integer type equality tests.
llvm-svn: 92759
2010-01-05 20:04:48 +00:00
Dan Gohman cb99fe9839 Make RecursivelyDeleteTriviallyDeadInstructions,
RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag
indicating whether they made any changes.

llvm-svn: 92732
2010-01-05 15:45:31 +00:00
Dan Gohman 1117a59b84 Some versions of GCC don't like non-static data members in sizeof
in this context.

llvm-svn: 92731
2010-01-05 15:28:21 +00:00
Dan Gohman 5976e7d5dd 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.

llvm-svn: 92730
2010-01-05 15:04:49 +00:00
Chris Lattner 27acfcd1c4 convert various IntrinsicInst's to use class instead of struct.
llvm-svn: 92681
2010-01-05 05:21:26 +00:00
Devang Patel 33f80d2303 Delete renaming use of dead dbg intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start
 Intrinsic::dbg_region_end
 Intrinsic::dbg_func_start

llvm-svn: 92672
2010-01-05 01:47:06 +00:00
David Greene c976131fe9 Fix a build error by adding a missing commit.
llvm-svn: 92670
2010-01-05 01:36:30 +00:00
Dan Gohman ea6f91ff64 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.

llvm-svn: 92564
2010-01-05 01:24:18 +00:00
Devang Patel be94f23992 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.

llvm-svn: 92557
2010-01-05 01:10:40 +00:00
Dan Gohman 1c93bbc7d4 Simplify this code; avoid duplicating the low-level implementation code.
llvm-svn: 92554
2010-01-05 00:42:54 +00:00
Dan Gohman 0b10fd4f4a Fix a typo in a comment.
llvm-svn: 92552
2010-01-05 00:30:22 +00:00
Dan Gohman b91411c9b9 Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.

llvm-svn: 92503
2010-01-04 20:31:55 +00:00
Mikhail Glushenkov 9081dc6b12 Fix the Emacs mode string.
Also trailing whitespace & 80-col violations.

llvm-svn: 92464
2010-01-04 07:16:12 +00:00
Chris Lattner 351e22aa36 remove the random sampling framework, which is not maintained anymore.
If there is interest, it can be resurrected from SVN.  PR4912.

llvm-svn: 92422
2010-01-02 20:07:03 +00:00
Chris Lattner 4394f71752 teach instcombine to optimize pointer difference idioms involving constant
expressions.  This is a step towards comment #4 in PR3351.

llvm-svn: 92401
2010-01-01 22:29:12 +00:00
Ted Kremenek 504b7f8cc4 Remove old header.
llvm-svn: 92378
2010-01-01 00:04:49 +00:00
Ted Kremenek 2fdca4b720 Remove derelict serialization code.
llvm-svn: 92374
2009-12-31 23:40:17 +00:00
Chris Lattner 5e9aca4c5d this #include is ok.
llvm-svn: 92338
2009-12-31 03:02:42 +00:00
Chris Lattner 6a0ca6aa90 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.

llvm-svn: 92337
2009-12-31 03:02:08 +00:00
Chris Lattner cc8c8146d2 Remove #include of metadata.h from intrinsicinst.h. The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.

llvm-svn: 92323
2009-12-31 01:32:41 +00:00
Chris Lattner 9b493028df rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.

llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner 8cb6c3476d 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.

llvm-svn: 92321
2009-12-31 01:05:46 +00:00
Chris Lattner 30ae06be14 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/

llvm-svn: 92315
2009-12-30 21:42:11 +00:00
Douglas Gregor 165882c240 Implement edit distance for StringRef
llvm-svn: 92309
2009-12-30 17:23:44 +00:00