Commit Graph

123501 Commits

Author SHA1 Message Date
Silviu Baranga
a0b73c263e [SCEV][LV] Add SCEV Predicates and use them to re-implement stride versioning
Summary:
SCEV Predicates represent conditions that typically cannot be derived from
static analysis, but can be used to reduce SCEV expressions to forms which are
usable for different optimizers.

ScalarEvolution now has the rewriteUsingPredicate method which can simplify a
SCEV expression using a SCEVPredicateSet. The normal workflow of a pass using
SCEVPredicates would be to hold a SCEVPredicateSet and every time assumptions
need to be made a new SCEV Predicate would be created and added to the set.
Each time after calling getSCEV, the user will call the rewriteUsingPredicate
method.

We add two types of predicates
SCEVPredicateSet - implements a set of predicates
SCEVEqualPredicate - tests for equality between two SCEV expressions

We use the SCEVEqualPredicate to re-implement stride versioning. Every time we
version a stride, we will add a SCEVEqualPredicate to the context.
Instead of adding specific stride checks, LoopVectorize now adds a more
generic SCEV check.

We only need to add support for this in the LoopVectorizer since this is the
only pass that will do stride versioning.

Reviewers: mzolotukhin, anemet, hfinkel, sanjoy

Subscribers: sanjoy, hfinkel, rengolin, jmolloy, llvm-commits

Differential Revision: http://reviews.llvm.org/D13595

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 14:41:02 +00:00
Nemanja Ivanovic
ee10ab5e95 Fix for bootstrap bug introduced in r244921
This revision has introduced an issue that only affects bootstrapped compiler
when it is printing the ASM. It turns out that the new code path taken due to
legalizing a scalar_to_vector of i64 -> v2i64 exposes a missing check in a
micro optimization to change a load followed by a scalar_to_vector into a
load and splat instruction on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 14:01:11 +00:00
Rafael Espindola
a16eb6190c This doesn't need a object::Archive::child_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 13:30:46 +00:00
Rafael Espindola
107eb74eed Avoid implicitly constructing a Archive::child_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 13:17:11 +00:00
James Molloy
d3c80611a2 [PatternMatch] Switch to use ValueTracking::matchSelectPattern
Instead of rolling our own min/max matching code (which is notoriously
hard to get completely right), use ValueTracking's instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 09:54:00 +00:00
Pawel Bylica
8bd55b5451 [Support] Extend sys::path with user_cache_directory function.
Summary:
The new function sys::path::user_cache_directory tries to discover
a directory suitable for cache storage for current system user.

On Windows and Darwin it returns a path to system-specific user cache directory.

On Linux it follows XDG Base Directory Specification, what is:
- use non-empty $XDG_CACHE_HOME env var,
- use $HOME/.cache.

Reviewers: chapuni, aaron.ballman, rafael

Subscribers: rafael, aaron.ballman, llvm-commits

