OSDN Git Service

android-x86/external-llvm.git
7 years agoCODE_OWNERS: Take ownership of Loop Strenght Reduce.
Quentin Colombet [Wed, 30 Nov 2016 19:55:49 +0000 (19:55 +0000)]
CODE_OWNERS: Take ownership of Loop Strenght Reduce.

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

7 years ago[git-llvm] Use --force-interactive when commiting to enable SVN to prompt password
Mehdi Amini [Wed, 30 Nov 2016 19:12:53 +0000 (19:12 +0000)]
[git-llvm] Use --force-interactive when commiting to enable SVN to prompt password

When svn does not know the password and it has to prompt, it needs to query.
However it won't when invoked from the Python script and instead fails with:

svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option

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

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

7 years agoFix macro check for ABI breacking check: should use #if instead of #ifndef
Mehdi Amini [Wed, 30 Nov 2016 19:08:41 +0000 (19:08 +0000)]
Fix macro check for ABI breacking check: should use #if instead of #ifndef

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

7 years ago[LibFuzzer] Split up some functions among different headers.
Zachary Turner [Wed, 30 Nov 2016 19:06:14 +0000 (19:06 +0000)]
[LibFuzzer] Split up some functions among different headers.

In an effort to get libfuzzer working on Windows, we need to make
a distinction between what functions require platform specific
code (e.g. different code on Windows vs Linux) and what code
doesn't.  IO functions, for example, tend to be platform
specific.

This patch separates out some of the functions which will need
to have platform specific implementations into different headers,
so that we can then provide different implementations for each
platform.

Aside from that, this patch contains no functional change.  It
is purely a re-organization.

Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27230

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

7 years agoAMDGPU: Move mir tests into mir test directory
Matt Arsenault [Wed, 30 Nov 2016 18:50:26 +0000 (18:50 +0000)]
AMDGPU: Move mir tests into mir test directory

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

7 years ago[InstCombine] update test to use FileCheck and auto-generate checks; NFC
Sanjay Patel [Wed, 30 Nov 2016 18:49:56 +0000 (18:49 +0000)]
[InstCombine] update test to use FileCheck and auto-generate checks; NFC

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

7 years ago[X86][SSE] Added tests showing missed combines of ANDs with shuffles.
Simon Pilgrim [Wed, 30 Nov 2016 18:15:10 +0000 (18:15 +0000)]
[X86][SSE] Added tests showing missed combines of ANDs with shuffles.

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

7 years agoFix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).
Eugene Zelenko [Wed, 30 Nov 2016 17:48:10 +0000 (17:48 +0000)]
Fix some Clang-tidy and Include What You Use warnings; other minor fixes (NFC).

This preparation to remove SetVector.h dependency on SmallSet.h.

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

7 years ago[InstCombine] auto-generate checks for select+bitwise logic tests; NFC
Sanjay Patel [Wed, 30 Nov 2016 17:07:21 +0000 (17:07 +0000)]
[InstCombine] auto-generate checks for select+bitwise logic tests; NFC

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

7 years ago[AArch64] Fix useful bits detection for BFM instructions
Silviu Baranga [Wed, 30 Nov 2016 17:04:22 +0000 (17:04 +0000)]
[AArch64] Fix useful bits detection for BFM instructions

Summary:
When computing useful bits for a BFM instruction, we need
to take into consideration the case where both operands
of the BFM are equal and provide data that we need to track.

Not doing this can cause us to miss useful bits.

