OSDN Git Service

android-x86/external-llvm.git
6 years agomir-canon: First commit.
Puyan Lotfi [Thu, 2 Nov 2017 23:37:32 +0000 (23:37 +0000)]
mir-canon: First commit.

mir-canon (MIRCanonicalizerPass) is a pass designed to reorder instructions and
rename operands so that two similar programs will diff more cleanly after being
run through mir-canon than they would otherwise. This project is still a work
in progress and there are ideas still being discussed for improving diff
quality.

M    include/llvm/InitializePasses.h
M    lib/CodeGen/CMakeLists.txt
M    lib/CodeGen/CodeGen.cpp
A    lib/CodeGen/MIRCanonicalizerPass.cpp

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

6 years ago[llvm-objcopy] Fix bug in how segment alignment was being handled
Jake Ehrlich [Thu, 2 Nov 2017 23:24:04 +0000 (23:24 +0000)]
[llvm-objcopy] Fix bug in how segment alignment was being handled

Just aligning segment offsets to segment alignment is incorrect and also
wastes more space than is needed. The requirement is that p_offset ==
p_addr modulo p_align *not* that p_offset == 0 modulo p_align. Generally
speaking we've been using p_addr == 0 modulo p_align. In fact yaml2obj
can't even produce a valid situation which causes llvm-objcopy to
produce incorrect results because alignment and offset were both
inherited from the sections the program header covers. This change fixes
this bad behavior in llvm-objcopy.

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

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

6 years ago[X86] Give AVX512VL instructions priority over their AVX equivalents.
Craig Topper [Thu, 2 Nov 2017 23:23:37 +0000 (23:23 +0000)]
[X86] Give AVX512VL instructions priority over their AVX equivalents.

I thought we had gotten all these priority bugs worked out, but I guess not.

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

6 years agoIndVarSimplify: preserve debug information attached to widened PHI nodes.
Adrian Prantl [Thu, 2 Nov 2017 23:17:06 +0000 (23:17 +0000)]
IndVarSimplify: preserve debug information attached to widened PHI nodes.

This fixes PR35015.

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

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

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

6 years agoAdd feature to determine if host architecture is 64-bit in llvm-lit
Jake Ehrlich [Thu, 2 Nov 2017 23:14:55 +0000 (23:14 +0000)]
Add feature to determine if host architecture is 64-bit in llvm-lit

I have a test that I'd like to add to llvm that demands using more than
32-bits worth of address space. This test can't be run on 32-bit systems
because they don't have enough address space. The host triple should be
used to determine this instead of config.host_arch because on Debian
systems config.host_arch is not correct. This change adds the
"host-arch-is-64bit" feature to allow tests to restrict themselves to
the 64-bit case.

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

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

6 years agoAMDGPU: Fix warning discovered by r317266 [-Wunused-private-field]
Konstantin Zhuravlyov [Thu, 2 Nov 2017 22:35:22 +0000 (22:35 +0000)]
AMDGPU: Fix warning discovered by r317266 [-Wunused-private-field]

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

6 years agoIrreducible loop metadata for more accurate block frequency under PGO.
Hiroshi Yamauchi [Thu, 2 Nov 2017 22:26:51 +0000 (22:26 +0000)]
Irreducible loop metadata for more accurate block frequency under PGO.

Summary:
Currently the block frequency analysis is an approximation for irreducible
loops.

The new irreducible loop metadata is used to annotate the irreducible loop
headers with their header weights based on the PGO profile (currently this is
approximated to be evenly weighted) and to help improve the accuracy of the
block frequency analysis for irreducible loops.

This patch is a basic support for this.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: mehdi_amini, llvm-commits, eraman

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

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

6 years ago[Hexagon] Prefer L2_loadrub_io over L4_loadrub_rr
Krzysztof Parzyszek [Thu, 2 Nov 2017 21:56:59 +0000 (21:56 +0000)]
[Hexagon] Prefer L2_loadrub_io over L4_loadrub_rr

If the offset is an immediate, avoid putting it in a register
to get Rs+Rt<<#0.

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

6 years ago[tools] Add option to install binutils symlinks
Shoaib Meenai [Thu, 2 Nov 2017 21:43:32 +0000 (21:43 +0000)]
[tools] Add option to install binutils symlinks

The LLVM tools can be used as a replacement for binutils, in which case
it's convenient to create symlinks with the binutils names. Add support
for these symlinks in the build system. As with any other llvm tool
symlinks, the user can limit the installed symlinks by only adding the
desired ones to `LLVM_TOOLCHAIN_TOOLS`.

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

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

6 years agoClean up comments in include/llvm-c/DebugInfo.h
Adrian Prantl [Thu, 2 Nov 2017 21:35:37 +0000 (21:35 +0000)]
Clean up comments in include/llvm-c/DebugInfo.h

Patch by Harlan Haskins!

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

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

