Jay Foad
1a180156b6
Remove unused STL header includes.
...
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Chris Lattner
0ab5e2cded
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Chris Lattner
e81d045d94
remove the StructRetPromotion pass. It is unused, not maintained and
...
has some bugs. If this is interesting functionality, it should be
reimplemented in the argpromotion pass.
llvm-svn: 129314
2011-04-11 23:09:44 +00:00
Nick Lewycky
0f85789800
Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn't
...
mean that it has to be ConstantArray of ConstantStruct. We might have
ConstantAggregateZero, at either level, so don't crash on that.
Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so
we end up with the two lists appended, each with their "sentinals" on them.
Different parts of LLVM treated sentinals differently, so make them all just
ignore the single entry and continue on with the rest of the list.
llvm-svn: 129307
2011-04-11 22:11:20 +00:00
Jay Foad
7c14a558fe
Don't include Operator.h from InstrTypes.h.
...
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Eli Friedman
9cca0715aa
Add back a couple checks removed by r129128; the fact that an intitializer
...
is an array of structures doesn't imply it's a ConstantArray of
ConstantStruct.
llvm-svn: 129207
2011-04-09 09:11:09 +00:00
Nick Lewycky
466d0c1f93
llvm.global_[cd]tor is defined to be either external, or appending with an array
...
of { i32, void ()* }. Teach the verifier to verify that, deleting copies of
checks strewn about.
llvm-svn: 129128
2011-04-08 07:30:21 +00:00
Jay Foad
11522097be
Remove some support for ReturnInsts with multiple operands, and for
...
returning a scalar value in a function whose return type is a single-
element structure or array.
llvm-svn: 128810
2011-04-04 07:44:02 +00:00
Jay Foad
52131344a2
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
...
PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
e0938d8a87
(Almost) always call reserveOperandSpace() on newly created PHINodes.
...
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Nick Lewycky
0e25c8b364
No functionality change, just adjust some whitespace for coding style compliance.
...
llvm-svn: 128257
2011-03-25 06:05:50 +00:00
Anders Carlsson
1cc8073bb3
Handle another case that Frits suggested.
...
llvm-svn: 128068
2011-03-22 03:21:01 +00:00
Anders Carlsson
4dd420f193
More cleanups to the OptimizeEmptyGlobalCXXDtors GlobalOpt function.
...
llvm-svn: 127997
2011-03-21 14:54:40 +00:00
Anders Carlsson
701822a48e
As suggested by Nick Lewycky, ignore debugging intrinsics when trying to decide whether a destructor is empty or not.
...
llvm-svn: 127985
2011-03-21 02:42:27 +00:00
Nick Lewycky
d078183725
Fix comments
...
llvm-svn: 127984
2011-03-21 02:26:01 +00:00
Anders Carlsson
336fd90f4d
Don't try to eliminate invokes to __cxa_atexit.
...
llvm-svn: 127976
2011-03-20 20:21:33 +00:00
Anders Carlsson
fcec2f519a
Don't segfault on mutual recursion, as pointed out by Frits.
...
llvm-svn: 127975
2011-03-20 20:16:43 +00:00
Anders Carlsson
48a44911d3
Address comments from Frits van Bommel.
...
llvm-svn: 127974
2011-03-20 19:51:13 +00:00
Anders Carlsson
ee6bc70d2f
Add an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if the function passed is empty.
...
llvm-svn: 127970
2011-03-20 17:59:11 +00:00
Devang Patel
a10794ab7b
These llvm.dbg.* constants are not used anymore.
...
llvm-svn: 127352
2011-03-09 19:41:33 +00:00
Rafael Espindola
871cfde1c2
Don't internalize available_externally functions. We already did the right
...
thing for variables.
llvm-svn: 127138
2011-03-06 23:41:34 +00:00
Eli Friedman
683bbc16c4
Add an obvious missing safety check to DAE::RemoveDeadArgumentsFromCallers.
...
llvm-svn: 126720
2011-03-01 00:33:47 +00:00
Nick Lewycky
080ea93779
Instead of keeping two Value*->id# mappings, keep one Value->Value mapping and
...
one Value set. This is faster because we only need to use the set when there
isn't already an entry in the map. No functionality change!
llvm-svn: 126076
2011-02-20 08:11:03 +00:00
Chris Lattner
69229316aa
convert ConstantVector::get to use ArrayRef.
...
llvm-svn: 125537
2011-02-15 00:14:00 +00:00
Chris Lattner
34442e6ebf
revert my ConstantVector patch, it seems to have made the llvm-gcc
...
builders unhappy.
llvm-svn: 125504
2011-02-14 18:15:46 +00:00
Chris Lattner
d9f5b88548
Switch ConstantVector::get to use ArrayRef instead of a pointer+size
...
idiom. Change various clients to simplify their code.
llvm-svn: 125487
2011-02-14 07:55:32 +00:00
Nick Lewycky
292e78c3cd
When removing a function from the function set and adding it to deferred, we
...
could end up removing a different function than we intended because it was
functionally equivalent, then end up with a comparison of a function against
itself in the next round of comparisons (the one in the function set and the
one on the deferred list). To fix this, I introduce a choice in the form of
comparison for ComparableFunctions, either normal or "pointer only" used to
find exact Function*'s in lookups.
Also add some debugging statements.
llvm-svn: 125180
2011-02-09 06:32:02 +00:00
Nick Lewycky
cb1a4c26ee
Simplify away redundant test, and document what's going on.
...
llvm-svn: 124977
2011-02-06 05:04:00 +00:00
Nick Lewycky
f8797fda44
Remove specialized comparison of InlineAsm objects. They're uniqued on creation
...
now, and this wasn't comparing some of their relevant bits anyhow.
llvm-svn: 124976
2011-02-06 04:33:50 +00:00
Nick Lewycky
a46c898314
Remove wasteful caching. This isn't needed for correctness because any function
...
that might have changed been affected by a merge elsewhere will have been
removed from the function set, and it isn't needed for performance because we
call grow() ahead of time to prevent reallocations.
llvm-svn: 124717
2011-02-02 05:31:01 +00:00
Nick Lewycky
cfb284cf96
Rename functions to follow coding standard. Also rejiggers comments. No
...
functionality change.
llvm-svn: 124482
2011-01-28 08:43:14 +00:00
Nick Lewycky
aaf401241a
Add a doxygen comment for this class.
...
llvm-svn: 124480
2011-01-28 08:19:00 +00:00
Nick Lewycky
564fcca856
Reorder for readability. (Chris, is this what you meant?)
...
llvm-svn: 124479
2011-01-28 07:36:21 +00:00
Nick Lewycky
c5eb3733f7
Reduce the number of functions we look at in the first pass, and preallocate
...
the function equality set.
llvm-svn: 124475
2011-01-28 05:48:15 +00:00
Benjamin Kramer
57e3d65884
Unbreak the build.
...
llvm-svn: 124426
2011-01-27 20:30:54 +00:00
Nick Lewycky
e2d46d30ae
Expound upon this comparison!
...
llvm-svn: 124406
2011-01-27 19:51:31 +00:00
Nick Lewycky
5a37e950e1
Use dyn_cast instead of isa+cast.
...
llvm-svn: 124404
2011-01-27 19:42:43 +00:00
Nick Lewycky
13e04aef2a
Fix surprising missed optimization in mergefunc where we forgot to consider
...
that relationships like "i8* null" is equivalent to "i32* null".
llvm-svn: 124368
2011-01-27 08:38:19 +00:00
Nick Lewycky
91543447a6
AttrListPtr has an overloaded operator== which does this for us, we should use
...
it. No functionality change!
llvm-svn: 124286
2011-01-26 09:23:19 +00:00
Nick Lewycky
82d4db8662
Teach mergefunc that intptr_t is the same width as a pointer. We still can't
...
merge vector<intptr_t>::push_back() and vector<void*>::push_back() because
Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent.
llvm-svn: 124285
2011-01-26 09:13:58 +00:00
Nick Lewycky
fb622f9920
There are no vectors of pointer or arrays, so we don't need to check vector
...
elements for type equivalence.
llvm-svn: 124284
2011-01-26 08:50:18 +00:00
Nick Lewycky
f1cec164ce
Teach mergefunc how to emit aliases safely again -- but keep it turned it off
...
for now. It's controlled by the HasGlobalAliases variable which is not attached
to any flag yet.
llvm-svn: 124182
2011-01-25 08:56:50 +00:00
Rafael Espindola
fc355bc070
Add unnamed_addr when we can show that address of a global is not used.
...
llvm-svn: 123834
2011-01-19 16:32:21 +00:00
Rafael Espindola
ecd5b9abe9
Reduce indentation and remove commented out code.
...
llvm-svn: 123729
2011-01-18 04:36:06 +00:00
Anders Carlsson
d3db83349e
Teach DAE to look for functions whose arguments are unused, and change all callers to pass in an undefvalue instead.
...
llvm-svn: 123596
2011-01-16 21:25:33 +00:00
Rafael Espindola
751677a040
Don't merge two constants if we care about the address of both.
...
This fixes the original testcase in PR8927. It also causes a clang
binary built with a patched clang to increase in size by 0.21%.
We can probably get some of the size back by writing a pass that
detects that a global never has its pointer compared and adds
unnamed_addr to it (maybe extend global opt). It is also possible that
there are some other cases clang could add unnamed_addr to.
I will investigate extending globalopt next.
llvm-svn: 123584
2011-01-16 17:05:09 +00:00
Chris Lattner
e5f8de8639
fix PR8932, a case where arg promotion could infinitely promote.
...
llvm-svn: 123574
2011-01-16 08:09:24 +00:00
Owen Anderson
4e54efd625
Improve the safety of my globalopt enhancement by ensuring that the bitcast
...
of the stored value to the new store type is always. Also, add a testcase.
llvm-svn: 123563
2011-01-16 04:33:33 +00:00
Chris Lattner
8b4952fcf7
simplify this code, it is still broken but will follow up on llvm-commits.
...
llvm-svn: 123558
2011-01-16 02:05:10 +00:00
Chris Lattner
1e209b87ad
remove the partial specialization pass. It is unmaintained and has bugs.
...
llvm-svn: 123554
2011-01-16 00:27:10 +00:00