Fixes PR31138 (https://llvm.org/bugs/show_bug.cgi?id=31138)

Reviewers: t.p.northover, jmolloy

Subscribers: evandro, gberry, srhines, pirama, mcrosier, aemerson, llvm-commits, rengolin

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

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

7 years ago[WebAssembly] Add llvm-objdump support for wasm file format
Derek Schuff [Wed, 30 Nov 2016 16:49:11 +0000 (16:49 +0000)]
[WebAssembly] Add llvm-objdump support for wasm file format

This is the first part of an effort to add wasm binary
support across all llvm tools.

Patch by Sam Clegg

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

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

7 years ago[X86][SSE] Add support for target shuffle constant folding
Simon Pilgrim [Wed, 30 Nov 2016 16:33:46 +0000 (16:33 +0000)]
[X86][SSE] Add support for target shuffle constant folding

Initial support for target shuffle constant folding in cases where all shuffle inputs are constant. We may be able to relax this and merge shuffles with only some constant inputs in the future.

I've added the helper function getTargetConstantBitsFromNode (based off a similar function in X86ShuffleDecodeConstantPool.cpp) that could be reused for other cases requiring constant vector extraction.

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

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

7 years ago[LibFuzzer] Add macro flags for Posix and Windows.
Zachary Turner [Wed, 30 Nov 2016 16:32:54 +0000 (16:32 +0000)]
[LibFuzzer] Add macro flags for Posix and Windows.

This is the beginning of an effort to get libfuzzer working on
Windows.  This is a NFC to just add some macros for platform
detection on Windows.

Patch by Marcos Pividori
Differential Revision: https://reviews.llvm.org/D27229

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

7 years ago[SelectionDAG] Refactor TargetLowering::expandMUL (NFC)
Nicolai Haehnle [Wed, 30 Nov 2016 16:26:33 +0000 (16:26 +0000)]
[SelectionDAG] Refactor TargetLowering::expandMUL (NFC)

Summary: Further preparation for the expansion of MUL_LOHI added in D24956.

Reviewers: efriedma, RKSimon

Subscribers: llvm-commits

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

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

7 years ago[Support] Use HAVE_DLOPEN to guard dlopen(3) usage
Pavel Labath [Wed, 30 Nov 2016 15:34:29 +0000 (15:34 +0000)]
[Support] Use HAVE_DLOPEN to guard dlopen(3) usage

Summary:
The usage was previously guarded by HAVE_DLFCN. This breaks on Android with
LLVM_BUILD_STATIC as the platform does not provide a static version of libdl.
Using HAVE_DLOPEN fixes it as the code will only get used if we are actually able
to link an executable using dlopen.

Reviewers: rafael, beanz

Subscribers: tberghammer, danalbert, llvm-commits

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

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

7 years ago[AArch64] use exact checks; NFC
Sanjay Patel [Wed, 30 Nov 2016 15:00:43 +0000 (15:00 +0000)]
[AArch64] use exact checks; NFC

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

7 years ago[PowerPC] Preserve machine dominator tree in PPCVSXFMAMutate
Krzysztof Parzyszek [Wed, 30 Nov 2016 13:31:09 +0000 (13:31 +0000)]
[PowerPC] Preserve machine dominator tree in PPCVSXFMAMutate

It is needed by LiveIntervalAnalysis.

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

7 years agoUpdated test with -verify-machineinstrs to check for PR21931
Simon Pilgrim [Wed, 30 Nov 2016 13:21:12 +0000 (13:21 +0000)]
Updated test with -verify-machineinstrs to check for PR21931

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

7 years ago[X86][SSE] Add tests demonstrating missed opportunities to combine 64-bit element...
Simon Pilgrim [Wed, 30 Nov 2016 11:30:33 +0000 (11:30 +0000)]
[X86][SSE] Add tests demonstrating missed opportunities to combine 64-bit element unpacks with horizontal pair ops.

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

7 years agoApply clang-tidy's 'performance-faster-string-find' check to LLVM.
Benjamin Kramer [Wed, 30 Nov 2016 10:01:11 +0000 (10:01 +0000)]
Apply clang-tidy's 'performance-faster-string-find' check to LLVM.

No functionality change intended.

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

7 years agoRevert 'Test commit as per developer policy'
Jonas Devlieghere [Wed, 30 Nov 2016 08:24:43 +0000 (08:24 +0000)]
Revert 'Test commit as per developer policy'

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

7 years agoTest commit as per developer policy
Jonas Devlieghere [Wed, 30 Nov 2016 08:06:23 +0000 (08:06 +0000)]
Test commit as per developer policy

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

7 years agoRevert "[GVN] Basic optimization remark support"
Adam Nemet [Wed, 30 Nov 2016 01:14:35 +0000 (01:14 +0000)]
Revert "[GVN] Basic optimization remark support"

This reverts commit r288210.

The failure on the stage2 LTO build is back.

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

7 years ago[RuntimeDyld] Skip undefined symbols when building the symbol table.
Lang Hames [Wed, 30 Nov 2016 01:12:07 +0000 (01:12 +0000)]
[RuntimeDyld] Skip undefined symbols when building the symbol table.

Storing these in the symbol table (with zero values) is just wasted space.

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

7 years ago[PowerPC] Improvements for BUILD_VECTOR Vol. 2
Nemanja Ivanovic [Tue, 29 Nov 2016 23:57:54 +0000 (23:57 +0000)]
[PowerPC] Improvements for BUILD_VECTOR Vol. 2

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

This patch adds support for converting a vector of loads into a single load if
the loads are consecutive (in either direction).

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

7 years ago[PowerPC] Improvements for BUILD_VECTOR Vol. 2
Nemanja Ivanovic [Tue, 29 Nov 2016 23:36:03 +0000 (23:36 +0000)]
[PowerPC] Improvements for BUILD_VECTOR Vol. 2

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

This is the 2nd patch in a series of 4 that improve the lowering and combining
for BUILD_VECTOR nodes on PowerPC. This particular patch combines a build vector
of fp-to-int conversions into an fp-to-int conversion of a build vector of fp
values. For example:
Converts (build_vector (fp_to_[su]i $A), (fp_to_[su]i $B), ...)
Into (fp_to_[su]i (build_vector $A, $B, ...))).
Which is a natural match for much cleaner code.

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

7 years agoAdd another missing dependency.
Peter Collingbourne [Tue, 29 Nov 2016 23:22:55 +0000 (23:22 +0000)]
Add another missing dependency.

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

7 years agoRevert r288212 due to lldb failure.
Paul Robinson [Tue, 29 Nov 2016 23:20:35 +0000 (23:20 +0000)]
Revert r288212 due to lldb failure.

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

7 years ago[lanai] Manually match 0/-1 with R0/R1.
Jacques Pienaar [Tue, 29 Nov 2016 23:01:09 +0000 (23:01 +0000)]
[lanai] Manually match 0/-1 with R0/R1.

Summary: Previously 0 and -1 was matched via tablegen rules. But this could cause problems where a physical register was being used where a virtual register was expected (seen in optimizeSelect and TwoAddressInstructionPass). Instead follow AArch64 and match in DAGToDAGISel.

Reviewers: eliben, majnemer

Subscribers: llvm-commits, aemerson

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

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

