OSDN Git Service

android-x86/external-llvm.git
7 years agoADT: Use LLVM_NODISCARD instead of LLVM_ATTRIBUTE_UNUSED_RESULT for APInt
Justin Bogner [Sat, 15 Oct 2016 00:22:06 +0000 (00:22 +0000)]
ADT: Use LLVM_NODISCARD instead of LLVM_ATTRIBUTE_UNUSED_RESULT for APInt

Instead of annotating (most of) the APInt API, we can just annotate
the type directly. This is less code and it will warn in more cases.

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

7 years ago[NFC] Loop Versioning for LICM code clean up
Evgeny Astigeevich [Fri, 14 Oct 2016 23:00:36 +0000 (23:00 +0000)]
[NFC] Loop Versioning for LICM code clean up

- Removed unused class members.
- Made class internal data private.
- Made class scoped data function scoped where it's possible.
- Replace naked new/delete with unique_ptr.
- Made resources guaranteed to be freed.

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

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

7 years agoGlobalISel: rename legalizer components to match others.
Tim Northover [Fri, 14 Oct 2016 22:18:18 +0000 (22:18 +0000)]
GlobalISel: rename legalizer components to match others.

The previous names were both misleading (the MachineLegalizer actually
contained the info tables) and inconsistent with the selector & translator (in
having a "Machine") prefix. This should make everything sensible again.

The only functional change is the name of a couple of command-line options.

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

7 years agoSupport: Add LLVM_NODISCARD with C++17's [[nodiscard]] semantics
Justin Bogner [Fri, 14 Oct 2016 22:04:17 +0000 (22:04 +0000)]
Support: Add LLVM_NODISCARD with C++17's [[nodiscard]] semantics

This is essentially a more powerful version of our current
LLVM_ATTRIBUTE_UNUSED_RESULT, in that it can also be applied to types
and generate warnings whenever an object of that type is returned by
value and the value is discarded.

I'll replace uses of LLVM_ATTRIBUTE_UNUSED_RESULT and remove that
macro in follow up commits.

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

7 years agohardware_physical_concurrency() should return 1 when LLVM is built with LLVM_ENABLE_T...
Mehdi Amini [Fri, 14 Oct 2016 21:32:35 +0000 (21:32 +0000)]
hardware_physical_concurrency() should return 1 when LLVM is built with LLVM_ENABLE_THREADS=OFF

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

7 years agoPowerPC: specify full triple to avoid different Darwin asm syntax.
Tim Northover [Fri, 14 Oct 2016 21:25:29 +0000 (21:25 +0000)]
PowerPC: specify full triple to avoid different Darwin asm syntax.

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

7 years ago[ARM] add tests for PR30660
Sanjay Patel [Fri, 14 Oct 2016 20:52:43 +0000 (20:52 +0000)]
[ARM] add tests for PR30660

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

7 years ago[PowerPC] add tests for PR30661
Sanjay Patel [Fri, 14 Oct 2016 20:51:41 +0000 (20:51 +0000)]
[PowerPC] add tests for PR30661

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

7 years ago[PPC] Shorter sequence to load 64bit constant with same hi/lo words
Guozhi Wei [Fri, 14 Oct 2016 20:41:50 +0000 (20:41 +0000)]
[PPC] Shorter sequence to load 64bit constant with same hi/lo words

This is a patch to implement pr30640.

When a 64bit constant has the same hi/lo words, we can use rldimi to copy the low word into high word of the same register.

This optimization caused failure of test case bperm.ll because of not optimal heuristic in function SelectAndParts64. It chooses AND or ROTATE to extract bit groups from a register, and OR them together. This optimization lowers the cost of loading 64bit constant mask used in AND method, and causes different code sequence. But actually ROTATE method is better in this test case. The reason is in ROTATE method the final OR operation can be avoided since rldimi can insert the rotated bits into target register directly. So this patch also enhances SelectAndParts64 to prefer ROTATE method when the two methods have same cost and there are multiple bit groups need to be ORed together.

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

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

7 years ago[libFuzzer] remove subdir fuzzer-test-suite as it is now superseded with https:/...
Kostya Serebryany [Fri, 14 Oct 2016 20:26:40 +0000 (20:26 +0000)]
[libFuzzer] remove subdir fuzzer-test-suite as it is now superseded with https://github.com/google/fuzzer-test-suite

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

