Commit Graph

10882 Commits

Author SHA1 Message Date
Victor Hernandez
3a32865d58 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:04:09 +00:00
Nate Begeman
3fe980b127 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:18 +00:00
Victor Hernandez
5f03238d62 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 17:36:47 +00:00
Victor Hernandez
283ba2fbb4 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 03:37:48 +00:00
Dale Johannesen
243a32f96b Remove DEBUG_DECLARE, looks like we don't need it.
Also, DEBUG_VALUE has side effects.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:50:44 +00:00
Jeffrey Yasskin
3581d662e9 Make sure include/llvm/MC/MCParsedAsmOperand.h can be compiled alone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:41:53 +00:00
Chris Lattner
9d3c755fd6 add virtual methods to get the start/end of a MCParsedAsmOperand,
the default implementation returns "unknown".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:29:57 +00:00
Chris Lattner
9898671a74 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. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Chris Lattner
f007e853e2 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:32:45 +00:00
Chris Lattner
45220a8439 introduce the MCParsedAsmOperand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:20:55 +00:00
Victor Hernandez
c7650b4d19 Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:45:14 +00:00
Tobias Grosser
edd1cc78d2 Add getSource() to SuccIterator
Get the source BB of an iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 22:21:43 +00:00
Tobias Grosser
5106140a50 Extend SuccIterator
Implement most of the missing methods to make SuccIterator random access.
operator[] is still missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 22:21:28 +00:00
Chris Lattner
145438489f makeNameProper is now private!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:31:39 +00:00
Chris Lattner
4564ec9ca7 expose a static function as a static method on the MCSymbol class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:09:59 +00:00
Benjamin Kramer
b357e06f67 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 12:45:23 +00:00
Chris Lattner
bf86e5df18 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?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:12:06 +00:00
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