7 years agoRevert https://reviews.llvm.org/rL287679
Nemanja Ivanovic [Tue, 29 Nov 2016 23:00:33 +0000 (23:00 +0000)]
Revert https://reviews.llvm.org/rL287679

This commit caused some miscompiles that did not show up on any of the bots.
Reverting until we can investigate the cause of those failures.

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

7 years agoEmit 'no line' information for interesting 'orphan' instructions.
Paul Robinson [Tue, 29 Nov 2016 22:41:16 +0000 (22:41 +0000)]
Emit 'no line' information for interesting 'orphan' instructions.

DWARF specifies that "line 0" really means "no appropriate source
location" in the line table.  Use this for branch targets and some
other cases that have no specified source location, to prevent
inheriting unfortunate line numbers from physically preceding
instructions (which might be from completely unrelated source).

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

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

7 years ago[X86][AVX512VL] Improved testing of vcvtpd2ps, vcvtpd2dq/vcvtpd2udq and vcvttpd2dq...
Simon Pilgrim [Tue, 29 Nov 2016 22:38:30 +0000 (22:38 +0000)]
[X86][AVX512VL] Improved testing of vcvtpd2ps, vcvtpd2dq/vcvtpd2udq and vcvttpd2dq/vcvttpd2udq implicit zeroing of upper 64-bits of xmm result

Ensure that masked instruction doesn't assume implicit zeroing.

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

7 years ago[GVN] Basic optimization remark support
Adam Nemet [Tue, 29 Nov 2016 22:37:01 +0000 (22:37 +0000)]
[GVN] Basic optimization remark support

[recommiting patches one-by-one to see which breaks the stage2 LTO bot]

Follow-on patches will add more interesting cases.

The goal of this patch-set is to get the GVN messages printed in
opt-viewer from Dhrystone as was presented in my Dev Meeting talk.  This
is the optimization view for the function (the last remark in the
function has a bug which is fixed in this series):
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430

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

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

7 years ago[X86][AVX512DQVL] Improved testing of vcvtqq2ps/vcvtuqq2ps implicit zeroing of upper...
Simon Pilgrim [Tue, 29 Nov 2016 22:36:28 +0000 (22:36 +0000)]
[X86][AVX512DQVL] Improved testing of vcvtqq2ps/vcvtuqq2ps implicit zeroing of upper 64-bits of xmm result

Ensure that masked instruction doesn't assume implicit zeroing.

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

7 years ago[AArch64] allow and-not-compare transform to form 'bics'
Sanjay Patel [Tue, 29 Nov 2016 22:28:58 +0000 (22:28 +0000)]
[AArch64] allow and-not-compare transform to form 'bics'

This target hook was added with D19087:
https://reviews.llvm.org/D19087

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

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

7 years agoAdd documentation for the PDB Module Info stream.
Zachary Turner [Tue, 29 Nov 2016 22:14:56 +0000 (22:14 +0000)]
Add documentation for the PDB Module Info stream.

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

7 years agoBitcode: Add a more comprehensive multi-module test now that we have both llvm-cat...
Peter Collingbourne [Tue, 29 Nov 2016 21:55:09 +0000 (21:55 +0000)]
Bitcode: Add a more comprehensive multi-module test now that we have both llvm-cat and llvm-modextract.

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

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

7 years agoAdd llvm-modextract tool.
Peter Collingbourne [Tue, 29 Nov 2016 21:54:33 +0000 (21:54 +0000)]
Add llvm-modextract tool.

This program is for testing features that rely on multi-module bitcode files.
It takes a multi-module bitcode file, extracts one of the modules and writes
it to the output file.

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

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

7 years ago[StructurizeCFG] Fix infinite loop in rebuildSSA.
Justin Lebar [Tue, 29 Nov 2016 21:49:02 +0000 (21:49 +0000)]
[StructurizeCFG] Fix infinite loop in rebuildSSA.

Michel Dänzer reported that r288051, "[StructurizeCFG] Use range-based
for loops", introduced a bug into rebuildSSA, wherein we were iterating
over an instruction's use list while modifying it, without taking care
to do this correctly.

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

7 years agoAdd to llvm-objdump the -no-leading-headers option with the use of the -macho option.
Kevin Enderby [Tue, 29 Nov 2016 21:43:40 +0000 (21:43 +0000)]
Add to llvm-objdump the -no-leading-headers option with the use of the -macho option.

In some cases the leading headers of the file name, archive member and
architecture slice name in the output of lvm-objdump is not wanted so the
tool’s output can be directly used by scripts.  This matches the -X option
of the Apple otool(1) program.

rdar://28491674

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

7 years agoAdd missing dependency.
Peter Collingbourne [Tue, 29 Nov 2016 21:02:19 +0000 (21:02 +0000)]
Add missing dependency.

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

7 years agoChange Error unittest to use the LLVM_ENABLE_ABI_BREAKING_CHECKS instead of NDEBUG
Mehdi Amini [Tue, 29 Nov 2016 20:45:48 +0000 (20:45 +0000)]
Change Error unittest to use the LLVM_ENABLE_ABI_BREAKING_CHECKS instead of NDEBUG

This is consistent with the header (after r288087) and fixes the
test for the configuration:
  -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF

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

7 years agoBitcode: Introduce BitcodeWriter interface.
Peter Collingbourne [Tue, 29 Nov 2016 20:43:47 +0000 (20:43 +0000)]
Bitcode: Introduce BitcodeWriter interface.

