OSDN Git Service

android-x86/external-llvm.git
6 years ago[XRay] fix the -Werror build by handling all enum cases in switches
Martin Pelikan [Wed, 27 Sep 2017 05:10:31 +0000 (05:10 +0000)]
[XRay] fix the -Werror build by handling all enum cases in switches

Followup to D32840.

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

6 years ago[XRay] convert FDR arg1 log entries
Martin Pelikan [Wed, 27 Sep 2017 04:48:03 +0000 (04:48 +0000)]
[XRay] convert FDR arg1 log entries

Summary:
A new FDR metadata record will support logging a function call argument;
appending multiple metadata records will represent a sequence of arguments
meaning that "holes" are not representable by the buffer format.  Each
call argument is currently a 64-bit value (useful for "this" pointers and
synchronization objects).

If present, we put this argument to the function call "entry" record it
belongs to, and alter its type to notify the user of its presence.

Reviewers: dberris

Subscribers: llvm-commits

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

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

6 years ago[SimplifyIndVar] Constant fold IV users
Hongbin Zheng [Wed, 27 Sep 2017 03:11:46 +0000 (03:11 +0000)]
[SimplifyIndVar] Constant fold IV users

This patch tries to transform cases like:

for (unsigned i = 0; i < N; i += 2) {
  bool c0 = (i & 0x1) == 0;
  bool c1 = ((i + 1) & 0x1) == 1;
}
To

for (unsigned i = 0; i < N; i += 2) {
  bool c0 = true;
  bool c1 = true;
}

This commit also update test/Transforms/IndVarSimplify/replace-srem-by-urem.ll to prevent constant folding.

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

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

6 years agoReland: [llvm-objcopy] Add support for dynamic relocations
Jake Ehrlich [Wed, 27 Sep 2017 00:44:00 +0000 (00:44 +0000)]
Reland: [llvm-objcopy] Add support for dynamic relocations

This change adds support for dynamic relocations (allocated
SHT_REL/SHT_RELA sections with a dynamic symbol table as their link).

I had to reland this because of a I wasn't initilizing some pointers.

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

6 years agoInitialize the RelocationSectionBase::Section member.
James Y Knight [Tue, 26 Sep 2017 22:44:01 +0000 (22:44 +0000)]
Initialize the RelocationSectionBase::Section member.

In r314227, it wasn't always, and would thus contain random garbage.

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

6 years ago[Dominators] Invalidate DFS numbers upon edge deletions
Jakub Kuderski [Tue, 26 Sep 2017 21:56:55 +0000 (21:56 +0000)]
[Dominators] Invalidate DFS numbers upon edge deletions

This patch makes DeleteEdge correctly invalidate DFS numbers in the
incremental updater. This should fix PR34466 and related bugs.

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

6 years ago[BypassSlowDivision] Improve our handling of divisions by constants
Sanjoy Das [Tue, 26 Sep 2017 21:54:27 +0000 (21:54 +0000)]
[BypassSlowDivision] Improve our handling of divisions by constants

Summary:
Don't bail out on constant divisors for divisions that can be narrowed without
introducing control flow .  This gives us a 32 bit multiply instead of an
emulated 64 bit multiply in the generated PTX assembly.

Reviewers: jlebar

Subscribers: jholewinski, mcrosier, llvm-commits

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

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

6 years ago[AArch64][Falkor] Fix bug in falkor prefetcher fix pass.
Geoff Berry [Tue, 26 Sep 2017 21:40:46 +0000 (21:40 +0000)]
[AArch64][Falkor] Fix bug in falkor prefetcher fix pass.

Summary:
In rare cases, loads that don't get prefetched that were marked as
strided loads could cause a crash if they occurred in a loop with other
colliding loads.

Reviewers: mcrosier

Subscribers: aemerson, rengolin, javed.absar, kristof.beyls

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

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

6 years ago[AArch64][Falkor] Fix correctness bug in falkor prefetcher fix pass and correct some...
Geoff Berry [Tue, 26 Sep 2017 21:40:41 +0000 (21:40 +0000)]
[AArch64][Falkor] Fix correctness bug in falkor prefetcher fix pass and correct some opcode tag computations.

Summary:
This addresses a correctness bug for LD[1234]*_POST opcodes that have
the prefetcher fix applied to them: the base register was not being
written back from the temp after being incremented, so it would appear
to never be incremented.

Also, fix some opcode tag computations based on some updated HW details
to get better tag avoidance and thus better prefetcher performance.

Reviewers: mcrosier

Subscribers: aemerson, rengolin, javed.absar, kristof.beyls

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

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

6 years ago[X86] Fix register class name in a comment. NFC
Craig Topper [Tue, 26 Sep 2017 21:35:11 +0000 (21:35 +0000)]
[X86] Fix register class name in a comment. NFC

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

6 years agoRecommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseud...
Craig Topper [Tue, 26 Sep 2017 21:35:09 +0000 (21:35 +0000)]
Recommit r314151 "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST.""

The late MOV8rr_NOREX that caused the crash has been removed.

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

