oota-llvm.git
9 years agoFix two issues in MergeConsecutiveStores:
James Y Knight [Mon, 2 Nov 2015 18:48:08 +0000 (18:48 +0000)]
Fix two issues in MergeConsecutiveStores:

1) PR25154. This is basically a repeat of PR18102, which was fixed in
r200201, and broken again by r234430. The latter changed which of the
store nodes was merged into from the first to the last. Thus, we now
also need to prefer merging a later store at a given address into the
target node, instead of an earlier one.

2) While investigating that, I also realized I'd introduced a bug in
r236850. There, I removed a check for alignment -- not realizing that
nothing except the alignment check was ensuring that none of the stores
were overlapping! This is a really bogus way to ensure there's no
aliased stores.

A better solution to both of these issues is likely to always use the
code added in the 'if (UseAA)' branches which rearrange the chain based
on a more principled analysis. I'll look into whether that can be used
always, but in the interest of getting things back to working, I think a
minimal change makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251816 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMachO: improve load command tests slightly
Tim Northover [Mon, 2 Nov 2015 18:33:35 +0000 (18:33 +0000)]
MachO: improve load command tests slightly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251815 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWatchOS: update default CPU for triple after t2dsp -> dsp rename
Tim Northover [Mon, 2 Nov 2015 18:21:07 +0000 (18:21 +0000)]
WatchOS: update default CPU for triple after t2dsp -> dsp rename

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251814 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoClang format a few prior patches (NFC)
Teresa Johnson [Mon, 2 Nov 2015 18:02:11 +0000 (18:02 +0000)]
Clang format a few prior patches (NFC)

I had clang formatted my earlier patches using the wrong style.
Reformatted with the LLVM style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251812 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTvOS: add missing support for some libcalls.
Tim Northover [Mon, 2 Nov 2015 18:00:00 +0000 (18:00 +0000)]
TvOS: add missing support for some libcalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251811 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPreserve load alignment and dereferenceable metadata during some transformations
Artur Pilipenko [Mon, 2 Nov 2015 17:53:51 +0000 (17:53 +0000)]
Preserve load alignment and dereferenceable metadata during some transformations

Reviewed By: hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251809 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agolit: Add '-a' option to display commands+output of all tests
Matthias Braun [Mon, 2 Nov 2015 16:13:46 +0000 (16:13 +0000)]
lit: Add '-a' option to display commands+output of all tests