This interface allows clients to write multiple modules to a single
bitcode file. Also introduce the llvm-cat utility which can be used
to create a bitcode file containing multiple modules.

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

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

7 years ago[AArch64] Add a basic SchedMachineModel for Falkor.
Chad Rosier [Tue, 29 Nov 2016 20:00:27 +0000 (20:00 +0000)]
[AArch64] Add a basic SchedMachineModel for Falkor.

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

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

7 years agoUse CallSite to simplify code
David Blaikie [Tue, 29 Nov 2016 19:42:27 +0000 (19:42 +0000)]
Use CallSite to simplify code

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

7 years agoAMDGPU: Disallow exec as SMEM instruction operand
Matt Arsenault [Tue, 29 Nov 2016 19:39:53 +0000 (19:39 +0000)]
AMDGPU: Disallow exec as SMEM instruction operand

This is not in the list of valid inputs for the encoding.
When spilling, copies from exec can be folded directly
into the spill instruction which results in broken
stores.

This only fixes the operand constraints, more codegen
work is required to avoid emitting the invalid
spills.

This sort of breaks the dbg.value test. Because the
register class of the s_load_dwordx2 changes, there
is a copy to SReg_64, and the copy is the operand
of dbg_value. The copy is later dead, and removed
from the dbg_value.

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

7 years agoAMDGPU: Use SGPR_64 for argument lowerings
Matt Arsenault [Tue, 29 Nov 2016 19:39:48 +0000 (19:39 +0000)]
AMDGPU: Use SGPR_64 for argument lowerings

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

7 years ago[LiveRangeEdit] Handle instructions with no defs correctly.
Geoff Berry [Tue, 29 Nov 2016 19:31:35 +0000 (19:31 +0000)]
[LiveRangeEdit] Handle instructions with no defs correctly.

Summary:
The code in LiveRangeEdit::eliminateDeadDef() that computes isOrigDef
doesn't handle instructions in which operand 0 is not a def (e.g. KILL)
correctly.  Add a check that operand 0 is a def before doing the rest of
the isOrigDef computation.

Reviewers: qcolombet, MatzeB, wmi

Subscribers: mcrosier, llvm-commits

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

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

7 years agoAMDGPU: Rename flat operands to match mubuf
Matt Arsenault [Tue, 29 Nov 2016 19:30:44 +0000 (19:30 +0000)]
AMDGPU: Rename flat operands to match mubuf

Use vaddr/vdst for the same purposes.

This also fixes a beg in SIInsertWaits for the
operand check. The stored value operand is currently called
data0 in the single offset case, not data.

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

7 years agoAMDGPU: Use else if
Matt Arsenault [Tue, 29 Nov 2016 19:30:41 +0000 (19:30 +0000)]
AMDGPU: Use else if

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

7 years agoAMDGPU: Materialize frame index before add
Matt Arsenault [Tue, 29 Nov 2016 19:20:48 +0000 (19:20 +0000)]
AMDGPU: Materialize frame index before add

It isn't generally safe to fold the frame index
directly into the operand since it will possibly
not be an inline immediate after it is expanded.

This surprisingly seems to produce better code, since
the FI doesn't prevent folding other immediate operands.

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

7 years agoAMDGPU: Refactor immediate folding logic
Matt Arsenault [Tue, 29 Nov 2016 19:20:42 +0000 (19:20 +0000)]
AMDGPU: Refactor immediate folding logic

Change the logic for when to fold immediates to
consider the destination operand rather than the
source of the materializing mov instruction.

No change yet, but this will allow for correctly handling
i16/f16 operands. Since 32-bit moves are used to materialize
constants for these, the same bitvalue will not be in the
register.

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

7 years ago[AArch64] add tests for bics; NFC
Sanjay Patel [Tue, 29 Nov 2016 19:15:27 +0000 (19:15 +0000)]
[AArch64] add tests for bics; NFC

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

7 years ago[AArch64] add tests to show select transforms; NFC
Sanjay Patel [Tue, 29 Nov 2016 18:35:04 +0000 (18:35 +0000)]
[AArch64] add tests to show select transforms; NFC

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

7 years agoRevert "[GVN] Basic optimization remark support"
Adam Nemet [Tue, 29 Nov 2016 18:32:04 +0000 (18:32 +0000)]
Revert "[GVN] Basic optimization remark support"

This reverts commit r288046.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

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

7 years agoRevert "[GVN, OptDiag] Include the value that is forwarded in load elimination"
Adam Nemet [Tue, 29 Nov 2016 18:32:00 +0000 (18:32 +0000)]
Revert "[GVN, OptDiag] Include the value that is forwarded in load elimination"

This reverts commit r288047.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

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

7 years agoRevert "[GVN, OptDiag] Print the interesting instructions involved in missed load...
Adam Nemet [Tue, 29 Nov 2016 18:31:53 +0000 (18:31 +0000)]
Revert "[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination"

This reverts commit r288090.

Trying to see if the revert fixes a compiler crash during a stage2 LTO
build with a GVN backtrace.

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

7 years ago[AArch64] Fold spills of COPY of WZR/XZR
Geoff Berry [Tue, 29 Nov 2016 18:28:32 +0000 (18:28 +0000)]
[AArch64] Fold spills of COPY of WZR/XZR

