Nick Lewycky
efb16f7057
Be more careful modifying the use_list while also iterating through it.
...
llvm-svn: 46417
2008-01-27 18:35:00 +00:00
Duncan Sands
053c9871cd
Revert r46393: readonly/readnone functions are no
...
longer allowed to write through byval arguments.
llvm-svn: 46416
2008-01-27 18:12:58 +00:00
Bill Wendling
60361a16f8
The CorrelatedExpressionElimination pass is known to be buggy. Remove it.
...
This fixes PR1769.
llvm-svn: 46408
2008-01-27 06:11:41 +00:00
Chris Lattner
fa1e7eef30
Fold fptrunc(add (fpextend x), (fpextend y)) -> add(x,y), as GCC does.
...
llvm-svn: 46406
2008-01-27 05:29:54 +00:00
Bill Wendling
5079483957
If there are no machine instructions emitted for a function, then insert
...
a "nop" instruction so that we don't have the function's label associated
with something that it's not supposed to be associated with.
llvm-svn: 46394
2008-01-26 06:51:24 +00:00
Duncan Sands
c4dc3dc3a2
Create an explicit copy for byval parameters even
...
when inlining a readonly function.
llvm-svn: 46393
2008-01-26 06:41:49 +00:00
Bill Wendling
0862e3421d
If we have a function like this:
...
void bork() {
int *address = 0;
*address = 0;
}
It's compiled into LLVM code that looks like this:
define void @bork() noreturn nounwind {
entry:
unreachable
}
This is bad on some platforms (like PPC) because it will generate the label for
the function but no body. The label could end up being associated with some
non-code related stuff, like a section. This places a "trap" instruction if the
SimplifyCFG pass removed all code from the function leaving only one
"unreachable" instruction.
llvm-svn: 46387
2008-01-26 01:43:44 +00:00
Duncan Sands
f52faf9a64
Do this more neatly.
...
llvm-svn: 46369
2008-01-25 22:06:51 +00:00
Owen Anderson
6af19fd1e2
DeadStoreElimination can treat byval parameters as if there were alloca's for the purpose of removing end-of-function stores.
...
llvm-svn: 46351
2008-01-25 10:10:33 +00:00
Nick Lewycky
f069264164
Enable the fix I just checked in, silly me.
...
llvm-svn: 46247
2008-01-22 05:42:02 +00:00
Nick Lewycky
78712e5b59
Multiply can be evaluated in a different type, so long as the target type has
...
a smaller bitwidth.
llvm-svn: 46244
2008-01-22 05:08:48 +00:00
Duncan Sands
afa84da4e0
Make sure the caller doesn't use freed memory.
...
Fixes PR1935.
llvm-svn: 46203
2008-01-20 16:51:46 +00:00
Duncan Sands
fe3bef091f
Initializing an unsigned with ~0UL causes the compiler
...
to complain on x86-64 (gcc 4.1). Use ~0U instead.
llvm-svn: 46197
2008-01-20 10:49:23 +00:00
Evan Cheng
04af661b1f
DAE bug fix. Don't lose parameter attributes on vararg arguments.
...
llvm-svn: 46113
2008-01-17 04:18:54 +00:00
Chris Lattner
5630c4f217
Fix arg promotion to propagate the correct attrs on the calls to
...
promoted functions. This is important for varargs calls in
particular. Thanks to duncan for providing a great testcase.
llvm-svn: 46108
2008-01-17 01:17:03 +00:00
Chris Lattner
39f156183d
Handle attribute(used) global variables that are i8.
...
llvm-svn: 46090
2008-01-16 21:35:43 +00:00
Devang Patel
b3696e4f14
Do not strip llvm.used values.
...
llvm-svn: 46045
2008-01-16 03:33:05 +00:00
Duncan Sands
b5ca2e9fcb
I noticed that the trampoline straightening transformation could
...
drop attributes on varargs call arguments. Also, it could generate
invalid IR if the transformed call already had the 'nest' attribute
somewhere (this can never happen for code coming from llvm-gcc,
but it's a theoretical possibility). Fix both problems.
llvm-svn: 45973
2008-01-14 19:52:09 +00:00
Chris Lattner
26fe7ebc03
Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
...
byval work. This miscompilation is due to the program indexing an array out
of range and us doing a transformation that broke this.
llvm-svn: 45949
2008-01-14 02:09:12 +00:00
Chris Lattner
9a6db18b04
The isNotSuitableForSRA property is now dead, don't compute it.
...
llvm-svn: 45948
2008-01-14 01:32:52 +00:00
Chris Lattner
ab0537258f
Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
...
difficult to understand the invariants.
llvm-svn: 45947
2008-01-14 01:31:05 +00:00
Chris Lattner
20bbac3435
Make the 'shrink global to bool' optimization more self contained, and thus
...
easier to show that its safe. No functionality change.
llvm-svn: 45946
2008-01-14 01:17:44 +00:00
Chris Lattner
92bd785323
Turn a memcpy from a double* into a load/store of double instead of
...
a load/store of i64. The later prevents promotion/scalarrepl of the
source and dest in many cases.
This fixes the 300% performance regression of the byval stuff on
stepanov_v1p2.
llvm-svn: 45945
2008-01-14 00:28:35 +00:00
Chris Lattner
57974c8d51
factor memcpy/memmove simplification out to its own SimplifyMemTransfer
...
method, no functionality change.
llvm-svn: 45944
2008-01-13 23:50:23 +00:00
Chris Lattner
8c5cdddfb9
simplify some code. If we can infer alignment for source and dest that are
...
greater than memcpy alignment, and if we lower to load/store, use the best
alignment info we have.
llvm-svn: 45943
2008-01-13 22:30:28 +00:00
Chris Lattner
5a86612d3f
simplify some code by adding a InsertBitCastBefore method,
...
make memmove->memcpy conversion a bit simpler.
llvm-svn: 45942
2008-01-13 22:23:22 +00:00
Chris Lattner
5bc253c8f2
Fix PR1907, a nasty miscompilation because instcombine didn't
...
realize that ne & sgt was a signed comparison (it was only
looking at whether the left compare was signed).
llvm-svn: 45937
2008-01-13 20:59:02 +00:00
Duncan Sands
ff70c5de69
Small simplification.
...
llvm-svn: 45932
2008-01-13 08:12:17 +00:00
Duncan Sands
781f6549db
When turning a call to a bitcast function into a direct call,
...
if this becomes a varargs call then deal correctly with any
parameter attributes on the newly vararg call arguments.
llvm-svn: 45931
2008-01-13 08:02:44 +00:00
Chris Lattner
4f6c81ac68
we don't have to make an explicit copy of a byval argument when
...
inlining a function if we know that the function does not write
to *any* memory. This implements test/Transforms/Inline/byval2.ll
llvm-svn: 45912
2008-01-12 18:54:29 +00:00
Chris Lattner
22ad7abdfe
Allow clients to specify the inline threshold when creating
...
the inliner pass. Patch by Robert Zeh.
llvm-svn: 45903
2008-01-12 06:49:13 +00:00
Duncan Sands
5b721fc21d
When DAE drops the varargs part of a function, ensure any
...
attributes on the vararg call arguments are also dropped.
llvm-svn: 45892
2008-01-11 23:13:45 +00:00
Chris Lattner
b5bd924e83
Teach argpromote to ruthlessly hack small byval structs when it can
...
get away with it, which exposes opportunities to eliminate the memory
objects entirely. For example, we now compile byval.ll to:
define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
%tmp2 = add i32 %b.0, 1 ; <i32> [#uses=0]
ret void
}
define i32 @main() nounwind {
entry:
call void @f1( i32 1, i64 2 )
ret i32 0
}
This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...
llvm-svn: 45886
2008-01-11 22:31:41 +00:00
Chris Lattner
b66fbdde42
Use smallptrset instead of std::set for efficiency.
...
llvm-svn: 45878
2008-01-11 19:36:30 +00:00
Chris Lattner
4a70261f00
a byval argument is guaranteed to be valid to load.
...
llvm-svn: 45877
2008-01-11 19:34:32 +00:00
Chris Lattner
4062a625e5
Update this code to use eraseFromParent where possible. Compute
...
whether an argument is byval and pass into isSafeToPromoteArgument.
llvm-svn: 45876
2008-01-11 19:20:39 +00:00
Chris Lattner
e736e55d3c
replace a loop with a constant time check.
...
llvm-svn: 45875
2008-01-11 18:55:10 +00:00
Chris Lattner
669e7054ca
another minor datastructure tweak.
...
llvm-svn: 45874
2008-01-11 18:47:45 +00:00
Chris Lattner
a8ba28f6e4
start using smallvector to avoid vector heap thrashing.
...
llvm-svn: 45873
2008-01-11 18:43:58 +00:00
Chris Lattner
908117bf69
When inlining a functino with a byval argument, make an explicit
...
copy of it in case the callee modifies the struct.
llvm-svn: 45853
2008-01-11 06:09:30 +00:00
Chris Lattner
2940c5c56d
Implement PR1795, an instcombine hack for forming GEPs with integer pointer arithmetic.
...
llvm-svn: 45745
2008-01-08 07:23:51 +00:00
Duncan Sands
b18c30acec
Small cleanup for handling of type/parameter attribute
...
incompatibility.
llvm-svn: 45704
2008-01-07 17:16:06 +00:00
Gordon Henriksen
efb08802ec
Deleting an empty file. Thanks, /usr/bin/patch!
...
llvm-svn: 45675
2008-01-07 02:29:04 +00:00
Gordon Henriksen
6047b6e140
With this patch, the LowerGC transformation becomes the
...
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.
Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):
; shadowstack prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl $___gc_fun, 20(%esp)
movl $0, 24(%esp)
movl $0, 28(%esp)
movl $0, 32(%esp)
movl $0, 36(%esp)
movl $0, 40(%esp)
movl $0, 44(%esp)
movl $0, 48(%esp)
movl $0, 52(%esp)
movl %ecx, 16(%esp)
leal 16(%esp), %ecx
movl %ecx, (%eax)
; shadowstack loop overhead
(none)
; shadowstack epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; shadowstack metadata
.align 3
___gc_fun: # __gc_fun
.long 8
.space 4
In comparison to LowerGC:
; lowergc prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl %ecx, 48(%esp)
movl $8, 52(%esp)
movl $0, 60(%esp)
movl $0, 56(%esp)
movl $0, 68(%esp)
movl $0, 64(%esp)
movl $0, 76(%esp)
movl $0, 72(%esp)
movl $0, 84(%esp)
movl $0, 80(%esp)
movl $0, 92(%esp)
movl $0, 88(%esp)
movl $0, 100(%esp)
movl $0, 96(%esp)
movl $0, 108(%esp)
movl $0, 104(%esp)
movl $0, 116(%esp)
movl $0, 112(%esp)
; lowergc loop overhead
leal 44(%esp), %eax
movl %eax, 56(%esp)
leal 40(%esp), %eax
movl %eax, 64(%esp)
leal 36(%esp), %eax
movl %eax, 72(%esp)
leal 32(%esp), %eax
movl %eax, 80(%esp)
leal 28(%esp), %eax
movl %eax, 88(%esp)
leal 24(%esp), %eax
movl %eax, 96(%esp)
leal 20(%esp), %eax
movl %eax, 104(%esp)
leal 16(%esp), %eax
movl %eax, 112(%esp)
; lowergc epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; lowergc metadata
(none)
llvm-svn: 45670
2008-01-07 01:30:53 +00:00
Duncan Sands
404eb05247
The transform that tries to turn calls to bitcast functions into
...
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.
llvm-svn: 45658
2008-01-06 18:27:01 +00:00
Duncan Sands
55e5090fe8
When transforming a call to a bitcast function into
...
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not. Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.
llvm-svn: 45657
2008-01-06 10:12:28 +00:00
Chris Lattner
e666bc272d
remove a couple more unsafe xforms in the face of overflow.
...
llvm-svn: 45613
2008-01-05 01:22:42 +00:00
Chris Lattner
db026d703b
remove the (x-y) < 0 comparison xform, it miscompiles
...
things that are not equality comparisons, for example:
(2147479553+4096)-2147479553 < 0 != (2147479553+4096) < 2147479553
llvm-svn: 45612
2008-01-05 01:18:20 +00:00
Wojciech Matyjewicz
30e434569e
fix typo
...
llvm-svn: 45594
2008-01-04 20:02:18 +00:00
Chris Lattner
bdd6acfb59
Fix PR1896
...
llvm-svn: 45568
2008-01-04 05:04:53 +00:00
Chris Lattner
f391883670
don't hoist FP additions into unconditional adds + selects. This
...
could theoretically introduce a trap, but is also a performance issue.
This speeds up ptrdist/ks by 8%.
llvm-svn: 45533
2008-01-03 07:25:26 +00:00
Chris Lattner
d2b0e15535
add missing #include
...
llvm-svn: 45516
2008-01-02 23:41:05 +00:00
Chris Lattner
f3ebc3f3d2
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
a087a8d2ce
remove attribution from lib Makefiles.
...
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Christopher Lamb
b053b80b79
Disable null pointer folding transforms for non-generic address spaces. This should probably be a target-specific predicate based on address space. That way for targets where this isn't applicable the predicate can be optimized away.
...
llvm-svn: 45403
2007-12-29 07:56:53 +00:00
Chris Lattner
e96658392d
dead calls to llvm.stacksave can be deleted, even though they
...
have potential side-effects.
llvm-svn: 45392
2007-12-29 00:59:12 +00:00
Owen Anderson
7363914ef7
Repair a transform that Chris noticed a bug in. Thanks to Nicholas for pointing out my stupid mistakes when writing this patch. :-)
...
llvm-svn: 45384
2007-12-28 07:42:12 +00:00
Chris Lattner
5179819beb
disable this instcombine xform, it miscompiles:
...
define i32 @main() {
entry:
%z = alloca i32 ; <i32*> [#uses=2]
store i32 0, i32* %z
%tmp = load i32* %z ; <i32> [#uses=1]
%sub = sub i32 %tmp, 1 ; <i32> [#uses=1]
%cmp = icmp ult i32 %sub, 0 ; <i1> [#uses=1]
%retval = select i1 %cmp, i32 1, i32 0 ; <i32> [#uses=1]
ret i32 %retval
}
into ret 1, instead of ret 0.
Christopher, please investigate.
llvm-svn: 45383
2007-12-28 06:24:31 +00:00
Gordon Henriksen
520e64c0c2
Fixing several transforms which would drop the collector attribute
...
when copying functions.
llvm-svn: 45356
2007-12-25 22:16:06 +00:00
Chris Lattner
ef1bbfc762
Don't break critical edges for single-bb loops, this helps with PR1877, though
...
it is only a partial fix. This change is noise for most programs, but
speeds up Shootout-C++/matrix by 20%, Ptrdist/ks by 24%, smg2000 by 8%,
hexxagon by 9%, bzip2 by 9% (not sure I trust this), ackerman by 13%, etc.
OTOH, it slows down Shootout/fib2 by 40% (I'll update PR1877 with this info).
llvm-svn: 45354
2007-12-25 19:06:45 +00:00
Gordon Henriksen
b969c5981b
GC poses hazards to the inliner. Consider:
...
define void @f() {
...
call i32 @g()
...
}
define void @g() {
...
}
The hazards are:
- @f and @g have GC, but they differ GC. Inlining is invalid. This
may never occur.
- @f has no GC, but @g does. g's GC must be propagated to @f.
The other scenarios are safe:
- @f and @g have the same GC.
- @f and @g have no GC.
- @g has no GC.
This patch adds inliner checks for the former two scenarios.
llvm-svn: 45351
2007-12-25 03:10:07 +00:00
Chris Lattner
62a806d565
add a -backedge-hack llc-beta option to codegenprepare.
...
When specified, don't split backedges of single-bb loops.
This helps address PR1877
llvm-svn: 45344
2007-12-24 19:32:55 +00:00
Chris Lattner
74b2ab59fd
implement InstCombine/shift-trunc-shift.ll. This allows
...
us to compile:
#include <math.h>
int t1(double d) { return signbit(d); }
into:
_t1:
movd %xmm0, %rax
shrq $63, %rax
ret
instead of:
_t1:
movd %xmm0, %rax
shrq $32, %rax
shrl $31, %eax
ret
on x86-64.
llvm-svn: 45311
2007-12-22 09:07:47 +00:00
Devang Patel
7a2c66b11e
If succ has succ itself as one of the predecessors then do
...
not merge current bb and succ even if bb's terminator is
unconditional branch to succ.
llvm-svn: 45305
2007-12-22 01:32:53 +00:00
Duncan Sands
6a7703ed63
Make DAE not wipe out attributes on calls, and not drop
...
return attributes on the floor. In the case of a call
to a varargs function where the varargs arguments are
being removed, any call attributes on those arguments
need to be dropped. I didn't do this because I plan to
make it illegal to have such attributes (see next patch).
With this change, compiling the gcc filter2 eh test at -O0
and then running opt -std-compile-opts on it results in
a correctly working program (compiling at -O1 or higher
results in the test failing due to a problem with how we
output eh info into the IR).
llvm-svn: 45285
2007-12-21 19:16:16 +00:00
Christopher Lamb
7d82bc46b8
Implement review feedback, including additional transforms
...
(icmp slt (sub A B) 1) -> (icmp sle A B)
icmp sgt (sub A B) -1) -> (icmp sge A B)
and add testcase.
llvm-svn: 45256
2007-12-20 07:21:11 +00:00
Evan Cheng
26ee54eb05
Clean up previous patch: PHI uses should not prevent iv reuse if all other uses are addresses. This trades a constant multiply for one fewer iv.
...
llvm-svn: 45251
2007-12-20 02:20:53 +00:00
Chris Lattner
16a51da0e2
simplify this code with the new m_Zero() pattern. Make sure the select only
...
has a single use, and generalize it to not require N to be a constant.
llvm-svn: 45250
2007-12-20 01:56:58 +00:00
Evan Cheng
e2a8ba7fec
Allow iv reuse if the user is a PHI node which is in turn used as addresses.
...
llvm-svn: 45230
2007-12-19 23:33:23 +00:00
Duncan Sands
aa31b92508
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.
llvm-svn: 45218
2007-12-19 21:13:37 +00:00
Christopher Lamb
f00ac6dd93
Fold subtracts into integer compares vs. zero. This improves generate code for this case on X86
...
from
_foo:
movl $99, %ecx
movl 4(%esp), %eax
subl %eax, %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovs %edx, %eax
ret
to
_foo:
xorl %ecx, %ecx
movl 4(%esp), %eax
cmpl $99, %eax
cmovg %ecx, %eax
ret
llvm-svn: 45173
2007-12-18 21:32:20 +00:00
Christopher Lamb
b7016c53d1
Fix comments
...
llvm-svn: 45170
2007-12-18 20:33:11 +00:00
Christopher Lamb
74dbad9216
Remove an orthogonal transformation of the selection condition from my most recent submission.
...
llvm-svn: 45169
2007-12-18 20:30:28 +00:00
Duncan Sands
3353ed09ac
Rename isNoReturn to doesNotReturn, and isNoUnwind to
...
doesNotThrow.
llvm-svn: 45160
2007-12-18 09:59:50 +00:00
Christopher Lamb
30291f4a30
Fix typos.
...
llvm-svn: 45159
2007-12-18 09:45:40 +00:00
Christopher Lamb
8b09a464b4
Fold certain additions through selects (and their compares) so as to eliminate subtractions. This code is often produced by the SMAX expansion in SCEV.
...
This implements test/Transforms/InstCombine/2007-12-18-AddSelCmpSub.ll
llvm-svn: 45158
2007-12-18 09:34:41 +00:00
Duncan Sands
b5a79d0eaa
Make invokes of inline asm legal. Teach codegen
...
how to lower them (with no attempt made to be
efficient, since they should only occur for
unoptimized code).
llvm-svn: 45108
2007-12-17 18:08:19 +00:00
David Greene
71eae8a5ee
GLIBCXX_DEBUG fix. std::vector<>::end() is invalidated by erase.
...
llvm-svn: 45101
2007-12-17 17:42:03 +00:00
David Greene
c4a80fb574
Get rid of annoying spaces.
...
llvm-svn: 45100
2007-12-17 17:40:29 +00:00
David Greene
2a5967b36a
Fix GLIBCXX_DEBUG errors. Erase invalidates std::vector iterators
...
passed the erased element.
llvm-svn: 45099
2007-12-17 17:39:51 +00:00
Christopher Lamb
edf0788758
Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
...
llvm-svn: 45082
2007-12-17 01:12:55 +00:00
Duncan Sands
56ed48036b
Revert this part of r45073 until the verifier is
...
changed not to reject invoke of inline asm.
llvm-svn: 45077
2007-12-16 21:01:21 +00:00
Duncan Sands
8e4847ee95
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...
llvm-svn: 45073
2007-12-16 15:51:49 +00:00
Evan Cheng
2011df4e39
Fix typo.
...
llvm-svn: 44997
2007-12-13 07:50:36 +00:00
Evan Cheng
37c36ed79a
Be extra careful with extension use optimation. Now turned on by default.
...
llvm-svn: 44981
2007-12-13 03:32:53 +00:00
Chris Lattner
f0fbf077d2
Fix for edge profiling, patch by 'Marc' for PR1857
...
llvm-svn: 44965
2007-12-13 00:04:46 +00:00
Wojciech Matyjewicz
309e5a723b
1. "Upgrage" comments.
...
2. Using zero-extended value of Scale and unsigned division is safe provided
that Scale doesn't have the sign bit set.
Previously these 2 instructions:
%p = bitcast [100 x {i8,i8,i8}]* %x to i8*
%q = getelementptr i8* %p, i32 -4
were combined into:
%q = getelementptr [100 x { i8, i8, i8 }]* %x, i32 0,
i32 1431655764, i32 0
what was incorrect.
llvm-svn: 44936
2007-12-12 15:21:32 +00:00
Evan Cheng
63d33cfd2b
Don't muck with phi nodes; bug fixes.
...
llvm-svn: 44905
2007-12-12 02:53:41 +00:00
Evan Cheng
7bc8942532
Bug fix. Only safe to perform extension uses optimization if the source of extension is also defined in the same BB as the extension.
...
llvm-svn: 44896
2007-12-12 00:51:06 +00:00
Chris Lattner
d2265b45ae
Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
...
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe. While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".
llvm-svn: 44817
2007-12-10 22:53:04 +00:00
Duncan Sands
9f76be61d1
Make PruneEH update the nounwind/noreturn attributes
...
on functions as it calculates them.
llvm-svn: 44802
2007-12-10 19:09:40 +00:00
Gordon Henriksen
71183b6739
Adding a collector name attribute to Function in the IR. These
...
methods are new to Function:
bool hasCollector() const;
const std::string &getCollector() const;
void setCollector(const std::string &);
void clearCollector();
The assembly representation is as such:
define void @f() gc "shadow-stack" { ...
The implementation uses an on-the-side table to map Functions to
collector names, such that there is no overhead. A StringPool is
further used to unique collector names, which are extremely
likely to be unique per process.
llvm-svn: 44769
2007-12-10 03:18:06 +00:00
Owen Anderson
086b2c4537
Fix several cache coherence bugs in MemDep/GVN that were found. Also add some (disabled) debugging code
...
to make such problems easier to diagnose in the future, written by Duncan Sands.
llvm-svn: 44695
2007-12-08 01:37:09 +00:00
Chris Lattner
d2bbbabbfb
simplify some code.
...
llvm-svn: 44655
2007-12-06 06:25:04 +00:00
Chris Lattner
0ccb663cca
move some ashr-specific code out of commonShiftTransforms into visitAShr.
...
llvm-svn: 44650
2007-12-06 01:59:46 +00:00
Evan Cheng
d3d8017bcb
If both result of the {s|z}xt and its source are live out, rewrite all uses of the source with result of extension.
...
llvm-svn: 44643
2007-12-05 23:58:20 +00:00
Duncan Sands
38ef3a8ec7
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).
llvm-svn: 44544
2007-12-03 20:06:50 +00:00
Chris Lattner
19970e62e7
update file comment.
...
llvm-svn: 44543
2007-12-03 19:43:18 +00:00
Devang Patel
bd75910fa7
If ExitValue operand is also defined in Loop header then
...
insert new ExitValue after this operand definition.
This fixes PR1828.
llvm-svn: 44539
2007-12-03 19:17:21 +00:00
Duncan Sands
68b6f50938
Integrate the readonly/readnone logic more deeply
...
into alias analysis. This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter. These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function. Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite. To reduce the
chance of misuse it is now protected.
llvm-svn: 44487
2007-12-01 07:51:45 +00:00