6 years ago[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg.
Craig Topper [Tue, 26 Sep 2017 21:35:06 +0000 (21:35 +0000)]
[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg.

This hook is called after register allocation with two physical registers. We don't need a separate instruction at that time to force register class constraints. I left in the assert though. We also have a fatal error in X86MCCodeEmitter if we ever encode an H-reg and a REX prefix.

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

6 years ago[X86] Fix typo in comment. NFC
Craig Topper [Tue, 26 Sep 2017 21:35:04 +0000 (21:35 +0000)]
[X86] Fix typo in comment. NFC

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

6 years ago[WebAssembly] Model weakly defined symbols as wasm exports
Sam Clegg [Tue, 26 Sep 2017 21:10:09 +0000 (21:10 +0000)]
[WebAssembly] Model weakly defined symbols as wasm exports

Previously these were being included as both imports and
exports, with the import being satisfied by the export
(or some strong symbol) at runtime.  However proved
unnecessary and actually complicated linking as it meant
there was not a 1-to-1 mapping between a wasm function
/global index and a linker symbol.

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

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

6 years ago[PowerPC] Reverting sequence of patches for elimination of comparison instructions
Nemanja Ivanovic [Tue, 26 Sep 2017 20:42:47 +0000 (20:42 +0000)]
[PowerPC] Reverting sequence of patches for elimination of comparison instructions

In the past while, I've committed a number of patches in the PowerPC back end
aimed at eliminating comparison instructions. However, this causes some failures
in proprietary source and these issues are not observed in SPEC or any open
source packages I've been able to run.
As a result, I'm pulling the entire series and will refactor it to:
- Have a single entry point for easy control
- Have fine-grained control over which patterns we transform

A side-effect of this is that test cases for these patches (and modified by
them) are XFAIL-ed. This is a temporary measure as it is counter-productive
to remove/modify these test cases and then have to modify them again when
the refactored patch is recommitted.
The failure will be investigated in parallel to the refactoring effort and
the recommit will either have a fix for it or will leave this transformation
off by default until the problem is resolved.

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

6 years ago[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF...
Michael Zuckerman [Tue, 26 Sep 2017 18:49:11 +0000 (18:49 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF{8|16|32} stride 3)

This patch expands the support of lowerInterleavedStore to {8|16|32}x8i stride 3.

LLVM creates suboptimal shuffle code-gen for AVX2. In overall, this patch is a specific fix for the pattern (Strid=3 VF={8|16|32}) .
This patch is part two of two patches and it covers the store (interlevaed) side.

The patch goal is to optimize the following sequence:
a0 a1 a2 a3 a4 a5 a6 a7
b0 b1 b2 b3 b4 b5 b6 b7
c0 c1 c2 c3 c4 c5 c6 c7

into
a0 b0 c0 a1 b1 c1 a2 b2
c2 a3 b3 c3 a4 b4 c4 a5
b5 c5 a6 b6 c6 a7 b7 c7

Reviewers:
zvi
guyblank
dorit
Ayal

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

Change-Id: I56ced8bcbea809a37654060771911ade20246ccc

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

6 years ago[InstCombine] Remove one use restriction on the shift for calls to foldICmpAndShift.
Craig Topper [Tue, 26 Sep 2017 18:47:25 +0000 (18:47 +0000)]
[InstCombine] Remove one use restriction on the shift for calls to foldICmpAndShift.

If this transformation succeeds, we're going to remove our dependency on the shift by rewriting the and. So it doesn't matter how many uses the shift has.

This distributes the one use check to other transforms in foldICmpAndConstConst that do need it.

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

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

6 years ago[WebAssembly] Use function/global index space in WasmSymbol
Sam Clegg [Tue, 26 Sep 2017 18:21:12 +0000 (18:21 +0000)]
[WebAssembly] Use function/global index space in WasmSymbol

It is useful for the symbol to contain the index of the
function of global it represents in the function/global
index space.

For imports we also store the import index so that the
linker can find, for example, the signature of the
corresponding function, which is defined by the import

In the long run we need to decide whether this API
surface should be closer to binary (where imported
functions are seperate) or the wasm spec (where the
function index space is unified).

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

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

6 years ago[llvm-objcopy] Add support for dynamic relocations
Jake Ehrlich [Tue, 26 Sep 2017 18:02:25 +0000 (18:02 +0000)]
[llvm-objcopy] Add support for dynamic relocations

This change adds support for dynamic relocations (allocated
SHT_REL/SHT_RELA sections with a dynamic symbol table as their link).

The binary I added for the test is here:
https://drive.google.com/file/d/0B3gtIAmiMwZXSjJUZE9pUjd4M0k/view?usp=sharing

Unless support for dynamic symbol tables in yaml2obj is added this is
needed.

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

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

6 years ago[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
Artem Belevich [Tue, 26 Sep 2017 17:07:23 +0000 (17:07 +0000)]
[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.

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

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

6 years ago[mips] Use llvm-dwarfdump to simplify the test. NFC
Simon Atanasyan [Tue, 26 Sep 2017 17:02:35 +0000 (17:02 +0000)]
[mips] Use llvm-dwarfdump to simplify the test. NFC

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

6 years ago[X86] Add support for v16i32 UMUL_LOHI/SMUL_LOHI
Craig Topper [Tue, 26 Sep 2017 16:43:57 +0000 (16:43 +0000)]
[X86] Add support for v16i32 UMUL_LOHI/SMUL_LOHI

Summary: This patch extends the v8i32/v4i32 custom lowering to support v16i32

Reviewers: zvi, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years ago[Hexagon] Fix a typo: #ifndef DEBUG -> #ifndef NDEBUG
Krzysztof Parzyszek [Tue, 26 Sep 2017 15:31:15 +0000 (15:31 +0000)]
[Hexagon] Fix a typo: #ifndef DEBUG -> #ifndef NDEBUG

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

6 years ago[Hexagon] Fix initialization of HexagonSubtarget
Krzysztof Parzyszek [Tue, 26 Sep 2017 15:06:37 +0000 (15:06 +0000)]
[Hexagon] Fix initialization of HexagonSubtarget

Make sure that "initializeSubtargetDependencies" sets all members that
InstrInfo and the like may depend on.

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

6 years ago[dwarfdump] Skip 'stripped' sections
Jonas Devlieghere [Tue, 26 Sep 2017 14:22:35 +0000 (14:22 +0000)]
[dwarfdump] Skip 'stripped' sections

When dsymutil generates the companion file, its strips all unnecessary
sections by omitting their body and setting the offset in their
corresponding load command to zero.

One such section is the .eh_frame section, as it contains runtime
information rather than debug information and is part of the __TEXT
segment. When reading this section, we would just read the number of
bytes specified in the load command, starting from offset 0 (i.e. the
beginning of the file).

Rather than trying to parse this obviously invalid section, dwarfdump
now skips this.

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

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

6 years ago[X86][XOP] Merge rotation opcodes with AVX512 equivalents. NFCI.
Simon Pilgrim [Tue, 26 Sep 2017 14:12:50 +0000 (14:12 +0000)]
[X86][XOP] Merge rotation opcodes with AVX512 equivalents. NFCI.

The XOP rotations act as ROTL with +ve values and ROTR with -ve values, which means that we can treat them all as ROTL with unsigned modulo. We already check that we're only trying to lower as ROTL for XOP rotations.

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

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

6 years ago[DSE] Merge stores when the later store only writes to memory locations the early...
Sanjay Patel [Tue, 26 Sep 2017 13:54:28 +0000 (13:54 +0000)]
[DSE] Merge stores when the later store only writes to memory locations the early store also wrote to (2nd try)

This is a 2nd attempt at:
https://reviews.llvm.org/rL310055
...which was reverted at rL310123 because of PR34074:
https://bugs.llvm.org/show_bug.cgi?id=34074

In this version, we break out of the inner loop after we successfully merge and kill a pair of stores. In the
earlier rev, we were continuing instead, which meant we could process the invalid info from a now dead store.

Original commit message (authored by Filipe Cabecinhas):

This fixes PR31777.

If both stores' values are ConstantInt, we merge the two stores
(shifting the smaller store appropriately) and replace the earlier (and
larger) store with an updated constant.

In the future we should also support vectors of integers. And maybe
float/double if we can.

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

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

6 years ago[x86] fix pr29061
Coby Tayree [Tue, 26 Sep 2017 13:28:05 +0000 (13:28 +0000)]
[x86] fix pr29061

https://bugs.llvm.org//show_bug.cgi?id=29061
Don't try referencing REX-needed regs when not on 64bit mode
Aligns to GCC

Differetial Revision: https://reviews.llvm.org/D37801

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

6 years agoTidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.
Simon Pilgrim [Tue, 26 Sep 2017 12:59:01 +0000 (12:59 +0000)]
Tidyup P->getComplexPatternInfo call by moving it inside if( != NULL) test. NFCI.

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

6 years agoDon't move llvm.localescape outside the entry block in the GCOV profiling pass
Sylvestre Ledru [Tue, 26 Sep 2017 11:56:43 +0000 (11:56 +0000)]
Don't move llvm.localescape outside the entry block in the GCOV profiling pass

Summary:
This fixes https://bugs.llvm.org/show_bug.cgi?id=34714.

Patch by Marco Castelluccio

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

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

6 years agoRevert "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like...
Benjamin Kramer [Tue, 26 Sep 2017 10:25:27 +0000 (10:25 +0000)]
Revert "[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST."

Makes llc crash. This reverts commit r314151.

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

6 years ago[dsymutil] Better support for symbol aliases
Jonas Devlieghere [Tue, 26 Sep 2017 08:17:28 +0000 (08:17 +0000)]
[dsymutil] Better support for symbol aliases

This patch adds logic to follow a symbol's aliases when the symbol name
cannot be found in the current object file. It checks the main binary
for the symbol's address and queries the current object for its aliases
(symbols with the same address) before printing out a warning.

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

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

6 years ago[X86] Finishing broadcastf32x2 and broadcasti32x2 intrinsics lowering to IR. llvm...
Uriel Korach [Tue, 26 Sep 2017 07:39:39 +0000 (07:39 +0000)]
[X86] Finishing broadcastf32x2 and broadcasti32x2 intrinsics lowering to IR. llvm side.

Removing X86 broadcast(f/i)32x2 intrinsics from llvm.
Adding autoUpgrade support.
Moving matching tests from avx512dq-intrinsics.ll to avx512dq-intrinsics-upgrade.ll and from avx512dqvl-intrinsics.ll to avx512dqvl-intrinsics-upgrade.ll.

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

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

6 years agoCMake: Add option to set LLVM_ENABLE_DUMP
Matthias Braun [Tue, 26 Sep 2017 02:36:58 +0000 (02:36 +0000)]
CMake: Add option to set LLVM_ENABLE_DUMP

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

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

6 years agoTargetLibraryInfo: Stop guessing wchar_t size
Matthias Braun [Tue, 26 Sep 2017 02:36:57 +0000 (02:36 +0000)]
TargetLibraryInfo: Stop guessing wchar_t size

Usually the frontend communicates the size of wchar_t via metadata and
we can optimize wcslen (and possibly other calls in the future). In
cases without the wchar_size metadata we would previously try to guess
the correct size based on the target triple; however this is fragile to
keep up to date and may miss users manually changing the size via flags.
Better be safe and stop guessing and optimizing if the frontend didn't
communicate the size.

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

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

6 years ago[AVR] Fix the build after setting alignment to 1 in r314179
Dylan McKay [Tue, 26 Sep 2017 02:07:54 +0000 (02:07 +0000)]
[AVR] Fix the build after setting alignment to 1 in r314179

Changing all types to be byte-aligned broke a small number of tests.

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

6 years ago[AVR] Prefer BasicBlock::getIterator over Function::begin()
Dylan McKay [Tue, 26 Sep 2017 01:37:53 +0000 (01:37 +0000)]
[AVR] Prefer BasicBlock::getIterator over Function::begin()

Thanks to Eli Friedman for the suggestion.

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

6 years ago[AVR] When lowering shifts into loops, put newly generated MBBs in the same
Dylan McKay [Tue, 26 Sep 2017 00:51:03 +0000 (00:51 +0000)]
[AVR] When lowering shifts into loops, put newly generated MBBs in the same
spot as the original MBB

Discovered in avr-rust/rust#62
https://github.com/avr-rust/rust/issues/62

Patch by Gergo Erdi.

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

6 years ago[AVR] Use 1-byte alignment for all data types
Dylan McKay [Tue, 26 Sep 2017 00:45:27 +0000 (00:45 +0000)]
[AVR] Use 1-byte alignment for all data types

This was an oversight in the original backend data layout.

The AVR architecture does not have the concept of unaligned loads - all
loads/stores from all addresses are aligned to one byte.

Discovered in avr-rust issue #64
https://github.com/avr-rust/rust/issues/64

Patch By Gergo Erdi.

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

6 years ago[docs] llvm-cov: Make docs for boolean options more consistent
Vedant Kumar [Mon, 25 Sep 2017 23:10:04 +0000 (23:10 +0000)]
[docs] llvm-cov: Make docs for boolean options more consistent

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

6 years ago[llvm-cov] Warn if -show-functions is used without query files
Vedant Kumar [Mon, 25 Sep 2017 23:10:03 +0000 (23:10 +0000)]
[llvm-cov] Warn if -show-functions is used without query files

llvm-cov's report mode does not print any output when -show-functions is
specified and no source files are specified. This can be surprising, so
the tool should at least print out an error message when this happens.

rdar://problem/34636859

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

6 years agoModernize comments
Adrian Prantl [Mon, 25 Sep 2017 22:51:26 +0000 (22:51 +0000)]
Modernize comments

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

6 years agoModernize comments
Adrian Prantl [Mon, 25 Sep 2017 22:51:15 +0000 (22:51 +0000)]
Modernize comments

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

6 years agoAdd section headers to SpecialCaseLists
Vlad Tsyrklevich [Mon, 25 Sep 2017 22:11:11 +0000 (22:11 +0000)]
Add section headers to SpecialCaseLists

Summary:
Sanitizer blacklist entries currently apply to all sanitizers--there
is no way to specify that an entry should only apply to a specific
sanitizer. This is important for Control Flow Integrity since there are
several different CFI modes that can be enabled at once. For maximum
security, CFI blacklist entries should be scoped to only the specific
CFI mode(s) that entry applies to.

Adding section headers to SpecialCaseLists allows users to specify more
information about list entries, like sanitizer names or other metadata,
like so:

  [section1]
  fun:*fun1*
  [section2|section3]
  fun:*fun23*

The section headers are regular expressions. For backwards compatbility,
blacklist entries entered before a section header are put into the '[*]'
section so that blacklists without sections retain the same behavior.

SpecialCaseList has been modified to also accept a section name when
matching against the blacklist. It has also been modified so the
follow-up change to clang can define a derived class that allows
matching sections by SectionMask instead of by string.

Reviewers: pcc, kcc, eugenis, vsk

Reviewed By: eugenis, vsk

Subscribers: vitalybuka, llvm-commits

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

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

6 years agoRevert r312724 ("[ARM] Remove redundant vcvt patterns.").
Eli Friedman [Mon, 25 Sep 2017 22:07:33 +0000 (22:07 +0000)]
Revert r312724 ("[ARM] Remove redundant vcvt patterns.").

It leads to some improvements, but also a regression for the simple
case, so it's not clearly a good idea.

test/CodeGen/ARM/vcvt.ll now has test coverage to show the difference.

Ultimately, the right solution is probably to custom-lower fp-to-int
conversions, to something like ARMISD::VCVT_F32_S32 plus a bitcast.
It's hard to do the right thing when the implicit bitcast isn't visible
to DAG transforms.

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

6 years ago[GlobalISel] Update the documentation and comment for G_[UN]MERGE_VALUES
Quentin Colombet [Mon, 25 Sep 2017 22:03:06 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation and comment for G_[UN]MERGE_VALUES

In r296921, we added the G_[UN]MERGE_VALUES node, but did not update the
documentation. Fixing that.

NFC.

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

6 years ago[GlobalISel] Update the documentation for G_SEQUENCE
Quentin Colombet [Mon, 25 Sep 2017 22:03:05 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation for G_SEQUENCE

This instruction has been removed in r306120.

NFC.

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

6 years ago[GlobalISel] Update the documentation and comments for G_EXTRACT
Quentin Colombet [Mon, 25 Sep 2017 22:03:01 +0000 (22:03 +0000)]
[GlobalISel] Update the documentation and comments for G_EXTRACT

In r297100, G_EXTRACT changed from a multiple results instruction to a
single result one. Update the documentation accordingly.

NFC.

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

6 years agoX86: remove R12 from CSR on Windows x64 SwiftCC
Saleem Abdulrasool [Mon, 25 Sep 2017 22:00:17 +0000 (22:00 +0000)]
X86: remove R12 from CSR on Windows x64 SwiftCC

R12 is used for the SwiftError parameter.  It is no longer a CSR as it
is used for transfer the SwiftError, and the caller must preserve it if
they need to.

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

6 years ago[ARM] Fix tests for vcvt+store to return void.
Eli Friedman [Mon, 25 Sep 2017 21:55:27 +0000 (21:55 +0000)]
[ARM] Fix tests for vcvt+store to return void.

This is what I meant to do in r314161; I didn't realize I'd messed up
because the generated assembly is currently identical.

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

6 years ago[ARM] Add tests for vcvt followed by store.
Eli Friedman [Mon, 25 Sep 2017 21:37:52 +0000 (21:37 +0000)]
[ARM] Add tests for vcvt followed by store.

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

6 years ago[ARM] Regenerate vcvt test checks.
Eli Friedman [Mon, 25 Sep 2017 21:34:29 +0000 (21:34 +0000)]
[ARM] Regenerate vcvt test checks.

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

6 years ago[InstCombine] Move an optimization from foldICmpAndConstConst to foldICmpUsingKnownBits
Craig Topper [Mon, 25 Sep 2017 21:15:00 +0000 (21:15 +0000)]
[InstCombine] Move an optimization from foldICmpAndConstConst to foldICmpUsingKnownBits

All this optimization cares about is knowing how many low bits of LHS is known to be zero and whether that means that the result is 0 or greater than the RHS constant. It doesn't matter where the zeros in the low bits came from. So we don't need to specifically look for an AND. Instead we can use known bits.

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

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

6 years ago[X86] Don't select anyext GR32->GR64 to SUBREG_TO_REG. Use INSERT_SUBREG instead.
Craig Topper [Mon, 25 Sep 2017 21:14:59 +0000 (21:14 +0000)]
[X86] Don't select anyext GR32->GR64 to SUBREG_TO_REG. Use INSERT_SUBREG instead.

As far as I know SUBREG_TO_REG is stating that the upper bits are 0. But if we are just converting the GR32 with no checks, then we have no reason to say the upper bits are 0.

I don't really know how to test this today since I can't find anything that looks that closely at SUBREG_TO_REG. The test changes here seems to be some perturbance of register allocation.

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

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

6 years ago[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX...
Craig Topper [Mon, 25 Sep 2017 21:14:55 +0000 (21:14 +0000)]
[X86] Make all the NOREX CodeGenOnly instructions into postRA pseudos like the NOREX version of TEST.

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

6 years ago[llvm-objcopy] Refactor code to include initialize method
Jake Ehrlich [Mon, 25 Sep 2017 20:37:28 +0000 (20:37 +0000)]
[llvm-objcopy] Refactor code to include initialize method

This change refactors some of the code to allow for some code
deduplication in later diffs as well as just to make adding a new
section type more self contained to the class itself. The idea for this
was first mentioned by James in D 37915 and will be used in that change
as recommended.

This change follows changes for dynamic sections but precedes support
for dynamic relocations.

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

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

6 years ago[InstCombine] remove extract-of-select vector transform (2nd try)
Sanjay Patel [Mon, 25 Sep 2017 20:30:53 +0000 (20:30 +0000)]
[InstCombine] remove extract-of-select vector transform (2nd try)

The 1st attempt at this:
https://reviews.llvm.org/rL314117
was reverted at:
https://reviews.llvm.org/rL314118

because of bot fails for clang tests that were checking optimized IR. That should be fixed with:
https://reviews.llvm.org/rL314144
...so try again.

Original commit message:

The transform to convert an extract-of-a-select-of-vectors was added at:
https://reviews.llvm.org/rL194013

And a question about the validity of this transform was raised in the review:
https://reviews.llvm.org/D1539:
...but not answered AFAICT>

Most of the motivating cases in that patch are now handled by other combines. These are the tests that were added with
the original commit, but they are not regressing even after we remove the transform in this patch.

The diffs we see after removing this transform cause us to avoid increasing the instruction count, so we don't want to do
those transforms as canonicalizations.

The motivation for not turning a vector-select-of-vectors into a scalar operation is shown in PR33301:
https://bugs.llvm.org/show_bug.cgi?id=33301
...in those cases, we'll get vector ops with this patch rather than the vector/scalar mix that we currently see.

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

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

6 years ago[Hexagon] Avoid unused variable warnings in Release builds.
Benjamin Kramer [Mon, 25 Sep 2017 19:42:20 +0000 (19:42 +0000)]
[Hexagon] Avoid unused variable warnings in Release builds.

No functionality change intended.

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

6 years agoRevert "[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins."...
Justin Lebar [Mon, 25 Sep 2017 19:41:56 +0000 (19:41 +0000)]
Revert "[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.", rL314135.

Causing assertion failures on macos:

> Assertion failed: (Num < NumOperands && "Invalid child # of SDNode!"),
> function getOperand, file
> /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm/include/llvm/CodeGen/SelectionDAGNodes.h,
> line 835.

http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42739/testReport/LLVM/CodeGen_NVPTX/surf_read_cuda_ll/

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

6 years ago[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm...
Konstantin Belochapka [Mon, 25 Sep 2017 19:26:48 +0000 (19:26 +0000)]
[X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm-syntax=intel (PR34617).
Fix for incorrect code generation when x86-asm-syntax=intel.
Differential Revision: https://reviews.llvm.org/D37945

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

6 years ago[SelectionDAG] Teach simplifyDemandedBits to handle shifts by constant splat vectors
Craig Topper [Mon, 25 Sep 2017 19:26:08 +0000 (19:26 +0000)]
[SelectionDAG] Teach simplifyDemandedBits to handle shifts by constant splat vectors

This teach simplifyDemandedBits to handle constant splat vector shifts.

This required changing some uses of getZExtValue to getLimitedValue since we can't rely on legalization using getShiftAmountTy for the shift amount.

I believe there may have been a bug in the ((X << C1) >>u ShAmt) handling where we didn't check if the inner shift was too large. I've fixed that here.

I had to add new patterns to ARM because the zext/sext the patterns were trying to look for got turned into an any_extend with this patch. Happy to split that out too, but not sure how to test without this change.

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

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

6 years ago[SLP] Add a test for PR32086, NFC.
Alexey Bataev [Mon, 25 Sep 2017 19:12:59 +0000 (19:12 +0000)]
[SLP] Add a test for PR32086, NFC.

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

6 years ago[Hexagon] Better determination of register classes in bit tracker
Krzysztof Parzyszek [Mon, 25 Sep 2017 19:12:55 +0000 (19:12 +0000)]
[Hexagon] Better determination of register classes in bit tracker

Add two callbacks to MachineEvaluator, so that specific implementations
can specify more details about register classes:
- composeWithSubRegIndex(RC,Idx), to provide the register class for a
  register from RC used in conjunction with a subregister index Idx.
- getPhysRegBitWidth(Reg), to provide the size in bits of the given
  physical register.

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

6 years ago[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.
Artem Belevich [Mon, 25 Sep 2017 18:53:57 +0000 (18:53 +0000)]
[NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.

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

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

6 years ago[Hexagon] Make getHexagonSubRegIndex take reference instead of pointer
Krzysztof Parzyszek [Mon, 25 Sep 2017 18:49:42 +0000 (18:49 +0000)]
[Hexagon] Make getHexagonSubRegIndex take reference instead of pointer

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

6 years ago[AVX-512] Replace large number of explicit patterns that check for insert_subvector...
Craig Topper [Mon, 25 Sep 2017 18:43:13 +0000 (18:43 +0000)]
[AVX-512] Replace large number of explicit patterns that check for insert_subvector with zero after masked compares with fewer patterns with predicate

This replaces the large number of patterns that handle every possible case of zeroing after a masked compare with a few simpler patterns that use a predicate to check for a masked compare producer.

This is similar to what we do for detecting free GR32->GR64 zero extends and free xmm->ymm/zmm zero extends.

This shrinks the isel table from ~590k to ~531k. This is a roughly 10% reduction in size.

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

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

6 years ago[SimplifyIndvar] Minor change to refine r314125, NFC
Hongbin Zheng [Mon, 25 Sep 2017 18:10:36 +0000 (18:10 +0000)]
[SimplifyIndvar] Minor change to refine r314125, NFC

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

6 years agoARM: One more fix for swifterror CSR set
Arnold Schwaighofer [Mon, 25 Sep 2017 17:51:33 +0000 (17:51 +0000)]
ARM: One more fix for swifterror CSR set

We use a differently ordered CSR set if the frame pointer is pushed. Add a
matching ..._SwiftError version.

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

6 years ago[SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands...
Hongbin Zheng [Mon, 25 Sep 2017 17:39:40 +0000 (17:39 +0000)]
[SimplifyIndvar] Replace the srem used by IV if we can prove both of its operands are non-negative

Since now SCEV can handle 'urem', an 'urem' is a better canonical form than an 'srem' because it has well-defined behavior

This is a follow up of D34598

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

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

6 years ago[ARM] Fix -Wdangling-else warning.
Benjamin Kramer [Mon, 25 Sep 2017 17:35:38 +0000 (17:35 +0000)]
[ARM] Fix -Wdangling-else warning.

A ternary is clearer here. No functionality change.

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

6 years agoARM: Use the proper swifterror CSR list on platforms other than darwin
Arnold Schwaighofer [Mon, 25 Sep 2017 17:19:50 +0000 (17:19 +0000)]
ARM: Use the proper swifterror CSR list on platforms other than darwin

Noticed by inspection

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

6 years agorevert r314117 because there are bogus clang tests that depend on the optimizer
Sanjay Patel [Mon, 25 Sep 2017 17:00:04 +0000 (17:00 +0000)]
revert r314117 because there are bogus clang tests that depend on the optimizer

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

6 years ago[InstCombine] remove extract-of-select vector transform
Sanjay Patel [Mon, 25 Sep 2017 16:41:34 +0000 (16:41 +0000)]
[InstCombine] remove extract-of-select vector transform

The transform to convert an extract-of-a-select-of-vectors was added at:
rL194013

And a question about the validity of this transform was raised in the review:
https://reviews.llvm.org/D1539:
...but not answered AFAICT>

Most of the motivating cases in that patch are now handled by other combines. These are the tests that were added with
the original commit, but they are not regressing even after we remove the transform in this patch.

The diffs we see after removing this transform cause us to avoid increasing the instruction count, so we don't want to do
those transforms as canonicalizations.

The motivation for not turning a vector-select-of-vectors into a scalar operation is shown in PR33301:
https://bugs.llvm.org/show_bug.cgi?id=33301
...in those cases, we'll get vector ops with this patch rather than the vector/scalar mix that we currently see.

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

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

6 years agoRemove trailing whitespaces.
Michael Liao [Mon, 25 Sep 2017 16:21:21 +0000 (16:21 +0000)]
Remove trailing whitespaces.

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

6 years ago[DebugInfo] Sort the SDDbgValue list before assuming it is in IR order
Reid Kleckner [Mon, 25 Sep 2017 16:14:53 +0000 (16:14 +0000)]
[DebugInfo] Sort the SDDbgValue list before assuming it is in IR order

Summary:
This code iterates the 'Orders' vector in parallel with the DbgValue
list, emitting all DBG_VALUEs that occurred between the last IR order
insertion point and the next insertion point. This assumes the
SDDbgValue list is sorted in IR order, which it usually is. However, it
is not sorted when a node with a debug value is replaced with another
one. When this happens, TransferDbgValues is called, and the new value
is added to the end of the list.

The problem can be solved by stably sorting the list by IR order.

Reviewers: aprantl, Ka-Ka

Reviewed By: aprantl

Subscribers: MatzeB, hiraditya, llvm-commits

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

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

6 years agoUse {} instead of make_pair and an iterator for the insertion point, NFC
Reid Kleckner [Mon, 25 Sep 2017 16:14:39 +0000 (16:14 +0000)]
Use {} instead of make_pair and an iterator for the insertion point, NFC

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

6 years ago[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF8...
Michael Zuckerman [Mon, 25 Sep 2017 14:50:38 +0000 (14:50 +0000)]
[X86][LLVM]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess (VF8 stride 4):

This patch expands the support of lowerInterleavedStore to 8x8i stride 4.

LLVM creates suboptimal shuffle code-gen for AVX2.
In overall, this patch is a specific fix for the pattern (Strid=4 VF=8) and we plan to include more patterns in the future.

The patch goal is to optimize the following sequence:
At the end of the computation, we have xmm2, xmm0, xmm12 and xmm3 holding
each 8 chars:

c0, c1, , c7
m0, m1, , m7
y0, y1, , y7
k0, k1, ., k7

And these need to be transposed/interleaved and stored like so:

c0 m0 y0 k0 c1 m1 y1 k1 c2 m2 y2 k2 c3 m3 y3 k3 ....

Reviewers
DavidKreitzer
Farhana
zvi
igorb
guyblank
RKSimon
Ayal

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

Change-Id: I3cc5c2ca5d6318901c192a4428493b99ef424c32

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

6 years ago[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLT/SETGT
Nemanja Ivanovic [Mon, 25 Sep 2017 14:05:46 +0000 (14:05 +0000)]
[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLT/SETGT

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential review.

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

6 years ago[AArch64] Add basic support for Qualcomm's Saphira CPU.
Chad Rosier [Mon, 25 Sep 2017 14:05:00 +0000 (14:05 +0000)]
[AArch64] Add basic support for Qualcomm's Saphira CPU.

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

6 years agoAdding missing feature to goldmont.
Michael Zuckerman [Mon, 25 Sep 2017 13:45:31 +0000 (13:45 +0000)]
Adding missing feature to goldmont.

Change-Id: I1ddc619169fae6a56308deef8dae5db3da702cf4

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

6 years ago[SLP] Support for horizontal min/max reduction.
Alexey Bataev [Mon, 25 Sep 2017 13:34:59 +0000 (13:34 +0000)]
[SLP] Support for horizontal min/max reduction.

Summary:
SLP vectorizer supports horizontal reductions for Add/FAdd binary operations. Patch adds support for horizontal min/max reductions.
Function getReductionCost() is split to getArithmeticReductionCost() for binary operation reductions and getMinMaxReductionCost() for min/max reductions.
Patch fixes PR26956.

Reviewers: spatel, mkuper, hfinkel, RKSimon

Subscribers: llvm-commits

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

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

6 years ago[CodeGenPrepare][NFC] Rename TargetTransformInfo::expandMemCmp -> TargetTransformInfo...
Clement Courbet [Mon, 25 Sep 2017 06:35:16 +0000 (06:35 +0000)]
[CodeGenPrepare][NFC] Rename TargetTransformInfo::expandMemCmp -> TargetTransformInfo::enableMemCmpExpansion.

Summary:
Right now there are two functions with the same name, one does the work
and the other one returns true if expansion is needed. Rename
TargetTransformInfo::expandMemCmp to make it more consistent with other
members of TargetTransformInfo.

Remove the unused Instruction* parameter.

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

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

6 years ago[X86] Make IFMA instructions during isel so we can fold broadcast loads.
Craig Topper [Sun, 24 Sep 2017 19:30:55 +0000 (19:30 +0000)]
[X86] Make IFMA instructions during isel so we can fold broadcast loads.

This required changing the ISD opcode for these instructions to have the commutable operands first and the addend last. This way tablegen can autogenerate the additional patterns for us.

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

6 years ago[X86] Add tests to show missed opportunities to fold broadcast loads into IFMA instru...
Craig Topper [Sun, 24 Sep 2017 19:30:54 +0000 (19:30 +0000)]
[X86] Add tests to show missed opportunities to fold broadcast loads into IFMA instructions when the load is on operand1 of the instrinsic.

We need to enable commuting during isel to catch this since the load folding tables can't handle broadcasts.

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

6 years ago[X86] Add IFMA instructions to the load folding tables and make them commutable for...
Craig Topper [Sun, 24 Sep 2017 17:28:14 +0000 (17:28 +0000)]
[X86] Add IFMA instructions to the load folding tables and make them commutable for the multiply operands.

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

6 years agoFix signed/unsigned warning
Simon Pilgrim [Sun, 24 Sep 2017 14:00:52 +0000 (14:00 +0000)]
Fix signed/unsigned warning

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

6 years ago[X86][SSE] Add more tests for shuffle combining with extracted vector elements (PR22415)
Simon Pilgrim [Sun, 24 Sep 2017 13:45:49 +0000 (13:45 +0000)]
[X86][SSE] Add more tests for shuffle combining with extracted vector elements (PR22415)

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

6 years ago[X86][SSE] Add support for extending bool vectors bitcasted from scalars
Simon Pilgrim [Sun, 24 Sep 2017 13:42:31 +0000 (13:42 +0000)]
[X86][SSE] Add support for extending bool vectors bitcasted from scalars

This patch acts as a reverse to combineBitcastvxi1 - bitcasting a scalar integer to a boolean vector and extending it 'in place' to the requested legal type.

Currently this doesn't handle AVX512 at all - but the current mask register approach is lacking for some cases.

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

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

6 years ago[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLE/SETGE
Nemanja Ivanovic [Sun, 24 Sep 2017 05:48:11 +0000 (05:48 +0000)]
[PowerPC] Eliminate compares - add i64 sext/zext handling for SETLE/SETGE

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential review.

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

6 years ago[AVX-512] Add pattern for selecting masked version of v8i32/v8f32 compare instruction...
Craig Topper [Sun, 24 Sep 2017 05:24:52 +0000 (05:24 +0000)]
[AVX-512] Add pattern for selecting masked version of v8i32/v8f32 compare instructions when VLX isn't available.

We use a v16i32/v16f32 compare instead and truncate the result. We already did this for the unmasked version, but were missing the version with 'and'.

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

6 years ago[X86] Make sure we still mark the full register as implicitly defined when we shrink...
Craig Topper [Sun, 24 Sep 2017 05:24:51 +0000 (05:24 +0000)]
[X86] Make sure we still mark the full register as implicitly defined when we shrink 256/512 bit zeroing xors to 128-bit.

Not sure if anything really cares, but this seems like the right thing to do.

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

6 years ago[AVR] Implement getCmpLibcallReturnType().
Dylan McKay [Sun, 24 Sep 2017 01:07:26 +0000 (01:07 +0000)]
[AVR] Implement getCmpLibcallReturnType().

This fixes the avr-rust issue (#75) with floating-point comparisons generating broken code.
By default, LLVM assumes these comparisons return 32-bit values, but ours are 8-bit.

Patch By Thomas Backman.

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

6 years ago[Verifier] Stop accepting broken DIGlobalVariable(s).
Davide Italiano [Sun, 24 Sep 2017 01:06:35 +0000 (01:06 +0000)]
[Verifier] Stop accepting broken DIGlobalVariable(s).

The code wasn't yelling at the user when there's a reference
from a DIGlobalVariableExpression. Thanks to Adrian for the
reduced testcase. Fixes PR34672.

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

6 years ago[X86] Regenerate i64 to v2f32 bitcast test
Simon Pilgrim [Sat, 23 Sep 2017 19:18:29 +0000 (19:18 +0000)]
[X86] Regenerate i64 to v2f32 bitcast test

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

6 years ago[x86] reduce 64-bit mask constant to 32-bits by right shifting
Sanjay Patel [Sat, 23 Sep 2017 14:32:07 +0000 (14:32 +0000)]
[x86] reduce 64-bit mask constant to 32-bits by right shifting

This is a follow-up from D38181 (r314023). We have to put 64-bit
constants into a register using a separate instruction, so we
should try harder to avoid that.

From what I see, we're not likely to encounter this pattern in the
DAG because the upstream setcc combines from this don't (usually?)
produce this pattern. If we fix that, then this will become more
relevant. Since the cost of handling this case is just loosening
the predicate of the existing fold, we might as well do it now.

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

6 years ago[x86] add an add+shift test for follow-up suggestion from D38181; NFC
Sanjay Patel [Sat, 23 Sep 2017 14:24:07 +0000 (14:24 +0000)]
[x86] add an add+shift test for follow-up suggestion from D38181; NFC

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

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT
Nemanja Ivanovic [Sat, 23 Sep 2017 12:53:03 +0000 (12:53 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULT/SETUGT

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

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

6 years ago[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULE/SETUGE
Nemanja Ivanovic [Sat, 23 Sep 2017 09:50:12 +0000 (09:50 +0000)]
[PowerPC] Eliminate compares - add i32 sext/zext handling for SETULE/SETUGE

As mentioned in https://reviews.llvm.org/D33718, this simply adds another
pattern to the compare elimination sequence and is committed without a
differential revision.

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

6 years ago[X86] Move the getInsertVINSERTImmediate and getExtractVEXTRACTImmediate helper funct...
Craig Topper [Sat, 23 Sep 2017 05:34:07 +0000 (05:34 +0000)]
[X86] Move the getInsertVINSERTImmediate and getExtractVEXTRACTImmediate helper functions over to X86ISelDAGToDAG.cpp

Redefine them to call getI8Imm and return that directly.

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

6 years ago[X86] Remove is the isVINSERT*Index/isVEXTRACT*Index predicates from isel.
Craig Topper [Sat, 23 Sep 2017 05:34:06 +0000 (05:34 +0000)]
[X86] Remove is the isVINSERT*Index/isVEXTRACT*Index predicates from isel.

The only insert_subvector/extract_subvector nodes that make it to isel are guaranteed to match.

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