Summary:
In AArch64InstrInfo::foldMemoryOperandImpl, catch more cases where the
COPY being spilled is copying from WZR/XZR, but the source register is
not in the COPY destination register's regclass.

For example, when spilling:

  %vreg0 = COPY %XZR ; %vreg0:GPR64common

without this change, the code in TargetInstrInfo::foldMemoryOperand()
and canFoldCopy() that normally handles cases like this would fail to
optimize since %XZR is not in GPR64common.  So the spill code generated
would be:

  %vreg0 = COPY %XZR
  STR %vreg

instead of the new code generated:

  STR %XZR

Reviewers: qcolombet, MatzeB

Subscribers: mcrosier, aemerson, t.p.northover, llvm-commits, rengolin

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

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

7 years ago[docs] Typos and whitespace fixed in LTO docs.
Mehdi Amini [Tue, 29 Nov 2016 18:00:31 +0000 (18:00 +0000)]
[docs] Typos and whitespace fixed in LTO docs.

While reading the LTO docs I fixed few small typos and whitespace issues.

Patch by: Jonas Devlieghere <jonas@devlieghere.com>

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

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

7 years agoAvoid repeated calls to MVT getSizeInBits and getScalarSizeInBits(). NFCI.
Simon Pilgrim [Tue, 29 Nov 2016 17:57:48 +0000 (17:57 +0000)]
Avoid repeated calls to MVT getSizeInBits and getScalarSizeInBits(). NFCI.

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

7 years agoSuppress abi-breaking.h on cygming, for now.
NAKAMURA Takumi [Tue, 29 Nov 2016 17:32:58 +0000 (17:32 +0000)]
Suppress abi-breaking.h on cygming, for now.

FIXME: Implement checks without weak for them.

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

7 years agoFix a linefeed at eof.
NAKAMURA Takumi [Tue, 29 Nov 2016 17:32:43 +0000 (17:32 +0000)]
Fix a linefeed at eof.

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

7 years ago[CVP] Remove use of removed flag (-cvp-dont-process-adds) from the test
Artur Pilipenko [Tue, 29 Nov 2016 16:43:30 +0000 (16:43 +0000)]
[CVP] Remove use of removed flag (-cvp-dont-process-adds) from the test

The flag was removed by 288154

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

7 years ago[CVP] Remove cvp-dont-process-adds flag
Artur Pilipenko [Tue, 29 Nov 2016 16:24:57 +0000 (16:24 +0000)]
[CVP] Remove cvp-dont-process-adds flag

The flag was introduced because the optimization controlled by the flag initially caused regressions. All the regressions were fixed some time ago and the flag has been false for quite a while.

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

7 years ago[PowerPC] Improvements for BUILD_VECTOR Vol. 1
Nemanja Ivanovic [Tue, 29 Nov 2016 16:11:34 +0000 (16:11 +0000)]
[PowerPC] Improvements for BUILD_VECTOR Vol. 1

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

This is the first patch in a series of 4 that improve the lowering and combining
for BUILD_VECTOR nodes on PowerPC.

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

7 years ago[SLP] Add a new test for tree vectorization starting from insertelement
Alexey Bataev [Tue, 29 Nov 2016 15:37:52 +0000 (15:37 +0000)]
[SLP] Add a new test for tree vectorization starting from insertelement
instruction.

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

7 years ago[X86] Moved getTargetConstantFromNode function so a future patch is more understandab...
Simon Pilgrim [Tue, 29 Nov 2016 15:32:58 +0000 (15:32 +0000)]
[X86] Moved getTargetConstantFromNode function so a future patch is more understandable. NFCI.

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

7 years ago[GVNHoist] Rename variables.
Aditya Kumar [Tue, 29 Nov 2016 14:36:27 +0000 (14:36 +0000)]
[GVNHoist] Rename variables.

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

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

7 years ago[GVNHoist] Enable aggressive hoisting when optimizing for code-size
Aditya Kumar [Tue, 29 Nov 2016 14:34:01 +0000 (14:34 +0000)]
[GVNHoist] Enable aggressive hoisting when optimizing for code-size

Enable scalar hoisting at -Oz as it is safe to hoist scalars to a place
where they are partially needed.

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

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

7 years ago[X86][SSE] Add initial support for combining target shuffles to (V)PMOVZX.
Simon Pilgrim [Tue, 29 Nov 2016 14:18:51 +0000 (14:18 +0000)]
[X86][SSE] Add initial support for combining target shuffles to (V)PMOVZX.

We can only handle 128-bit vectors until we support target shuffle inputs of different size to the output.

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

7 years agoAvoid repeated calls to MVT::getScalarSizeInBits(). NFCI.
Simon Pilgrim [Tue, 29 Nov 2016 13:43:08 +0000 (13:43 +0000)]
Avoid repeated calls to MVT::getScalarSizeInBits(). NFCI.

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

7 years ago[X86][SSE] Added tests showing missed combines to (V)PMOVZX
Simon Pilgrim [Tue, 29 Nov 2016 13:16:11 +0000 (13:16 +0000)]
[X86][SSE] Added tests showing missed combines to (V)PMOVZX

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

7 years ago[PM] Fix a bad invalid densemap iterator bug in the new invalidation
Chandler Carruth [Tue, 29 Nov 2016 12:54:34 +0000 (12:54 +0000)]
[PM] Fix a bad invalid densemap iterator bug in the new invalidation
logic.

Yup, the invalidation logic has an invalid iterator bug. Can't make this
stuff up.