6 years ago[LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck
Anna Thomas [Thu, 2 Nov 2017 21:21:02 +0000 (21:21 +0000)]
[LoopPredication] Enable predication when latchCheckIV is wider than rangeCheck

Summary:
This patch allows us to predicate range checks that have a type narrower than
the latch check type. We leverage SCEV analysis to identify a truncate for the
latchLimit and latchStart.
There is also safety checks in place which requires the start and limit to be
known at compile time. We require this to make sure that the SCEV truncate expr
for the IV corresponding to the latch does not cause us to lose information
about the IV range.
Added tests show the loop predication over range checks that are of various
types and are narrower than the latch type.
This enhancement has been in our downstream tree for a while.

Reviewers: apilipenko, sanjoy, mkazantsev

Subscribers: llvm-commits

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

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

6 years agoAdd missing header guards.
Adrian Prantl [Thu, 2 Nov 2017 20:58:58 +0000 (20:58 +0000)]
Add missing header guards.

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

6 years agoAMDGPU: Remove outdated fixme (it was already fixed)
Konstantin Zhuravlyov [Thu, 2 Nov 2017 20:48:06 +0000 (20:48 +0000)]
AMDGPU: Remove outdated fixme (it was already fixed)

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

6 years ago[cmake] Remove policy conditionals
Shoaib Meenai [Thu, 2 Nov 2017 20:33:36 +0000 (20:33 +0000)]
[cmake] Remove policy conditionals

LLVM now requires a minimum of cmake 3.4.3, and all the policies
currently being set are present in that cmake version, so the
conditionals will always be true and are therefore unnecessary. The
movation is that the conditionals can give the false impression that the
policy settings are optional, whereas for example it's necessary to set
CMP0056 in order for `check_linker_flags` to operate correctly after
r316972. Inline the project version and language setting in the process.

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

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

6 years agoFix llvm-dsymutil test in -DLLVM_ENABLE_THREADS=OFF mode
Hans Wennborg [Thu, 2 Nov 2017 20:22:03 +0000 (20:22 +0000)]
Fix llvm-dsymutil test in -DLLVM_ENABLE_THREADS=OFF mode

After r316999, tools/dsymutil/X86/alias.test started failing in builds
that have threading disabled.

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

6 years ago[test] Move llvm-lib tests into tools/llvm-lib. NFC.
Martin Storsjo [Thu, 2 Nov 2017 20:05:20 +0000 (20:05 +0000)]
[test] Move llvm-lib tests into tools/llvm-lib. NFC.

Similarly to SVN r317189 for llvm-dlltool, these are probably
easier to find in a tools subdirectory with a name identical to
the tool, than in a toplevel directory with a different name.

This matches the move of LibDriver itself in SVN r302995.

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

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

6 years ago[X86] Simplify the pentium4 code in getHostCPUName to be based on feature flags....
Craig Topper [Thu, 2 Nov 2017 19:13:34 +0000 (19:13 +0000)]
[X86] Simplify the pentium4 code in getHostCPUName to be based on feature flags. Don't use 'x86-64' ever.

'x86-64' has started to reflect a sort of generic tuning flag for more modern 64-bit CPUs. We probably shouldn't be using it as the name of an unidentifiable pentium4. So use nocona for all 64-bit pentium4s instead.

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

6 years ago[X86] Change getHostCPUName fallback code to not select 'x86-64' for unknown CPUs...
Craig Topper [Thu, 2 Nov 2017 19:13:32 +0000 (19:13 +0000)]
[X86] Change getHostCPUName fallback code to not select 'x86-64' for unknown CPUs in family 6 that has 64-bit support but not any newer SSE features. Use 'core2' instead

We know that's the earliest CPU with 64-bit support. x86-64 has taken on a role of representing a more modern 64-bit CPU so we probably shouldn't be using that when we can't identify things.

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

6 years ago[dsymutil][doc] Improve wording in manpage and rename file.
Jonas Devlieghere [Thu, 2 Nov 2017 18:44:54 +0000 (18:44 +0000)]
[dsymutil][doc] Improve wording in manpage and rename file.

 - Improve wording
 - Rename llvm-dsymutil to dsymutil
 - Name -arch=<arch> argument

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

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

6 years agoStrip off invariant.start because memory locations arent invariant
Anna Thomas [Thu, 2 Nov 2017 18:24:04 +0000 (18:24 +0000)]
Strip off invariant.start because memory locations arent invariant

The original change was reverted in rL317217 because of the failure in
the RS4GC testcase. I couldn't reproduce the failure on my local machine
(macbook) but could reproduce it on a linux box.

The failure was around removing the uses of invariant.start. The fix
here is to just RAUW undef (which was the first implementation in D39388).
This is perfectly valid IR as discussed in the review.

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

6 years agoFixed line length style issue.
Mitch Phillips [Thu, 2 Nov 2017 18:04:44 +0000 (18:04 +0000)]
Fixed line length style issue.

Reviewers: zturner

Subscribers: llvm-commits

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

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

6 years ago[TargetParser][AArch64] Reorder enum to preserve 5.0.0 libLLVM ABI.
Chad Rosier [Thu, 2 Nov 2017 17:52:27 +0000 (17:52 +0000)]
[TargetParser][AArch64] Reorder enum to preserve 5.0.0 libLLVM ABI.

This is required for backporting r311659 to the 5.0.1 release.
PR35060

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

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

6 years ago[dsymutil] Add a manpage for dsymutil
Jonas Devlieghere [Thu, 2 Nov 2017 17:12:34 +0000 (17:12 +0000)]
[dsymutil] Add a manpage for dsymutil

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

6 years agoRevert "[RS4GC] Strip off invariant.start because memory locations arent invariant"
Anna Thomas [Thu, 2 Nov 2017 16:45:51 +0000 (16:45 +0000)]
Revert "[RS4GC] Strip off invariant.start because memory locations arent invariant"

This reverts commit r317215, investigating the test failure.

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

6 years ago[RS4GC] Strip off invariant.start because memory locations arent invariant
Anna Thomas [Thu, 2 Nov 2017 16:23:31 +0000 (16:23 +0000)]
[RS4GC] Strip off invariant.start because memory locations arent invariant

Summary:
Invariant.start on memory locations has the property that the memory
location is unchanging. However, this is not true in the face of
rewriting statepoints for GC.
Teach RS4GC about removing invariant.start so that optimizations after
RS4GC does not incorrect sink a load from the memory location past a
statepoint.

Added test showcasing the issue.

Reviewers: reames, apilipenko, dneilson

Subscribers: llvm-commits

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

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

6 years agoRevert "[ExpandMemCmp] Split ExpandMemCmp from CodeGen into its own pass."
Clement Courbet [Thu, 2 Nov 2017 15:53:10 +0000 (15:53 +0000)]
Revert "[ExpandMemCmp] Split ExpandMemCmp from CodeGen into its own pass."

undefined reference to `llvm::TargetPassConfig::ID' on
clang-ppc64le-linux-multistage

This reverts commit eea333c33fa73ad225ef28607795984829f65688.

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

6 years ago[ExpandMemCmp] Split ExpandMemCmp from CodeGen into its own pass.
Clement Courbet [Thu, 2 Nov 2017 15:02:51 +0000 (15:02 +0000)]
[ExpandMemCmp] Split ExpandMemCmp from CodeGen into its own pass.

Summary:
This is mostly a noop (most of the test diffs are renamed blocks).
There are a few temporary register renames (eax<->ecx) and a few blocks are
shuffled around.

See the discussion in PR33325 for more details.

Reviewers: spatel

Subscribers: mgorny

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

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

6 years ago[X86] Fix bug in legalize vector types - Split large loads
Ayman Musa [Thu, 2 Nov 2017 13:07:06 +0000 (13:07 +0000)]
[X86] Fix bug in legalize vector types - Split large loads

When splitting a large load to smaller legally-typed loads, the last load should be padded to reach the size of the previous one so a CONCAT_VECTORS node could reunite them again.
The code currently pads the last load to reach the size of the first load (instead of the previous).

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

Change-Id: Ib60b55ed26ce901fabf68108daf52683fbd5013f

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

6 years ago[mips] Use register scavenging with MSA.
Simon Dardis [Thu, 2 Nov 2017 12:47:22 +0000 (12:47 +0000)]
[mips] Use register scavenging with MSA.

MSA stores and loads to the stack are more likely to require an
emergency GPR spill slot due to the smaller offsets available
with those instructions.

Handle this by overestimating the size of the stack by determining
the largest offset presuming that all callee save registers are
spilled and accounting of incoming arguments when determining
whether an emergency spill slot is required.

Reviewers: atanasyan

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

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

6 years agoTemporary workaround for msan false positive.
Sam McCall [Thu, 2 Nov 2017 12:29:47 +0000 (12:29 +0000)]
Temporary workaround for msan false positive.

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

6 years agoAdding test for extraxt sub vector load and store avx512
Michael Zuckerman [Thu, 2 Nov 2017 12:19:36 +0000 (12:19 +0000)]
Adding test for extraxt sub vector load and store avx512

Change-Id: Iefcb0ec6b6aa1b530ce5358081f02e6e522a8e50

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

6 years agoAllow inaccessiblememonly and inaccessiblemem_or_argmemonly to be overwriten on call...
Yichao Yu [Thu, 2 Nov 2017 12:18:33 +0000 (12:18 +0000)]
Allow inaccessiblememonly and inaccessiblemem_or_argmemonly to be overwriten on call site with operand bundle

Summary:
Similar to argmemonly, readonly and readnone.

Fix PR35128

Reviewers: andrew.w.kaylor, chandlerc, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

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

6 years ago[AsmPrinterDwarf] Add support for .cfi_restore directive
Francis Visoiu Mistrih [Thu, 2 Nov 2017 12:00:58 +0000 (12:00 +0000)]
[AsmPrinterDwarf] Add support for .cfi_restore directive

As of today we only use .cfi_offset to specify the offset of a CSR, but
we never use .cfi_restore when the CSR is restored.

If we want to perform a more advanced type of shrink-wrapping, we need
to use .cfi_restore in order to switch the CFI state between blocks.

This patch only aims at adding support for the directive.

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

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

6 years ago[SimplifyCFG] Discard speculated dbg intrinsics
Bjorn Pettersson [Thu, 2 Nov 2017 11:55:14 +0000 (11:55 +0000)]
[SimplifyCFG] Discard speculated dbg intrinsics

Summary:
SpeculativelyExecuteBB can flatten the CFG by doing
speculative execution followed by a select instruction.
When the speculatively executed BB contained dbg intrinsics
the result could be a little bit weird, since those dbg
intrinsics were inserted before the select in the flattened
CFG. So when single stepping in the debugger, printing the
value of the variable referenced in the dbg intrinsic, it
could happen that it looked like the variable had values
that never actually were assigned to the variable.

This patch simply discards all dbg intrinsics that were found
in the speculatively executed BB.

Reviewers: aprantl, chandlerc, craig.topper

Reviewed By: aprantl

Subscribers: llvm-commits

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

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

6 years ago[ARM] and, or, xor and add with shl combine
Sam Parker [Thu, 2 Nov 2017 10:43:10 +0000 (10:43 +0000)]
[ARM] and, or, xor and add with shl combine

The generic dag combiner will fold:

(shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
(shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2)

This can create constants which are too large to use as an immediate.
Many ALU operations are also able of performing the shl, so we can
unfold the transformation to prevent a mov imm instruction from being
generated.

Other patterns, such as b + ((a << 1) | 510), can also be simplified
in the same manner.

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

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

6 years agoThe patch updates sched numbers for YMM AVX instrs such as VMOVx, VORx, VXOR, VPERMIL...
Andrew V. Tischenko [Thu, 2 Nov 2017 10:33:41 +0000 (10:33 +0000)]
The patch updates sched numbers for YMM AVX instrs such as VMOVx, VORx, VXOR, VPERMILx, VBROADCASTx, etc.
PR32857 should be closed.
Differential Revision: https://reviews.llvm.org/D39227

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

6 years agoUpdate go bindings to use new functions from rL317135.
Sam McCall [Thu, 2 Nov 2017 10:22:26 +0000 (10:22 +0000)]
Update go bindings to use new functions from rL317135.

This fixes duplicate symbol problems.

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

6 years agollvm-c/DebugInfo.h: Fix warning. [-Wdocumentation]
NAKAMURA Takumi [Thu, 2 Nov 2017 08:03:12 +0000 (08:03 +0000)]
llvm-c/DebugInfo.h: Fix warning. [-Wdocumentation]

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

6 years ago[test] Remove the leftover empty directory after SVN r317189. NFC.
Martin Storsjo [Thu, 2 Nov 2017 08:02:03 +0000 (08:02 +0000)]
[test] Remove the leftover empty directory after SVN r317189. NFC.

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

6 years ago[test] Move llvm-dlltool tests into tools/llvm-dlltool. NFC.
Martin Storsjo [Thu, 2 Nov 2017 07:57:32 +0000 (07:57 +0000)]
[test] Move llvm-dlltool tests into tools/llvm-dlltool. NFC.

A toplevel test directory DllTool isn't consistent with other
similar tools.

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

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

6 years ago[X86] Remove the model checks from the 486 detection code in Host.cpp
Craig Topper [Thu, 2 Nov 2017 03:32:50 +0000 (03:32 +0000)]
[X86] Remove the model checks from the 486 detection code in Host.cpp

This just provided a bunch of comments to read and not much else.

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

6 years ago[X86] Simplify the detection of pentium-mmx in Host.cpp.
Craig Topper [Thu, 2 Nov 2017 03:32:49 +0000 (03:32 +0000)]
[X86] Simplify the detection of pentium-mmx in Host.cpp.

Rather than looking at model numbers just check for the mmx feature flag. While there promote INTEL_PENTIUM_MMX to a CPU type instead of a subtype so that we don't have weird type with only one subtype.

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

6 years agoRevert "Remove some of the go specific C bindings for debug info now that they've...
Eric Christopher [Thu, 2 Nov 2017 01:46:49 +0000 (01:46 +0000)]
Revert "Remove some of the go specific C bindings for debug info now that they've been migrated into the main C API."

This reverts commits r317151 and 317152

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

6 years ago[X86] Fix fast-isel-int-float-conversion test
Steven Wu [Thu, 2 Nov 2017 01:34:15 +0000 (01:34 +0000)]
[X86] Fix fast-isel-int-float-conversion test

Test is failing due to the revert in r317136. Fix the test to make all
the bots happy.

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

6 years agoFix for go bindings header to match previous commit.
Eric Christopher [Thu, 2 Nov 2017 01:25:00 +0000 (01:25 +0000)]
Fix for go bindings header to match previous commit.

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

6 years agoRemove some of the go specific C bindings for debug info now that they've been migrat...
Eric Christopher [Thu, 2 Nov 2017 01:24:12 +0000 (01:24 +0000)]
Remove some of the go specific C bindings for debug info now that they've been migrated into the main C API.

Fixes a go bindings breakage after r317135.

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

6 years ago[cmake] Switch FATAL_ERROR to SEND_ERROR
Shoaib Meenai [Thu, 2 Nov 2017 01:07:37 +0000 (01:07 +0000)]
[cmake] Switch FATAL_ERROR to SEND_ERROR

It's possible for multiple distribution components to have missing
targets, and it's a lot more convenient to get all those errors in one
shot rather than having to fix them individually.

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

6 years agoUpdate cl::opt<uint64_t> instances to cl::opt<unsigned long long>
Mitch Phillips [Wed, 1 Nov 2017 23:39:41 +0000 (23:39 +0000)]
Update cl::opt<uint64_t> instances to cl::opt<unsigned long long>

cl::opt<uint64_t> fails when parsing command line arguments.

See https://bugs.llvm.org/show_bug.cgi?id=19665.

Reviewers: pcc

Subscribers: mgorny, llvm-commits, kcc

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

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

6 years ago[yaml2obj][ELF] Add support for setting alignment in program headers
Jake Ehrlich [Wed, 1 Nov 2017 23:14:48 +0000 (23:14 +0000)]
[yaml2obj][ELF] Add support for setting alignment in program headers

Sometimes program headers have larger alignments than any of the
sections they contain. Currently yaml2obj can't produce such files. A
bug recently appeared in llvm-objcopy that failed in such a case. I'd
like to be able to add tests to llvm-objcopy for such cases.

This change adds an optional alignment parameter to program headers that
will be used instead of calculating the alignment.

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

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

6 years agoloop-unroll: teach remapInstruction to update dbg.value intrinsics.
Adrian Prantl [Wed, 1 Nov 2017 23:12:35 +0000 (23:12 +0000)]
loop-unroll: teach remapInstruction to update dbg.value intrinsics.

Fixes PR35112.

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

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

6 years agoRevert "Correct dwarf unwind information in function epilogue for X86"
Petar Jovanovic [Wed, 1 Nov 2017 23:05:52 +0000 (23:05 +0000)]
Revert "Correct dwarf unwind information in function epilogue for X86"

This reverts r317100 as it introduced sanitizer-x86_64-linux-autoconf
buildbot failure (build #15606).

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

6 years ago[LLVM-C] Expose functions to create debug locations via DIBuilder.
whitequark [Wed, 1 Nov 2017 22:18:52 +0000 (22:18 +0000)]
[LLVM-C] Expose functions to create debug locations via DIBuilder.

These include:
  * Several functions for creating an LLVMDIBuilder,
  * LLVMDIBuilderCreateCompileUnit,
  * LLVMDIBuilderCreateFile,
  * LLVMDIBuilderCreateDebugLocation.

Patch by Harlan Haskins.

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

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

6 years ago[X86] Use foreach in X86.td to combine some of the CPU names that are obviously alias...
Craig Topper [Wed, 1 Nov 2017 22:15:49 +0000 (22:15 +0000)]
[X86] Use foreach in X86.td to combine some of the CPU names that are obviously aliases. NFC

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

6 years ago[X86] Add CMOV feature to 'i686' processor, making it a proper alias of pentiumpro...
Craig Topper [Wed, 1 Nov 2017 22:15:40 +0000 (22:15 +0000)]
[X86] Add CMOV feature to 'i686' processor, making it a proper alias of pentiumpro which I believe it should be.

This is consistent with current gcc behavior.

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

6 years ago[globalisel][regbank] Warn about MIR ambiguities when register bank/class names clash.
Daniel Sanders [Wed, 1 Nov 2017 22:13:05 +0000 (22:13 +0000)]
[globalisel][regbank] Warn about MIR ambiguities when register bank/class names clash.

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

6 years ago[X86][SSE] Add PACKUS support to LowerTruncate
Simon Pilgrim [Wed, 1 Nov 2017 21:52:29 +0000 (21:52 +0000)]
[X86][SSE] Add PACKUS support to LowerTruncate

Similar to the existing code to lower to PACKSS, we can use PACKUS if the input vector's leading zero bits extend all the way to the packed/truncated value.

We have to account for pre-SSE41 targets not supporting PACKUSDW

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

6 years agoRewrite FileOutputBuffer as two separate classes.
Rui Ueyama [Wed, 1 Nov 2017 21:38:14 +0000 (21:38 +0000)]
Rewrite FileOutputBuffer as two separate classes.

This patch is to rewrite FileOutputBuffer as two separate classes;
one for file-backed output buffer and the other for memory-backed
output buffer. I think the new code is easier to follow because two
different implementations are now actually separated as different
classes.

Unlike the previous implementation, the class that does not replace the
final output file using rename(2) does not create a temporary file at
all. Instead, it allocates memory using mmap(2) and use it. I think
this is an improvement because it is now guaranteed that the temporary
memory region doesn't trigger any I/O and there's now zero chance to
leave a temporary file behind. Also, it shouldn't impose new restrictions
because were using mmap IO too.

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

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

6 years ago[dsymutil, llvm-objcopy] Fix some Clang-tidy modernize and Include What You Use warni...
Eugene Zelenko [Wed, 1 Nov 2017 21:16:06 +0000 (21:16 +0000)]
[dsymutil, llvm-objcopy] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[X86] Add custom code to EVEX to VEX pass to turn unmasked 128-bit VPALIGND/Q into...
Craig Topper [Wed, 1 Nov 2017 21:00:59 +0000 (21:00 +0000)]
[X86] Add custom code to EVEX to VEX pass to turn unmasked 128-bit VPALIGND/Q into VPALIGNR if the extended registers aren't being used.

This will enable us to prefer VALIGND/Q during shuffle lowering in order to get the extended register encoding space when BWI isn't available. But if we end up not using the extended registers we can switch VPALIGNR for the shorter VEX encoding.

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

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

6 years agoloop-rotate: avoid duplicating dbg.value intrinsics in the entry block.
Adrian Prantl [Wed, 1 Nov 2017 20:53:22 +0000 (20:53 +0000)]
loop-rotate: avoid duplicating dbg.value intrinsics in the entry block.

This fixes the second half of PR35113.

This reapplies r317106 without modifications.

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

6 years agoloop-rotate: eliminate duplicate debug intrinsics after splicing.
Adrian Prantl [Wed, 1 Nov 2017 20:43:30 +0000 (20:43 +0000)]
loop-rotate: eliminate duplicate debug intrinsics after splicing.

Fixes part of PR35113.

This reapplies r317105 with an additional check for isa<Instruction>
as found by the bots.

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

6 years agoInclude GUIDs from the same module when computing GUIDs that needs to be imported.
Dehao Chen [Wed, 1 Nov 2017 20:26:47 +0000 (20:26 +0000)]
Include GUIDs from the same module when computing GUIDs that needs to be imported.

Summary: In the compile phase of SamplePGO+ThinLTO, ICP is not invoked. Instead, indirect call targets will be included as function metadata for ThinIndex to buidl the call graph. This should not only include functions defined in other modules, but also functions defined in the same module, otherwise ThinIndex may find the callee dead and eliminate it, while ICP in backend will revive the symbol, which leads to undefined symbol.

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

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

6 years ago[globalisel][tablegen] Add support for multi-insn emission
Daniel Sanders [Wed, 1 Nov 2017 19:57:57 +0000 (19:57 +0000)]
[globalisel][tablegen] Add support for multi-insn emission

The importer will now accept nested instructions in the result pattern such as
(ADDWrr $a, (SUBWrr $b, $c)). This is only valid when the nested instruction
def's a single vreg and the parent instruction consumes a single vreg where a
nested instruction is specified. The importer will automatically create a vreg
to connect the two using the type information from the pattern. This vreg will
be constrained to the register classes given in the instruction definitions*.

* REG_SEQUENCE is explicitly rejected because of this. The definition doesn't
  constrain to a register class and it therefore needs special handling.

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

6 years agoRevert 317016 and 317048
Philip Reames [Wed, 1 Nov 2017 19:49:20 +0000 (19:49 +0000)]
Revert 317016 and 317048

The former appears to have introduced a miscompile in a stage2 clang build.  Revert so I can investigate offline.

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

6 years agoAMDGPU: Fix set but not used warnings related to AMDGPUAS
Konstantin Zhuravlyov [Wed, 1 Nov 2017 19:12:38 +0000 (19:12 +0000)]
AMDGPU: Fix set but not used warnings related to AMDGPUAS

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

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

6 years ago[X86] Prevent fast isel from folding loads into the instructions listed in hasPartial...
Craig Topper [Wed, 1 Nov 2017 18:10:06 +0000 (18:10 +0000)]
[X86] Prevent fast isel from folding loads into the instructions listed in hasPartialRegUpdate.

This patch moves the check for opt size and hasPartialRegUpdate into the lower level implementation of foldMemoryOperandImpl to catch the entry point that fast isel uses.

We're still folding undef register instructions in AVX that we should also probably disable, but that's a problem for another patch.

Unfortunately, this requires reordering a bunch of functions which is why the diff is so large. I can do the function reordering separately if we want.

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

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

6 years agoAdds code to PPC ISEL lowering to recognize half-word inserts from vector_shuffles...
Graham Yiu [Wed, 1 Nov 2017 18:06:56 +0000 (18:06 +0000)]
Adds code to PPC ISEL lowering to recognize half-word inserts from vector_shuffles, and use P9 shift and vector insert instructions instead of vperm.

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

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

6 years agoRevert r317105 to investigate bot breakage.
Adrian Prantl [Wed, 1 Nov 2017 18:06:38 +0000 (18:06 +0000)]
Revert r317105 to investigate bot breakage.

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

6 years agoRevert r317106 to facilitate reverting r317105.
Adrian Prantl [Wed, 1 Nov 2017 18:06:35 +0000 (18:06 +0000)]
Revert r317106 to facilitate reverting r317105.

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

6 years agoLTO: Apply global DCE to ThinLTO modules at LTO opt level 0.
Peter Collingbourne [Wed, 1 Nov 2017 17:58:39 +0000 (17:58 +0000)]
LTO: Apply global DCE to ThinLTO modules at LTO opt level 0.

This is necessary because DCE is applied to full LTO modules. Without
this change, a reference from a dead ThinLTO global to a dead full
LTO global will result in an undefined reference at link time.

This problem is only observable when --gc-sections is disabled, or
when targeting COFF, as the COFF port of lld requires all symbols to
have a definition even if all references are dead (this is consistent
with link.exe).

This change also adds an EliminateAvailableExternally pass at -O0. This
is necessary to handle the situation on Windows where a non-prevailing
copy of a linkonce_odr function has an SEH filter function; any
such filters must be DCE'd because they will contain a call to the
llvm.localrecover intrinsic, passing as an argument the address of the
function that the filter belongs to, and llvm.localrecover requires
this function to be defined locally.

Fixes PR35142.

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

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

6 years ago[X86] Regnerate test to attempt to fix build bot failure.
Craig Topper [Wed, 1 Nov 2017 17:44:12 +0000 (17:44 +0000)]
[X86] Regnerate test to attempt to fix build bot failure.

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

6 years agoloop-rotate: avoid duplicating dbg.value intrinsics in the entry block.
Adrian Prantl [Wed, 1 Nov 2017 17:28:50 +0000 (17:28 +0000)]
loop-rotate: avoid duplicating dbg.value intrinsics in the entry block.

This fixes the second half of PR35113.

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

6 years agoloop-rotate: eliminate duplicate debug intrinsics after splicing.
Adrian Prantl [Wed, 1 Nov 2017 17:28:47 +0000 (17:28 +0000)]
loop-rotate: eliminate duplicate debug intrinsics after splicing.

Fixes part of PR35113.

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

6 years ago[dsymutil][NFC} Rename thread related command line options
Jonas Devlieghere [Wed, 1 Nov 2017 17:15:29 +0000 (17:15 +0000)]
[dsymutil][NFC} Rename thread related command line options

This makes the command line options consistent with llvm-cov and
llvm-profdata, which both use `-num-threads` and `-j`.

This also addresses the conflict reported after landing D39355.

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

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

6 years ago[X86] Add 64-bit int to float/double conversion with AVX to X86FastISel::X86SelectSIToFP
Craig Topper [Wed, 1 Nov 2017 16:23:06 +0000 (16:23 +0000)]
[X86] Add 64-bit int to float/double conversion with AVX  to X86FastISel::X86SelectSIToFP

Summary:
[X86] Teach fast isel to handle i64 sitofp with AVX.

For some reason we only handled i32 sitofp with AVX. But with SSE only we support i64 so we should do the same with AVX.

Also add i686 command lines for the 32-bit tests. 64-bit tests are in a separate file to avoid a fast-isel abort failure in 32-bit mode.

Reviewers: RKSimon, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

6 years agoUpdate VCVTx, VMOVNTPx and VROUNDYPx instructions scheduling on btver2.
Andrew V. Tischenko [Wed, 1 Nov 2017 16:10:20 +0000 (16:10 +0000)]
Update VCVTx, VMOVNTPx and VROUNDYPx instructions scheduling on btver2.
Differential Revision: https://reviews.llvm.org/D39059

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

6 years agoCorrect dwarf unwind information in function epilogue for X86
Petar Jovanovic [Wed, 1 Nov 2017 16:04:11 +0000 (16:04 +0000)]
Correct dwarf unwind information in function epilogue for X86

This patch aims to provide correct dwarf unwind information in function
epilogue for X86.

It consists of two parts. The first part inserts CFI instructions that set
appropriate cfa offset and cfa register in emitEpilogue() in
X86FrameLowering. This part is X86 specific.

The second part is platform independent and ensures that:

- CFI instructions do not affect code generation
- Unwind information remains correct when a function is modified by
  different passes. This is done in a late pass by analyzing information
  about cfa offset and cfa register in BBs and inserting additional CFI
  directives where necessary.

Changed CFI instructions so that they:

- are duplicable
- are not counted as instructions when tail duplicating or tail merging
- can be compared as equal

Added CFIInstrInserter pass:

- analyzes each basic block to determine cfa offset and register valid at
  its entry and exit
- verifies that outgoing cfa offset and register of predecessor blocks match
  incoming values of their successors
- inserts additional CFI directives at basic block beginning to correct the
  rule for calculating CFA

Having CFI instructions in function epilogue can cause incorrect CFA
calculation rule for some basic blocks. This can happen if, due to basic
block reordering, or the existence of multiple epilogue blocks, some of the
blocks have wrong cfa offset and register values set by the epilogue block
above them.

CFIInstrInserter is currently run only on X86, but can be used by any target
that implements support for adding CFI instructions in epilogue.

Patch by Violeta Vukobrat.

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

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

6 years ago[X86][SSE] Begun generalizing truncateVectorWithPACKSS to work with PACKSS/PACKUS...
Simon Pilgrim [Wed, 1 Nov 2017 15:31:51 +0000 (15:31 +0000)]
[X86][SSE] Begun generalizing truncateVectorWithPACKSS to work with PACKSS/PACKUS functions

Renamed to truncateVectorWithPACK

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

6 years agoRegenerate PACKUS/TRUNCS test (PR31773)
Simon Pilgrim [Wed, 1 Nov 2017 15:27:23 +0000 (15:27 +0000)]
Regenerate PACKUS/TRUNCS test (PR31773)

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

6 years ago[BranchProbabilityInfo] Handle irreducible loops.
Geoff Berry [Wed, 1 Nov 2017 15:16:50 +0000 (15:16 +0000)]
[BranchProbabilityInfo] Handle irreducible loops.

Summary:
Compute the strongly connected components of the CFG and fall back to
use these for blocks that are in loops that are not detected by
LoopInfo when computing loop back-edge and exit branch probabilities.

Reviewers: dexonsmith, davidxl

Subscribers: mcrosier, llvm-commits

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

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

6 years agoRevert r313618 "[ARM] Use ADDCARRY / SUBCARRY"
Roger Ferrer Ibanez [Wed, 1 Nov 2017 14:06:57 +0000 (14:06 +0000)]
Revert r313618 "[ARM] Use ADDCARRY / SUBCARRY"

That change causes PR35103, so reverting until I figure it out.

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

6 years agoFix warnings discovered by rL317076. [-Wunused-private-field]
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:55 +0000 (13:47 +0000)]
Fix warnings discovered by rL317076. [-Wunused-private-field]

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

6 years agoSuppress a warning discovered by rL317076. [-Wunused-private-field]
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:51 +0000 (13:47 +0000)]
Suppress a warning discovered by rL317076. [-Wunused-private-field]

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

6 years agoRevert rL311205 "[IRCE] Fix buggy behavior in Clamp"
Max Kazantsev [Wed, 1 Nov 2017 13:21:56 +0000 (13:21 +0000)]
Revert rL311205 "[IRCE] Fix buggy behavior in Clamp"

This patch reverts rL311205 that was initially a wrong fix. The real problem
was in intersection of signed and unsigned ranges (see rL316552), and the
patch being reverted masked the problem instead of fixing it.

By now, the test against which rL311205 was made works OK even without this
code. This revert patch also contains a test case that demonstrates incorrect
behavior caused by rL311205: it is caused by incorrect choise of signed max
instead of unsigned.

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

6 years ago[SelectionDAG] computeKnownBits - use ashrInPlace on known bits of ISD::SRA input...
Simon Pilgrim [Wed, 1 Nov 2017 13:16:48 +0000 (13:16 +0000)]
[SelectionDAG] computeKnownBits - use ashrInPlace on known bits of ISD::SRA input. NFCI.

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

6 years ago[X86][SSE] Truncate with PACKSS any input with sufficient sign-bits
Simon Pilgrim [Wed, 1 Nov 2017 11:47:44 +0000 (11:47 +0000)]
[X86][SSE] Truncate with PACKSS any input with sufficient sign-bits

So far we've only been using PACKSS truncations with 'all-bits or zero-bits' patterns (vector comparison results etc.). When really we can safely use it for any case as long as the number of sign bits reach down to the last 16-bits (or 8-bits if we're truncating to bytes).

The next steps after this is add the equivalent support for PACKUS and to support packing to sub-128 bit vectors for truncating stores etc.

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

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

6 years ago[CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting.
Florian Hahn [Wed, 1 Nov 2017 09:48:12 +0000 (09:48 +0000)]
[CodeExtractor] Fix iterator invalidation in findOrCreateBlockForHoisting.

Summary:
By replacing branches to CommonExitBlock, we remove the node from
CommonExitBlock's predecessors, invalidating the iterator. The problem
is exposed when the common exit block has multiple predecessors and
needs to sink lifetime info. The modification in the test case trigger
the issue.

Reviewers: davidxl, davide, wmi

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

6 years agoFix APFloat mod sign
Serguei Katkov [Wed, 1 Nov 2017 07:56:55 +0000 (07:56 +0000)]
Fix APFloat mod sign

fmod specification requires the sign of the remainder is
the same as numerator in case remainder is zero.

Reviewers: gottesmm, scanon, arsenm, davide, craig.topper
Reviewed By: scanon
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D39225

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

6 years ago[X86] Add more type qualifiers to INSERT_SUBREG operations in rotate patterns so...
Craig Topper [Wed, 1 Nov 2017 07:11:32 +0000 (07:11 +0000)]
[X86] Add more type qualifiers to INSERT_SUBREG operations in rotate patterns so they don't get created with a v64i8 type.

Not sure why tablegen didn't error on this.

Fixes PR35158.

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

6 years agoReformat.
NAKAMURA Takumi [Wed, 1 Nov 2017 05:14:35 +0000 (05:14 +0000)]
Reformat.

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

6 years agoRevert rL317019, "[ADT] Split optional to only include copy mechanics and dtor for...
NAKAMURA Takumi [Wed, 1 Nov 2017 05:14:31 +0000 (05:14 +0000)]
Revert rL317019, "[ADT] Split optional to only include copy mechanics and dtor for non-trivial types."

Seems g++-4.8 (eg. Ubuntu 14.04) doesn't like this.

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

6 years ago[DAGCombiner] Fix typos in comments. NFC
Craig Topper [Wed, 1 Nov 2017 03:30:52 +0000 (03:30 +0000)]
[DAGCombiner] Fix typos in comments. NFC

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

6 years agoAdd test dependency on llvm-cfi-verify to fix up the build breakages on sanitizers.
Mitch Phillips [Wed, 1 Nov 2017 00:49:45 +0000 (00:49 +0000)]
Add test dependency on llvm-cfi-verify to fix up the build breakages on sanitizers.

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

6 years ago[X86] Add AVX512 support to X86FastISel::fastMaterializeFloatZero.
Craig Topper [Wed, 1 Nov 2017 00:47:45 +0000 (00:47 +0000)]
[X86] Add AVX512 support to X86FastISel::fastMaterializeFloatZero.

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

6 years ago[globalisel][tablegen] Stop hard-coding the emitted instruction ID to 0. NFC
Daniel Sanders [Wed, 1 Nov 2017 00:29:47 +0000 (00:29 +0000)]
[globalisel][tablegen] Stop hard-coding the emitted instruction ID to 0. NFC

The next commit will add support for multi-instruction emission so we need to
start allocating instruction ID's instead of hard-coding them to 0.

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

6 years agoAdd system-linux to allow tests run with llvm-lit to restrict themselves to linux
Jake Ehrlich [Wed, 1 Nov 2017 00:18:51 +0000 (00:18 +0000)]
Add system-linux to allow tests run with llvm-lit to restrict themselves to linux

I need a test that only runs in a reasonable amount of time on systems
that have sparse files. The broadest class of systems that support
sparse files are linux systems. So restricting my test to linux systems
should suffice. This change adds the system-linux feature to llvm-lit so
that it can be required.

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

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

6 years ago[AMDGPU] Clean up symbols in the global namespace.
Benjamin Kramer [Tue, 31 Oct 2017 23:21:30 +0000 (23:21 +0000)]
[AMDGPU] Clean up symbols in the global namespace.

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

6 years agoParse DWARF information to reduce false positives.
Mitch Phillips [Tue, 31 Oct 2017 23:20:05 +0000 (23:20 +0000)]
Parse DWARF information to reduce false positives.

Summary: Help differentiate code and data by parsing DWARF information. This will reduce false positive rates where data is placed in executable sections and is mistakenly parsed as code, resulting in an inflation in the number of indirect CF instructions (and hence an inflation of the number of unprotected).

Also prints the DWARF line data around the region of each indirect CF instruction.

Reviewers: pcc

Subscribers: probinson, llvm-commits, vlad.tsyrklevich, mgorny, aprantl, kcc

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

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

6 years agoRe-commit: [globalisel][tablegen] Keep track of the insertion point while adding...
Daniel Sanders [Tue, 31 Oct 2017 23:03:18 +0000 (23:03 +0000)]
Re-commit: [globalisel][tablegen] Keep track of the insertion point while adding BuildMIAction's. NFC

Multi-instruction emission needs to ensure the the instructions are generated
a depth-first fashion. For example:
(ADDWrr (SUBWrr a, b), c)
needs to emit the SUBWrr before the ADDWrr. However, our walk over
TreePatternNode's is highly context sensitive which makes it difficult to append
BuildMIActions in the order we want. To fix this, we now keep track of the
insertion point as we add actions. This will allow multi-insn emission to insert
BuildMI's in the correct place.

The previous commit failed on the Ubuntu bots using GCC 4.8. These bots lack the
const_iterator forms of insert() and emplace() that were added in C++11. As a
result I've switched the const_iterators to iterators.

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

6 years ago[SimplifyIndVar] Inline makIVComparisonInvariant to eleminate code duplication [NFC]
Philip Reames [Tue, 31 Oct 2017 22:56:16 +0000 (22:56 +0000)]
[SimplifyIndVar] Inline makIVComparisonInvariant to eleminate code duplication [NFC]

This formulation might be slightly slower since I eagerly compute the cheap replacements.  If anyone sees this having a compile time impact, let me know and I'll use lazy population instead.

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