Commit Graph

9961 Commits

Author SHA1 Message Date
Benjamin Kramer
39b5f12dd6 InstCombine: Fix and simplify the inttoptr side too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 20:22:40 +00:00
Michael Gottesman
da6bf1d8bb Removed explicit inline as per the LLVM style guide.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 19:32:18 +00:00
Benjamin Kramer
1018fa256d InstCombine: Harden code to work with vectors of pointers and simplify it a bit.
Found by running instcombine on a fabricated test case for the constant folder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 19:21:56 +00:00
Arnold Schwaighofer
7d80dad407 Loop Vectorizer: Refactor code to compute vectorized memory instruction cost
Introduce a helper class that computes the cost of memory access instructions.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174422 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 18:46:41 +00:00
Chad Rosier
1e45487dfd [SjLj Prepare] When demoting an invoke instructions to the stack, if the normal
edge is critical, then split it so we can insert the store.
rdar://13126179

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 18:23:10 +00:00
Arnold Schwaighofer
935645b765 Loop Vectorizer: Handle pointer stores/loads in getWidestType()
In the loop vectorizer cost model, we used to ignore stores/loads of a pointer
type when computing the widest type within a loop. This meant that if we had
only stores/loads of pointers in a loop we would return a widest type of 8bits
(instead of 32 or 64 bit) and therefore a vector factor that was too big.

Now, if we see a consecutive store/load of pointers we use the size of a pointer
(from data layout).

This problem occured in SingleSource/Benchmarks/Shootout-C++/hash.cpp (reduced
test case is the first test in vector_ptr_load_store.ll).

radar://13139343

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 15:08:02 +00:00
Nick Lewycky
fb10b256aa Revert accidental commit (ran svn commit from wrong directory).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02 00:25:26 +00:00
Nick Lewycky
214a5661d1 This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug in the previous patch that caused us to not mark the function
referenced just because we didn't want to mark it odr used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174240 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02 00:22:37 +00:00
Preston Gurd
83474ee594 This patch aims to improve compile time performance by increasing
the SCEV vector size in LoopStrengthReduce. It is observed that
the BaseRegs vector size is 4 in most cases,
and elements are frequently copied when it is initialized as
SmallVector<const SCEV *, 2> BaseRegs.
Our benchmark results show that the compilation time performance
improved by ~0.5%.

Patch by Wan Xiaofei.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174219 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 20:41:27 +00:00
Nadav Rotem
36146afb96 Revert r174152. The shift amount may overflow and in that case this transformation is illegal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 07:59:33 +00:00
Nadav Rotem
d5eb1cbee5 Optimize shift lefts of a constant by a value plus constant into a single shift.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174152 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 06:45:40 +00:00
Manman Ren
16d1a6bf08 Linker: correctly link in dbg.declare
This is a re-worked version of r174048.
Given source IR:
call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !14), !dbg !15
we used to generate 
call void @llvm.dbg.declare(metadata !27, metadata !28), !dbg !29
!27 = metadata !{null}

With this patch, we will correctly generate
call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !27), !dbg !28

Looking up %argc.addr in ValueMap will return null, since %argc.addr is already
correctly set up, we can use identity mapping.

rdar://problem/13089880


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 21:19:18 +00:00
Alexey Samsonov
e22df330a3 Revert r173946. This breaks compilation of googletest with Clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 08:02:11 +00:00
Dan Gohman
a070d2a035 Change GetPointerBaseWithConstantOffset's DataLayout argument from a
reference to a pointer, so that it can handle the case where DataLayout
is not available and behave conservatively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174024 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 02:00:45 +00:00
Bill Wendling
ac72eb264c Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 23:40:31 +00:00
Bill Wendling
e74365462a Convert typeIncompatible to return an AttributeSet.
There are still places which treat the Attribute object as a collection of
attributes. I'm systematically removing them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173990 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 23:07:40 +00:00
Manman Ren
1229c0cb10 Linker: correctly link in dbg.declare
Given source IR:
call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !14), !dbg !15
we used to generate 
call void @llvm.dbg.declare(metadata !27, metadata !28), !dbg !29
!27 = metadata !{null}

With this patch, we will correctly generate
call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !27), !dbg !28

Looking up %argc.addr in ValueMap will return null, since %argc.addr is already
correctly set up, we can use identity mapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173946 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 17:42:15 +00:00
Nadav Rotem
cc687faba3 InstCombine: canonicalize sext-and --> select
sext-not-and --> select.