We can recursively insert things into the map so we can't cache the
iterator into that map across those recursive calls. We did this
differently in two places. I have an end-to-end test that triggers at
least one of them. I'm going to work on a nice minimal test case that
triggers these, but I didn't want to leave the bug in the tree while
I tried to trigger it.

Also, the dense map iterator checking stuff we have now is awesome. =D

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

7 years ago[StringRef] Use default member initializers and = default.
Malcolm Parsons [Tue, 29 Nov 2016 10:53:18 +0000 (10:53 +0000)]
[StringRef] Use default member initializers and = default.

Summary: This makes the default constructor implicitly constexpr and noexcept.

Reviewers: zturner, beanz

Subscribers: llvm-commits

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

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

7 years ago[SLPVectorizer] Improved support of partial tree vectorization.
Alexey Bataev [Tue, 29 Nov 2016 08:21:14 +0000 (08:21 +0000)]
[SLPVectorizer] Improved support of partial tree vectorization.

Currently SLP vectorizer tries to vectorize a binary operation and dies
immediately after unsuccessful the first unsuccessfull attempt. Patch
tries to improve the situation, trying to vectorize all binary
operations of all children nodes in the binop tree.

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

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

7 years agoTest commit. Comment changes. NFC.
Warren Ristow [Tue, 29 Nov 2016 02:37:13 +0000 (02:37 +0000)]
Test commit.  Comment changes.  NFC.

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

7 years agoBitcode: Change expected layout of module blocks.
Peter Collingbourne [Tue, 29 Nov 2016 02:27:04 +0000 (02:27 +0000)]
Bitcode: Change expected layout of module blocks.

We now expect each module's identification block to appear immediately before
the module block. Any module block that appears without an identification block
immediately before it is interpreted as if it does not have a module block.

Also change the interpretation of VST and function offsets in bitcode.
The offset is always taken as relative to the start of the identification
(or module if not present) block, minus one word. This corresponds to the
historical interpretation of offsets, i.e. relative to the start of the file.

These changes allow for bitcode modules to be concatenated by copying bytes.

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

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

7 years ago[asan/win] Align global registration metadata to its size
Reid Kleckner [Tue, 29 Nov 2016 01:32:21 +0000 (01:32 +0000)]
[asan/win] Align global registration metadata to its size

This way, when the linker adds padding between globals, we can skip over
the zero padding bytes and reliably find the start of the next metadata
global.

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

7 years agoAMDGPU/SI: Avoid moving PHIs to VALU when phi values are defined in scalar branches
Tom Stellard [Tue, 29 Nov 2016 00:46:46 +0000 (00:46 +0000)]
AMDGPU/SI: Avoid moving PHIs to VALU when phi values are defined in scalar branches

Reviewers: arsenm

Subscribers: arsenm, llvm-commits, kzhuravl

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

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

7 years agoRecognize ${:uid} escapes in intel syntax inline asm
Reid Kleckner [Tue, 29 Nov 2016 00:29:27 +0000 (00:29 +0000)]
Recognize ${:uid} escapes in intel syntax inline asm

It looks like this logic was duplicated long ago and the GCC side of
things has grown additional functionality. We need ${:uid} at least to
generate unique MS inline asm labels (PR23715), so expose these.

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

7 years ago[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination
Adam Nemet [Tue, 29 Nov 2016 00:09:22 +0000 (00:09 +0000)]
[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination

This includes the intervening store and the load/store that we're trying
to forward from in the optimization remark for the missed load
elimination.

This is hooked up under a new mode in ORE that allows for compile-time
budget for a bit more analysis to print more insightful messages.  This
mode is currently enabled for -fsave-optimization-record (-Rpass is
trickier since it is controlled in the front-end).

With this we can now print the red remark in http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446

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

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

7 years ago[DAG] clean up foldSelectCCToShiftAnd(); NFCI
Sanjay Patel [Mon, 28 Nov 2016 23:05:55 +0000 (23:05 +0000)]
[DAG] clean up foldSelectCCToShiftAnd(); NFCI

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

7 years agoPut ABI breaking test in Error checking behind LLVM_ENABLE_ABI_BREAKING_CHECKS
Mehdi Amini [Mon, 28 Nov 2016 22:57:11 +0000 (22:57 +0000)]
Put ABI breaking test in Error checking behind LLVM_ENABLE_ABI_BREAKING_CHECKS

This macro is supposed to be the one controlling the compatibility
of ABI breaks induced when enabling or disabling assertions in LLVM.

The macro is enabled by default in assertions build, so this commit
won't disable the tests.

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

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

7 years agoAdd error checking for Mach-O universal files.
Kevin Enderby [Mon, 28 Nov 2016 22:40:50 +0000 (22:40 +0000)]
Add error checking for Mach-O universal files.

Add the checking for both the MachO::fat_header and the
MachO::fat_arch struct values in the constructor for
MachOUniversalBinary. Such that when the constructor
for ObjectForArch is called it can assume the values in
the MachO::fat_arch for the offset and size are contained
in the file after the MachOUniversalBinary constructor
is called for the Parent.

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

7 years agoAdd link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
Mehdi Amini [Mon, 28 Nov 2016 22:23:53 +0000 (22:23 +0000)]
Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch

The macro LLVM_ENABLE_ABI_BREAKING_CHECKS is moved to a new header
abi-breaking.h, from llvm-config.h. Only headers that are using the
macro are including this new header.

LLVM will define a symbol, either EnableABIBreakingChecks or
DisableABIBreakingChecks depending on the configuration setting for
LLVM_ABI_BREAKING_CHECKS.

The abi-breaking.h header will add weak references to these symbols in
every clients that includes this header. This should ensure that
a mismatch triggers a link failure (or a load time failure for DSO).

On MSVC, the pragma "detect_mismatch" is used instead.

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

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

7 years ago[PM] Extend the explicit 'invalidate' method API on analysis results to
Chandler Carruth [Mon, 28 Nov 2016 22:04:31 +0000 (22:04 +0000)]
[PM] Extend the explicit 'invalidate' method API on analysis results to
accept an Invalidator that allows them to invalidate themselves if their
dependencies are in turn invalidated.

Rather than recording the dependency graph ahead of time when analysis
get results from other analyses, this simply lets each result trigger
the immediate invalidation of any analyses they actually depend on. They
do this in a way that has three nice properties:

1) They don't have to handle transitive dependencies because the
   infrastructure will recurse for them.
2) The invalidate methods are still called only once. We just
   dynamically discover the necessary topological ordering, everything
   is memoized nicely.