7 years ago[libFuzzer] add -trace_cmp=1 (guiding mutations based on the observed CMP instruction...
Kostya Serebryany [Fri, 14 Oct 2016 20:20:33 +0000 (20:20 +0000)]
[libFuzzer] add -trace_cmp=1 (guiding mutations based on the observed CMP instructions). This is a reincarnation of the previously deleted -use_traces, but using a different approach for collecting traces. Still a toy, but at least it scales well. Also fix -merge in trace-pc-guard mode

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

7 years agovim: add `norecurse` attribute
Saleem Abdulrasool [Fri, 14 Oct 2016 19:48:34 +0000 (19:48 +0000)]
vim: add `norecurse` attribute

Add missing attribute to the keyword set.

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

7 years agovim: add `comdat` keyword
Saleem Abdulrasool [Fri, 14 Oct 2016 19:48:31 +0000 (19:48 +0000)]
vim: add `comdat` keyword

The attribute may be applied to a function.  Highlight it as a keyword.

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

7 years ago[DAG] avoid creating illegal node when transforming negated shifted sign bit
Sanjay Patel [Fri, 14 Oct 2016 19:46:31 +0000 (19:46 +0000)]
[DAG] avoid creating illegal node when transforming negated shifted sign bit

Eli noted this potential bug in the post-commit thread for:
https://reviews.llvm.org/rL284239
...but I'm not sure how to trigger it, so there's no test case yet.

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

7 years agoAMDGPU/SI: Use new SimplifyDemandedBits helper for multi-use operations
Tom Stellard [Fri, 14 Oct 2016 19:14:29 +0000 (19:14 +0000)]
AMDGPU/SI: Use new SimplifyDemandedBits helper for multi-use operations

Summary:
We are using this helper for our 24-bit arithmetic combines, so we are now able to eliminate multi-use operations that mask the high-bits of 24-bit inputs (e.g. and x, 0xffffff)

Reviewers: arsenm, nhaehnle

Subscribers: tony-tye, arsenm, kzhuravl, wdng, nhaehnle, llvm-commits, yaxunl

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

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

7 years agoTargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt
Tom Stellard [Fri, 14 Oct 2016 19:14:26 +0000 (19:14 +0000)]
TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt

Summary:
The main purpose of this new helper is to enable simplifying operations that
have multiple uses.  SimplifyDemandedBits does not handle multiple uses
currently, and this new function makes it possible to optimize:

and v1, v0, 0xffffff
mul24 v2, v1, v1      ; Multiply ignoring high 8-bits.

To:

mul24 v2, v0, v0

Where before this would not be optimized, because v1 has multiple uses.

Reviewers: bogner, arsenm

Subscribers: nhaehnle, wdng, llvm-commits

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

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

7 years agoThe real fix for post-r284255 failures
Krzysztof Parzyszek [Fri, 14 Oct 2016 19:06:25 +0000 (19:06 +0000)]
The real fix for post-r284255 failures

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

7 years agoWorkaround to eliminate check-llvm failures after r284255
Krzysztof Parzyszek [Fri, 14 Oct 2016 18:36:42 +0000 (18:36 +0000)]
Workaround to eliminate check-llvm failures after r284255

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

7 years agoAdd a pass to optimize patterns of vectorized interleaved memory accesses for
David L Kreitzer [Fri, 14 Oct 2016 18:20:41 +0000 (18:20 +0000)]
Add a pass to optimize patterns of vectorized interleaved memory accesses for
X86. The pass optimizes as a unit the entire wide load + shuffles pattern
produced by interleaved vectorization. This initial patch optimizes one pattern
(64-bit elements interleaved by a factor of 4). Future patches will generalize
to additional patterns.

Patch by Farhana Aleen

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

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

7 years agoAMDGPU/SI: Don't allow unaligned scratch access
Tom Stellard [Fri, 14 Oct 2016 18:10:39 +0000 (18:10 +0000)]
AMDGPU/SI: Don't allow unaligned scratch access

Summary: The hardware doesn't support this.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

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

7 years ago[RDF] Switch RegisterRef to be a pair (Register, LaneMask)
Krzysztof Parzyszek [Fri, 14 Oct 2016 17:57:55 +0000 (17:57 +0000)]
[RDF] Switch RegisterRef to be a pair (Register, LaneMask)

Use PackedRegisterRef to store the register information in the graph nodes.

This commit also removes support for virtual registers. It has never been
tested or used. It will be possible to add it back if there is a need.

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

7 years ago[safestack] Use non-thread-local unsafe stack pointer for Contiki OS
David L Kreitzer [Fri, 14 Oct 2016 17:56:00 +0000 (17:56 +0000)]
[safestack] Use non-thread-local unsafe stack pointer for Contiki OS

Patch by Michael LeMay

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

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

7 years agoRevert "In preparation for removing getNameWithPrefix off of
Eric Christopher [Fri, 14 Oct 2016 17:28:23 +0000 (17:28 +0000)]
Revert "In preparation for removing getNameWithPrefix off of
TargetMachine," as it's causing sanitizer/memory issues until I
can track down this set.

This reverts commit r284203

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

7 years ago[Coverage] Support loading multiple binaries into a CoverageMapping
Vedant Kumar [Fri, 14 Oct 2016 17:16:53 +0000 (17:16 +0000)]
[Coverage] Support loading multiple binaries into a CoverageMapping

Add support for loading multiple coverage readers into a single
CoverageMapping instance. This should make it easier to prepare a
unified coverage report for multiple binaries.

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

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

7 years agoMove alignTo computation inside the if.
Rafael Espindola [Fri, 14 Oct 2016 17:01:39 +0000 (17:01 +0000)]
Move alignTo computation inside the if.

This is an improvement when compiling with llvm. llvm doesn't inline
the call to insert, so the align is always executed and shows up in
the profile.

With gcc the call to insert is inlined and the align computation moved
and done only if needed.

With this patch we explicitly only compute it if it is needed.

In the two tests with debug info, the speedup was

scylla
  master 3.008959365
  patch  2.932080942 1.02621974786x faster

firefox
  master 6.709823604
  patch  6.592387227 1.01781393795x faster

In all others the difference was in the noise.

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

7 years ago[X86] Take advantage of the lzcnt instruction on btver2 architectures when ORing...
Pierre Gousseau [Fri, 14 Oct 2016 16:41:38 +0000 (16:41 +0000)]
[X86] Take advantage of the lzcnt instruction on btver2 architectures when ORing comparisons to zero.

This change adds transformations such as:
  zext(or(setcc(eq, (cmp x, 0)), setcc(eq, (cmp y, 0))))
  To:
  srl(or(ctlz(x), ctlz(y)), log2(bitsize(x))
This optimisation is beneficial on Jaguar architecture only, where lzcnt has a good reciprocal throughput.
Other architectures such as Intel's Haswell/Broadwell or AMD's Bulldozer/PileDriver do not benefit from it.
For this reason the change also adds a "HasFastLZCNT" feature which gets enabled for Jaguar.

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

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

7 years ago[InstCombine] use m_APInt to allow sub with constant folds for splat vectors
Sanjay Patel [Fri, 14 Oct 2016 16:31:54 +0000 (16:31 +0000)]
[InstCombine] use m_APInt to allow sub with constant folds for splat vectors

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

7 years ago[docs] Update some obsolete information in BitCodeFormat docs.
Mehdi Amini [Fri, 14 Oct 2016 16:23:09 +0000 (16:23 +0000)]
[docs] Update some obsolete information in BitCodeFormat docs.

Summary:
* Describe new (3.3) parameter attribute group encoding, leaving old encoding there with a note about legacy
* Bring TYPE_BLOCK docs up to date
* Remove docs about obsolete (pre 3.0) TYPE_SYMTAB_BLOCK, TST_CODE_ENTRY
* Fix a couple of incorrect comments and remove one unused enum definition along the way

This addresses https://llvm.org/bugs/show_bug.cgi?id=28941.

Patch by: Ismail Badawi <ibadawi@cisco.com>

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

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

7 years ago[InstCombine] add tests for missing vector folds
Sanjay Patel [Fri, 14 Oct 2016 15:55:34 +0000 (15:55 +0000)]
[InstCombine] add tests for missing vector folds

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

7 years ago[InstCombine] auto-generate checks
Sanjay Patel [Fri, 14 Oct 2016 15:41:25 +0000 (15:41 +0000)]
[InstCombine] auto-generate checks

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

7 years ago[InstCombine] remove redundant test
Sanjay Patel [Fri, 14 Oct 2016 15:36:28 +0000 (15:36 +0000)]
[InstCombine] remove redundant test

This test was apparently checking for 2 independent folds, but we have
plenty of tests for those individual folds already. We are lacking
vector tests, however, because we don't have the shift folds for vectors.

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

7 years ago[InstCombine] update test to use FileCheck and auto-generate checks
Sanjay Patel [Fri, 14 Oct 2016 15:30:31 +0000 (15:30 +0000)]
[InstCombine] update test to use FileCheck and auto-generate checks

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

7 years ago[InstCombine] sub X, sext(bool Y) -> add X, zext(bool Y)
Sanjay Patel [Fri, 14 Oct 2016 15:24:31 +0000 (15:24 +0000)]
[InstCombine] sub X, sext(bool Y) -> add X, zext(bool Y)

Prefer add/zext because they are better supported in terms of value-tracking.

Note that the backend should be prepared for this IR canonicalization
(including vector types) after:
https://reviews.llvm.org/rL284015

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

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

7 years agoDefine "contiki" OS specifier.
David L Kreitzer [Fri, 14 Oct 2016 14:41:46 +0000 (14:41 +0000)]
Define "contiki" OS specifier.

Patch by Michael LeMay

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

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

7 years ago[DAG] add folds for negated shifted sign bit
Sanjay Patel [Fri, 14 Oct 2016 14:26:47 +0000 (14:26 +0000)]
[DAG] add folds for negated shifted sign bit

The same folds exist in InstCombine already.

This came up as part of:
https://reviews.llvm.org/D25485

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

7 years ago[x86] add tests to show missing folds for negated shifted sign bit
Sanjay Patel [Fri, 14 Oct 2016 14:14:40 +0000 (14:14 +0000)]
[x86] add tests to show missing folds for negated shifted sign bit

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

7 years agoAMDGPU: Select 64-bit {ADD,SUB}{C,E} nodes
Nicolai Haehnle [Fri, 14 Oct 2016 10:30:00 +0000 (10:30 +0000)]
AMDGPU: Select 64-bit {ADD,SUB}{C,E} nodes

Summary:
This will be used for 64-bit MULHU, which is in turn used for the 64-bit
divide-by-constant optimization (see D24822).

Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

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

7 years ago[GlobalISel] Get the AArch64 tests to work on Linux
Diana Picus [Fri, 14 Oct 2016 10:19:40 +0000 (10:19 +0000)]
[GlobalISel] Get the AArch64 tests to work on Linux

Mostly this just means changing the triple from aarch64-apple-ios to the generic
aarch64--. Only one test needs more significant changes, but GlobalISel already
does the right thing so it's ok to just change the checks.

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

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

7 years agoFix use-after-frees
Nicolai Haehnle [Fri, 14 Oct 2016 09:49:51 +0000 (09:49 +0000)]
Fix use-after-frees

Extracted from D25313, as suggested by Justin Bogner.

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

7 years ago[mips] Fix aui/daui/dahi/dati for MIPSR6
Simon Dardis [Fri, 14 Oct 2016 09:31:42 +0000 (09:31 +0000)]
[mips] Fix aui/daui/dahi/dati for MIPSR6

For compatiblity with binutils, define these instructions to take
two registers with a 16bit unsigned immediate. Both of the registers
have to be same for dahi and dati.

Reviewers: dsanders, zoran.jovanovic

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

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

7 years agoAMDGPU: Fix use-after-frees
Nicolai Haehnle [Fri, 14 Oct 2016 09:03:04 +0000 (09:03 +0000)]
AMDGPU: Fix use-after-frees

Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits

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

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

7 years ago[x86][ms-inline-asm] use of "jmp short" in asm is not supported
Michael Zuckerman [Fri, 14 Oct 2016 08:09:40 +0000 (08:09 +0000)]
[x86][ms-inline-asm] use of "jmp short" in asm is not supported

Committing in the name of Ziv Izhar: After check-all and LGTM .

The following patch is for compatability with Microsoft.
Microsoft ignores the keyword "short" when used after a jmp, for example:
__asm {
      jmp short label
      label:
      }

A test for that patch will be added in another patch, since it's located in clang's codegen tests. Link will be added shortly.
link to test: https://reviews.llvm.org/D24958

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

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

7 years ago[DAGCombiner] Teach createBuildVecShuffle to handle cases where input vectors are...
Craig Topper [Fri, 14 Oct 2016 06:00:42 +0000 (06:00 +0000)]
[DAGCombiner] Teach createBuildVecShuffle to handle cases where input vectors are less than half of the output vector size.

This will be needed by a future commit to support sign/zero extending from v8i8 to v8i64 which requires a sign/zero_extend_vector_inreg to be created which requires v8i8 to be concatenated upto v64i8 and goes through this code.

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

7 years agoIn preparation for removing getNameWithPrefix off of TargetMachine,
Eric Christopher [Fri, 14 Oct 2016 05:47:41 +0000 (05:47 +0000)]
In preparation for removing getNameWithPrefix off of TargetMachine,
sink the current behavior into the callers and sink
TargetMachine::getNameWithPrefix into TargetMachine::getSymbol.

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

7 years agoTidy the calls to getCurrentSection().first -> getCurrentSectionOnly to help
Eric Christopher [Fri, 14 Oct 2016 05:47:37 +0000 (05:47 +0000)]
Tidy the calls to getCurrentSection().first -> getCurrentSectionOnly to help
readability a bit.

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

7 years agoTidy up example of getting the pointer size.
Eric Christopher [Fri, 14 Oct 2016 05:45:46 +0000 (05:45 +0000)]
Tidy up example of getting the pointer size.

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

7 years ago[AMDGPU] Emit 32-bit lo/hi got and pc relative variant kinds for external and global...
Konstantin Zhuravlyov [Fri, 14 Oct 2016 04:37:34 +0000 (04:37 +0000)]
[AMDGPU] Emit 32-bit lo/hi got and pc relative variant kinds for external and global address space variables

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

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

7 years ago[AMDGPU] Add 32-bit lo/hi got and pc relative variant kinds and emit appropriate...
Konstantin Zhuravlyov [Fri, 14 Oct 2016 04:21:32 +0000 (04:21 +0000)]
[AMDGPU] Add 32-bit lo/hi got and pc relative variant kinds and emit appropriate relocations

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

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

7 years ago[Support/ELF/AMDGPU] Add 32-bit lo/hi got and pc relative relocations
Konstantin Zhuravlyov [Fri, 14 Oct 2016 04:03:49 +0000 (04:03 +0000)]
[Support/ELF/AMDGPU] Add 32-bit lo/hi got and pc relative relocations

Added relocation names:
  - R_AMDGPU_GOTPCREL32_LO
  - R_AMDGPU_GOTPCREL32_HI
  - R_AMDGPU_REL32_LO
  - R_AMDGPU_REL32_HI

AMDGPU isa only supports 32-bit immediates. In order to access 64-bit address we need to generate 32-bit lo/hi relocations, and do the right math (separate patch). Currently we only generate one 32 bit relocation for lower bits for each access, losing higher bits. Hence we need relocations listed above.

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

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

7 years agoAdd `llvm::` in clEnumVal macro (NFC)
Mehdi Amini [Fri, 14 Oct 2016 03:54:46 +0000 (03:54 +0000)]
Add `llvm::` in clEnumVal macro (NFC)

This allows to use llvm:cl::opt without `using namespace llvm;`

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

7 years agoTimer: Fix doxygen comments, use member initializer; NFC
Matthias Braun [Fri, 14 Oct 2016 00:17:19 +0000 (00:17 +0000)]
Timer: Fix doxygen comments, use member initializer; NFC

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

7 years agoAdd interface for querying physical hardware concurrency
Teresa Johnson [Fri, 14 Oct 2016 00:13:59 +0000 (00:13 +0000)]
Add interface for querying physical hardware concurrency

Summary:
This will be used by ThinLTO to set the amount of backend
parallelism, which performs better when restricted to the number
of physical cores (on X86 at least, where getHostNumPhysicalCores is
currently defined). If not available this falls back to
thread::hardware_concurrency.

Note I didn't add to the thread class since that is a typedef to
std::thread where available.

Reviewers: mehdi_amini

Subscribers: beanz, llvm-commits, mgorny

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

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

7 years agoCodeGen: use MSVC division on windows itanium
Saleem Abdulrasool [Thu, 13 Oct 2016 23:00:11 +0000 (23:00 +0000)]
CodeGen: use MSVC division on windows itanium

Windows itanium is identical to MSVC when dealing with everything but C++.
Lower the math routines into msvcrt rather than compiler-rt.

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

7 years agoCodeGen: adjust floating point operations in Windows itanium
Saleem Abdulrasool [Thu, 13 Oct 2016 22:38:15 +0000 (22:38 +0000)]
CodeGen: adjust floating point operations in Windows itanium

Windows itanium is equivalent to MSVC except in C++ mode.  Ensure that the
promote the 32-bit floating point operations to their 64-bit equivalences.

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

7 years ago[DAG] hoist DL(N) and fix formatting; NFC
Sanjay Patel [Thu, 13 Oct 2016 22:27:10 +0000 (22:27 +0000)]
[DAG] hoist DL(N) and fix formatting; NFC

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

7 years ago[libFuzzer] more detailed message for disabled leak detection
Kostya Serebryany [Thu, 13 Oct 2016 22:24:10 +0000 (22:24 +0000)]
[libFuzzer] more detailed message for disabled leak detection

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

7 years agoLegalizeDAG: Implement PROMOTE for ISD::BITREVERSE
Tom Stellard [Thu, 13 Oct 2016 21:03:49 +0000 (21:03 +0000)]
LegalizeDAG: Implement PROMOTE for ISD::BITREVERSE

Summary:
This operation is promoted the same way was ISD::BSWAP.  This will
prevent a regression in test/Target/AMDGOU/bitreverse.ll when i16
support is implemented.

Reviewers: bogner, hfinkel

Subscribers: hfinkel, wdng, llvm-commits

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

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

7 years ago[safestack] Reapply r283248 after moving X86-targeted SafeStack tests into
David L Kreitzer [Thu, 13 Oct 2016 20:57:51 +0000 (20:57 +0000)]
[safestack] Reapply r283248 after moving X86-targeted SafeStack tests into
the X86 subdirectory. Original commit message:

Requires a valid TargetMachine to be passed to the SafeStack pass.

Patch by Michael LeMay

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

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

7 years agoNew llc option pie-copy-relocations to optimize access to extern globals.
Sriraman Tallam [Thu, 13 Oct 2016 20:54:39 +0000 (20:54 +0000)]
New llc option pie-copy-relocations to optimize access to extern globals.

This option indicates copy relocations support is available from the linker
when building as PIE and allows accesses to extern globals to avoid the GOT.

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

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

7 years agoRevert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is...
Nirav Dave [Thu, 13 Oct 2016 20:23:25 +0000 (20:23 +0000)]
Revert "In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled."

This reverts commit r284151 which appears to be triggering a LTO
failures on Hexagon

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

7 years ago[RAGreedy] Empty live-ranges always succeed in last chance recoloring.
Quentin Colombet [Thu, 13 Oct 2016 19:27:48 +0000 (19:27 +0000)]
[RAGreedy] Empty live-ranges always succeed in last chance recoloring.

Relax the constraint for empty live-ranges while doing last chance
recoloring. Indeed, those live-ranges do not need an actual color to be
fond for the recoloring to work.
Empty live-range may happen as a result of splitting/spilling.

Unfortunately no test case for in-tree targets.

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

7 years agoIn visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.
Nirav Dave [Thu, 13 Oct 2016 19:20:16 +0000 (19:20 +0000)]
In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled.

   Retrying after upstream changes.

   Simplify Consecutive Merge Store Candidate Search

   Now that address aliasing is much less conservative, push through
   simplified store merging search which only checks for parallel stores
   through the chain subgraph. This is cleaner as the separation of
   non-interfering loads/stores from the store-merging logic.

   Whem merging stores, search up the chain through a single load, and
   finds all possible stores by looking down from through a load and a
   TokenFactor to all stores visited. This improves the quality of the
   output SelectionDAG and generally the output CodeGen (with some
   exceptions).

   Additional Minor Changes:

       1. Finishes removing unused AliasLoad code
       2. Unifies the the chain aggregation in the merged stores across
       code paths
       3. Re-add the Store node to the worklist after calling
       SimplifyDemandedBits.
       4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
       arbitrary, but seemed sufficient to not cause regressions in
       tests.

   This finishes the change Matt Arsenault started in r246307 and
   jyknight's original patch.

   Many tests required some changes as memory operations are now
   reorderable. Some tests relying on the order were changed to use
   volatile memory operations

   Noteworthy tests:

    CodeGen/AArch64/argument-blocks.ll -
      It's not entirely clear what the test_varargs_stackalign test is
      supposed to be asserting, but the new code looks right.

    CodeGen/AArch64/arm64-memset-inline.lli -
    CodeGen/AArch64/arm64-stur.ll -
    CodeGen/ARM/memset-inline.ll -

      The backend now generates *worse* code due to store merging
      succeeding, as we do do a 16-byte constant-zero store efficiently.

    CodeGen/AArch64/merge-store.ll -
      Improved, but there still seems to be an extraneous vector insert
      from an element to itself?

    CodeGen/PowerPC/ppc64-align-long-double.ll -
      Worse code emitted in this case, due to the improved store->load
      forwarding.

    CodeGen/X86/dag-merge-fast-accesses.ll -
    CodeGen/X86/MergeConsecutiveStores.ll -
    CodeGen/X86/stores-merging.ll -
    CodeGen/Mips/load-store-left-right.ll -
      Restored correct merging of non-aligned stores

    CodeGen/AMDGPU/promote-alloca-stored-pointer-value.ll -
      Improved. Correctly merges buffer_store_dword calls

    CodeGen/AMDGPU/si-triv-disjoint-mem-access.ll -
      Improved. Sidesteps loading a stored value and
      merges two stores

    CodeGen/X86/pr18023.ll -
      This test has been removed, as it was asserting incorrect
      behavior. Non-volatile stores *CAN* be moved past volatile loads,
      and now are.

    CodeGen/X86/vector-idiv.ll -
    CodeGen/X86/vector-lzcnt-128.ll -
      It's basically impossible to tell what these tests are actually
      testing. But, looks like the code got better due to the memory
      operations being recognized as non-aliasing.

    CodeGen/X86/win32-eh.ll -
      Both loads of the securitycookie are now merged.

    CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll -
      This test appears to work but no longer exhibits the spill behavior.

Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle

Subscribers: wdng, nhaehnle, nemanjai, arsenm, weimingz, niravd, RKSimon, aemerson, qcolombet, dsanders, resistor, tstellarAMD, t.p.northover, spatel

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

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

7 years ago[libFuzzer] add -trace_malloc= flag
Kostya Serebryany [Thu, 13 Oct 2016 19:06:46 +0000 (19:06 +0000)]
[libFuzzer] add -trace_malloc= flag

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

7 years ago[AArch64][RegisterBankInfo] Switch to fully static opds mapping for G_BITCAST.
Quentin Colombet [Thu, 13 Oct 2016 18:46:38 +0000 (18:46 +0000)]
[AArch64][RegisterBankInfo] Switch to fully static opds mapping for G_BITCAST.

NFC.

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

7 years ago[safestack] Move X86-targeted tests into the X86 subdirectory.
David L Kreitzer [Thu, 13 Oct 2016 17:51:59 +0000 (17:51 +0000)]
[safestack] Move X86-targeted tests into the X86 subdirectory.

Patch by Michael LeMay

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

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

7 years agoAdd interface to compute number of physical cores on host system
Teresa Johnson [Thu, 13 Oct 2016 17:43:20 +0000 (17:43 +0000)]
Add interface to compute number of physical cores on host system

Summary:
For now I have only added support for x86_64 Linux, but other systems
can be added incrementally.

This is to be used for setting the default parallelism for ThinLTO
backends (instead of thread::hardware_concurrency which includes
hyperthreading and is too aggressive). I'll send this as a follow-on
patch, and it will fall back to hardware_concurrency when the new
getHostNumPhysicalCores returns -1 (when not supported for a given
host system).

I also added an interface to MemoryBuffer to force reading a file
as a stream - this is required for /proc/cpuinfo which is a special
file that looks like a normal file but appears to have 0 size.
The existing readers of this file in Host.cpp are reading the first
1024 or so bytes from it, because the necessary info is near the top.
But for the new functionality we need to be able to read the entire
file. I can go back and change the other readers to use the new
getFileAsStream as a follow-on patch since it seems much more robust.

Added a unittest.

Reviewers: mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

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

7 years agoTruncate long names in type records
Reid Kleckner [Thu, 13 Oct 2016 17:33:22 +0000 (17:33 +0000)]
Truncate long names in type records

In the MS ABI, the frontend is supposed to MD5 such pathologically long
names. LLVM should still defend itself from long names, though.

Fixes part of PR29098.

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

7 years ago[unittests] Remove a redundant test fixture (NFC)
Vedant Kumar [Thu, 13 Oct 2016 17:22:44 +0000 (17:22 +0000)]
[unittests] Remove a redundant test fixture (NFC)

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

7 years ago[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Igor Breger [Thu, 13 Oct 2016 17:20:38 +0000 (17:20 +0000)]
[X86][AVX512] Fix sext v32i1 -> v32i8 lowering.
Fix PR30600.

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

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

7 years ago[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix...
Kostya Serebryany [Thu, 13 Oct 2016 16:19:09 +0000 (16:19 +0000)]
[libFuzzer] reapply r283946: refactoring to speed things up, NFC. Now with a fix for gcc build

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

7 years agoFix for PR30687. Avoid dereferencing MBB.end().
Reid Kleckner [Thu, 13 Oct 2016 15:48:48 +0000 (15:48 +0000)]
Fix for PR30687. Avoid dereferencing MBB.end().

We don't need to return a MachineInstr* from these stack probe insertion
calls anyway. If we ever need to add it back, we can return an iterator
instead.

Based on a patch by David Kreitzer

This bug is a consequence of

r279314 | dexonsmith | 2016-08-19 13:40:12 -0700 (Fri, 19 Aug 2016) | 110 lines

We hit the "Assertion `!NodePtr->isKnownSentinel()' failed" assertion,
but only when inserting a stack probe call at the end of an MBB, which
isn't necessarily a common situation.

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

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

7 years agoDo not delete leading ../ in remove_dots.
Eric Liu [Thu, 13 Oct 2016 15:07:14 +0000 (15:07 +0000)]
Do not delete leading ../ in remove_dots.

Reviewers: bkramer

Subscribers: llvm-commits

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

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

7 years ago[ARM]: Assign cost of scaling used in addressing mode for ARM cores
Javed Absar [Thu, 13 Oct 2016 14:57:43 +0000 (14:57 +0000)]
[ARM]: Assign cost of scaling used in addressing mode for ARM cores

This patch assigns cost of the scaling used in addressing.
On many ARM cores, a negated register offset takes longer than a
non-negated register offset, in a register-offset addressing mode.

For instance:

LDR R0, [R1, R2 LSL #2]
LDR R0, [R1, -R2 LSL #2]

Above, (1) takes less cycles than (2).

By assigning appropriate scaling factor cost, we enable the LLVM
to make the right trade-offs in the optimization and code-selection phase.

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

Reviewers: jmolloy, rengolin

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

7 years ago[LV] Account for predicated stores in instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:54:31 +0000 (14:54 +0000)]
[LV] Account for predicated stores in instruction costs

This patch ensures that we scale the estimated cost of predicated stores by
block probability. This is a follow-on patch for r284123.

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

7 years ago[x86] add negate-i1 run for 32-bit target
Sanjay Patel [Thu, 13 Oct 2016 14:27:08 +0000 (14:27 +0000)]
[x86] add negate-i1 run for 32-bit target

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

7 years ago[LV] Avoid rounding errors for predicated instruction costs
Matthew Simpson [Thu, 13 Oct 2016 14:19:48 +0000 (14:19 +0000)]
[LV] Avoid rounding errors for predicated instruction costs

This patch modifies the cost calculation of predicated instructions (div and
rem) to avoid the accumulation of rounding errors due to multiple truncating
integer divisions. The calculation for predicated stores will be addressed in a
follow-on patch since we currently don't scale the cost of predicated stores by
block probability.

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

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

7 years ago[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style...
Simon Pilgrim [Thu, 13 Oct 2016 14:04:35 +0000 (14:04 +0000)]
[DAGCombiner] Add vector support to (mul (shl X, Y), Z) -> (shl (mul X, Z), Y) style combines

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

7 years agoAMDGPU: Assume spilling will occur at -O0
Matt Arsenault [Thu, 13 Oct 2016 13:10:00 +0000 (13:10 +0000)]
AMDGPU: Assume spilling will occur at -O0

Because everything live is spilled at the end of a
block by fast regalloc, assume this will happen and
avoid the copies of the resource descriptor.

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

7 years agoCopy+pasts typo in comment describing combine test
Simon Pilgrim [Thu, 13 Oct 2016 12:54:32 +0000 (12:54 +0000)]
Copy+pasts typo in comment describing combine test

Repeated the "fold (mul x, 0) -> 0" instead of "fold (mul x, 1) -> x"

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

7 years ago[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding
Simon Pilgrim [Thu, 13 Oct 2016 12:49:31 +0000 (12:49 +0000)]
[DAGCombiner] Add vector support to C2-(A+C1) -> (C2-C1)-A folding

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

7 years agoAMDGPU: Fix truncate to bool warnings
Matt Arsenault [Thu, 13 Oct 2016 12:45:16 +0000 (12:45 +0000)]
AMDGPU: Fix truncate to bool warnings

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

7 years ago[mips] Add IAS support for dvp, evp
Simon Dardis [Thu, 13 Oct 2016 12:12:56 +0000 (12:12 +0000)]
[mips] Add IAS support for dvp, evp

These instructions were only defined for microMIPSR6 previously. Add
definitions for MIPSR6, correct definitions for microMIPSR6, flag these
instructions as having unmodelled side effects (they disable/enable
virtual processors) and add missing disassember tests for microMIPSR6.

Reviewers: vkalintiris

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

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

7 years ago[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization
Simon Pilgrim [Thu, 13 Oct 2016 12:05:20 +0000 (12:05 +0000)]
[DAGCombiner] Add vector support to (sub -1, x) -> (xor x, -1) canonicalization

Improves commutation potential

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

7 years ago[X86] Basic additions to support RegCall Calling Convention.
Oren Ben Simhon [Thu, 13 Oct 2016 07:53:43 +0000 (07:53 +0000)]
[X86] Basic additions to support RegCall Calling Convention.

The Register Calling Convention (RegCall) was introduced by Intel to optimize parameter transfer on function call.
This calling convention ensures that as many values as possible are passed or returned in registers.
This commit presents the basic additions to LLVM CodeGen in order to support RegCall in X86.

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

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

7 years agoSilence unused warning in non-assert builds.
Daniel Jasper [Thu, 13 Oct 2016 06:39:44 +0000 (06:39 +0000)]
Silence unused warning in non-assert builds.

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

7 years ago[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.
Craig Topper [Thu, 13 Oct 2016 05:41:01 +0000 (05:41 +0000)]
[AVX-512] Fix v16i32 zero extending shuffle test case so it's really zero extend.

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

7 years ago[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.
Craig Topper [Thu, 13 Oct 2016 05:29:41 +0000 (05:29 +0000)]
[AVX-512] Teach shuffle lowering to recognize 512-bit zero extends.

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

7 years ago[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will...
Craig Topper [Thu, 13 Oct 2016 05:29:37 +0000 (05:29 +0000)]
[AVX-512] Add tests for basic 512-bit zero extending shuffle patterns. Code will be improved in a future commit.

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

7 years agoRemove a FIXME that I forgot about. NFC.
Diana Picus [Thu, 13 Oct 2016 05:28:55 +0000 (05:28 +0000)]
Remove a FIXME that I forgot about. NFC.

Sorry about the noise.

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

7 years ago[X86] Simplify the lowering code for extracting and inserting subvectors.
Craig Topper [Thu, 13 Oct 2016 04:14:47 +0000 (04:14 +0000)]
[X86] Simplify the lowering code for extracting and inserting subvectors.

We don't need to check if AVX is enabled. It's implied by the operation action being set to Custom.
We don't need to check both the input and output type widths. We only need to check the type that's being inserted or extracted. The other type is known to be a legal type and we can assume its a different width.

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

7 years agoMemory-SSA: strengthen defClobbersUseOrDef interface
Sebastian Pop [Thu, 13 Oct 2016 03:23:33 +0000 (03:23 +0000)]
Memory-SSA: strengthen defClobbersUseOrDef interface

As Danny pointed out, defClobbersUseOrDef should use MemoryLocOrCall to make
sure fences are properly handled.

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

7 years agocommit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Sebastian Pop [Thu, 13 Oct 2016 01:39:10 +0000 (01:39 +0000)]
commit back "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This is with an extra change to avoid calling MemoryLocation::get() on a call instruction.

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

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

7 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load
Quentin Colombet [Thu, 13 Oct 2016 01:01:23 +0000 (01:01 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for 64-bit load

This allows RegBankSelect in greedy mode to get rid some of the cross
register bank copies when loads are involved in the chain of
computation.

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

7 years agoCorrect PrivateLinkage for COFF
Reid Kleckner [Thu, 13 Oct 2016 00:55:24 +0000 (00:55 +0000)]
Correct PrivateLinkage for COFF

- Use storage class C_STAT for 'PrivateLinkage' The storage class for
  PrivateLinkage should equal to the Internal Linkage.

- Set 'PrivateGlobalPrefix' from "L" to ".L" for MM_WinCOFF (includes
  x86_64) MM_WinCOFF has empty GlobalPrefix '\0' so PrivateGlobalPrefix
  "L" may conflict to the normal symbol name starting with 'L'.

Based on a patch by Han Sangjin! Manually updated test cases.

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

7 years ago[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.
Quentin Colombet [Thu, 13 Oct 2016 00:34:48 +0000 (00:34 +0000)]
[AArch64][RegisterBankInfo] Provide alternative mappings for G_BITCASTs.

Thanks to this patch, RegBankSelect is able to get rid of some register
bank copies as demonstrated in the test case.

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

7 years agoRevert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"
Reid Kleckner [Thu, 13 Oct 2016 00:18:26 +0000 (00:18 +0000)]
Revert "GVN-hoist: fix store past load dependence analysis (PR30216, PR30499)"

This CL didn't actually address the test case in PR30499, and clang
still crashes.

Also revert dependent change "Memory-SSA cleanup of clobbers interface, NFC"

Reverts r283965 and r283967.

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

7 years ago[AArch64][RegisterBankInfo] Describe cross regbank copies statically.
Quentin Colombet [Thu, 13 Oct 2016 00:12:06 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Describe cross regbank copies statically.

NFC.

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

7 years ago[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.
Quentin Colombet [Thu, 13 Oct 2016 00:12:04 +0000 (00:12 +0000)]
[AArch64][RegisterBankInfo] Use static mapping for same bank G_BITCAST.

NFC.

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

7 years ago[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.
Quentin Colombet [Thu, 13 Oct 2016 00:12:01 +0000 (00:12 +0000)]
[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.

Basically any vector types that fits in a 32-bit register is also valid
as far as copies are concerned.

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

7 years ago[AArch64][RegisterBankInfo] Bump the cost of vector loads.
Quentin Colombet [Thu, 13 Oct 2016 00:11:59 +0000 (00:11 +0000)]
[AArch64][RegisterBankInfo] Bump the cost of vector loads.

This does not change anything yet, because we do not offer any
alternative mapping.

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