OSDN Git Service

android-x86/external-llvm.git
7 years agoRe-commit "Use StringRef in Support/Darf APIs (NFC)"
Mehdi Amini [Wed, 5 Oct 2016 00:37:18 +0000 (00:37 +0000)]
Re-commit "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

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

7 years ago[libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements...
Kostya Serebryany [Wed, 5 Oct 2016 00:25:17 +0000 (00:25 +0000)]
[libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements with proper coverage are found). Make sure we never try to mutate empty element. Print the corpus size in bytes in the status lines

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

7 years agoRevert "Use StringRef in Support/Darf APIs (NFC)"
Mehdi Amini [Wed, 5 Oct 2016 00:21:14 +0000 (00:21 +0000)]
Revert "Use StringRef in Support/Darf APIs (NFC)"

This reverts commit r283275, it broke LLDB Android debug server.

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

7 years agoUse StringRef instead of raw pointers in ARMBuildAttrs (NFC)
Mehdi Amini [Wed, 5 Oct 2016 00:15:18 +0000 (00:15 +0000)]
Use StringRef instead of raw pointers in ARMBuildAttrs (NFC)

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

7 years agoUse StringRef in Support/Darf APIs (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:55:40 +0000 (23:55 +0000)]
Use StringRef in Support/Darf APIs (NFC)

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

7 years agoCodegen: Tail-duplicate during placement.
Kyle Butt [Tue, 4 Oct 2016 23:54:18 +0000 (23:54 +0000)]
Codegen: Tail-duplicate during placement.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well.

Differential revision: https://reviews.llvm.org/D18226

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

7 years agoUse StringRef in TableGen (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:47:33 +0000 (23:47 +0000)]
Use StringRef in TableGen (NFC)

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

7 years ago[C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.
Manuel Jacob [Tue, 4 Oct 2016 23:32:42 +0000 (23:32 +0000)]
[C API] Add LLVMConstExactUDiv and LLVMBuildExactUDiv functions.

Summary:
These are analog to the existing LLVMConstExactSDiv and LLVMBuildExactSDiv
functions.

Reviewers: deadalnix, majnemer

Subscribers: majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D25259

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

7 years agoUse StringRef in TableGen emitted API for attribute (NFC)
Mehdi Amini [Tue, 4 Oct 2016 23:31:39 +0000 (23:31 +0000)]
Use StringRef in TableGen emitted API for attribute (NFC)

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

7 years agoMisc improvements to StringTableBuilder.
Rafael Espindola [Tue, 4 Oct 2016 22:43:25 +0000 (22:43 +0000)]
Misc improvements to StringTableBuilder.

This patch adds write methods to StringTableBuilder so that it is
easier to change the underlying implementation.

Using the write methods, avoid creating a temporary buffer when using
mmaped output.

It also uses a more compact key in the DenseMap. Overall this produces
a slightly faster lld:

firefox
  master 6.853419709
  patch  6.841968912 1.00167361138x faster
chromium
  master 4.297280174
  patch  4.298712163 1.00033323147x slower
chromium fast
  master 1.802335952
  patch  1.806872459 1.00251701521x slower
the gold plugin
  master 0.3247149
  patch  0.321971644 1.00852017888x faster
clang
  master 0.551279945
  patch  0.543733194 1.01387951128x faster
llvm-as
  master 0.032743458
  patch  0.032143478 1.01866568391x faster
the gold plugin fsds
  master 0.350814247
  patch  0.348571741 1.00643341309x faster
clang fsds
  master 0.6281672
  patch  0.621130222 1.01132931187x faster
llvm-as fsds
  master 0.030168899
  patch  0.029797155 1.01247582194x faster
scylla
  master 3.104222518
  patch  3.059590248 1.01458766252x faster

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

7 years ago[cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to...
Alina Sbirlea [Tue, 4 Oct 2016 22:39:53 +0000 (22:39 +0000)]
[cpu-detection] Copy simplified version of get_cpuid_max to remove dependency to clang's implementation

Summary:
Attempting to fix PR30384.
Take the same approach as in compiler_rt and add a simplified version of __get_cpuid_max.
Including cpuid.h is no longer needed.

Reviewers: echristo, joerg

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D24597

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

7 years agoRevert r283248. It caused failures in the hexagon buildbots.
David L Kreitzer [Tue, 4 Oct 2016 20:57:19 +0000 (20:57 +0000)]
Revert r283248. It caused failures in the hexagon buildbots.

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

7 years ago[Target] move reciprocal estimate settings from TargetOptions to TargetLowering
Sanjay Patel [Tue, 4 Oct 2016 20:46:43 +0000 (20:46 +0000)]
[Target] move reciprocal estimate settings from TargetOptions to TargetLowering

The motivation for the change is that we can't have pseudo-global settings for
codegen living in TargetOptions because that doesn't work with LTO.

Ideally, these reciprocal attributes will be moved to the instruction-level via
FMF, metadata, or something else. But making them function attributes is at least
an improvement over the current state.

The ingredients of this patch are:

    Remove the reciprocal estimate command-line debug option.
    Add TargetRecip to TargetLowering.
    Remove TargetRecip from TargetOptions.
    Clean up the TargetRecip implementation to work with this new scheme.
    Set the default reciprocal settings in TargetLoweringBase (everything is off).
    Update the PowerPC defaults, users, and tests.
    Update the x86 defaults, users, and tests.

Note that if this patch needs to be reverted, the related clang patch checked in
at r283251 should be reverted too.

Differential Revision: https://reviews.llvm.org/D24816

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

7 years agoNext set of additional error checks for invalid Mach-O files for the
Kevin Enderby [Tue, 4 Oct 2016 20:37:43 +0000 (20:37 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that uses the MachO::encryption_info_command and
MachO::encryption_info_command types but not used in llvm libObject
code but used in llvm tool code.

This includes just LC_ENCRYPTION_INFO and
LC_ENCRYPTION_INFO_64 load commands.

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

7 years ago[safestack] Requires a valid TargetMachine to be passed to the SafeStack pass.
David L Kreitzer [Tue, 4 Oct 2016 20:31:32 +0000 (20:31 +0000)]
[safestack] Requires a valid TargetMachine to be passed to the SafeStack pass.

Patch by Michael LeMay

Differential revision: http://reviews.llvm.org/D24896

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

7 years ago[cmake] Make LIT_COMMAND configurable and improve fallback support
Michal Gorny [Tue, 4 Oct 2016 20:25:37 +0000 (20:25 +0000)]
[cmake] Make LIT_COMMAND configurable and improve fallback support

Make LIT_COMMAND configurable, use source tree only when actually
available and extend the default search to other common executable names
'lit.py' and 'lit', in order to increase uniformity between all LLVM
projects and support using installed lit.

Changing the conditional used to determine whether in-tree or external
lit is being used covers the case when LLVM_MAIN_SRC_DIR is defined but
does not exist (anymore). In this case, the functions falls back to
looking for installed lit rather than attempting to use a non-existing
path. The same conditional is used in clang already.

Making LIT_COMMAND a cache variable in case the source tree variant is
used serves two purposes. Firstly, it increases uniformity between
the two branches since find_program() implicitly makes LIT_COMMAND
a cache variable. Secondly, it allows overriding the lit executable used
to run the tests when the LLVM source tree is provided. Gentoo is
planning to use this to use installed (and byte-compiled) lit instead of
re-compiling it in every LLVM project.

Extending default search is meant to increase uniformity between
different LLVM projects. The 'lit.py' name is already used by a few of
them, and 'lit' is the name used by utils/lit/setup.py when installing.

Differential Revision: https://reviews.llvm.org/D25076

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

7 years ago[Support] Add case-insensitive versions of StringSwitch members.
Zachary Turner [Tue, 4 Oct 2016 19:33:13 +0000 (19:33 +0000)]
[Support] Add case-insensitive versions of StringSwitch members.

This adds support for CaseLower, CasesLower, StartsWithLower, and
EndsWithLower.

Differential revision: https://reviews.llvm.org/D24686

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

7 years agoAArch64: Macrofusion: Split features, add missing combinations.
Matthias Braun [Tue, 4 Oct 2016 19:28:21 +0000 (19:28 +0000)]
AArch64: Macrofusion: Split features, add missing combinations.

AArch64InstrInfo::shouldScheduleAdjacent() determines whether two
instruction can benefit from macroop fusion on apple CPUs. The list
turned out to be incomplete:
- the "rr" variants of the instructions were missing
- even the "rs" variants can have shift value == 0 and behave like the
  "rr" variants

This also splits the MacropFusion target feature into
ArithmeticBccFusion and ArithmeticCbzFusion.

Differential Revision: https://reviews.llvm.org/D25142

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

7 years ago[sancov] renamed symcov-report-server to coverage-report-server
Mike Aizatsky [Tue, 4 Oct 2016 19:18:23 +0000 (19:18 +0000)]
[sancov] renamed symcov-report-server to coverage-report-server

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

7 years ago[asan] LLVM: Switch to using dynamic shadow offset on iOS
Anna Zaks [Tue, 4 Oct 2016 19:02:29 +0000 (19:02 +0000)]
[asan] LLVM: Switch to using dynamic shadow offset on iOS

The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset.

This is the LLVM counterpart of https://reviews.llvm.org/D25218

Differential Revision: https://reviews.llvm.org/D25219

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

7 years agoDon't filter diagnostics written as YAML to the output file
Hal Finkel [Tue, 4 Oct 2016 18:13:45 +0000 (18:13 +0000)]
Don't filter diagnostics written as YAML to the output file

The purpose of the YAML diagnostic output file is to collect information on
optimizations performed, or not performed, for later processing by tools that
help users (and compiler developers) understand how code was optimized. As
such, the diagnostics that appear in the file should not be coupled to what a
user might want to see summarized for them as the compiler runs, and in fact,
because the user likely does not know what optimization diagnostics their tools
might want to use, the user cannot provide a useful filter regardless. As such,
we shouldn't filter the diagnostics going to the output file.

Differential Revision: https://reviews.llvm.org/D25224

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

7 years ago[CMake] Exclude intrinsics_gen from LLVM_COMMON_DEPENDS in LLVMConfig.cmake
Chris Bieneman [Tue, 4 Oct 2016 17:44:28 +0000 (17:44 +0000)]
[CMake] Exclude intrinsics_gen from LLVM_COMMON_DEPENDS in LLVMConfig.cmake

CMake requires that all targets expressed as dependencies exist, so we can't have intrinsics_gen in LLVM_COMMON_DEPENDS when it is written out, otherwise projects building out of tree will have CMake errors.

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

7 years agoSerialize remark argument as a mapping to get proper quotation for the value.
Adam Nemet [Tue, 4 Oct 2016 17:05:04 +0000 (17:05 +0000)]
Serialize remark argument as a mapping to get proper quotation for the value.

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

7 years agoAllow derived classes of OptimizationRemarkAnalysis in YAML
Adam Nemet [Tue, 4 Oct 2016 17:05:01 +0000 (17:05 +0000)]
Allow derived classes of OptimizationRemarkAnalysis in YAML

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

7 years ago[SLPVectorizer] Add a test with non-vectorizable IR.
Alexey Bataev [Tue, 4 Oct 2016 15:07:23 +0000 (15:07 +0000)]
[SLPVectorizer] Add a test with non-vectorizable IR.

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

7 years ago[RS4GC] Handle ShuffleVector instruction in findBasePointer
Anna Thomas [Tue, 4 Oct 2016 13:48:37 +0000 (13:48 +0000)]
[RS4GC] Handle ShuffleVector instruction in findBasePointer

Summary:
This patch modifies the findBasePointer to handle the shufflevector instruction.

Tests run: RS4GC tests, local downstream tests.

Reviewers: reames, sanjoy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25197

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

7 years agoRemove duplicated typedef. NFC.
Rafael Espindola [Tue, 4 Oct 2016 13:09:59 +0000 (13:09 +0000)]
Remove duplicated typedef. NFC.

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

7 years agoFix IntegerType::MAX_INT_BITS value
Andrey Bokhanko [Tue, 4 Oct 2016 12:43:46 +0000 (12:43 +0000)]
Fix IntegerType::MAX_INT_BITS value

IntegerType::MAX_INT_BITS is apparently not in sync with Type::SubclassData
size. This patch fixes this.

Differential Revision: https://reviews.llvm.org/D24814

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

7 years ago[Power9] Exploit D-Form VSX Scalar memory ops that target full VSX register set
Nemanja Ivanovic [Tue, 4 Oct 2016 11:25:52 +0000 (11:25 +0000)]
[Power9] Exploit D-Form VSX Scalar memory ops that target full VSX register set

This patch corresponds to review:

The newly added VSX D-Form (register + offset) memory ops target the upper half
of the VSX register set. The existing ones target the lower half. In order to
unify these and have the ability to target all the VSX registers using D-Form
operations, this patch defines Pseudo-ops for the loads/stores which are
expanded post-RA. The expansion then choses the correct opcode based on the
register that was allocated for the operation.

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

7 years ago[mips][fastisel] Consider soft-float an unsupported floating point mode
Simon Dardis [Tue, 4 Oct 2016 10:35:07 +0000 (10:35 +0000)]
[mips][fastisel] Consider soft-float an unsupported floating point mode

Treat soft-float as unsupported for fast-isel. Additionally, ensure we check
that lowering f32 arguments also considers the case of soft-float mode.

Reviewers: ehostunreach, vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24505

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

7 years ago[Object/ELF] - Do not crash on invalid sh_offset value of REL[A] section.
George Rimar [Tue, 4 Oct 2016 09:25:39 +0000 (09:25 +0000)]
[Object/ELF] - Do not crash on invalid sh_offset value of REL[A] section.

Previously code would access invalid memory and may crash,
patch fixes the issue.

Differential revision: https://reviews.llvm.org/D25187

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

7 years ago[SelectionDAG] Fix calling convention in expansion of ?MULO.
whitequark [Tue, 4 Oct 2016 09:07:49 +0000 (09:07 +0000)]
[SelectionDAG] Fix calling convention in expansion of ?MULO.

The SMULO/UMULO DAG nodes, when not directly supported by the target,
expand to a multiplication twice as wide. In case that the resulting
type is not legal, an __mul?i3 intrinsic is used. Since the type is
not legal, the legalizer cannot directly call the intrinsic with
the wide arguments; instead, it "pre-lowers" them by splitting them
in halves.

The "pre-lowering" code in essence made assumptions about
the calling convention, specifically that i(N*2) values will be
split into two iN values and passed in consecutive registers in
little-endian order. This, naturally, breaks on a big-endian system,
such as our OR1K out-of-tree backend.

Thanks to James Miller <james@aatch.net> for help in debugging.

Differential Revision: https://reviews.llvm.org/D25223

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

7 years ago[Object/ELF] - Avoid possible crash in getExtendedSymbolTableIndex().
George Rimar [Tue, 4 Oct 2016 08:44:03 +0000 (08:44 +0000)]
[Object/ELF] - Avoid possible crash in getExtendedSymbolTableIndex().

When using broken input object found using AFL,
getExtendedSymbolTableIndex() crashed because ShndxTable
was empty as object does not contain SHT_SYMTAB_SHNDX section.

Differential revision: https://reviews.llvm.org/D25189

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

7 years agoConsistent fp denormal mode names. NFC.
Sjoerd Meijer [Tue, 4 Oct 2016 08:03:36 +0000 (08:03 +0000)]
Consistent fp denormal mode names. NFC.

This fixes the inconsistency of the fp denormal option names: in LLVM this was
DenormalType, but in Clang this is DenormalMode which seems better.

Differential Revision: https://reviews.llvm.org/D24906

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

7 years agoFix a test case failure on Apple PPC.
Nemanja Ivanovic [Tue, 4 Oct 2016 07:37:38 +0000 (07:37 +0000)]
Fix a test case failure on Apple PPC.

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

7 years ago[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions
Nemanja Ivanovic [Tue, 4 Oct 2016 06:59:23 +0000 (06:59 +0000)]
[Power9] Part-word VSX integer scalar loads/stores and sign extend instructions

This patch corresponds to review:
https://reviews.llvm.org/D23155

This patch removes the VSHRC register class (based on D20310) and adds
exploitation of the Power9 sub-word integer loads into VSX registers as well
as vector sign extensions.
The new instructions are useful for a few purposes:

    Int to Fp conversions of 1 or 2-byte values loaded from memory
    Building vectors of 1 or 2-byte integers with values loaded from memory
    Storing individual 1 or 2-byte elements from integer vectors

This patch implements all of those uses.

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

7 years ago[cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries
Michal Gorny [Tue, 4 Oct 2016 06:09:18 +0000 (06:09 +0000)]
[cmake] Reintroduce (ldconfig-compatible) SOVERSIONs on shared libraries

Reintroduce versioning of shared libraries via SOVERSION, addressing
the issues with the previous design, since Gentoo is relying
on shared-split install of LLVM. The SOVERSIONs were originally
introduced in r229720 for all libraries, and removed in r252093 in favor
of custom SONAME. As far as I understand, the major concern with the old
versioning was that the used versions were incompatible with ldconfig.

Having considered that, this commit introduce SOVERSIONS with the
following considerations:

1. SOVERSIONs are formed of major & minor version concatenated -- i.e.
for 4.0 its .so.40. This matches the common practice where the first
version number indicates ABI breakage, and therefore fixes the issues
with ldconfig. Additionally, VERSION with the remaining verion
components appended is used, however this is not strictly necessary.

2. The versioning is only applied to libraries with no explicit SONAME
specified -- i.e. it won't apply to libLLVM but only to the split
libraries. It will also apply to libraries installed by the subprojects.

3. The versioning is only done on *nix systems, Darwin excluded. This
matches the current use of SONAME.

Differential Revision: https://reviews.llvm.org/D24757

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

7 years ago[cmake] Use separate doctrees to prevent races between Sphinx instances
Michal Gorny [Tue, 4 Oct 2016 06:09:14 +0000 (06:09 +0000)]
[cmake] Use separate doctrees to prevent races between Sphinx instances

Use separate doctrees between different Sphinx builders in order to
prevent race condition issues due to multiple Sphinx instances accessing
the same doctree cache in parallel.

Bug: https://llvm.org/bugs/show_bug.cgi?id=23781

Differential Revision: https://reviews.llvm.org/D23755

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

7 years ago[libFuzzer] remove dfsan support and some related stale code. This is not being used...
Kostya Serebryany [Tue, 4 Oct 2016 06:08:46 +0000 (06:08 +0000)]
[libFuzzer] remove dfsan support and some related stale code. This is not being used and as is is pretty weak anyway

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

7 years ago[X86] Add MOV8rm_NOREX to switch in isReallyTriviallyReMaterializable to match MOV8rm.
Craig Topper [Tue, 4 Oct 2016 03:11:44 +0000 (03:11 +0000)]
[X86] Add MOV8rm_NOREX to switch in isReallyTriviallyReMaterializable to match MOV8rm.

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

7 years ago[libFuzzer] change the probabilities so that we choose only the inputs that are known...
Kostya Serebryany [Tue, 4 Oct 2016 01:51:44 +0000 (01:51 +0000)]
[libFuzzer] change the probabilities so that we choose only the inputs that are known to be minimal inputs for at least one coverage feature (works only with -shrink=1 for now)

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

7 years agoAMDGPU: Refactor indirect vector lowering
Matt Arsenault [Tue, 4 Oct 2016 01:41:05 +0000 (01:41 +0000)]
AMDGPU: Refactor indirect vector lowering

Allow inserting multiple instructions in the
expanded loop.

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

7 years agoAMDGPU: Factor SGPR spilling into separate functions
Matt Arsenault [Tue, 4 Oct 2016 01:14:56 +0000 (01:14 +0000)]
AMDGPU: Factor SGPR spilling into separate functions

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

7 years agoRevert "Codegen: Tail-duplicate during placement."
Kyle Butt [Tue, 4 Oct 2016 00:38:23 +0000 (00:38 +0000)]
Revert "Codegen: Tail-duplicate during placement."

This reverts commit ff234efbe23528e4f4c80c78057b920a51f434b2.

Causing crashes on aarch64 build.

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

7 years ago[lit] Remove workaround for Python 2.5
Brian Gesiak [Tue, 4 Oct 2016 00:15:37 +0000 (00:15 +0000)]
[lit] Remove workaround for Python 2.5

Summary:
The minimum version of Python necessary to run the LLVM test suite is
2.7. Code to work around Python 2.5 and lower isn't necessary.

Reviewers: ddunbar, echristo, delcypher, beanz

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25209

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

7 years agoMake GlobalsAA ignore dead constant expressions.
Eli Friedman [Tue, 4 Oct 2016 00:03:55 +0000 (00:03 +0000)]
Make GlobalsAA ignore dead constant expressions.

Slightly improves the precision of GlobalsAA in certain situations, and
makes the behavior of optimization passes more predictable.

Differential Revision: https://reviews.llvm.org/D24104

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

7 years agoCodegen: Tail-duplicate during placement.
Kyle Butt [Tue, 4 Oct 2016 00:00:09 +0000 (00:00 +0000)]
Codegen: Tail-duplicate during placement.

The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

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

7 years ago[MSSA] Allow unittests to use BasicAA when building.
George Burgess IV [Mon, 3 Oct 2016 23:12:35 +0000 (23:12 +0000)]
[MSSA] Allow unittests to use BasicAA when building.

We now build MemorySSA in its ctor, instead of waiting until the user
calls MemorySSA::getWalker. This silently changed our unittests, since
we add BasicAA to AAResults *after* constructing MemorySSA (...but
before calling MemorySSA::getWalker).

None of them broke because we do most of our "did this get optimized
correctly?" tests in .ll files.

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

7 years ago[WebAssembly] Update to more stack-machine-oriented terminology.
Dan Gohman [Mon, 3 Oct 2016 22:43:53 +0000 (22:43 +0000)]
[WebAssembly] Update to more stack-machine-oriented terminology.

WebAssembly has officially switched from being an AST to being a stack
machine. Update various bits of terminology and README.md entries
accordingly.

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

7 years ago[WebAssemby] Clean up an obsolete comment.
Dan Gohman [Mon, 3 Oct 2016 22:32:21 +0000 (22:32 +0000)]
[WebAssemby] Clean up an obsolete comment.

The comment is present inside the body of GetVRegDef.

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

7 years ago[lit] Use argparse instead of optparse
Chris Bieneman [Mon, 3 Oct 2016 22:12:42 +0000 (22:12 +0000)]
[lit] Use argparse instead of optparse

Summary:
optparse is deprecated in Python 2.7, which is the minimum version of
Python required to run the LLVM test suite. Replace its usage in lit
with argparse, optparse's 2.7 replacement module.

argparse has several benefits over optparse, but this commit does not
make use of those benefits yet. Instead, it simply uses the new API,
and attempts to keep the number of changes to a minimum.

Confirmed that lit's test suite, as well as LLVM's regression test suite,
still pass with these changes.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz, delcypher

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25173

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

7 years agoTargetMachine: Make the win32-macho workaround more specific.
Matthias Braun [Mon, 3 Oct 2016 22:12:37 +0000 (22:12 +0000)]
TargetMachine: Make the win32-macho workaround more specific.

This is to avoid problems with win32 + ELF which surprisingly happens a
lot in practice: If a user just specifies -march on the commandline the
object format changes along with the architecture to ELF in many
instances while the OS stays with the default/host OS.

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

7 years ago[WebAssembly] Delete an unused function. NFC.
Dan Gohman [Mon, 3 Oct 2016 22:06:28 +0000 (22:06 +0000)]
[WebAssembly] Delete an unused function. NFC.

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

7 years agoSet some tests to an unknown vendor and OS
Matthias Braun [Mon, 3 Oct 2016 21:58:20 +0000 (21:58 +0000)]
Set some tests to an unknown vendor and OS

This avoids llc using the hosts OS/vendor as defaults and triggering
unwanted behaviour in the tests. This should deal with the buildbot
breakages on windows after r283140.

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

7 years ago[LTO] Fix test to not depend on the exact address of symbols, just their linkage
Mehdi Amini [Mon, 3 Oct 2016 21:40:50 +0000 (21:40 +0000)]
[LTO] Fix test to not depend on the exact address of symbols, just their linkage

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

7 years ago[WebAssembly] Fix indentation. NFC.
Dan Gohman [Mon, 3 Oct 2016 21:33:09 +0000 (21:33 +0000)]
[WebAssembly] Fix indentation. NFC.

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

7 years ago[WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.
Dan Gohman [Mon, 3 Oct 2016 21:31:31 +0000 (21:31 +0000)]
[WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.

WebAssembly documentation consistently says "f32" rather than "fp32" to
describe 32-bit floating-point.

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

7 years ago[AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.
Quentin Colombet [Mon, 3 Oct 2016 20:20:13 +0000 (20:20 +0000)]
[AArch64][RegisterBankInfo] Add getSameKindofOperandsMapping.

Refactor the code so that the same function can be used for all
instructions with all the same operands for up to 3 operands.

This is going to be useful for cast instructions.
NFC.

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

7 years ago[RDF] Fix liveness propagation through shadows
Krzysztof Parzyszek [Mon, 3 Oct 2016 20:17:20 +0000 (20:17 +0000)]
[RDF] Fix liveness propagation through shadows

Each shadow only represents data flow that is restricted to its reaching
def. Propagating more than that could lead to spurious register liveness,
resulting in extra (incorrectly) block live-ins.

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

7 years agoAArch64Subtarget: Remove unused CPUString field
Matthias Braun [Mon, 3 Oct 2016 20:17:02 +0000 (20:17 +0000)]
AArch64Subtarget: Remove unused CPUString field

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

7 years agoX86: Do not produce GOT relocations on windows
Matthias Braun [Mon, 3 Oct 2016 20:11:24 +0000 (20:11 +0000)]
X86: Do not produce GOT relocations on windows

Windows has no GOT relocations the way elf/darwin has. Some people use
x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT
relocations for this target.

Differential Revision: https://reviews.llvm.org/D24627

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

7 years agoAdd unit tests for StringSwitch.
Zachary Turner [Mon, 3 Oct 2016 19:56:50 +0000 (19:56 +0000)]
Add unit tests for StringSwitch.

Differential revision: https://reviews.llvm.org/D25205

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

7 years ago[PruneEH] Be correct in the face IPO
Sanjoy Das [Mon, 3 Oct 2016 19:35:30 +0000 (19:35 +0000)]
[PruneEH] Be correct in the face IPO

This fixes one spot I had missed in r265762.  Credit goes to Philip
Reames for spotting this one!

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

7 years ago[sancov] using env for better portability
Mike Aizatsky [Mon, 3 Oct 2016 19:22:05 +0000 (19:22 +0000)]
[sancov] using env for better portability

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

7 years agoRefactor LICM pass in preparation for LoopSink pass.
Dehao Chen [Mon, 3 Oct 2016 18:52:08 +0000 (18:52 +0000)]
Refactor LICM pass in preparation for LoopSink pass.

Summary: LoopSink pass uses some common function in LICM. This patch refactor the LICM code to make it usable by LoopSink pass (https://reviews.llvm.org/D22778).

Reviewers: davidxl, danielcdh, hfinkel, chandlerc

Subscribers: hfinkel, llvm-commits

Differential Revision: https://reviews.llvm.org/D24168

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

7 years ago[AMDGPU] Pass optimization level to SelectionDAGISel
Konstantin Zhuravlyov [Mon, 3 Oct 2016 18:47:26 +0000 (18:47 +0000)]
[AMDGPU] Pass optimization level to SelectionDAGISel

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

7 years ago[AMDGPU] Sign extend AShr when promoting (instead of zero extending)
Konstantin Zhuravlyov [Mon, 3 Oct 2016 18:29:01 +0000 (18:29 +0000)]
[AMDGPU] Sign extend AShr when promoting (instead of zero extending)

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

7 years agoJump threading: avoid trying to split edge into landingpad block (PR27840)
Hans Wennborg [Mon, 3 Oct 2016 18:18:04 +0000 (18:18 +0000)]
Jump threading: avoid trying to split edge into landingpad block (PR27840)

Splitting the edge is nontrivial because of the landing pad, and we would
currently assert trying to do it.

Differential Revision: https://reviews.llvm.org/D24680

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

7 years agoRename Error -> ReportError.
Zachary Turner [Mon, 3 Oct 2016 18:17:18 +0000 (18:17 +0000)]
Rename Error -> ReportError.

Error conflicts with the llvm::Error datatype, creating
ambiguities.

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

7 years agoRevert "Use getSize instead of data().size(). NFC."
Rafael Espindola [Mon, 3 Oct 2016 18:01:10 +0000 (18:01 +0000)]
Revert "Use getSize instead of data().size(). NFC."

This reverts commit r283125.

lld needs to be updated.

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

7 years ago[RDF] Further improve readability of the graph
Krzysztof Parzyszek [Mon, 3 Oct 2016 17:54:33 +0000 (17:54 +0000)]
[RDF] Further improve readability of the graph

Print target basic block for a branch.

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

7 years agoUse getSize instead of data().size(). NFC.
Rafael Espindola [Mon, 3 Oct 2016 17:49:19 +0000 (17:49 +0000)]
Use getSize instead of data().size(). NFC.

Also assert isFinalized in getSize(). This just reduces the noise from
another patch.

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

7 years ago[RTDyld] Fix a bug in RTDyldMemoryManager::deregisterEHFrames.
Lang Hames [Mon, 3 Oct 2016 17:34:56 +0000 (17:34 +0000)]
[RTDyld] Fix a bug in RTDyldMemoryManager::deregisterEHFrames.

It should forward to deregisterEHFramesInProcess by default, not
registerEHFramesInProcess.

No test case: I haven't come up with a good way to unit test EH frame
registration yet.

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

7 years ago[RDF] Replace RegisterAliasInfo with target-independent code using lane masks
Krzysztof Parzyszek [Mon, 3 Oct 2016 17:14:48 +0000 (17:14 +0000)]
[RDF] Replace RegisterAliasInfo with target-independent code using lane masks

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

7 years ago[x86, SSE/AVX] allow 128/256-bit lowering for copysign vector intrinsics (PR30433)
Sanjay Patel [Mon, 3 Oct 2016 16:38:27 +0000 (16:38 +0000)]
[x86, SSE/AVX] allow 128/256-bit lowering for copysign vector intrinsics (PR30433)

This should fix:
https://llvm.org/bugs/show_bug.cgi?id=30433

There are a couple of open questions about the codegen:
1. Should we let scalar ops be scalars and avoid vector constant loads/splats?
2. Should we have a pass to combine constants such as the inverted pair that we have here?

Differential Revision: https://reviews.llvm.org/D25165

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

7 years agoDon't drop the llvm. prefix when renaming.
Rafael Espindola [Mon, 3 Oct 2016 15:51:42 +0000 (15:51 +0000)]
Don't drop the llvm. prefix when renaming.

If the llvm. prefix is dropped other parts of llvm don't see this as
an intrinsic.  This means that the number of regular symbols depends
on the context the module is loaded into, which causes LTO to abort.

Fixes PR30509.

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

7 years agofix formatting; NFC
Sanjay Patel [Mon, 3 Oct 2016 15:18:36 +0000 (15:18 +0000)]
fix formatting; NFC

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

7 years agoPrevent out of order HashDirective lexing in AsmLexer.
Nirav Dave [Mon, 3 Oct 2016 13:48:27 +0000 (13:48 +0000)]
Prevent out of order HashDirective lexing in AsmLexer.

Retrying after buildbot reset.

To lex hash directives we peek ahead to find component tokens, create a
unified token, and unlex the peeked tokens so the parser does not need
to parse the tokens then. Make sure we do not to lex another hash
directive during peek operation.

This fixes PR28921.

Reviewers: rnk, loladiro

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24839

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

7 years agoAMDGPU: Fix typo
Matt Arsenault [Mon, 3 Oct 2016 13:06:58 +0000 (13:06 +0000)]
AMDGPU: Fix typo

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

7 years agoAMDGPU: Fix missing -verify-machineinstrs in test
Matt Arsenault [Mon, 3 Oct 2016 12:58:59 +0000 (12:58 +0000)]
AMDGPU: Fix missing -verify-machineinstrs in test

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

7 years ago[X86][SSE] Add PR30371 (shuffle constant folding) test case
Simon Pilgrim [Mon, 3 Oct 2016 12:16:39 +0000 (12:16 +0000)]
[X86][SSE] Add PR30371 (shuffle constant folding) test case

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

7 years agoAdd new target hooks for LoadStoreVectorizer
Volkan Keles [Mon, 3 Oct 2016 10:31:34 +0000 (10:31 +0000)]
Add new target hooks for LoadStoreVectorizer

Summary: Added 6 new target hooks for the vectorizer in order to filter types, handle size constraints and decide how to split chains.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, mzolotukhin, wdng, llvm-commits, nhaehnle

Differential Revision: https://reviews.llvm.org/D24727

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

7 years ago[ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
Sjoerd Meijer [Mon, 3 Oct 2016 10:12:32 +0000 (10:12 +0000)]
[ARM] Code size optimisation to lower udiv+urem to udiv+mls instead of a
library call to __aeabi_uidivmod. This is an improved implementation of
r280808, see also D24133, that got reverted because isel was stuck in a loop.
That was caused by the optimisation incorrectly triggering on i64 ints, which
shouldn't happen because there is no 64bit hwdiv support; that put isel's type
legalization and this optimisation in a loop. A native ARM compiler and testing
now shows that this is fixed.

Patch mostly by Pablo Barrio.

Differential Revision: https://reviews.llvm.org/D25077

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

7 years ago[CodeGen] Adding a test showing the current state of poor code gen of
Alexey Bataev [Mon, 3 Oct 2016 07:47:01 +0000 (07:47 +0000)]
[CodeGen] Adding a test showing the current state of poor code gen of
search loop, by Andrey Tischenko

PR27136 shows failure to hoist constant out of loop. This test is used
as start point to fix the failure: it shows the current state of codegen
and discovers what should be fixed

Differential Revision: https://reviews.llvm.org/D25097

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

7 years ago[lit] Throw in unimplemented method (NFC)
Chris Bieneman [Mon, 3 Oct 2016 04:48:22 +0000 (04:48 +0000)]
[lit] Throw in unimplemented method (NFC)

Summary:
lit's `OneCommandFileTest` class implements an abstract method that
raises if called. However, it raises by referencing an undefined
symbol. Instead, raise explicitly by throwing a `NotImplementedError`.
This is clearer, and appeases Python linters.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25170

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

7 years ago[lit] Remove unused imports (NFC)
Chris Bieneman [Mon, 3 Oct 2016 04:48:18 +0000 (04:48 +0000)]
[lit] Remove unused imports (NFC)

Reviewers: ddunbar, echristo, beanz

Patch by Brian Gesiak!

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25169

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

7 years ago[lit] Compare to None using identity, not equality
Chris Bieneman [Mon, 3 Oct 2016 04:48:13 +0000 (04:48 +0000)]
[lit] Compare to None using identity, not equality

Summary:
In Python, `None` is a singleton, so checking whether a variable is
`None` may be done with `is` or `is not`. This has a slight advantage
over equiality comparisons `== None` and `!= None`, since `__eq__` may
be overridden in Python to produce sometimes unexpected results.

Using `is None` and `is not None` is also recommended practice in
https://www.python.org/dev/peps/pep-0008:

> Comparisons to singletons like `None` should always be done with `is` or
> `is not`, never the equality operators.

Patch by Brian Gesiak!

Reviewers: ddunbar, echristo, beanz

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25168

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

7 years ago[AMDGPU] Remove unused variables from SIOptimizeExecMasking
Konstantin Zhuravlyov [Mon, 3 Oct 2016 04:43:22 +0000 (04:43 +0000)]
[AMDGPU] Remove unused variables from SIOptimizeExecMasking

Differential Revision: https://reviews.llvm.org/D25110

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

7 years ago[PowerPC] Account for the ELFv2 function prologue during branch selection
Hal Finkel [Mon, 3 Oct 2016 04:06:44 +0000 (04:06 +0000)]
[PowerPC] Account for the ELFv2 function prologue during branch selection

The PPC branch-selection pass, which performs branch relaxation, needs to
account for the padding that might be introduced to satisfy block alignment
requirements. We were assuming that the first block was at offset zero (i.e.
had the alignment of the function itself), but under the ELFv2 ABI, a global
entry function prologue is added to the first block, and it is a
two-instruction sequence (i.e. eight-bytes long). If the function has 16-byte
alignment, the fact that the first block is eight bytes offset from the start
of the function is relevant to calculating where padding will be added in
between later blocks.

Unfortunately, I don't have a small test case.

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

7 years ago[AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.
Craig Topper [Mon, 3 Oct 2016 02:22:33 +0000 (02:22 +0000)]
[AVX-512] Remove isCheapAsAMove flag from VMOVAPSZ128rm_NOVLX and friends.

This was accidentally copy and pasted from other Pseudos in the file.

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

7 years ago[X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.
Craig Topper [Mon, 3 Oct 2016 02:00:29 +0000 (02:00 +0000)]
[X86] Mark all sizes of (V)MOVUPD as trivially rematerializable.

I don't know for sure that we truly needs this, but its the only vector load that isn't rematerializable. Making it consistent allows it to not be a special case in the td files.

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

7 years ago[X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS
Simon Pilgrim [Sun, 2 Oct 2016 21:07:58 +0000 (21:07 +0000)]
[X86][AVX2] Add support for combining target shuffles to VPERMD/VPERMPS

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

7 years ago[SCEV] Rely on ConstantRange instead of custom logic; NFCI
Sanjoy Das [Sun, 2 Oct 2016 20:59:10 +0000 (20:59 +0000)]
[SCEV] Rely on ConstantRange instead of custom logic; NFCI

This was first landed in rL283058 and subsequenlty reverted since a
change this depends on (rL283057) was buggy and had to be reverted.

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

7 years ago[ConstantRange] Make getEquivalentICmp smarter
Sanjoy Das [Sun, 2 Oct 2016 20:59:05 +0000 (20:59 +0000)]
[ConstantRange] Make getEquivalentICmp smarter

This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

An earlier version of this change was landed as rL283057 which had a
use-after-free bug.  This new version has a fix for that bug, and a (C++
unittests/) test case that would have triggered it rL283057.

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

7 years ago[X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPS
Simon Pilgrim [Sun, 2 Oct 2016 20:43:02 +0000 (20:43 +0000)]
[X86][AVX2] Missed opportunities to combine to VPERMD/VPERMPS

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

7 years ago[X86][AVX2] Fix typo in test names
Simon Pilgrim [Sun, 2 Oct 2016 19:31:58 +0000 (19:31 +0000)]
[X86][AVX2] Fix typo in test names

We are testing vpermps not vpermd

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

7 years agoRangify for loops.
Yaron Keren [Sun, 2 Oct 2016 19:21:41 +0000 (19:21 +0000)]
Rangify for loops.

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

7 years ago[x86] remove 'nan' strings from copysign assertions; NFC
Sanjay Patel [Sun, 2 Oct 2016 17:07:24 +0000 (17:07 +0000)]
[x86] remove 'nan' strings from copysign assertions; NFC

Preemptively scrubbing these to avoid a bot fail as in PR30443:
https://llvm.org/bugs/show_bug.cgi?id=30443

I'm nearly done with a patch to fix these cases, so not trying very
hard to do better for the temporary win.

I plan to use better checks than what the script produces for the vectorized cases.

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

7 years ago[x86] add test to show unnecessary scalarization of copysign intrinsics (PR30433)
Sanjay Patel [Sun, 2 Oct 2016 16:31:35 +0000 (16:31 +0000)]
[x86] add test to show unnecessary scalarization of copysign intrinsics (PR30433)

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

7 years ago[X86][AVX] Ensure broadcast loads respect dependencies
Simon Pilgrim [Sun, 2 Oct 2016 15:59:15 +0000 (15:59 +0000)]
[X86][AVX] Ensure broadcast loads respect dependencies

To allow broadcast loads of a non-zero'th vector element, lowerVectorShuffleAsBroadcast can replace a load with a new load with an adjusted address, but unfortunately we weren't ensuring that the new load respected the same dependencies.

This patch adds a TokenFactor and updates all dependencies of the old load to reference the new load instead.

Bug found during internal testing.

Differential Revision: https://reviews.llvm.org/D25039

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