3) The infrastructure still provides a default implementation and can
   access it so that only analyses which have dependencies need to do
   anything custom.

To make this work at all, the invalidation logic also has to defer the
deletion of the result objects themselves so that they can remain alive
until we have collected the complete set of results to invalidate.

A unittest is added here that has exactly the dependency pattern we are
concerned with. It hit the use-after-free described by Sean in much
detail in the long thread about analysis invalidation before this
change, and even in an intermediate form of this change where we failed
to defer the deletion of the result objects.

There is an important problem with doing dependency invalidation that
*isn't* solved here: we don't *enforce* that results correctly
invalidate all the analyses whose results they depend on.

I actually looked at what it would take to do that, and it isn't as hard
as I had thought but the complexity it introduces seems very likely to
outweigh the benefit. The technique would be to provide a base class for
an analysis result that would be populated with other results, and
automatically provide the invalidate method which immediately does the
correct thing. This approach has some nice pros IMO:
- Handles the case we care about and nothing else: only *results*
  that depend on other analyses trigger extra invalidation.
- Localized to the result rather than centralized in the analysis
  manager.
- Ties the storage of the reference to another result to the triggering
  of the invalidation of that analysis.
- Still supports extending invalidation in customized ways.

But the down sides here are:
- Very heavy-weight meta-programming is needed to provide this base
  class.
- Requires a pretty awful API for accessing the dependencies.

Ultimately, I fear it will not pull its weight. But we can re-evaluate
this at any point if we start discovering consistent problems where the
invalidation and dependencies get out of sync. It will fit as a clean
layer on top of the facilities in this patch that we can add if and when
we need it.

Note that I'm not really thrilled with the names for these APIs... The
name "Invalidator" seems ok but not great. The method name "invalidate"
also. In review some improvements were suggested, but they really need
*other* uses of these terms to be updated as well so I'm going to do
that in a follow-up commit.

I'm working on the actual fixes to various analyses that need to use
these, but I want to try to get tests for each of them so we don't
regress. And those changes are seperable and obvious so once this goes
in I should be able to roll them out throughout LLVM.

Many thanks to Sean, Justin, and others for help reviewing here.

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

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

7 years agocmake: Set rpath for loadable modules as well as shared libraries.
Peter Collingbourne [Mon, 28 Nov 2016 21:59:14 +0000 (21:59 +0000)]
cmake: Set rpath for loadable modules as well as shared libraries.

This fixes a regression introduced by r285714: we weren't setting the
rpath on LLVMgold.so correctly.

Spotted by mark@chromium.org!

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

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

7 years ago[SROA] Drop lifetime.start/end intrinsics when they block promotion.
Eli Friedman [Mon, 28 Nov 2016 21:50:34 +0000 (21:50 +0000)]
[SROA] Drop lifetime.start/end intrinsics when they block promotion.

Preserving lifetime markers isn't as important as allowing promotion,
so just drop the lifetime markers if necessary.

This also fixes an assertion failure where other parts of SROA assumed
that lifetime markers never block promotion.

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

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

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

7 years ago[DAG] add helper function for selectcc --> and+shift transforms; NFC
Sanjay Patel [Mon, 28 Nov 2016 21:47:41 +0000 (21:47 +0000)]
[DAG] add helper function for selectcc --> and+shift transforms; NFC

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

7 years agoImprove error handling in YAML parsing
Mehdi Amini [Mon, 28 Nov 2016 21:38:52 +0000 (21:38 +0000)]
Improve error handling in YAML parsing

Some scanner errors were not checked and reported by the parser.

Fix PR30934. Recommit r288014 after fixing unittest.

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

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

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

7 years ago[DebugInfo] Add support for DW_AT_main_subprogram on subprograms
David Blaikie [Mon, 28 Nov 2016 21:32:19 +0000 (21:32 +0000)]
[DebugInfo] Add support for DW_AT_main_subprogram on subprograms

Patch by Tom Tromey! (for use with Rust)

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

7 years agoMachineScheduler: Export function to construct "default" scheduler.
Matthias Braun [Mon, 28 Nov 2016 20:11:54 +0000 (20:11 +0000)]
MachineScheduler: Export function to construct "default" scheduler.