Differential Revision: http://reviews.llvm.org/D13801

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 09:49:17 +00:00
Igor Breger
9aaefc3baa AVX512: Implemented encoding and intrinsics for VBROADCASTI32x2 and VBROADCASTF32x2 instructions.
Differential Revision: http://reviews.llvm.org/D14216

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251781 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:39:36 +00:00
Craig Topper
e242e0c920 [X86] Remove assertions that check for valid scale values on scatter/gather intrinsics. Nothing upstream prevented illegal values from getting here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251780 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:40 +00:00
Craig Topper
417a782401 [X86] Don't pass a scale value of 0 to scatter/gather intrinsics. This causes the code emitter to throw an assertion if we try to encode it. Need to add a check to fail isel for this, but for now avoid testing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251779 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:37 +00:00
Craig Topper
0bc7f97b9f [X86] Fold 'if' followed by just an llvm_unreachable into an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:34 +00:00
Craig Topper
4ed2813163 [X86] Use isa instead of dyn_cast in a bool context. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251777 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:32 +00:00
Craig Topper
b2005d055a [X86] Remove some llvm_unreachables after switches that already have an unreachable in their default case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251776 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:30 +00:00
Craig Topper
4b0b5887e4 [X86] Remove a 'break' after an llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251775 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:27 +00:00
Craig Topper
257fc78e07 [X86] Use cast instead of dyn_cast and a null check marked unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251774 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 07:24:25 +00:00
Craig Topper
6eef6fc859 Fix a -Wpessimizing-move warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251773 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 05:24:28 +00:00
Craig Topper
81f6c558d7 [X86] Use MVT instead of EVT when the type is known to be simple. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 05:24:22 +00:00
Xinliang David Li
61c7e68339 [PGO] Value profiling (index format) code cleanup and testing
1. Added a set of public interfaces in InstrProfRecord
    class to access (read/write) value profile data.
 2. Changed IndexedProfile reader and writer code to 
    use the newly defined interfaces and hide implementation
    details.
 3. Added a couple of unittests for value profiling:
   - Test new interfaces to get and set value profile data
   - Test value profile data merging with various scenarios.

 No functional change is expected. The new interfaces will also
 make it possible to change on-disk format of value prof data
 to be more compact (to be submitted). 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251771 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 05:08:23 +00:00
Sanjoy Das
15465ea1a2 [SCEV] Fix PR25369
Have `getConstantEvolutionLoopExitValue` work correctly with multiple
entry loops.

As far as I can tell, `getConstantEvolutionLoopExitValue` never did the
right thing for multiple entry loops; and before r249712 it would
silently return an incorrect answer.  r249712 changed SCEV to fail an
assert on a multiple entry loop, and this change fixes the underlying
issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 02:06:01 +00:00
NAKAMURA Takumi
d40a898651 Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251769 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 01:38:12 +00:00
Davide Italiano
2511eced9d [LibraryInfo] Point to FreeBSD HEAD repo and not to a dolphin branch.
The latter might go away (anytime soon).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251765 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 17:00:13 +00:00
Elena Demikhovsky
77ab058bf8 AVX-512: Optimized SIMD truncate operations for AVX512F set.
Optimized <8 x i32> to <8 x i16>
<4 x i64> to < 4 x i32>
<16 x i16> to <16 x i8>
All these oprtrations use now AVX512F set (KNL). Before this change it was implemented with AVX2 set.


Differential Revision: http://reviews.llvm.org/D14108



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 11:45:47 +00:00
Saleem Abdulrasool
7683ca4522 RuntimeDyld: add COFF i386 support
This adds support for COFF I386.  This is sufficient for code execution in a
32-bit JIT, though, imported symbols need to custom lowered for the redirection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251761 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 01:26:15 +00:00
Rafael Espindola
c48e5eaaf5 Make a few definitions static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 00:14:59 +00:00
Rafael Espindola
25569fdcda Use Child instead of child_iterator in the archive writer.
We never need to pass end(). This will also remove some complication
once we start adding error checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 00:10:37 +00:00
Davide Italiano
4784e1362f Simplify a check. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-01 00:09:16 +00:00
Sanjoy Das
2b19a08110 [SCEV] Don't create SCEV expressions that break LCSSA
Prevent `createNodeFromSelectLikePHI` from creating SCEV expressions
that break LCSSA.

A better fix for the same issue is to teach SCEVExpander to not break
LCSSA by inserting PHI nodes at appropriate places.  That's planned for
the future.