The existing -v option only displays commands and outputs for failed
tests, the newly introduced -a displays it for all executed tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251806 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd missing override statements in ScalarEvolution.h. NFC
Silviu Baranga [Mon, 2 Nov 2015 15:29:49 +0000 (15:29 +0000)]
Add missing override statements in ScalarEvolution.h. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251805 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse static instead of anonymous namespace for helper functions. NFC.
Pawel Bylica [Mon, 2 Nov 2015 14:57:24 +0000 (14:57 +0000)]
Use static instead of anonymous namespace for helper functions. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251801 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SCEV][LV] Add SCEV Predicates and use them to re-implement stride versioning
Silviu Baranga [Mon, 2 Nov 2015 14:41:02 +0000 (14:41 +0000)]
[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

9 years agoFix for bootstrap bug introduced in r244921
Nemanja Ivanovic [Mon, 2 Nov 2015 14:01:11 +0000 (14:01 +0000)]
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

9 years agoThis doesn't need a object::Archive::child_iterator.
Rafael Espindola [Mon, 2 Nov 2015 13:30:46 +0000 (13:30 +0000)]
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

9 years agoAvoid implicitly constructing a Archive::child_iterator.
Rafael Espindola [Mon, 2 Nov 2015 13:17:11 +0000 (13:17 +0000)]
Avoid implicitly constructing a Archive::child_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251794 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PatternMatch] Switch to use ValueTracking::matchSelectPattern
James Molloy [Mon, 2 Nov 2015 09:54:00 +0000 (09:54 +0000)]
[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

9 years ago[Support] Extend sys::path with user_cache_directory function.
Pawel Bylica [Mon, 2 Nov 2015 09:49:17 +0000 (09:49 +0000)]
[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

9 years agoAVX512: Implemented encoding and intrinsics for VBROADCASTI32x2 and VBROADCASTF32x2...
Igor Breger [Mon, 2 Nov 2015 07:39:36 +0000 (07:39 +0000)]
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

9 years ago[X86] Remove assertions that check for valid scale values on scatter/gather intrinsic...
Craig Topper [Mon, 2 Nov 2015 07:24:40 +0000 (07:24 +0000)]
[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

9 years ago[X86] Don't pass a scale value of 0 to scatter/gather intrinsics. This causes the...
Craig Topper [Mon, 2 Nov 2015 07:24:37 +0000 (07:24 +0000)]
[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

9 years ago[X86] Fold 'if' followed by just an llvm_unreachable into an assert.
Craig Topper [Mon, 2 Nov 2015 07:24:34 +0000 (07:24 +0000)]
[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

9 years ago[X86] Use isa instead of dyn_cast in a bool context. NFC
Craig Topper [Mon, 2 Nov 2015 07:24:32 +0000 (07:24 +0000)]
[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

9 years ago[X86] Remove some llvm_unreachables after switches that already have an unreachable...
Craig Topper [Mon, 2 Nov 2015 07:24:30 +0000 (07:24 +0000)]
[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

9 years ago[X86] Remove a 'break' after an llvm_unreachable.
Craig Topper [Mon, 2 Nov 2015 07:24:27 +0000 (07:24 +0000)]
[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

9 years ago[X86] Use cast instead of dyn_cast and a null check marked unreachable.
Craig Topper [Mon, 2 Nov 2015 07:24:25 +0000 (07:24 +0000)]
[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

9 years agoFix a -Wpessimizing-move warning.
Craig Topper [Mon, 2 Nov 2015 05:24:28 +0000 (05:24 +0000)]
Fix a -Wpessimizing-move warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251773 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Use MVT instead of EVT when the type is known to be simple. NFC
Craig Topper [Mon, 2 Nov 2015 05:24:22 +0000 (05:24 +0000)]
[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

9 years ago[PGO] Value profiling (index format) code cleanup and testing
Xinliang David Li [Mon, 2 Nov 2015 05:08:23 +0000 (05:08 +0000)]
[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

9 years ago[SCEV] Fix PR25369
Sanjoy Das [Mon, 2 Nov 2015 02:06:01 +0000 (02:06 +0000)]
[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

9 years agoUntabify.
NAKAMURA Takumi [Mon, 2 Nov 2015 01:38:12 +0000 (01:38 +0000)]
Untabify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251769 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LibraryInfo] Point to FreeBSD HEAD repo and not to a dolphin branch.
Davide Italiano [Sun, 1 Nov 2015 17:00:13 +0000 (17:00 +0000)]
[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

9 years agoAVX-512: Optimized SIMD truncate operations for AVX512F set.
Elena Demikhovsky [Sun, 1 Nov 2015 11:45:47 +0000 (11:45 +0000)]
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

9 years agoRuntimeDyld: add COFF i386 support
Saleem Abdulrasool [Sun, 1 Nov 2015 01:26:15 +0000 (01:26 +0000)]
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

9 years agoMake a few definitions static. NFC.
Rafael Espindola [Sun, 1 Nov 2015 00:14:59 +0000 (00:14 +0000)]
Make a few definitions static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251759 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse Child instead of child_iterator in the archive writer.
Rafael Espindola [Sun, 1 Nov 2015 00:10:37 +0000 (00:10 +0000)]
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

9 years agoSimplify a check. NFC.
Davide Italiano [Sun, 1 Nov 2015 00:09:16 +0000 (00:09 +0000)]
Simplify a check. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251757 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SCEV] Don't create SCEV expressions that break LCSSA
Sanjoy Das [Sat, 31 Oct 2015 23:21:40 +0000 (23:21 +0000)]
[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

9 years ago[SCEV] Use auto and range for; NFC
Sanjoy Das [Sat, 31 Oct 2015 23:21:32 +0000 (23:21 +0000)]
[SCEV] Use auto and range for; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251755 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SimplifyLibCalls] Factor out other common code.
Davide Italiano [Sat, 31 Oct 2015 23:17:45 +0000 (23:17 +0000)]
[SimplifyLibCalls] Factor out other common code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251754 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThis can take a const reference. NFC.
Rafael Espindola [Sat, 31 Oct 2015 22:25:59 +0000 (22:25 +0000)]
This can take a const reference. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251753 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSamplePGO - Count sample records in embedded profiles when computing coverage.
Diego Novillo [Sat, 31 Oct 2015 21:53:58 +0000 (21:53 +0000)]
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

9 years ago[X86] Replace getScalarType with getVectorElementType when the type is already known...
Craig Topper [Sat, 31 Oct 2015 21:44:52 +0000 (21:44 +0000)]
[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

9 years agoDon't store a Child to the first regular member.
Rafael Espindola [Sat, 31 Oct 2015 21:44:42 +0000 (21:44 +0000)]
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

9 years agoDelete dead code.
Rafael Espindola [Sat, 31 Oct 2015 21:16:01 +0000 (21:16 +0000)]
Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251749 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify handling of archive Symbol tables.
Rafael Espindola [Sat, 31 Oct 2015 21:03:29 +0000 (21:03 +0000)]
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

9 years ago[SimplifyLibCalls] Add test to ensure transform is not executed if fast-math
Davide Italiano [Sat, 31 Oct 2015 20:59:32 +0000 (20:59 +0000)]
[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

9 years agoSimplify the handling of the archive string table.
Rafael Espindola [Sat, 31 Oct 2015 20:06:13 +0000 (20:06 +0000)]
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

9 years ago[X86] Convert to MVT instead of calling EVT functions since we already know the type...
Craig Topper [Sat, 31 Oct 2015 18:14:17 +0000 (18:14 +0000)]
[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

9 years ago[X86] Call getScalarSizeInBits() instead of getScalarType().getScalarSizeInBits(...
Craig Topper [Sat, 31 Oct 2015 18:14:15 +0000 (18:14 +0000)]
[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

9 years ago[X86] Remove two const references to the return value of a constructor and just use...
Craig Topper [Sat, 31 Oct 2015 17:28:02 +0000 (17:28 +0000)]
[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

9 years ago[X86] Replace EVT with MVT in some more places. NFC
Craig Topper [Sat, 31 Oct 2015 17:27:59 +0000 (17:27 +0000)]
[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

9 years ago[X86] Fix indentation of case statements in switch. NFC
Craig Topper [Sat, 31 Oct 2015 17:27:56 +0000 (17:27 +0000)]
[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

9 years ago[X86] Reduce math for index calculation for inserting and extracting subvectors and...
Craig Topper [Sat, 31 Oct 2015 17:27:52 +0000 (17:27 +0000)]
[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

9 years ago[SimplifyLibCalls] Remove dead code.
Davide Italiano [Sat, 31 Oct 2015 08:28:10 +0000 (08:28 +0000)]
[SimplifyLibCalls] Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251737 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a unittest for SmallDenseMap that tests assigning a SmallDenseMap when it is...
Michael Gottesman [Sat, 31 Oct 2015 05:23:53 +0000 (05:23 +0000)]
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

9 years agoAdd a sys::OwningMemoryBlock class, which is a sys::MemoryBlock that owns its
Lang Hames [Sat, 31 Oct 2015 00:55:32 +0000 (00:55 +0000)]
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

9 years ago[FunctionAttrs] Inline the prototype attribute inference to an existing
Chandler Carruth [Sat, 31 Oct 2015 00:28:37 +0000 (00:28 +0000)]
[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

9 years ago[PM] Port StripDeadPrototypes to the new pass manager
Justin Bogner [Fri, 30 Oct 2015 23:28:12 +0000 (23:28 +0000)]
[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

9 years ago[PM] Port ADCE to the new pass manager
Justin Bogner [Fri, 30 Oct 2015 23:13:18 +0000 (23:13 +0000)]
[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

9 years agoWhitespace. NFC
Justin Bogner [Fri, 30 Oct 2015 23:02:38 +0000 (23:02 +0000)]
Whitespace. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251724 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPM: Print the IR unit's name in debug output. NFC
Justin Bogner [Fri, 30 Oct 2015 22:58:15 +0000 (22:58 +0000)]
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

9 years agoImplemented the code to make llvm-nm’s -g option work.
Kevin Enderby [Fri, 30 Oct 2015 19:55:32 +0000 (19:55 +0000)]
Implemented the code to make llvm-nm’s -g option work.

While llvm-nm parses the -g option and has help that describes it as:

  -extern-only            - Show only external symbols

There is no code in the program to use the boolean valve it sets from the
command line.

rdar://23261095

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251718 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[FunctionAttrs] Separate another chunk of the logic for functionattrs
Chandler Carruth [Fri, 30 Oct 2015 16:48:08 +0000 (16:48 +0000)]
[FunctionAttrs] Separate another chunk of the logic for functionattrs
from its pass harness by providing a lambda to query for AA results.

This allows the legacy pass to easily provide a lambda that uses the
special helpers to construct function AA results from a legacy CGSCC
pass. With the new pass manager (the next patch) the lambda just
directly wraps the intuitive query API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251715 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[WebAssembly] Fix import statement
JF Bastien [Fri, 30 Oct 2015 16:41:21 +0000 (16:41 +0000)]
[WebAssembly] Fix import statement

Summary:
Imports should be generated like (param i32 f32...) not (param i32) (param f32) ...

Author: binji
Reviewers: jfb
Subscribers: jfb, dschuff

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251714 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoARM: add extra test for watchOS ABI
Tim Northover [Fri, 30 Oct 2015 16:29:44 +0000 (16:29 +0000)]
ARM: add extra test for watchOS ABI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251705 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SCEV] Generalize the SCEV algorithm for creating expressions for PHI nodes
Silviu Baranga [Fri, 30 Oct 2015 15:02:28 +0000 (15:02 +0000)]
[SCEV] Generalize the SCEV algorithm for creating expressions for PHI nodes

Summary:
When forming expressions for phi nodes having an incoming value from
outside the loop A and a value coming from the previous iteration B
we were forming an AddRec if:
  - B was an AddRec
  - the value A was equal to the value for B at iteration -1 (or equal
    to the value of B shifted by one iteration, at iteration 0)

In this case, we were computing the expression to be the expression of
B, shifted by one iteration.

This changes generalizes the logic above by removing the restriction that
B needs to be an AddRec. For this we introduce two expression rewriters
that allow us to
  - shift an expression by one iteration
  - get the value of an expression at iteration 0

This allows us to get SCEV expressions for PHI nodes when these expressions
are not AddRecExprs.

Reviewers: sanjoy

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251700 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecommit r251680 (also need to update clang test)
Dehao Chen [Fri, 30 Oct 2015 05:07:15 +0000 (05:07 +0000)]
Recommit r251680 (also need to update clang test)

Update the discriminator assignment algorithm

* If a scope has already been assigned a discriminator, do not reassign a nested discriminator for it.
* If the file and line both match, even if the column does not match, we should assign a new discriminator for the stmt.

original code:
; #1 int foo(int i) {
; #2 if (i == 3 || i == 5) return 100; else return 99;
; #3 }

; i == 3: discriminator 0
; i == 5: discriminator 2
; return 100: discriminator 1
; return 99: discriminator 3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251689 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove oneline.ll test.
Dehao Chen [Fri, 30 Oct 2015 04:48:24 +0000 (04:48 +0000)]
Remove oneline.ll test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251688 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Use is128BitVector/is256BitVector/is512BitVector in place of getSizeInBits...
Craig Topper [Fri, 30 Oct 2015 04:31:18 +0000 (04:31 +0000)]
[X86] Use is128BitVector/is256BitVector/is512BitVector in place of getSizeInBits == in some places. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251687 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Minor formatting fixes. NFC.
Craig Topper [Fri, 30 Oct 2015 04:31:14 +0000 (04:31 +0000)]
[X86] Minor formatting fixes. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251686 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r251680:
Dehao Chen [Fri, 30 Oct 2015 04:29:05 +0000 (04:29 +0000)]
Revert r251680:

Update the discriminator assignment algorithm

* If a scope has already been assigned a discriminator, do not reassign a nested discriminator for it.
* If the file and line both match, even if the column does not match, we should assign a new discriminator for the stmt.

original code:
; #1 int foo(int i) {
; #2 if (i == 3 || i == 5) return 100; else return 99;
; #3 }

; i == 3: discriminator 0
; i == 5: discriminator 2
; return 100: discriminator 1
; return 99: discriminator 3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251685 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc] Expose the compile callback API through the C bindings.
Lang Hames [Fri, 30 Oct 2015 03:20:21 +0000 (03:20 +0000)]
[Orc] Expose the compile callback API through the C bindings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251683 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86] Use MVT instead of EVT in some places. NFC
Craig Topper [Fri, 30 Oct 2015 03:19:12 +0000 (03:19 +0000)]
[X86] Use MVT instead of EVT in some places. NFC

Prior to this the compiled code probably had extra checks for extended types that won't ever execute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251682 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate the discriminator assignment algorithm
Dehao Chen [Fri, 30 Oct 2015 02:38:29 +0000 (02:38 +0000)]
Update the discriminator assignment algorithm

* If a scope has already been assigned a discriminator, do not reassign a nested discriminator for it.
* If the file and line both match, even if the column does not match, we should assign a new discriminator for the stmt.

original code:
; #1 int foo(int i) {
; #2 if (i == 3 || i == 5) return 100; else return 99;
; #3 }

; i == 3: discriminator 0
; i == 5: discriminator 2
; return 100: discriminator 1
; return 99: discriminator 3

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251680 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MC] Make another header NDEBUG-free.
Davide Italiano [Fri, 30 Oct 2015 01:25:50 +0000 (01:25 +0000)]
[MC] Make another header NDEBUG-free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251679 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLet the users of LLVMSymbolizer decide whether they want to symbolize inlined frames.
Alexey Samsonov [Fri, 30 Oct 2015 00:40:20 +0000 (00:40 +0000)]
Let the users of LLVMSymbolizer decide whether they want to symbolize inlined frames.

Introduce LLVMSymbolizer::symbolizeInlinedCode() instead of switching
on PrintInlining option passed to the constructor. This will be needed
once we retrun structured data (instead of std::string) from
LLVMSymbolizer and move printing logic out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251675 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agollvm/ExecutionEngine/Orc/LogicalDylib.h: Satisfy Modules.
NAKAMURA Takumi [Fri, 30 Oct 2015 00:38:01 +0000 (00:38 +0000)]
llvm/ExecutionEngine/Orc/LogicalDylib.h: Satisfy Modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251674 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LLVMSymbolize] Simplify SymbolizableObjectFile::symbolizeInlinedCode(). NFC.
Alexey Samsonov [Fri, 30 Oct 2015 00:02:55 +0000 (00:02 +0000)]
[LLVMSymbolize] Simplify SymbolizableObjectFile::symbolizeInlinedCode(). NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251672 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Don't assert if materializing before seeing any function bodies"
Filipe Cabecinhas [Fri, 30 Oct 2015 00:00:58 +0000 (00:00 +0000)]
Revert "Don't assert if materializing before seeing any function bodies"

This reverts r251667 since it broke the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251671 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LLVMSymbolize] Move printing the description of a global into a separate function...
Alexey Samsonov [Thu, 29 Oct 2015 23:49:19 +0000 (23:49 +0000)]
[LLVMSymbolize] Move printing the description of a global into a separate function. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251669 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDon't assert if materializing before seeing any function bodies
Filipe Cabecinhas [Thu, 29 Oct 2015 23:37:28 +0000 (23:37 +0000)]
Don't assert if materializing before seeing any function bodies

This assert was reachable from user input. A minimized test case (no
FUNCTION_BLOCK_ID record) is attached.

Bug found with afl-fuzz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251667 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "[ARM] Remove XFAIL on test/CodeGen/Generic/MachineBranchProb.ll"
Weiming Zhao [Thu, 29 Oct 2015 22:34:59 +0000 (22:34 +0000)]
Revert "[ARM] Remove XFAIL on test/CodeGen/Generic/MachineBranchProb.ll"

Summary:
This reverts commit 79c37e1a4ff1e634da8f95322f080601b4c815fc.

    This test passes locally but fails on the community buildbot. So we will let it
    XFAIL for now.

Patched by Mandeep Singh Grang (mgrang@codeaurora.org)

Reviewers: kparzysz, weimingz

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251664 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[LLVMSymbolize] Move ModuleInfo into a separate class (SymbolizableModule).
Alexey Samsonov [Thu, 29 Oct 2015 22:21:37 +0000 (22:21 +0000)]
[LLVMSymbolize] Move ModuleInfo into a separate class (SymbolizableModule).

Summary:
This is mostly NFC. It is a first step in cleaning up LLVMSymbolize
library. It removes "ModuleInfo" class which bundles together ObjectFile
and its debug info context in favor of:
  * abstract SymbolizableModule in public headers;
  * SymbolizableObjectFile subclass in implementation.

Additionally, SymbolizableObjectFile is now created via factory, so we
can properly detect object parsing error at this stage instead of keeping
the broken half-parsed object. As a next step, we would be able to
propagate the error all the way back to the library user.

Further improvements might include:
  * factoring out the logic of finding appropriate file with debug info
    for a given object file, and caching all parsed object files into a
    separate class [A].
  * factoring out DILineInfo rendering [B].
This would make what is now a heavyweight "LLVMSymbolizer" a relatively
straightforward class, that calls into [A] to turn filepath into a
SymbolizableModule, delegates actual symbolization to concrete SymbolizableModule
implementation, and lets [C] render the result.

Reviewers: dblaikie, echristo, rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251662 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Added load+sext tests for 16i1->16i8 and 32i1->32i8
Simon Pilgrim [Thu, 29 Oct 2015 22:19:21 +0000 (22:19 +0000)]
[X86][SSE] Added load+sext tests for 16i1->16i8 and 32i1->32i8

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251661 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][SSE] Shuffle blends with zero
Simon Pilgrim [Thu, 29 Oct 2015 22:11:28 +0000 (22:11 +0000)]
[X86][SSE] Shuffle blends with zero

This patch generalizes the zeroing of vector elements with the BLEND instructions. Currently a zero vector will only blend if the shuffled elements are correctly inline, this patch recognises when a vector input is zero (or zeroable) and modifies a local copy of the shuffle mask to support a blend. As a zeroable vector input may not be all zeroes, the zeroable vector is regenerated if necessary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251659 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc] Teach IndirectStubsManager to manage an expandable pool of stubs, rather
Lang Hames [Thu, 29 Oct 2015 22:04:22 +0000 (22:04 +0000)]
[Orc] Teach IndirectStubsManager to manage an expandable pool of stubs, rather
than a pre-allocated slab of stubs. Also add a convenience method for creating a
single stub, rather than a whole block a time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251658 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format lib/Transforms/Utils/AddDiscriminators.cpp
Dehao Chen [Thu, 29 Oct 2015 21:25:33 +0000 (21:25 +0000)]
clang-format lib/Transforms/Utils/AddDiscriminators.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251656 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix test check label.
Teresa Johnson [Thu, 29 Oct 2015 21:24:38 +0000 (21:24 +0000)]
Fix test check label.

Summary:
I noticed when manually modifying this test that it was passing when I
expected it to fail. Looks like the combination of LABEL and NOT on the
check does not work. This can also be seen when running FileCheck with
only that one -check-prefix (removing the additional -check-prefix=B):

/usr/local/google/home/tejohnson/llvm/llvm_11_build/./bin/llvm-link -S -internalize -only-needed /usr/local/google/home/tejohnson/llvm/llvm_11_build/test/Linker/Output/link-flags.ll.tmp.b.bc /usr/local/google/home/tejohnson/llvm/llvm_11_build/test/Linker/Output/link-flags.ll.tmp.c.bc | /usr/local/google/home/tejohnson/llvm/llvm_11_build/./bin/FileCheck /usr/local/google/home/tejohnson/llvm/llvm_11/test/Linker/link-flags.ll -check-prefix=CN
error: no check strings found with prefix 'CN:'

The CN prefix checks don't in fact need "LABEL" so remove that.

Reviewers: tra

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251655 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[ARM] Remove XFAIL on test/CodeGen/Generic/MachineBranchProb.ll
Weiming Zhao [Thu, 29 Oct 2015 20:51:54 +0000 (20:51 +0000)]
[ARM] Remove XFAIL on test/CodeGen/Generic/MachineBranchProb.ll

Summary: Refer PR23377. This test was XFAIL'ed for Hexagon as well as ARM. But it has now started passing for ARM.

Reviewers: hans, rengolin, aemerson, kparzysz

Subscribers: aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251652 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Orc] Rename IndirectStubsManagerBase method 'init' to 'createStubs'.
Lang Hames [Thu, 29 Oct 2015 18:36:27 +0000 (18:36 +0000)]
[Orc] Rename IndirectStubsManagerBase method 'init' to 'createStubs'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251641 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[FunctionAttrs] Provide a single SCC node set to all of the
Chandler Carruth [Thu, 29 Oct 2015 18:29:15 +0000 (18:29 +0000)]
[FunctionAttrs] Provide a single SCC node set to all of the
transformations in FunctionAttrs rather than building a new one each
time.

This isn't trivial because there are different heuristics from different
passes for exactly what set they want. The primary difference is whether
an *overridable* function completely disables the synthesis of
attributes. I've modeled this by directly testing for overridable, and
using the common set that excludes external and opt-none functions.

This does cause some changes by disabling more optimizations in the face
of opt-none. Specifically, we were still optimizing *calls* to opt-none
functions based on their attributes, just not the bodies. It seems
better to be conservative on both fronts given the intended semanticas
here (best effort to not assume or disturb anything). I've not tried to
test this change as it seems complex, brittle, and not important to the
implicit contract of opt-none. Instead, it seems more like a choice that
should be dictated by the simplified implementation and the change to be
acceptable differences within the space of opt-none.

A big benefit here is that these transformations no longer rely on the
legacy pass manager's SCC types, they just work on generic sets of
function pointers. This will make it easy to re-use their logic in the
new pass manager.

I've also made the transforms static functions instead of members where
trivial while I was touching the signatures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251640 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r251593.
Diego Novillo [Thu, 29 Oct 2015 16:20:38 +0000 (16:20 +0000)]
Revert r251593.

The patch in r251593 was only papering over the problem. The actual fix
was committed in r251623.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251635 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SystemZ] Make the CCRegs regclass non-allocatable.
Jonas Paulsson [Thu, 29 Oct 2015 16:13:55 +0000 (16:13 +0000)]
[SystemZ] Make the CCRegs regclass non-allocatable.

This was discovered to be necessary while running memchr-01.ll with
-verify-machinstrs, because it is not allowed to have a phys reg live
accross block boundaries while on SSA form, if the register is
allocatable (expect in entry block and landing pads).

In this test case, stringRRE pseudos are expanded after isel by adding
a loop block which produces a live out CC register. To make the test
pass, it was also necessary to not say that StringRRELoop pseudo uses
R0L, this is only true for the StringRRE opcode.

-verify-machineinstrs added to memchr-01.ll test.

New test case int-cmp-51.ll to test that MachineCSE can eliminate
an identical compare (which it couldn't do before).

Reviewed by Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251634 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAMDGPU/SI: handle undef for llvm.SI.packf16
Marek Olsak [Thu, 29 Oct 2015 15:29:09 +0000 (15:29 +0000)]
AMDGPU/SI: handle undef for llvm.SI.packf16

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251632 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAMDGPU/SI: use S_OR for fneg (fabs f32)
Marek Olsak [Thu, 29 Oct 2015 15:29:05 +0000 (15:29 +0000)]
AMDGPU/SI: use S_OR for fneg (fabs f32)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251631 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAMDGPU/SI: use S_AND for i1 trunc
Marek Olsak [Thu, 29 Oct 2015 15:05:03 +0000 (15:05 +0000)]
AMDGPU/SI: use S_AND for i1 trunc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251630 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] wrong opcode for ll/sc instructions on mipsr6 when -integrated-as is used
Zoran Jovanovic [Thu, 29 Oct 2015 14:40:19 +0000 (14:40 +0000)]
[mips] wrong opcode for ll/sc instructions on mipsr6 when -integrated-as is used

Summary:
This commit resolves wrong opcodes for ll and sc instructions for r6 architecutres, which were generated in method MipsTargetLowering::emitAtomicBinary.

Author: Jelena.Losic

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251629 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecognize that ARM1176JZ[F]-S support TrustZone
Artyom Skrobov [Thu, 29 Oct 2015 13:56:19 +0000 (13:56 +0000)]
Recognize that ARM1176JZ[F]-S support TrustZone

Summary:
ARMv6KZ cores were set up incorrectly in ARM.td; also, the SMI mnemonic
(the old name for SMC, as defined in ARMv6KZ) wasn't supported.

Reviewers: jmolloy, rengolin

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251627 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[sanitizer] [msan] Unify aarch64 mapping
Adhemerval Zanella [Thu, 29 Oct 2015 13:02:30 +0000 (13:02 +0000)]
[sanitizer] [msan] Unify aarch64 mapping

This patch unify the 39-bit and 42-bit mapping for aarch64 to use only
one instrumentation algorithm.  This removes compiler flag
SANITIZER_AARCH64_VMA requirement for MSAN on aarch64.

The mapping to use now is for 39 and 42-bits:

    0x00000000000ULL-0x01000000000ULL  MappingDesc::INVALID
    0x01000000000ULL-0x02000000000ULL  MappingDesc::SHADOW
    0x02000000000ULL-0x03000000000ULL  MappingDesc::ORIGIN
    0x03000000000ULL-0x04000000000ULL  MappingDesc::SHADOW
    0x04000000000ULL-0x05000000000ULL  MappingDesc::ORIGIN
    0x05000000000ULL-0x06000000000ULL  MappingDesc::APP
    0x06000000000ULL-0x07000000000ULL  MappingDesc::INVALID
    0x07000000000ULL-0x08000000000ULL  MappingDesc::APP

And only for 42-bits:

    0x08000000000ULL-0x09000000000ULL  MappingDesc::INVALID
    0x09000000000ULL-0x0A000000000ULL  MappingDesc::SHADOW
    0x0A000000000ULL-0x0B000000000ULL  MappingDesc::ORIGIN
    0x0B000000000ULL-0x0F000000000ULL  MappingDesc::INVALID
    0x0F000000000ULL-0x10000000000ULL  MappingDesc::APP
    0x10000000000ULL-0x11000000000ULL  MappingDesc::INVALID
    0x11000000000ULL-0x12000000000ULL  MappingDesc::APP
    0x12000000000ULL-0x17000000000ULL  MappingDesc::INVALID
    0x17000000000ULL-0x18000000000ULL  MappingDesc::SHADOW
    0x18000000000ULL-0x19000000000ULL  MappingDesc::ORIGIN
    0x19000000000ULL-0x20000000000ULL  MappingDesc::INVALID
    0x20000000000ULL-0x21000000000ULL  MappingDesc::APP
    0x21000000000ULL-0x26000000000ULL  MappingDesc::INVALID
    0x26000000000ULL-0x27000000000ULL  MappingDesc::SHADOW
    0x27000000000ULL-0x28000000000ULL  MappingDesc::ORIGIN
    0x28000000000ULL-0x29000000000ULL  MappingDesc::SHADOW
    0x29000000000ULL-0x2A000000000ULL  MappingDesc::ORIGIN
    0x2A000000000ULL-0x2B000000000ULL  MappingDesc::APP
    0x2B000000000ULL-0x2C000000000ULL  MappingDesc::INVALID
    0x2C000000000ULL-0x2D000000000ULL  MappingDesc::SHADOW
    0x2D000000000ULL-0x2E000000000ULL  MappingDesc::ORIGIN
    0x2E000000000ULL-0x2F000000000ULL  MappingDesc::APP
    0x2F000000000ULL-0x39000000000ULL  MappingDesc::INVALID
    0x39000000000ULL-0x3A000000000ULL  MappingDesc::SHADOW
    0x3A000000000ULL-0x3B000000000ULL  MappingDesc::ORIGIN
    0x3B000000000ULL-0x3C000000000ULL  MappingDesc::APP
    0x3C000000000ULL-0x3D000000000ULL  MappingDesc::INVALID
    0x3D000000000ULL-0x3E000000000ULL  MappingDesc::SHADOW
    0x3E000000000ULL-0x3F000000000ULL  MappingDesc::ORIGIN
    0x3F000000000ULL-0x40000000000ULL  MappingDesc::APP

And although complex it provides a better memory utilization that
previous one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251624 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix use-after-free. Thanks ASAN for giving me a detailed report :-).
Daniel Jasper [Thu, 29 Oct 2015 12:49:37 +0000 (12:49 +0000)]
Fix use-after-free. Thanks ASAN for giving me a detailed report :-).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251623 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Check the register class before replacing materializations of zero with $zero...
Vasileios Kalintiris [Thu, 29 Oct 2015 10:17:16 +0000 (10:17 +0000)]
[mips] Check the register class before replacing materializations of zero with $zero in microMIPS.

Summary:
The microMIPS register class GPRMM16 does not contain the $zero register.
However, MipsSEDAGToDAGISel::replaceUsesWithZeroReg() would replace uses
of the $dst register:

  [d]addiu, $dst, $zero, 0

with the $zero register, without checking for membership in the register
class of the target machine operand.

Reviewers: dsanders

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251622 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MachineVerifier] Analyze MachineMemOperands for mem-to-mem moves.
Jonas Paulsson [Thu, 29 Oct 2015 08:28:35 +0000 (08:28 +0000)]
[MachineVerifier] Analyze MachineMemOperands for mem-to-mem moves.

Since the verifier will give false reports if it incorrectly thinks MI is
loading or storing using an FI, it is necessary to scan memoperands and
find out how the FI is used in the instruction. This should be relatively
rare.

Needed to make CodeGen/SystemZ/spill-01.ll pass, which now runs with this flag.

Reviewed by Quentin Colombet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251620 91177308-0d34-0410-b5e6-96231b3b80d8