This makes the createGenericSchedLive() function that constructs the
default scheduler available for the public API. This should help when
you want to get a scheduler and the default list of DAG mutations.

This also shrinks the list of default DAG mutations:
{Load|Store}ClusterDAGMutation and MacroFusionDAGMutation are no longer
added by default. Targets can easily add them if they need them. It also
makes it easier for targets to add alternative/custom macrofusion or
clustering mutations while staying with the default
createGenericSchedLive(). It also saves the callback back and forth in
TargetInstrInfo::enableClusterLoads()/enableClusterStores().

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

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

7 years agoRevert r287637 "[wasm] hack around test failure after r287553."
Artem Belevich [Mon, 28 Nov 2016 19:55:46 +0000 (19:55 +0000)]
Revert r287637 "[wasm] hack around test failure after r287553."

-cgp-freq-ratio-to-skip-merge option was removed by rollback in r288052.

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

7 years ago[AMDGPU] Allow hoisting of comparisons out of a loop and eliminate condition copies
Stanislav Mekhanoshin [Mon, 28 Nov 2016 18:58:49 +0000 (18:58 +0000)]
[AMDGPU] Allow hoisting of comparisons out of a loop and eliminate condition copies

Codegen prepare sinks comparisons close to a user is we have only one register
for conditions. For AMDGPU we have many SGPRs capable to hold vector conditions.
Changed BE to report we have many condition registers. That way IR LICM pass
would hoist an invariant comparison out of a loop and codegen prepare will not
sink it.

With that done a condition is calculated in one block and used in another.
Current behavior is to store workitem's condition in a VGPR using v_cndmask_b32
and then restore it with yet another v_cmp instruction from that v_cndmask's
result. To mitigate the issue a propagation of source SGPR pair in place of v_cmp
is implemented. Additional side effect of this is that we may consume less VGPRs
at a cost of more SGPRs in case if holding of multiple conditions is needed, and
that is a clear win in most cases.

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

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

7 years agoRevert r287553: [CodeGenPrep] Skip merging empty case blocks
Joerg Sonnenberger [Mon, 28 Nov 2016 18:56:54 +0000 (18:56 +0000)]
Revert r287553: [CodeGenPrep] Skip merging empty case blocks

It results in assertions in lib/Analysis/BlockFrequencyInfoImpl.cpp line
670 ("Expected irreducible CFG").

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

7 years ago[StructurizeCFG] Use range-based for loops.
Justin Lebar [Mon, 28 Nov 2016 18:50:03 +0000 (18:50 +0000)]
[StructurizeCFG] Use range-based for loops.

Reviewers: arsenm

Subscribers: wdng, llvm-commits

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

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

7 years ago[StructurizeCFG] Refactor NearestCommonDominator.
Justin Lebar [Mon, 28 Nov 2016 18:49:59 +0000 (18:49 +0000)]
[StructurizeCFG] Refactor NearestCommonDominator.

Summary:
As far as I can tell, doing our own computations in
NearestCommonDominator is a false optimization -- DomTree will build up
what appears to be exactly this data when it decides it's worthwhile.
Moreover, by building the cache ourselves, we cannot take advantage of
the cache that the domtree might have available.

In addition, I am not convinced of the correctness of the original code.
In particular, setting ResultIndex = 1 on the first addBlock instead of
setting it to 0 is quite fishy.  Similarly, it's not clear to me that
setting IndexMap[Node] = 0 for every node as we walk up the tree finding
a common parent is correct.  But rather than ponder over these
questions, I'd rather just make the code do the obviously-correct thing.

This patch also changes the NearestCommonDominator API a bit, improving
the names and getting rid of the boolean parameter in addBlock -- see
http://jlebar.com/2011/12/16/Boolean_parameters_to_API_functions_considered_harmful..html

Reviewers: arsenm

Subscribers: aemerson, wdng, llvm-commits

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

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

7 years ago[X86][SSE] Add initial support for combining (V)PMOVZX with shuffles.
Simon Pilgrim [Mon, 28 Nov 2016 17:58:19 +0000 (17:58 +0000)]
[X86][SSE] Add initial support for combining (V)PMOVZX with shuffles.

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

7 years ago[GVN, OptDiag] Include the value that is forwarded in load elimination
Adam Nemet [Mon, 28 Nov 2016 17:45:34 +0000 (17:45 +0000)]
[GVN, OptDiag] Include the value that is forwarded in load elimination

This requires some changes to the opt-diag API.  Hal and I have
discussed this at the Dev Meeting and came up with a streaming delimiter
(setExtraArgs) to solve this.

Arguments after this delimiter are only included in the optimization
records and not in the remarks printed in the compiler output.  (Note,
how in the test the content of the YAML file changes but the remarks on
the compiler output don't.)

This implements the green GVN message with a bug fix at line
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446

The fix is that now we properly include the constant value in the
message: "load of type i32 eliminated in favor of 7"

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

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

7 years ago[GVN] Basic optimization remark support
Adam Nemet [Mon, 28 Nov 2016 17:45:28 +0000 (17:45 +0000)]
[GVN] Basic optimization remark support

Follow-on patches will add more interesting cases.

The goal of this patch-set is to get the GVN messages printed in
opt-viewer from Dhrystone as was presented in my Dev Meeting talk.  This
is the optimization view for the function (the last remark in the
function has a bug which is fixed in this series):
http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L430

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

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