Fixes PR25360.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 23:21:40 +00:00
Sanjoy Das
861933b54e [SCEV] Use auto and range for; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 23:21:32 +00:00
Davide Italiano
7e5269ed6d [SimplifyLibCalls] Factor out other common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 23:17:45 +00:00
Rafael Espindola
3c66b5721b This can take a const reference. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 22:25:59 +00:00
Diego Novillo
012b206fd3 SamplePGO - Count sample records in embedded profiles when computing coverage.
The initial coverage checking code for sample records failed to count
records inside inlined profiles. This change fixes the oversight.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 21:53:58 +00:00
Craig Topper
76b8f7bc0e [X86] Replace getScalarType with getVectorElementType when the type is already known to be a vector. This should result in slightly less code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 21:44:52 +00:00
Rafael Espindola
d3ca239fe8 Don't store a Child to the first regular member.
This is a bit ugly, but has a few advantages:
* Archive is now easy to copy since there is no Archive -> Child -> Archive
  loop.
* It makes it clear that we already checked for errors when finding the Child
  data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 21:44:42 +00:00
Rafael Espindola
05a69d8e6c Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 21:16:01 +00:00
Rafael Espindola
2825a23253 Simplify handling of archive Symbol tables.
We only need to store a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 21:03:29 +00:00
Davide Italiano
d35fbff07e [SimplifyLibCalls] Add test to ensure transform is not executed if fast-math
attribute is not present.

During my refactor in r251595 I changed the behavior of optimizeSqrt(),
skipping the transformation if the function wasn't marked with unsafe-fp-math
attribute. This fixed a bug, as confirmed by Sanjay (before the optimization
was silently executed anyway), although it wasn't my primary aim.
This commit adds a test to ensure the code doesn't break again.

Reported by: Marcello Maggioni
Discussed with: Sanjay Patel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 20:59:32 +00:00
Rafael Espindola
22258251b9 Simplify the handling of the archive string table.
We only need to store a StringRef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 20:06:13 +00:00
Craig Topper
f56dbe97a7 [X86] Convert to MVT instead of calling EVT functions since we already know the type is simple. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 18:14:17 +00:00
Craig Topper
2bdab3b0b7 [X86] Call getScalarSizeInBits() instead of getScalarType().getScalarSizeInBits(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 18:14:15 +00:00
Craig Topper
9a297e1923 [X86] Remove two const references to the return value of a constructor and just use normal object creation syntax. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 17:28:02 +00:00
Craig Topper
f042791677 [X86] Replace EVT with MVT in some more places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251742 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 17:27:59 +00:00
Craig Topper
7a8ae34723 [X86] Fix indentation of case statements in switch. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 17:27:56 +00:00
Craig Topper
2d7d45bb20 [X86] Reduce math for index calculation for inserting and extracting subvectors and elements by exploiting the fact that all supported vector types have a power 2 number of elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 17:27:52 +00:00
Davide Italiano
e798009f10 [SimplifyLibCalls] Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 08:28:10 +00:00
Michael Gottesman
23a49a637b Add a unittest for SmallDenseMap that tests assigning a SmallDenseMap when it is not small.
This complements CopyConstructorNotSmallTest. If we are testing the copy
constructor in such a way, we should also probably test assignment in the same
way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251736 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 05:23:53 +00:00
Lang Hames
2cbdea79bd Add a sys::OwningMemoryBlock class, which is a sys::MemoryBlock that owns its
underlying memory, and will automatically release it on destruction.

Use this to tidy up the orc::IndirectStubsInfo class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251731 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 00:55:32 +00:00
Chandler Carruth
f73144bb03 [FunctionAttrs] Inline the prototype attribute inference to an existing
loop over the SCC.

The separate function wasn't really adding much, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-31 00:28:37 +00:00
Justin Bogner
e39e3a473d [PM] Port StripDeadPrototypes to the new pass manager
This is a really straightforward port. Also adds a test for the pass,
since it only seemed to be tested tangentially before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 23:28:12 +00:00
Justin Bogner
af0199863a [PM] Port ADCE to the new pass manager
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251725 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 23:13:18 +00:00
Justin Bogner
c5677ed9f1 Whitespace. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 23:02:38 +00:00
Justin Bogner
d0c36ad34f PM: Print the IR unit's name in debug output. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 22:58:15 +00:00