Commit Graph

591 Commits

Author SHA1 Message Date
Nick Lewycky
cd943e4317 Treat BBs that use BBs as proper predecessors and successors in the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-06 06:54:53 +00:00
Dale Johannesen
08e78b18b8 Pass alignment on ByVal parameters, from FE, all
the way through.  It is now used for codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:49:45 +00:00
Dan Gohman
b5660dc822 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47382 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 16:44:09 +00:00
Anton Korobeynikov
d57160d097 Add 'sink' cmdline option. Patch by Mikhail Glushenkov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 12:38:07 +00:00
Devang Patel
40a04216da Add GetResultInst. First step for multiple return value support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 22:15:16 +00:00
Dale Johannesen
0d51e7ec0d Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 21:38:47 +00:00
Duncan Sands
548448a317 Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:32:13 +00:00
Owen Anderson
823391ae6e Add support for setting parameters to CallSite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47249 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 00:10:55 +00:00
Dan Gohman
ca2a0e1062 Add count{Leading,Trailing}Ones_{32,64} functions with simple implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13 20:54:54 +00:00
Ted Kremenek
1f801fa5ad Added "Profile" method to APFloat for use with FoldingSet.
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary
objects to a profile via dispatch to FoldingSetTrait<T>::Profile().

Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their
functionality is now replaced using the above mentioned member template.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11 17:24:50 +00:00
Chris Lattner
dc97d4cb2f make this 64-bit safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26 19:50:30 +00:00
Ted Kremenek
f02e26abc0 Added special escape sequences "\{", "\}", and "\|" when processing
getNodeLabel(); these sequences allow the user to specify the characters '{',
'}', and '|' in the label, which facilitate breaking the label into multiple
record segments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46283 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-23 22:29:58 +00:00
Anton Korobeynikov
70c8650de0 Silence a warning. Should we turn this into configure-time check?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 11:01:23 +00:00
Gordon Henriksen
afa47c5a26 Fix a memory correctness error noticed by valgrind (harmless in practice).
Thanks to Duncan Sands for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46007 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 20:02:11 +00:00
Chris Lattner
4a83e963b3 add match support for casts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 07:02:44 +00:00
Chris Lattner
50ee9ddc8f Split param attr implementation out from Function.cpp into its
own file.  Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 23:42:30 +00:00
Chris Lattner
234d529e58 remove attribution from a variety of miscellaneous files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 22:59:10 +00:00
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
Chris Lattner
46f1a8797c Add m_Zero().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20 04:47:44 +00:00
Duncan Sands
f0c3354d99 When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'.  It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 21:13:37 +00:00
Duncan Sands
2b0e8990ab Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 09:59:50 +00:00
Devang Patel
a6e757ec99 Add cast operators in LLVMFoldingBuilder.
Patch by Richard Pennington.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 19:06:26 +00:00
Duncan Sands
ece2c04d53 Make instcombine promote inline asm calls to 'nounwind'
calls.  Remove special casing of inline asm from the
inliner.  There is a potential problem: the verifier
rejects invokes of inline asm (not sure why).  If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created.  This is bad but
I'm not sure what the best approach is.  I'm tempted
to remove the check in the verifier...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 15:51:49 +00:00
Anton Korobeynikov
b5ec947b5e Constify graph arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 00:42:19 +00:00
Dan Gohman
abb8bf131c Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45031 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 15:11:58 +00:00
Gordon Henriksen
53c34b1db9 Delete the CollectorNamePool if it should become empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:35:18 +00:00
Gordon Henriksen
8d1ea75060 Fix a very silly typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 01:12:08 +00:00
Gordon Henriksen
7446d0cfc5 Incorporating review feedback from Reid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 20:10:40 +00:00
Gordon Henriksen
985cb62234 Adding a StringPool data structure, which GC will use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 17:07:47 +00:00
Duncan Sands
a3355ffb3d Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 20:06:50 +00:00
Duncan Sands
afa3b6da11 Add some convenience methods for querying attributes, and
use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 17:07:01 +00:00
Duncan Sands
dc024674ff Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 13:23:08 +00:00
Chris Lattner
2b1f1066ac Fix the Linker testcase regressions, by making MemoryBuffer::getFileOrSTDIN return
a valid but empty buffer if stdin is empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44219 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 18:52:28 +00:00
Duncan Sands
fd617d0143 Move MinAlign to MathExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 13:41:39 +00:00
Duncan Sands
dc84650679 The guaranteed alignment of ptr+offset is only the minimum of
of offset and the alignment of ptr if these are both powers of
2.  While the ptr alignment is guaranteed to be a power of 2,
there is no reason to think that offset is.  For example, if
offset is 12 (the size of a long double on x86-32 linux) and
the alignment of ptr is 8, then the alignment of ptr+offset
will in general be 4, not 8.  Introduce a function MinAlign,
lifted from gcc, for computing the minimum guaranteed alignment.
I've tried to fix up everywhere under lib/CodeGen/SelectionDAG/.
I also changed some places that weren't wrong (because both values
were a power of 2), as a defensive change against people copying
and pasting the code.
Hopefully someone who cares about alignment will review the rest
of LLVM and fix up the remaining places.  Since I'm on x86 I'm
not very motivated to do this myself...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43421 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 12:59:45 +00:00
Chris Lattner
a0d9de0b66 remove dead file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 16:12:54 +00:00
Ted Kremenek
52e2d83e65 Changed the return type of type-specific Allocate() methods to return
void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-18 00:30:14 +00:00
Ted Kremenek
129d7d3bde Removed inclusion of cassert, which is no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43099 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:12:14 +00:00
Ted Kremenek
87f3870db9 Added template function alignof() which provides a clean
function-based interface to getting the alignment of a type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 22:08:55 +00:00
Ted Kremenek
869a3344f1 Added member template functions to MallocAllocator and
BumpPtrAllocator that implement allocations that return a properly
typed pointer.  For BumpPtrAllocator, the allocated memory is
automatically aligned to the minimum alignment of the type (as
calculated by llvm::AlignOf::Alignment).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 21:10:21 +00:00
Ted Kremenek
a4d9869cf2 Added llvm::AlignOf, a template class whose purpose is to portably
compute the minimum memory alignment of arbitrary types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43086 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 20:56:47 +00:00
Hartmut Kaiser
efd4a5144b Updated VC++ build system.
Silenced some VC warnings.

I'm getting linker errors, though: unresolved externals:

llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

and

llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

Where are these defined?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:56:40 +00:00
Chris Lattner
3ef437d137 Add a new use_iterator::atEnd() method, which allows us to shrink
pred_iterator down to a single ivar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 04:18:11 +00:00
Chris Lattner
3daae2701b Add new MemoryBuffer::getMemBufferCopy method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:46:38 +00:00
Devang Patel
ec1f944230 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:41:00 +00:00
Devang Patel
cd80c169d7 Add LLVMFoldingBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42806 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 19:49:19 +00:00
Dan Gohman
1fc46d5a8c Remove an unnecessary friend declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:39:48 +00:00
Chris Lattner
49588d83da update prototype, fixing build error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42789 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 16:27:44 +00:00
Dan Gohman
9a5263241d Pass argc by value, not by reference, since it isn't modified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 16:04:57 +00:00
Dan Gohman
3ab264a985 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:10:04 +00:00