Bill Wendling
c6a15cf519
Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.
...
llvm-svn: 166009
2012-10-16 05:23:31 +00:00
Bill Wendling
50d27849f6
Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
...
llvm-svn: 165960
2012-10-15 20:35:56 +00:00
Bill Wendling
fbd38fe2e3
Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
...
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling
d079a446d7
Attributes Rewrite
...
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.
llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Bill Wendling
722b26c0f2
Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
...
llvm-svn: 165895
2012-10-14 07:35:59 +00:00
Bill Wendling
93f70b78fd
Use the enum value of the attributes when adding them to the attributes builder.
...
llvm-svn: 165494
2012-10-09 09:11:20 +00:00
Bill Wendling
f1c60d6d04
Fix. Apply the no capture attribute to the correct parameter.
...
llvm-svn: 165469
2012-10-09 00:51:40 +00:00
Bill Wendling
c1e8e74cbd
Convert to using the Attributes::Builder class to create attributes.
...
llvm-svn: 165468
2012-10-09 00:47:36 +00:00
Craig Topper
b1d83e8c72
Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
...
llvm-svn: 164090
2012-09-18 02:01:41 +00:00
Dmitri Gribenko
5485acd440
Fix Doxygen issues:
...
* wrap code blocks in \code ... \endcode;
* refer to parameter names in paragraphs correctly (\arg is not what most
people want -- it starts a new paragraph);
* use \param instead of \arg to document parameters in order to be consistent
with the rest of the codebase.
llvm-svn: 163902
2012-09-14 14:57:36 +00:00
Dan Gohman
7c84dad80a
Detect overflow in the path count computation. rdar://12277446.
...
llvm-svn: 163739
2012-09-12 20:45:17 +00:00
Dan Gohman
df476e5e93
Make provenance checking conservative in cases when
...
pointers-to-strong-pointers may be in play. These can lead to retains and
releases happening in unstructured ways, foiling the optimizer. This fixes
rdar://12150909.
llvm-svn: 163180
2012-09-04 23:16:20 +00:00
Dan Gohman
10c82cee04
Don't use for loops for code that is only intended to execute once. No
...
intended functionality change. Thanks to Ahmed Charles for spotting it.
llvm-svn: 162686
2012-08-27 18:31:36 +00:00
Dan Gohman
f64ff8ed3a
An objc_retain can serve as a may-use for a different pointer.
...
rdar://11931823.
llvm-svn: 160637
2012-07-23 19:27:31 +00:00
Sylvestre Ledru
35521e2310
Fix a typo (the the => the)
...
llvm-svn: 160621
2012-07-23 08:51:15 +00:00
Dan Gohman
5f725cd196
Fix the objc_autoreleasedReturnValue optimization code to locate
...
the call correctly even in the case where it is an invoke. This
fixes rdar://11714057.
llvm-svn: 159157
2012-06-25 19:47:37 +00:00
Benjamin Kramer
bde9176663
Fix typos found by http://github.com/lyda/misspell-check
...
llvm-svn: 157885
2012-06-02 10:20:22 +00:00
Chris Lattner
144b619684
Reimplement the intrinsic verifier to use the same table as Intrinsic::getDefinition,
...
making it stronger and more sane.
Delete the code from tblgen that produced the old code.
Besides being a path forward in intrinsic sanity, this also eliminates a bunch of
machine generated code that was compiled into Function.o
llvm-svn: 157545
2012-05-27 19:37:05 +00:00
Dan Gohman
9c97eea0fd
Mark an unreachable region of code with llvm_unreachable.
...
llvm-svn: 157197
2012-05-21 17:41:28 +00:00
Dan Gohman
14862c3141
Fix replacing all the users of objc weak runtime routines
...
when deleting them. rdar://11434915.
llvm-svn: 157080
2012-05-18 22:17:29 +00:00
Dan Gohman
f8b19d09ba
Fix the objc_storeStrong recognizer to stop before walking off the
...
end of a basic block if there's no store.
llvm-svn: 156520
2012-05-09 23:08:33 +00:00
Craig Topper
28540adfcf
Remove unused variable to get rid of warning.
...
llvm-svn: 156466
2012-05-09 07:08:58 +00:00
Dan Gohman
41375a3545
Miscellaneous accumulated cleanups.
...
llvm-svn: 156445
2012-05-08 23:39:44 +00:00
Dan Gohman
61708d37d6
Fix objc_storeStrong pattern matching to catch a potential use of the
...
old value after the store but before it is released.
This fixes rdar:/11116986.
llvm-svn: 156442
2012-05-08 23:34:08 +00:00
Dan Gohman
dae3349ac2
Miscellaneous accumulated cleanups.
...
llvm-svn: 155725
2012-04-27 18:56:31 +00:00
Dan Gohman
62079b43cc
Simplify the known retain count tracking; use a boolean state instead
...
of a precise count. Also, move RRInfo's Partial field into PtrState,
now that it won't increase the size.
llvm-svn: 155513
2012-04-25 00:50:46 +00:00
Dan Gohman
c24c66f21c
Build custom predecessor and successor lists for each basic block.
...
These lists exclude invoke unwind edges and loop backedges which
are being ignored. This makes it easier to ignore them
consistently.
llvm-svn: 155500
2012-04-24 22:53:18 +00:00
Dan Gohman
26aa827461
Avoid a bug in the path count computation, preventing an infinite
...
loop repeatedlt making the same change. This is for rdar://11256239.
llvm-svn: 155160
2012-04-19 21:50:46 +00:00
Dan Gohman
22fbe8d709
Don't crash on code where the user put __attribute__((constructor)) on
...
a function with arguments. This fixes rdar://11265785.
llvm-svn: 155073
2012-04-18 22:24:33 +00:00
Dan Gohman
670f93744b
Add some comments, and fix a few places that missed setting Changed.
...
llvm-svn: 154687
2012-04-13 18:57:48 +00:00
Dan Gohman
e1e352af2b
Consider ObjC runtime calls objc_storeWeak and others which make a copy of
...
their argument as "escape" points for objc_retainBlock optimization.
This fixes rdar://11229925.
llvm-svn: 154682
2012-04-13 18:28:58 +00:00
Dan Gohman
de8d2c446b
Use the new Use-aware dominates method to apply the objc runtime
...
library return value optimization for phi uses. Even when the
phi itself is not dominated, the specific use may be dominated.
llvm-svn: 154647
2012-04-13 01:08:28 +00:00
Dan Gohman
8478d76d64
Don't move objc_autorelease calls past autorelease pool boundaries when
...
optimizing autorelease calls on phi nodes with null operands.
This fixes rdar://11207070.
llvm-svn: 154642
2012-04-13 00:59:57 +00:00
Dan Gohman
cc64bbca81
Fix accidentally inverted logic from r152803, and make the
...
testcase slightly less trivial. This fixes rdar://11171718.
llvm-svn: 154118
2012-04-05 20:27:21 +00:00
Francois Pichet
4b9ab74690
Fix the MSVC build.
...
llvm-svn: 153366
2012-03-24 01:36:37 +00:00
Dan Gohman
e3ed2b0699
Don't convert objc_retainAutoreleasedReturnValue to objc_retain if it
...
is retaining the return value of an invoke that it immediately follows.
llvm-svn: 153344
2012-03-23 18:09:00 +00:00
Dan Gohman
5c70fadc17
It's not possible to insert code immediately after an invoke in the
...
same basic block, and it's not safe to insert code in the successor
blocks if the edges are critical edges. Splitting those edges is
possible, but undesirable, especially on the unwind side. Instead,
make the bottom-up code motion to consider invokes to be part of
their successor blocks, rather than part of their parent blocks, so
that it doesn't push code past them and onto the edges. This fixes
PR12307.
llvm-svn: 153343
2012-03-23 17:47:54 +00:00
Dan Gohman
817a7c6fdf
Refactor the code for visiting instructions out into helper functions.
...
llvm-svn: 153267
2012-03-22 18:24:56 +00:00
Rafael Espindola
f58927855b
Short term fix for pr12270 before we change dominates to handle unreachable
...
code.
While here, reduce indentation.
llvm-svn: 152803
2012-03-15 15:52:59 +00:00
Dan Gohman
532fb8131b
When an invoke is marked with metadata indicating its unwind edge
...
should be ignored by ARC optimization, don't insert new ARC runtime
calls in the unwind destination.
llvm-svn: 152748
2012-03-14 23:05:06 +00:00
Dan Gohman
500b598c5c
When identifying exit nodes for the reverse-CFG reverse-post-order
...
traversal, consider nodes for which the only successors are backedges
which the traversal is ignoring to be exit nodes. This fixes a problem
where the bottom-up traversal was failing to visit split blocks along
split loop backedges. This fixes rdar://10989035.
llvm-svn: 152421
2012-03-09 18:50:52 +00:00
Dan Gohman
362eb69f24
Fix an iterator invalidation problem. operator[] on a DenseMap
...
can insert a new element, invalidating iterators. Use find
instead, and handle the case where the key is not found explicitly.
llvm-svn: 151871
2012-03-02 01:26:46 +00:00
Dan Gohman
55b067427b
Misc micro-optimizations.
...
llvm-svn: 151869
2012-03-02 01:13:53 +00:00
Dan Gohman
0155f30a9c
Calls and invokes with the new clang.arc.no_objc_arc_exceptions
...
metadata may still unwind, but only in ways that the ARC
optimizer doesn't need to consider. This permits more
aggressive optimization.
llvm-svn: 150829
2012-02-17 18:59:53 +00:00
Dan Gohman
eb6e01533a
Just like in regular escape analysis, loads and stores through
...
(but not of) a block pointer do not cause the block pointer to
escape. This fixes rdar://10803830.
llvm-svn: 150424
2012-02-13 22:57:02 +00:00
David Blaikie
46a9f016c5
More dead code removal (using -Wunreachable-code)
...
llvm-svn: 148578
2012-01-20 21:51:11 +00:00
Dan Gohman
8ee108bf98
Set the "tail" flag on pattern-matched objc_storeStrong calls.
...
rdar://10531041.
llvm-svn: 148490
2012-01-19 19:14:36 +00:00
Dan Gohman
8f12faeb14
Add a depth limit to avoid runaway recursion.
...
llvm-svn: 148419
2012-01-18 21:24:45 +00:00
Dan Gohman
82041c2e60
Use llvm.global_ctors to locate global constructors instead
...
of recognizing them by name.
llvm-svn: 148416
2012-01-18 21:19:38 +00:00
Dan Gohman
e7a243fea5
Add a new ObjC ARC optimization pass to eliminate unneeded
...
autorelease push+pop pairs.
llvm-svn: 148330
2012-01-17 20:52:24 +00:00