OSDN Git Service

android-x86/external-llvm.git
5 years agoRevert "[llvm] Prevent duplicate files in debug line header in dwarf 5."
Ali Tamur [Mon, 25 Mar 2019 21:09:07 +0000 (21:09 +0000)]
Revert "[llvm] Prevent duplicate files in debug line header in dwarf 5."

This reverts commit 312ab05887d0e2caa29aaf843cefe39379a98d36.

My commit broke the build; I will revert and find out what happened.

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

5 years ago[LLVM-C] Add binding to look up intrinsic by name
Robert Widmann [Mon, 25 Mar 2019 20:58:58 +0000 (20:58 +0000)]
[LLVM-C] Add binding to look up intrinsic by name

Summary: Add a binding to Function::lookupIntrinsicID so clients don't have to go searching the ID table themselves.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Add support for cross address space synchronization scopes
Konstantin Zhuravlyov [Mon, 25 Mar 2019 20:50:21 +0000 (20:50 +0000)]
AMDGPU: Add support for cross address space synchronization scopes

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

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

5 years ago[llvm] Prevent duplicate files in debug line header in dwarf 5.
Ali Tamur [Mon, 25 Mar 2019 20:08:00 +0000 (20:08 +0000)]
[llvm] Prevent duplicate files in debug line header in dwarf 5.

Summary:

Motivation: In previous dwarf versions, file name indexes started from 1, and
the primary source file was not explicit. Dwarf 5 standard (6.2.4) prescribes
the primary source file to be explicitly given an entry with an index number 0.

The current implementation honors the specification by just duplicating the
main source file, once with index number 0, and later maybe with another
index number. While this is compliant with the letter of the standard, the
duplication causes problems for consumers of this information such as lldb.
(Some files are duplicated, where only some of them have a line table although
all refer to the same file)

With this change, dwarf 5 debug line section files always start from 0, and
the zeroth entry is not duplicated whenever possible. This requires different
handling of dwarf 4 and dwarf 5 during generation (e.g. when a function returns
an index zero for a file name, it signals an error in dwarf 4, but not in dwarf 5)
However, I think the minor complication is worth it, because it enables all
consumers (lldb, gdb, dwarfdump, objdump, and so on) to treat all files in the
file name list homogenously.

Reviewers: dblaikie, probinson, aprantl, espindola

Reviewed By: probinson

Subscribers: emaste, jvesely, nhaehnle, aprantl, javed.absar, arichardson, hiraditya, MaskRay, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

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