Patch by Muhammad Tauqir Ahmad.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173901 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 06:35:22 +00:00
Michael Gottesman
5500943771 Made certain small functions in PtrState inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 22:29:59 +00:00
Pekka Jaaskelainen
d855049576 LoopVectorize: convert TinyTripCountVectorThreshold constant
to a command line switch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:42:08 +00:00
Michael Gottesman
485da64848 Removed trailing comma in last element of enum declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:41:44 +00:00
Michael Gottesman
b82d200dcb Moved S_Stop back to its previous position in the sequence order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:39:02 +00:00
Michael Gottesman
02c953ea8b Fixed a few debug messages and some 80+ violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173832 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:07:53 +00:00
Michael Gottesman
a519c97b42 Added some periods to some comments and added an overload for operator<< for type Sequence so I can print out Sequences in debug statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:07:51 +00:00
Michael Gottesman
82b83011a1 Changed DoesObjCBlockEscape => DoesRetainableObjPtrEscape so I can use it to perform escape analysis of other retainable object pointers in other locations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173829 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:00:52 +00:00
Edwin Vane
f1af1feeee Fixing warnings revealed by gcc release build
Fixed set-but-not-used warnings.

Reviewer: gribozavr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173810 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 17:42:24 +00:00
Benjamin Kramer
8c3a411cd6 LoopVectorize: Clean up ValueMap a bit and avoid double lookups.
No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 17:31:33 +00:00
Timur Iskhodzhanov
09840daeef Hopefully fix the Windows build failure introduced in r173769
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173781 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 09:09:27 +00:00
Michael Gottesman
9d46ef67ba Fixed 2 more header comments...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 05:07:18 +00:00
Michael Gottesman
7fd324a31f Fixed header comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173773 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 05:05:17 +00:00
Michael Gottesman
3dcfdab267 Fixed some whitespace/80+ violations. Also added a space after a namespace declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:58:30 +00:00
Michael Gottesman
67866101a9 Added missing dashes from header declaration comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173770 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:53:55 +00:00
Michael Gottesman
9ab758b9bc Juggled Debug.h from ObjCARC.h to only the including cpp files that
actually have DEBUG statements. Also changed raw_ostream in said header
to be a forward declaration (removing an include).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:51:59 +00:00
Michael Gottesman
7a7102d17f Sorted includes using utils/sort_includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173767 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:20:52 +00:00
Michael Gottesman
4a0480ad4e Added two missing headers from ObjCARCAliasAnalysis.h.
This was missed since whenever I was including ObjCARCAliasAnalysis.h, I
was including ObjCARC.h before it which included these includes
(resulting in no compilation breakage).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:09:24 +00:00
Michael Gottesman
b0f82e7eab Removed InstCombine/Targets as library dependencies for libObjCARCOpts since they are unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:05:17 +00:00
Michael Gottesman
3a57c37964 Extracted ObjCARCContract from ObjCARCOpts into its own file.
This also required adding 2x headers Dependency Analysis.h/Provenance Analysis.h
and a .cpp file DependencyAnalysis.cpp to unentangle the dependencies inbetween
ObjCARCContract and ObjCARCOpts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 03:03:03 +00:00
Michael Gottesman
3b0f537867 Removed some cruft from ObjCARCAliasAnalysis.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173759 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 03:02:59 +00:00
Hal Finkel
c0b3d4c9c2 Unroll again after running BBVectorize
Because BBVectorize may significantly shorten a loop body, unroll
again after vectorization. This is especially important when using
runtime or partial unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173730 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 00:22:49 +00:00
Renato Golin
237f09db09 Vectorization Factor clarification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 16:02:45 +00:00
Evgeniy Stepanov
647c66e24d [msan] Mostly disable msan-handle-icmp-exact.
It is way too slow. Change the default option value to 0.
Always do exact shadow propagation for unsigned ICmp with constants, it is
cheap (under 1% cpu time) and required for correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173682 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 11:42:28 +00:00
Evgeniy Stepanov
ccfc295b9d Revert r173678.
Broken tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173679 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 09:18:40 +00:00
Evgeniy Stepanov
2f36a169a5 [msan] Make msan-handle-icmp-exact=0 by default.
50% slowdown on one of the specs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173678 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 09:15:15 +00:00
Michael Gottesman
64437ead05 Created ObjCARCUtil.cpp for functions which in my humble opinion are too large to static inline and place in a header file such as ObjCARC.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173666 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 06:39:31 +00:00
Michael Gottesman
074ddd6f01 Cleaned up includes in various ObjCARC files and removed some whitespace violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173663 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 05:51:58 +00:00
Michael Gottesman
6086847bfb Refactor ObjCARCAliasAnalysis into its own file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173662 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 05:51:54 +00:00
Michael Gottesman
3c67f1cd94 Refactored out pass ObjCARCAPElim from ObjCARCOpts.cpp => ObjCARCAPElim.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173654 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 04:12:07 +00:00
Michael Gottesman
73104b7d7f Fixed case insensitive issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 03:35:20 +00:00
Michael Gottesman
6313c99aa8 Removed extraneous doxygen end module statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173652 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 03:30:34 +00:00
Michael Gottesman
6504255a22 Extracted pass ObjCARCExpand from ObjCARC.cpp => ObjCARCExpand.cpp.
I also added the local header ObjCARC.h for common functions used by the
various passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173651 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 03:28:38 +00:00