Commit Graph

3860 Commits

Author SHA1 Message Date
Devang Patel
ed4edf9e5f Do not accidently initialize NumDbgValueLost and NumDbgLineLost counts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-16 00:27:57 +00:00
Francois Pichet
581d535af9 Unbreak the CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127383 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 00:51:01 +00:00
Devang Patel
6af531febe Introduce DebugInfoProbe. This is used to monitor how llvm optimizer is treating debugging information.
It generates output that lools like

8 times line number info lost by Scalar Replacement of Aggregates (SSAUp) 
1 times line number info lost by Simplify well-known library calls 
12 times variable info lost by Jump Threading



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127381 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 00:21:25 +00:00
Eric Christopher
f607abdf7b Make these options hidden to reduce the amount of text -help puts on the
command line, they'll still be seen with -help-hidden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127353 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-09 19:46:51 +00:00
Justin Holewinski
a6428a401b ptx: Fix calling convention printing in AsmWriter.cpp
This allows LLVM IR using ptx_kernel or ptx_device calling
conventions to be properly printed when emitted in text form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127157 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-07 14:32:30 +00:00
Nick Lewycky
d01f50f42c ConstantInt has some getters which return ConstantInt's or ConstantVector's of
the value splatted into every element. Extend this to getTrue and getFalse which
by providing new overloads that take Types that are either i1 or <N x i1>. Use
it in InstCombine to add vector support to some code, fixing PR8469!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-06 03:36:19 +00:00
Devang Patel
566bd12e54 Add ArrayRef variant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 01:20:33 +00:00
Tilmann Scheller
49d7999b89 Use X86_thiscall calling convention for Win64 as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:49:07 +00:00
Tilmann Scheller
f1cc70ca93 Add Win64 thiscall calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 19:29:22 +00:00
Rafael Espindola
38c4e53549 Add a special streamer to libLTO that just records symbols definitions and
uses.

The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 04:14:42 +00:00
Talin
bdcd766028 Added missing va_end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 18:00:49 +00:00
Talin
41ee4e57ea Add an END_WITH_NULL accessor for ConstantStruct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126714 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 23:53:27 +00:00
Devang Patel
29020a3b45 These tags are now covered by dwarf::TagString().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:13:40 +00:00
Rafael Espindola
1e09e5b979 Expose getTypeName to the C API. Patch by Patrick Walton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 16:35:37 +00:00
Chris Lattner
13fb0db0c2 hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:41:42 +00:00
Nadav Rotem
093399cbf3 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 21:22:27 +00:00
Chris Lattner
2ca5c8644e convert ConstantVector::get to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 00:14:00 +00:00
Chris Lattner
7583190422 revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 18:15:46 +00:00
Chris Lattner
283c8caccd Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom.  Change various clients to simplify their code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 07:55:32 +00:00
Nadav Rotem
bc53ca1b53 Fix a regression from r125393;
It caused a crash in MultiSource/Benchmarks/Bullet.
Opt hit an assertion with "opt -std-compile-opts" because
Constant::getAllOnesValue doesn't know how to handle floats.

This patch added a test to reproduce the problem and a check that the
destination vector is of integer type.

Thank you Benjamin!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 15:45:34 +00:00
Nadav Rotem
d2f27ead2d Fix 9173.
Add more folding patterns to constant expressions of vector selects and vector
bitcasts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125393 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 19:37:55 +00:00
Chris Lattner
33a8f3385b make ConstantExpr::replaceUsesOfWithOnConstant preserve the inbounds
flag.  Noticed by Jin Gu Kang!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125366 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 05:37:21 +00:00
Chris Lattner
1f78d51be6 make the constantexpr interfaces for inbounds GEPs follow the same style
as other constantexpr flags, reducing redundancy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125365 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 05:34:33 +00:00
Chris Lattner
81baf14fdf switch the constantexpr, target folder, and IRBuilder interfaces
for NSW/NUW binops to follow the pattern of exact binops.  This
allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 07:01:55 +00:00
Chris Lattner
74f5c5abea refactor ConstantExpr interfaces a bit around "exactness".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 16:43:07 +00:00
Chris Lattner
eb59ca976c fix comment change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 20:03:14 +00:00
Chris Lattner
f067d584a8 implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 16:40:21 +00:00
Chris Lattner
35bda8914c enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.

Nothing forms exact udivs yet though.  This is progress on PR8862



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-06 21:44:57 +00:00
Jay Foad
0faa60938a Make SwitchInst::removeCase() more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 09:22:34 +00:00
Duncan Sands
7681c6da60 Have m_One also match constant vectors for which every element is 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 08:39:12 +00:00
Nick Lewycky
bb25e2c91b Fix 'fcmp one' constant folding. Noticed by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-30 01:49:58 +00:00
Nick Lewycky
b8787f3403 Fix some formatting and upgrade comments from llvm 1.x to 2.x syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-30 01:48:50 +00:00
Nick Lewycky
175e7aec13 Add the select optimization recently added to instcombine to constant folding.
This is the one where one of the branches of the select is another select on
the same condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-29 20:35:06 +00:00
Jay Foad
9afc527671 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 14:44:55 +00:00
Jay Foad
adede0387b Simplify User::operator delete().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 21:56:10 +00:00
Nick Lewycky
f6c63c2320 AttrListPtr has an overloaded operator== which does this for us, we should use
it. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 09:23:19 +00:00
Rafael Espindola
3971df5203 Move unnamed_addr after the function arguments on Sabre's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 19:09:56 +00:00
Chris Lattner
3928af6ac4 teach Value::isDereferenceablePointer that byval arguments are always
dereferencable, noticed by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124085 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 21:15:29 +00:00
Nick Lewycky
4c93a0f092 Add a constant folding of casts from zero to zero. Fixes PR9011!
While here, I'd like to complain about how vector is not an aggregate type
according to llvm::Type::isAggregateType(), but they're listed under aggregate
types in the LangRef and zero vectors are stored as ConstantAggregateZero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 01:12:09 +00:00
Tobias Grosser
e906921480 Implement requiredTransitive
The PassManager did not implement the transitivity of requiredTransitive. This
was unnoticed since 2006.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 21:03:22 +00:00
Cameron Zwarich
a9ba456b7c Update a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 03:58:43 +00:00
Cameron Zwarich
f889b3bd6c Remove an unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 06:07:18 +00:00
Cameron Zwarich
4676599e30 Move DominanceFrontier from VMCore to Analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 06:06:27 +00:00
Cameron Zwarich
5d2cf40c40 There is no point in verifying an analysis that is never updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 05:44:04 +00:00
Cameron Zwarich
72d1695f12 Remove some now-unused DominanceFrontier methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 04:21:57 +00:00
Jay Foad
0d1941a46f Remove useless Tag enumeration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 15:18:06 +00:00
Jay Foad
1ed26acc58 Simplify the construction and destruction of Uses. Simplify
User::dropHungOffUses().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123580 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 15:30:52 +00:00
Jay Foad
bdbe342e86 Move the implementation of the User class into a new source file,
User.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123575 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 08:10:57 +00:00
Rafael Espindola
ba7c38c36a Allow unnamed_addr on declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 08:15:00 +00:00
Jay Foad
25052d8d64 Remove casts between Value** and Constant**, which won't work if a
static_cast from Constant* to Value* has to adjust the "this" pointer.
This is groundwork for PR889.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123435 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 08:07:43 +00:00