5 years ago[SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode
Simon Pilgrim [Mon, 25 Mar 2019 20:05:27 +0000 (20:05 +0000)]
[SLPVectorizer] Merge reorderAltShuffleOperands into reorderInputsAccordingToOpcode

As discussed on D59738, this generalizes reorderInputsAccordingToOpcode to handle multiple + non-commutative instructions so we can get rid of reorderAltShuffleOperands and make use of the extra canonicalizations that reorderInputsAccordingToOpcode brings.

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

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

5 years ago[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC
Simon Pilgrim [Mon, 25 Mar 2019 18:51:57 +0000 (18:51 +0000)]
[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC

First half of PR40800, this patch adds DAG undef handling to icmp instructions to match the behaviour in llvm::ConstantFoldCompareInstruction and SimplifyICmpInst, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).

This involved a lot of tweaking to reduced tests as bugpoint loves to reduce icmp arguments to undef........

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

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

5 years ago[CGP] Build the DominatorTree lazily
Teresa Johnson [Mon, 25 Mar 2019 18:38:48 +0000 (18:38 +0000)]
[CGP] Build the DominatorTree lazily

Summary:
In r355512 CGP was changed to build the DominatorTree only once per
function traversal, to avoid repeatedly building it each time it was
accessed. This solved one compile time issue but introduced another. In
the second case, we now were building the DT unnecessarily many times
when we performed many function traversals (i.e. more than once per
function when running CGP because of changes made each time).

Change to saving the DT in the CodeGenPrepare object, and building it
lazily when needed. It is reset whenever we need to rebuild it.

The case that exposed the issue there are 617 functions, and we walk
them (i.e. execute the "while (MadeChange)" loop in runOnFunction) a
total of 12083 times (so previously we were building the DT 12083
times). With this patch we only build the DT 844 times (average of 1.37
times per function). We dropped the total time to compile this file from
538.11s without this patch to 339.63s with it.

There is still an issue as CGP is taking much longer than all other
passes even with this patch, and before a recent compiler release cut at
r355392 the total time to this compile was only 97 sec with a huge
reduction in CGP time. I suspect that one of the other recent changes to
CGP led to iterating each function many more times on average, but I
need to do some more investigation.

Reviewers: spatel

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[x86] add another vector zext test; NFC
Sanjay Patel [Mon, 25 Mar 2019 17:53:56 +0000 (17:53 +0000)]
[x86] add another vector zext test; NFC

Goes with the proposal in D59777

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

5 years agoMoved everything SMT-related to LLVM and updated the cmake scripts.
Mikhail R. Gadelha [Mon, 25 Mar 2019 17:47:45 +0000 (17:47 +0000)]
Moved everything SMT-related to LLVM and updated the cmake scripts.

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

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

5 years agoMISched: Don't schedule regions with 0 instructions
Matt Arsenault [Mon, 25 Mar 2019 17:15:44 +0000 (17:15 +0000)]
MISched: Don't schedule regions with 0 instructions

I think this is correct, but may not necessarily be the correct fix
for the assertion I'm really trying to solve. If a scheduling region
was found that only has dbg_value instructions, the RegPressure
tracker would end up in an inconsistent state because it would skip
over any debug instructions and point to an instruction outside of the
scheduling region. It may still be possible for this to happen if
there are some real schedulable instructions between dbg_values, but I
haven't managed to break this.

The testcase is extremely sensitive and I'm not sure how to make it
more resistent to future scheduler changes that would avoid stressing
this situation.

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

5 years agomerge-request.sh: Update 8.0 metabug for 8.0.1
Tom Stellard [Mon, 25 Mar 2019 17:01:29 +0000 (17:01 +0000)]
merge-request.sh: Update 8.0 metabug for 8.0.1

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

5 years agoAMDGPU: Preserve LiveIntervals in WQM
Matt Arsenault [Mon, 25 Mar 2019 16:47:42 +0000 (16:47 +0000)]
AMDGPU: Preserve LiveIntervals in WQM

This seems to already be done, but wasn't marked.

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

5 years ago[llvm-objcopy]Preserve data in segments not covered by sections
James Henderson [Mon, 25 Mar 2019 16:36:26 +0000 (16:36 +0000)]
[llvm-objcopy]Preserve data in segments not covered by sections

llvm-objcopy previously knew nothing about data in segments that wasn't
covered by section headers, meaning that it wrote zeroes instead of what
was there. As it is possible for this data to be useful to the loader,
this patch causes llvm-objcopy to start preserving this data. Data in
sections that are explicitly removed continues to be written as zeroes.

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

Reviewed by: jakehehrlich, rupprecht

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

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

5 years ago[SLPVectorizer] Update file missed in rL356913
Simon Pilgrim [Mon, 25 Mar 2019 16:14:21 +0000 (16:14 +0000)]
[SLPVectorizer] Update file missed in rL356913

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

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

5 years ago[x86] add tests for vector zext; NFC
Sanjay Patel [Mon, 25 Mar 2019 15:54:34 +0000 (15:54 +0000)]
[x86] add tests for vector zext; NFC

The AVX1 lowering is poor.

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

5 years ago[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization
Simon Pilgrim [Mon, 25 Mar 2019 15:53:55 +0000 (15:53 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization

Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to rely on chance more than anything else and also have a tendency to fight existing instcombine canonicalization which moves constants to the RHS of commutable binary ops.

This is prep work towards:
(a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar reorderAltShuffleOperands
(b) improving reordering to optimized cases with commutable and non-commutable instructions to still find splat/consecutive ops.

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

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

5 years agoRevert 356905
Serge Guelton [Mon, 25 Mar 2019 15:18:55 +0000 (15:18 +0000)]
Revert 356905

Commited from wrong directory...

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

5 years agoPython 2/3 compat: queue vs Queue
Serge Guelton [Mon, 25 Mar 2019 15:14:15 +0000 (15:14 +0000)]
Python 2/3 compat: queue vs Queue

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

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

5 years agoMinidumpYAML.cpp: Fix some code standard violations missed during review
Pavel Labath [Mon, 25 Mar 2019 14:45:31 +0000 (14:45 +0000)]
MinidumpYAML.cpp: Fix some code standard violations missed during review

functions should begin with lower case letters. NFC.

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

5 years ago[RegAlloc] Simplify MIR test
Jonas Paulsson [Mon, 25 Mar 2019 14:28:32 +0000 (14:28 +0000)]
[RegAlloc]  Simplify MIR test

Remove the IR part from test/CodeGen/X86/regalloc-copy-hints.mir (added by
r355854).

To make the test remain functional, the parts of the MBB names referring to
BB names have been removed, as well as all machine memory operands.

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

5 years ago[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."
Brock Wyma [Mon, 25 Mar 2019 13:50:26 +0000 (13:50 +0000)]
[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."

Following r354972 the Intel JIT Listener would not report line table
information because the section indices did not match. There was
a similar issue with the PerfJitEventListener. This change performs
the section index lookup when building the object address used to
query the line table information.

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

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

5 years ago[clang-tidy] Separate the check-facing interface
Alexander Kornienko [Mon, 25 Mar 2019 12:36:30 +0000 (12:36 +0000)]
[clang-tidy] Separate the check-facing interface

Summary:
Move ClangTidyCheck to a separate header/.cpp
Switch checks to #include "ClangTidyCheck.h"
Mention ClangTidyCheck.h in the docs

Reviewers: hokein, gribozavr, aaron.ballman

Reviewed By: hokein

Subscribers: mgorny, javed.absar, xazax.hun, arphaman, jdoerfert, llvm-commits, cfe-commits

Tags: #clang, #llvm

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

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

5 years ago[llvm-objcopy] - Refactor the code. NFC.
George Rimar [Mon, 25 Mar 2019 12:34:25 +0000 (12:34 +0000)]
[llvm-objcopy] - Refactor the code. NFC.

The idea of the patch is about to move out the code to a new
helper static functions (to reduce the size of 'handleArgs' and to
isolate the parts of it's logic).

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

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

5 years ago[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Petar Avramovic [Mon, 25 Mar 2019 11:38:06 +0000 (11:38 +0000)]
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank

Move selectCopy into MipsInstructionSelector class.
Select copy for arguments from FPRBRegBank for MIPS32.

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

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

5 years agogn build: Clean up README.rst a bit
Nico Weber [Mon, 25 Mar 2019 11:33:19 +0000 (11:33 +0000)]
gn build: Clean up README.rst a bit

- Make introduction a bit shorter
- Add a `git clone` step to Quick start
- Put command to run first in each of the Quick start steps
- Use ``code`` instead of `label` throughout; this is .rst not .md

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

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

5 years agogn build: Let get.py keep zip file in memory instead of using a temp file
Nico Weber [Mon, 25 Mar 2019 11:32:27 +0000 (11:32 +0000)]
gn build: Let get.py keep zip file in memory instead of using a temp file

The zip is small, and it's a bit less code this way.
No intended behavior change.

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

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

5 years ago[MIPS GlobalISel] Add floating point register bank
Petar Avramovic [Mon, 25 Mar 2019 11:30:46 +0000 (11:30 +0000)]
[MIPS GlobalISel] Add floating point register bank

Add floating point register bank for MIPS32.
Implement getRegBankFromRegClass for float register classes.

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

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

5 years ago[MIPS GlobalISel] Lower float and double arguments in registers
Petar Avramovic [Mon, 25 Mar 2019 11:23:41 +0000 (11:23 +0000)]
[MIPS GlobalISel] Lower float and double arguments in registers

Lower float and double arguments in registers for MIPS32.
When float/double argument is passed through gpr registers
select appropriate move instruction.

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

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Mon, 25 Mar 2019 11:02:49 +0000 (11:02 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: jhenderson, rupprecht

Subscribers: ormris, dyung, RKSimon, llvm-commits

Tags: #llvm

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

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

5 years agoFix the build with GCC 4.8 after r356783
Hans Wennborg [Mon, 25 Mar 2019 09:27:42 +0000 (09:27 +0000)]
Fix the build with GCC 4.8 after r356783

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

5 years ago[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC
Sjoerd Meijer [Mon, 25 Mar 2019 08:54:47 +0000 (08:54 +0000)]
[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC

Moving this to base class TargetTransformInfoImplCRTPBase allows static_cast to
a subtarget so that calls to e.g. getMemcpyCost actually go the overridden
functions.

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

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

5 years ago[ARM GlobalISel] 64-bit memops should be aligned
Diana Picus [Mon, 25 Mar 2019 08:54:29 +0000 (08:54 +0000)]
[ARM GlobalISel] 64-bit memops should be aligned

We currently use only VLDR/VSTR for all 64-bit loads/stores, so the
memory operands must be word-aligned. Mark aligned operations as legal
and narrow non-aligned ones to 32 bits.

While we're here, also mark non-power-of-2 loads/stores as unsupported.

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

5 years ago[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include...
Craig Topper [Mon, 25 Mar 2019 07:22:18 +0000 (07:22 +0000)]
[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include a VT for a EFLAGS result.

This makes the nodes consistent with how they would be emitted from the isel
table.

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

5 years ago[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation...
Craig Topper [Mon, 25 Mar 2019 06:53:45 +0000 (06:53 +0000)]
[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation VT for the target constant.

Normally when the nodes we use here(AND32ri8 for example) are selected their
immediates are just converted from ConstantSDNode to TargetConstantSDNode
without changing VT from the original operation VT. So we should still be
emitting them with the operation VT.

Theoretically this could expose more accurate opportunities for CSE.

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

5 years ago[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI
Craig Topper [Mon, 25 Mar 2019 06:53:44 +0000 (06:53 +0000)]
[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI

We were using this to create an AND32ri8 node from a 64-bit and, but that node
normally still uses a 32-bit immediate. So we should just truncate the existing
immediate to i32. We already verified it has the same value in bits 31:7.

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

5 years ago[X86] Remove a couple unused SDNodeXForms. NFC
Craig Topper [Mon, 25 Mar 2019 06:53:43 +0000 (06:53 +0000)]
[X86] Remove a couple unused SDNodeXForms. NFC

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

5 years agoRevert r356688 "[X86] Don't avoid folding multiple use sign extended 8-bit immediate...
Craig Topper [Mon, 25 Mar 2019 01:25:32 +0000 (01:25 +0000)]
Revert r356688 "[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize."

Looking back over how the one use optimization works, I don't think this is the right way to fix this.

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

5 years ago[X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Simon Pilgrim [Sun, 24 Mar 2019 19:06:35 +0000 (19:06 +0000)]
[X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)

Enable SSE41 ZERO_EXTEND_VECTOR_INREG shuffle combines - for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern we reduce the shuffles (port5-bottleneck on Intel) at the expense of creating a zero (pxor v,v) and an extra register move - which is a good trade off as these are pretty cheap and in most cases it doesn't increase register pressure.

This also exposed a missed opportunity to use combine to ZERO_EXTEND_VECTOR_INREG with folded loads - even if we're in the float domain.

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

5 years ago[WebAssembly] Rename a variable in CFGSort (NFC)
Heejin Ahn [Sun, 24 Mar 2019 17:34:40 +0000 (17:34 +0000)]
[WebAssembly] Rename a variable in CFGSort (NFC)

Class `RegionInfo` was `SortUnitInfo` before, so the variables were
named `SUI`. Now the class name is `RegionInfo`, so this renames `SUI`
to `RI`, matching the class name.

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

5 years ago[LegalizeDAG] Expand i16 bswap directly to a rotate by 8 instead of relying on DAG...
Craig Topper [Sun, 24 Mar 2019 17:02:14 +0000 (17:02 +0000)]
[LegalizeDAG] Expand i16 bswap directly to a rotate by 8 instead of relying on DAG combine.

An i16 bswap can be implemented with an i16 rotate by 8. We previously emitted
a shift and OR sequence that DAG combine should be able to turn back into
rotate. But we might as well go there directly. If rotate isn't legal,
LegalizeDAG should further legalize it to either the opposite rotate, or the
shift and OR pattern.

I don't know of any way to get the existing DAG combine reliance to fail. So
I don't know any way to add new tests for this that wouldn't have worked
previously.

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

5 years ago[X86] Remove icmp undef from reduced tests
Simon Pilgrim [Sun, 24 Mar 2019 17:02:08 +0000 (17:02 +0000)]
[X86] Remove icmp undef from reduced tests

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @spatel (Sanjay Patel)

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

5 years ago[X86][AVX] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Simon Pilgrim [Sun, 24 Mar 2019 16:30:35 +0000 (16:30 +0000)]
[X86][AVX] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)

Just enable this for AVX for now as SSE41 introduces extra register moves for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern (but otherwise helps reduce port5 usage on Intel targets).

Only AVX support is required for PR40685 as the issue is due to 8i8->8i32 zext shuffle leftovers.

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

5 years ago[CGP] Make several static functions member functions (NFC)
Teresa Johnson [Sun, 24 Mar 2019 15:18:50 +0000 (15:18 +0000)]
[CGP] Make several static functions member functions (NFC)

This is extracted from D59696 as suggested in the review. It is
preparation for making the DominatorTree a member variable.

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

5 years agoRecommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSectio...
George Rimar [Sun, 24 Mar 2019 14:41:45 +0000 (14:41 +0000)]
Recommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."

Fix: r356853 + set AddressAlign to 4 in
Inputs/compress-debug-sections.yaml for the new group section introduced.

Original commit message:

Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.

The patch does that.

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

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

5 years ago[x86] improve the default expansion of uaddsat/usubsat
Sanjay Patel [Sun, 24 Mar 2019 13:55:54 +0000 (13:55 +0000)]
[x86] improve the default expansion of uaddsat/usubsat

This is yet another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613

uaddsat X, Y --> (X >u (X + Y)) ? -1 : X + Y
usubsat X, Y --> (X >u Y) ? X - Y : 0

We can't count on a sane vector ISA, so override the default (umin/umax)
expansion of unsigned add/sub saturate in cases where we do not have umin/umax.

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

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

5 years ago[SLPVectorizer] shouldReorderOperands - just check for reordering. NFCI.
Simon Pilgrim [Sun, 24 Mar 2019 13:36:32 +0000 (13:36 +0000)]
[SLPVectorizer] shouldReorderOperands - just check for reordering. NFCI.

Remove the I.getOperand() calls from inside shouldReorderOperands - reorderInputsAccordingToOpcode should handle the creation of the operand lists and shouldReorderOperands should just check to see whether the i'th element should be commuted.

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

5 years ago[llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.
George Rimar [Sun, 24 Mar 2019 13:31:08 +0000 (13:31 +0000)]
[llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.

This patch fixes the reason of ubsan failure (UB detected)
happened after landing the D59638 (I had to revert it).
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760/steps/check-llvm%20ubsan/logs/stdio)

Problem is the following. Our implementation of GroupSection assumes that
its address is 4 bytes aligned when writes it:

template <class ELFT>
void ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) {
  ELF::Elf32_Word *Buf =
      reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset);
...

But the test case for D59638 did not set AddressAlign in YAML. So address was
not 4 bytes aligned since Sec.Offset was odd. That triggered the issue.

This patch teaches llvm-objcopy to report an error for such sections (which should
not met in reality), what is better than having UB.

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

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

5 years ago[ConstantRange] Add getFull() + getEmpty() named constructors; NFC
Nikita Popov [Sun, 24 Mar 2019 09:34:40 +0000 (09:34 +0000)]
[ConstantRange] Add getFull() + getEmpty() named constructors; NFC

This adds ConstantRange::getFull(BitWidth) and
ConstantRange::getEmpty(BitWidth) named constructors as more readable
alternatives to the current ConstantRange(BitWidth, /* full */ false)
and similar. Additionally private getFull() and getEmpty() member
functions are added which return a full/empty range with the same bit
width -- these are commonly needed inside ConstantRange.cpp.

The IsFullSet argument in the ConstantRange(BitWidth, IsFullSet)
constructor is now mandatory for the few usages that still make use of it.

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

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

5 years agogn build: Merge r356820
Nico Weber [Sat, 23 Mar 2019 23:22:45 +0000 (23:22 +0000)]
gn build: Merge r356820

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

5 years agogn build: Add build files for modularize and pp-trace
Nico Weber [Sat, 23 Mar 2019 23:16:41 +0000 (23:16 +0000)]
gn build: Add build files for modularize and pp-trace

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

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

5 years agoFix unused variable warning on non-asserts builds. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 16:56:23 +0000 (16:56 +0000)]
Fix unused variable warning on non-asserts builds. NFCI.

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

5 years agoRemove unused function argument. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 16:20:34 +0000 (16:20 +0000)]
Remove unused function argument. NFCI.

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

5 years ago[DWARF] Delete a stray break and a stray comment. NFC
Fangrui Song [Sat, 23 Mar 2019 16:15:40 +0000 (16:15 +0000)]
[DWARF] Delete a stray break and a stray comment. NFC

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

5 years ago[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.
Simon Pilgrim [Sat, 23 Mar 2019 16:14:04 +0000 (16:14 +0000)]
[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.

If either the main/alt opcodes isn't commutable we may end up with the splats not correctly commuted to the same side.

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

5 years ago[x86] reduce code duplication; NFC
Sanjay Patel [Sat, 23 Mar 2019 15:00:52 +0000 (15:00 +0000)]
[x86] reduce code duplication; NFC

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

5 years ago[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 13:44:06 +0000 (13:44 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - use InstructionState directly. NFCI.

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

5 years ago[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC
Nikita Popov [Sat, 23 Mar 2019 12:48:54 +0000 (12:48 +0000)]
[LowerSwitch] Use ConstantRange::fromKnownBits(); NFC

Using an unsigned range to stay NFC, but a signed range would really
be more useful here.

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

5 years ago[SLPVectorizer] Don't repeat VL.size() call. NFCI.
Simon Pilgrim [Sat, 23 Mar 2019 12:11:25 +0000 (12:11 +0000)]
[SLPVectorizer] Don't repeat VL.size() call. NFCI.

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

5 years ago [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"
Alexey Lapshin [Sat, 23 Mar 2019 08:08:40 +0000 (08:08 +0000)]
  [DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

  [Symbolizer] Add getModuleSectionIndexForAddress() helper routine

  The https://reviews.llvm.org/D58194 patch changed symbolizer interface.
  Particularily it requires not only Address but SectionIndex also.
  Note object::SectionedAddress parameter:

  Expected<DILineInfo> symbolizeCode(const std::string &ModuleName,
                                   object::SectionedAddress ModuleOffset,
                                   StringRef DWPName = "");

  There are callers of symbolizer which do not know particular section index.
  That patch creates getModuleSectionIndexForAddress() routine which
  will detect section index for the specified address. Thus if caller
  set ModuleOffset.SectionIndex into object::SectionedAddress::UndefSection
  state then symbolizer would detect section index using
  getModuleSectionIndexForAddress routine.

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

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:31:23 +0000 (02:31 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years ago[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn
Vitaly Buka [Sat, 23 Mar 2019 02:20:48 +0000 (02:20 +0000)]
[gn] Add clang-tools-extra/clang-tidy/tool/BUILD.gn

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

5 years agoDisable MachO TBD write tests for Windows.
Juergen Ributzka [Sat, 23 Mar 2019 00:03:23 +0000 (00:03 +0000)]
Disable MachO TBD write tests for Windows.

The tests are failing on the windows bots. I am disabling them for now.
This is a followup to r356820.

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

5 years ago[Legacy][TimePasses] allow -time-passes reporting into a custom stream
Fedor Sergeev [Fri, 22 Mar 2019 23:11:08 +0000 (23:11 +0000)]
[Legacy][TimePasses] allow -time-passes reporting into a custom stream

As a followup to newpm -time-passes fix (D59366), now adding a similar
functionality to legacy time-passes.

Enhancing llvm::reportAndResetTimings to accept an optional stream
for reporting output. By default it still reports into the stream created
by CreateInfoOutputFile (-info-output-file).

Also fixing to actually reset after printing as declared.

Reviewed By: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D59416

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

5 years agoFollowup for r356820 to fix the bots.
Juergen Ributzka [Fri, 22 Mar 2019 23:10:51 +0000 (23:10 +0000)]
Followup for r356820 to fix the bots.

Try using a move constructor instead.

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

5 years ago[TextAPI] TBD Reader/Writer
Juergen Ributzka [Fri, 22 Mar 2019 22:46:52 +0000 (22:46 +0000)]
[TextAPI] TBD Reader/Writer

Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

Update: This contains changes to fix issues discovered by the bots:
 - add parentheses to silence warnings.
 - rename variables
 - use PlatformType from BinaryFormat
 - Trying if switching from a vector to an array will appeas the bots.
 - Replace the tuple with a struct to work around an explicit constructor bug.
 - This fixes an issue where we were leaking the YAML document if there was a
   parsing error.

Updated the license information in all files.

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

5 years ago[SLP] Remove redundancy of performing operand reordering twice: once in buildTree...
Simon Pilgrim [Fri, 22 Mar 2019 21:27:11 +0000 (21:27 +0000)]
[SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

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

5 years ago[pdb] Add -type-stats and sort stats by descending size
Reid Kleckner [Fri, 22 Mar 2019 21:22:13 +0000 (21:22 +0000)]
[pdb] Add -type-stats and sort stats by descending size

Summary:
It prints this on chromium browser_tests.exe.pdb:

  Types
           Total: 5647475 entries ( 371,897,512 bytes,   65.85 avg)
  --------------------------------------------------------------------------
        LF_CLASS:  397894 entries ( 119,537,780 bytes,  300.43 avg)
    LF_STRUCTURE:  236351 entries (  83,208,084 bytes,  352.05 avg)
    LF_FIELDLIST:  291003 entries (  66,087,920 bytes,  227.10 avg)
    LF_MFUNCTION: 1884176 entries (  52,756,928 bytes,   28.00 avg)
      LF_POINTER: 1149030 entries (  13,877,344 bytes,   12.08 avg)
      LF_ARGLIST:  789980 entries (  12,436,752 bytes,   15.74 avg)
   LF_METHODLIST:  361498 entries (   8,351,008 bytes,   23.10 avg)
         LF_ENUM:   16069 entries (   6,108,340 bytes,  380.13 avg)
    LF_PROCEDURE:  269374 entries (   4,309,984 bytes,   16.00 avg)
     LF_MODIFIER:  235602 entries (   2,827,224 bytes,   12.00 avg)
        LF_UNION:    9131 entries (   2,072,168 bytes,  226.94 avg)
      LF_VFTABLE:     323 entries (     207,784 bytes,  643.29 avg)
        LF_ARRAY:    6639 entries (     106,380 bytes,   16.02 avg)
      LF_VTSHAPE:     126 entries (       6,472 bytes,   51.37 avg)
     LF_BITFIELD:     278 entries (       3,336 bytes,   12.00 avg)
        LF_LABEL:       1 entries (           8 bytes,    8.00 avg)

The PDB is overall 1.9GB, so the LF_CLASS and LF_STRUCTURE declarations
account for about 10% of the overall file size. I was surprised to find
that on average LF_FIELDLIST records are short. Maybe this is because
there are many more types with short member lists than there are
instantiations with lots of members, like std::vector.

Reviewers: aganea, zturner

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU...
Douglas Yung [Fri, 22 Mar 2019 21:07:57 +0000 (21:07 +0000)]
Revert "[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`"

This reverts commit 94a0cffe250c1cd6b8fea5607be502cadf617bdc (r356764).

This change was originally committed in r356764, but then partially
reverted in r356777 due to "bad changes". This caused test failures
because the test changes committed along with the original change
were not reverted, so this change reverts the rest of the changes.

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

5 years ago[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range...
Simon Pilgrim [Fri, 22 Mar 2019 20:53:49 +0000 (20:53 +0000)]
[TargetLowering] SimplifyDemandedBits trunc(srl(x, C1)) - early out for out of range C1. NFCI.

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

5 years ago[ARM] Don't form "ands" when it isn't scheduled correctly.
Eli Friedman [Fri, 22 Mar 2019 20:49:15 +0000 (20:49 +0000)]
[ARM] Don't form "ands" when it isn't scheduled correctly.

In r322972/r323136, the iteration here was changed to catch cases at the
beginning of a basic block... but we accidentally deleted an important
safety check.  Restore that check to the way it was.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41116

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

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

5 years ago[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible...
Craig Topper [Fri, 22 Mar 2019 20:47:02 +0000 (20:47 +0000)]
[X86] Use xmm registers to implement 64-bit popcnt on 32-bit targets if possible if popcnt instruction is not available

On 32-bit targets without popcnt, we currently expand 64-bit popcnt to sequences of arithmetic and logic ops for each 32-bit half and then add the 32 bit halves together. If we have xmm registers we can use use those to implement the operation instead. This results in less instructions then doing two separate 32-bit popcnt sequences.

This mitigates some of PR41151 for the i64 on i686 case when we have SSE2.

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

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

5 years ago[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable
Craig Topper [Fri, 22 Mar 2019 20:46:56 +0000 (20:46 +0000)]
[X86] Use movq for i64 atomic load on 32-bit targets when sse2 is enable

We used a lock cmpxchg8b to do i64 atomic loads. But if we have SSE2 we can do better and use a plain movq to do the load instead.

I tried to just use an f64 atomic load and add isel patterns to MOVSD(which the domain fixing pass can turn to MOVQ), but the atomic_load SDNode in TargetSelectionDAG.td requires the type to be integer.

So I've emitted VZEXT_LOAD instead which should be selected by isel to a MOVQ. Hopefully we don't need a specific atomic flavor of this. I kept the memory operand from the original AtomicSDNode. I wasn't sure if I might need to set the MOVolatile flag?

I've left some FIXMEs for improvements we can do without SSE2.

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

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

5 years agoFix non-determinism in Reassociate caused by address coincidences
Daniel Sanders [Fri, 22 Mar 2019 20:16:35 +0000 (20:16 +0000)]
Fix non-determinism in Reassociate caused by address coincidences

Summary:
Between building the pair map and querying it there are a few places that
erase and create Values. It's rare but the address of these newly created
Values is occasionally the same as a just-erased Value that we already
have in the pair map. These coincidences should be accounted for to avoid
non-determinism.

Thanks to Roman Tereshin for the test case.

Reviewers: rtereshin, bogner

Reviewed By: rtereshin

Subscribers: mgrang, llvm-commits

Tags: #llvm

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

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

5 years ago[KnownBits] Add const to some methods. NFC
Bjorn Pettersson [Fri, 22 Mar 2019 19:36:51 +0000 (19:36 +0000)]
[KnownBits] Add const to some methods. NFC

Add "const" to the trunc, zext, sext and zextOrTrunc
methods to make it clear that they aren't updating
the object itself.

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

5 years ago[AArch64, ARM] Add support for Exynos M5
Evandro Menezes [Fri, 22 Mar 2019 18:42:14 +0000 (18:42 +0000)]
[AArch64, ARM] Add support for Exynos M5

Add Exynos M5 support and test cases.

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

5 years ago[ARM] [NFC] Use tGPR in patterns where appropriate.
Eli Friedman [Fri, 22 Mar 2019 18:37:26 +0000 (18:37 +0000)]
[ARM] [NFC] Use tGPR in patterns where appropriate.

This doesn't have any practical effect at the moment, as far as I know,
because high registers aren't allocatable in Thumb1 mode. But it might
matter in the future.

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

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

5 years ago[SLP] fix variables names in test; NFC
Sanjay Patel [Fri, 22 Mar 2019 18:33:11 +0000 (18:33 +0000)]
[SLP] fix variables names in test; NFC

'tmpXXX' conflicts with the auto-generated script regex names.
That could cause mask a bug or fail if the output changes.

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

5 years agoIR: Support parsing numeric block ids, and emit them in textual output.
James Y Knight [Fri, 22 Mar 2019 18:27:13 +0000 (18:27 +0000)]
IR: Support parsing numeric block ids, and emit them in textual output.

Just as as llvm IR supports explicitly specifying numeric value ids
for instructions, and emits them by default in textual output, now do
the same for blocks.

This is a slightly incompatible change in the textual IR format.

Previously, llvm would parse numeric labels as string names. E.g.
  define void @f() {
    br label %"55"
  55:
    ret void
  }
defined a label *named* "55", even without needing to be quoted, while
the reference required quoting. Now, if you intend a block label which
looks like a value number to be a name, you must quote it in the
definition too (e.g. `"55":`).

Previously, llvm would print nameless blocks only as a comment, and
would omit it if there was no predecessor. This could cause confusion
for readers of the IR, just as unnamed instructions did prior to the
addition of "%5 = " syntax, back in 2008 (PR2480).

Now, it will always print a label for an unnamed block, with the
exception of the entry block. (IMO it may be better to print it for
the entry-block as well. However, that requires updating many more
tests.)

Thus, the following is supported, and is the canonical printing:
  define i32 @f(i32, i32) {
    %3 = add i32 %0, %1
    br label %4

  4:
    ret i32 %3
  }

New test cases covering this behavior are added, and other tests
updated as required.

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

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

5 years ago[X86] Regenerate powi tests to include i686 x87/sse targets
Simon Pilgrim [Fri, 22 Mar 2019 18:04:28 +0000 (18:04 +0000)]
[X86] Regenerate powi tests to include i686 x87/sse targets

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

5 years ago[X86] Add PR13897 test case (i128 mul on i686)
Simon Pilgrim [Fri, 22 Mar 2019 17:52:21 +0000 (17:52 +0000)]
[X86] Add PR13897 test case (i128 mul on i686)

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

5 years ago[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()
Nikita Popov [Fri, 22 Mar 2019 17:51:40 +0000 (17:51 +0000)]
[ValueTracking] Avoid redundant known bits calculation in computeOverflowForSignedAdd()

We're already computing the known bits of the operands here. If the
known bits of the operands can determine the sign bit of the result,
we'll already catch this in signedAddMayOverflow(). The only other
way (and as the comment already indicates) we'll get new information
from computing known bits on the whole add, is if there's an assumption
on it.

As such, we change the code to only compute known bits from assumptions,
instead of computing full known bits on the add (which would unnecessarily
recompute the known bits of the operands as well).

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

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

5 years ago[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)
Simon Pilgrim [Fri, 22 Mar 2019 17:23:55 +0000 (17:23 +0000)]
[X86] lowerShuffleAsBitMask - ensure float bit masks are the correct width (PR41203)

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

5 years ago[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.
Alina Sbirlea [Fri, 22 Mar 2019 17:22:19 +0000 (17:22 +0000)]
[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.

Summary:
Adding contained caching to AliasAnalysis. BasicAA is currently the only one using it.

AA changes:
- This patch is pulling the caches from BasicAAResults to AAResults, meaning the getModRefInfo call benefits from the IsCapturedCache as well when in "batch mode".
- All AAResultBase implementations add the QueryInfo member to all APIs. AAResults APIs maintain wrapper APIs such that all alias()/getModRefInfo call sites are unchanged.
- AA now provides a BatchAAResults type as a wrapper to AAResults. It keeps the AAResults instance and a QueryInfo instantiated to batch mode. It delegates all work to the AAResults instance with the batched QueryInfo. More API wrappers may be needed in BatchAAResults; only the minimum needed is currently added.

MemorySSA changes:
- All walkers are now templated on the AA used (AliasAnalysis=AAResults or BatchAAResults).
- At build time, we optimize uses; now we create a local walker (lives only as long as OptimizeUses does) using BatchAAResults.
- All Walkers have an internal AA and only use that now, never the AA in MemorySSA. The Walkers receive the AA they will use when built.

- The walker we use for queries after the build is instantiated on AliasAnalysis and is built after building MemorySSA and setting AA.
- All static methods doing walking are now templated on AliasAnalysisType if they are used both during build and after. If used only during build, the method now only takes a BatchAAResults. If used only after build, the method now takes an AliasAnalysis.

Subscribers: sanjoy, arsenm, jvesely, nhaehnle, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

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

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

5 years ago[Tests] Add masked.gather tests for non-constant masks + speculation possibilities
Philip Reames [Fri, 22 Mar 2019 16:39:04 +0000 (16:39 +0000)]
[Tests] Add masked.gather tests for non-constant masks + speculation possibilities

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

5 years ago[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.
Bixia Zheng [Fri, 22 Mar 2019 16:37:37 +0000 (16:37 +0000)]
[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.

Summary:
In C++, the behavior of casting a double value that is beyond the range
of a single precision floating-point to a float value is undefined. This
change replaces such a cast with APFloat::convert to convert the value,
which is consistent with how we convert a double value to a half value.

Reviewers: sanjoy

Subscribers: lebedev.ri, sanjoy, jlebar, llvm-commits

Tags: #llvm

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

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

5 years agoMake clang-move use same file naming convention as other tools
Nico Weber [Fri, 22 Mar 2019 16:34:39 +0000 (16:34 +0000)]
Make clang-move use same file naming convention as other tools

In all the other clang-foo tools, the main library file is called
Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp.
Do this for clang-move too.

No intended behavior change.

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

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

5 years ago[tests] Add a generic masked.gather test to show sometimes we can't transform
Philip Reames [Fri, 22 Mar 2019 16:30:56 +0000 (16:30 +0000)]
[tests] Add a generic masked.gather test to show sometimes we can't transform

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

5 years ago[tests] Add tests for converting masked.load to load speculatively
Philip Reames [Fri, 22 Mar 2019 16:26:57 +0000 (16:26 +0000)]
[tests] Add tests for converting masked.load to load speculatively

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

5 years ago[llvm-readobj] Revert bad changes
Xing GUO [Fri, 22 Mar 2019 16:20:54 +0000 (16:20 +0000)]
[llvm-readobj] Revert bad changes

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

5 years ago[Tests] Use valid alignment in masked.gather tests
Philip Reames [Fri, 22 Mar 2019 16:20:24 +0000 (16:20 +0000)]
[Tests] Use valid alignment in masked.gather tests

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

5 years agogn build: Merge r356750
Nico Weber [Fri, 22 Mar 2019 16:00:16 +0000 (16:00 +0000)]
gn build: Merge r356750

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

5 years agogn build: Merge r356570
Nico Weber [Fri, 22 Mar 2019 15:58:33 +0000 (15:58 +0000)]
gn build: Merge r356570

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

5 years agogn build: Merge r356662
Nico Weber [Fri, 22 Mar 2019 15:56:33 +0000 (15:56 +0000)]
gn build: Merge r356662

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

5 years agogn build: Merge r356692
Nico Weber [Fri, 22 Mar 2019 15:54:29 +0000 (15:54 +0000)]
gn build: Merge r356692

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

5 years agoInstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics
Tim Renouf [Fri, 22 Mar 2019 15:53:50 +0000 (15:53 +0000)]
InstCombineSimplifyDemanded: Allow v3 results for AMDGCN buffer and image intrinsics

This helps to avoid the situation where RA spots that only 3 of the
v4f32 result of a load are used, and immediately reallocates the 4th
register for something else, requiring a stall waiting for the load.

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

Change-Id: I947661edfd5715f62361a02b100f14aeeada29aa

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

5 years agogn build: Merge r356753
Nico Weber [Fri, 22 Mar 2019 15:50:24 +0000 (15:50 +0000)]
gn build: Merge r356753

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

5 years agogn build: Merge r356652 (and follow-up r56655)
Nico Weber [Fri, 22 Mar 2019 15:48:11 +0000 (15:48 +0000)]
gn build: Merge r356652 (and follow-up r56655)

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

5 years agogn build: Merge r356729
Nico Weber [Fri, 22 Mar 2019 15:43:06 +0000 (15:43 +0000)]
gn build: Merge r356729

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

5 years ago[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Xing GUO [Fri, 22 Mar 2019 15:42:13 +0000 (15:42 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`

Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.

Reviewers: grimar, jhenderson, mattd, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[x86] auto-generate complete test checks; NFC
Sanjay Patel [Fri, 22 Mar 2019 15:33:59 +0000 (15:33 +0000)]
[x86] auto-generate complete test checks; NFC

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