Commit Graph

9933 Commits

Author SHA1 Message Date
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
Michael Gottesman
24c4898973 Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 01:35:51 +00:00
Hal Finkel
245b657ab6 BBVectorize: Better use of TTI->getShuffleCost
When flipping the pair of subvectors that form a vector, if the
vector length is 2, we can use the SK_Reverse shuffle kind to get
more-accurate cost information. Also we can use the SK_ExtractSubvector
shuffle kind to get accurate subvector extraction costs.

The current cost model implementations don't yet seem complex enough
for this to make a difference (thus, there are no test cases with this
commit), but it should help in future.

Depending on how the various targets optimize and combine shuffles in
practice, we might be able to get more-accurate costs by combining the
costs of multiple shuffle kinds. For example, the cost of flipping the
subvector pairs could be modeled as two extractions and two subvector
insertions. These changes, however, should probably be motivated
by specific test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 20:07:01 +00:00
Chandler Carruth
455151e4f7 Re-revert r173342, without losing the compile time improvements, flat
out bug fixes, or functionality preserving refactorings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 06:42:03 +00:00
Michael Gottesman
6de90c0820 Renamed function IsPotentialUse to IsPotentialRetainableObjPtr.
This name change does the following:

1. Causes the function name to use proper ARC terminology.
2. Makes it clear what the function truly does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 06:19:48 +00:00
Bill Wendling
ac90696722 Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173602 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 02:08:22 +00:00
Bill Wendling
b2484b4332 Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173601 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 01:57:28 +00:00
Bill Wendling
d04b2d45d9 Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 01:44:34 +00:00
Hal Finkel
ec5c3c2bd3 BBVectorize: Add a additional comment about the cost computation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173580 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 16:49:04 +00:00
Hal Finkel
7a8aba9064 BBVectorize: Fix anomalous capital letter in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173579 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 16:49:03 +00:00
Bill Wendling
32a5795822 Convert BuildLibCalls.cpp to using the AttributeSet methods instead of AttributeWithIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173536 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 00:03:11 +00:00
Bill Wendling
8e47daf285 Remove some introspection functions.
The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173522 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 23:09:36 +00:00
Nadav Rotem
c655c43ba5 LoopVectorize: Refactor the code that vectorizes loads/stores to remove duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173500 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 21:47:42 +00:00
Bill Wendling
85875647d6 Use the new 'getSlotIndex' method to retrieve the attribute's slot index.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173499 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 21:46:52 +00:00
Benjamin Kramer
5ac70a3804 LoopVectorize: Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173475 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 19:43:15 +00:00
Pedro Artigas
3f16858579 added ability to dynamically change the ExportList of an already
created InternalizePass (useful for pass reuse)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173474 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 19:41:03 +00:00
Nadav Rotem
1275708f29 LoopVectorizer: Refactor more code to use the IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 19:26:23 +00:00
Nadav Rotem
f8c2f90bb3 Refactor some code to use the IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173467 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 18:34:09 +00:00
Evgeniy Stepanov
94d1f5b10c [msan] A comment on ICmp handling logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 15:35:29 +00:00
Evgeniy Stepanov
351f65d972 [msan] Implement exact shadow propagation for relational ICmp.
Only for integers, pointers, and vectors of those. No floats.
Instrumentation seems very heavy, and may need to be replaced
with some approximation in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173452 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 15:31:10 +00:00
Chandler Carruth
baf868b9b8 Switch this code away from Value::isUsedInBasicBlock. That code either
loops over instructions in the basic block or the use-def list of the
value, neither of which are really efficient when repeatedly querying
about values in the same basic block.

What's more, we already know that the CondBB is small, and so we can do
a much more efficient test by counting the uses in CondBB, and seeing if
those account for all of the uses.

Finally, we shouldn't blanket fail on any such instruction, instead we
should conservatively assume that those instructions are part of the
cost.

Note that this actually fixes a bug in the pass because
isUsedInBasicBlock has a really terrible bug in it. I'll fix that in my
next commit, but the fix for it would make this code suddenly take the
compile time hit I thought it already was taking, so I wanted to go
ahead and migrate this code to a faster & better pattern.

The bug in isUsedInBasicBlock was also causing other tests to test the
wrong thing entirely: for example we weren't actually disabling
speculation for floating point operations as intended (and tested), but
the test passed because we failed to speculate them due to the
isUsedInBasicBlock failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173417 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-25 05:40:09 +00:00
Michael Gottesman
7c24e61a2b Added comment to ObjCARC elaborating what is meant by the term 'Provenance' in 'Provenance Analysis'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173374 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 21:35:00 +00:00
Benjamin Kramer
d5a80c7358 Reapply chandlerc's r173342 now that the miscompile it was triggering is fixed.
Original commit message:
Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173357 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 16:44:25 +00:00
Chandler Carruth
eacef325c6 Revert r173342 temporarily. It appears to cause a very late miscompile
of stage2 in a bootstrap. Still investigating....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173343 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 13:24:24 +00:00
Chandler Carruth
1f255419d4 Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173342 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 12:39:29 +00:00
Chandler Carruth
47d8f6dca5 Address a large chunk of this FIXME by accumulating the cost for
unfolded constant expressions rather than checking each one
independently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173341 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 12:05:17 +00:00
Chandler Carruth
681add7a63 Switch the constant expression speculation cost evaluation away from
a cost fuction that seems both a bit ad-hoc and also poorly suited to
evaluating constant expressions.

Notably, it is missing any support for trivial expressions such as
'inttoptr'. I could fix this routine, but it isn't clear to me all of
the constraints its other users are operating under.

The core protection that seems relevant here is avoiding the formation
of a select instruction wich a further chain of select operations in
a constant expression operand. Just explicitly encode that constraint.

Also, update the comments and organization here to make it clear where
this needs to go -- this should be driven off of real cost measurements
which take into account the number of constants expressions and the
depth of the constant expression tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173340 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 11:53:01 +00:00
Chandler Carruth
2c107a8020 Rephrase the speculating scan of the conditional BB to be phrased in
terms of cost rather than hoisting a single instruction.

This does *not* change the cost model! We still set the cost threshold
at 1 here, it's just that we track it by accumulating cost rather than
by storing an instruction.

The primary advantage is that we no longer leave no-op intrinsics in the
basic block. For example, this will now move both debug info intrinsics
and a single instruction, instead of only moving the instruction and
leaving a basic block with nothing bug debug info intrinsics in it, and
those intrinsics now no longer ordered correctly with the hoisted value.

Instead, we now splice the entire conditional basic block's instruction
sequence.

This also places the code for checking the safety of hoisting next to
the code computing the cost.

Currently, the only observable side-effect of this change is that debug
info intrinsics are no longer abandoned. I'm not sure how to craft
a test case for this, and my real goal was the refactoring, but I'll
talk to Dave or Eric about how to add a test case for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173339 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 11:52:58 +00:00
Kostya Serebryany
29f975f8ff [asan] fix 32-bit builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173338 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-24 10:43:50 +00:00