OSDN Git Service

android-x86/external-llvm.git
6 years ago[InstCombine] auto-generate complete test checks; NFC
Sanjay Patel [Tue, 28 Nov 2017 19:07:28 +0000 (19:07 +0000)]
[InstCombine] auto-generate complete test checks; NFC

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

6 years ago[mir] Print/Parse both MOLoad and MOStore when they occur together.
Daniel Sanders [Tue, 28 Nov 2017 18:57:02 +0000 (18:57 +0000)]
[mir] Print/Parse both MOLoad and MOStore when they occur together.

Summary:
They're not always mutually exclusive. read-modify-write atomics are both
at the same time. One example of this is the SWP instructions on AArch64.
Another example is GlobalISel's G_ATOMICRMW_* generic instructions which
will be added in a later patch.

Reviewers: arphaman, aemerson

Reviewed By: aemerson

Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits

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

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

6 years agoFix non assert build warnings.
Rafael Espindola [Tue, 28 Nov 2017 18:50:08 +0000 (18:50 +0000)]
Fix non assert build warnings.

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

6 years agoEntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)
Hans Wennborg [Tue, 28 Nov 2017 18:44:26 +0000 (18:44 +0000)]
EntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412)

Apparently the verifier requires that inlineable calls in a function
with debug info have debug locations.

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

6 years ago[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
Zachary Turner [Tue, 28 Nov 2017 18:33:17 +0000 (18:33 +0000)]
[CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.

The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

The current structure of TypeSerializer / TypeTableBuilder being a
single entry point that takes an unserialized type record, and then
hashes and de-duplicates it is not flexible enough to allow this.

At the same time, the existing TypeSerializer is already extremely
complex for this very reason -- it tries to be too many things. In
addition to serializing, hashing, and de-duplicating, ti also supports
splitting up field list records and adding continuations. All of this
functionality crammed into this one class makes it very complicated to
work with and hard to maintain.

To solve all of these problems, I've re-written everything from scratch
and split the functionality into separate pieces that can easily be
reused. The end result is that one class TypeSerializer is turned into 3
new classes SimpleTypeSerializer, ContinuationRecordBuilder, and
TypeTableBuilder, each of which in isolation is simple and
straightforward.

A quick summary of these new classes and their responsibilities are:

- SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of
  bytes. Does not do any hashing. Every time you call it, it will
  re-serialize and return bytes again. The same instance can be re-used
  over and over to avoid re-allocations, and in exchange for this
  optimization the bytes returned by the serializer only live until the
  caller attempts to serialize a new record.

- ContinuationRecordBuilder : Turns a FieldList-like record into a series
  of fragments. Does not do any hashing. Like SimpleTypeSerializer,
  returns references to privately owned bytes, so the storage is
  invalidated as soon as the caller tries to re-use the instance. Works
  equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a
  long-standing theoretical limitation of the previous implementation.

- TypeTableBuilder : Accepts sequences of bytes that the user has already
  serialized, and inserts them by de-duplicating with a hash table. For
  the sake of convenience and efficiency, this class internally stores a
  SimpleTypeSerializer so that it can accept unserialized records. The
  same is not true of ContinuationRecordBuilder. The user is required to
  create their own instance of ContinuationRecordBuilder.

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

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

6 years ago[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo
Simon Pilgrim [Tue, 28 Nov 2017 18:10:29 +0000 (18:10 +0000)]
[X86][X87] Tag FP_TO_INT_IN_MEM pseudos with hasNoSchedulingInfo

We don't need scheduling info for pseudos

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

6 years ago[CodeGen] Separate MachineOperand implementation from MachineInstr
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:43 +0000 (17:58 +0000)]
[CodeGen] Separate MachineOperand implementation from MachineInstr

Move the implementation to its own file.

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

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

6 years ago[CodeGen] Cleanup MachineOperand
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:58:38 +0000 (17:58 +0000)]
[CodeGen] Cleanup MachineOperand

* clang-format
* move doxygen from the implementation to headers
* remove duplicate doxygen

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

6 years agoAMDGPU: Add num spilled s/vgprs to metadata
Konstantin Zhuravlyov [Tue, 28 Nov 2017 17:51:08 +0000 (17:51 +0000)]
AMDGPU: Add num spilled s/vgprs to metadata

This was requested by tools.

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

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

6 years agoAdd opt-viewer testing
Adam Nemet [Tue, 28 Nov 2017 17:26:28 +0000 (17:26 +0000)]
Add opt-viewer testing

Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

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

6 years ago[CodeGen] Print register names in lowercase in both MIR and debug output
Francis Visoiu Mistrih [Tue, 28 Nov 2017 17:15:09 +0000 (17:15 +0000)]
[CodeGen] Print register names in lowercase in both MIR and debug output

As part of the unification of the debug format and the MIR format,
always print registers as lowercase.

* Only debug printing is affected. It now follows MIR.

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

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

6 years ago[WebAssembly] Support bitcasted function addresses with varargs.
Dan Gohman [Tue, 28 Nov 2017 17:15:03 +0000 (17:15 +0000)]
[WebAssembly] Support bitcasted function addresses with varargs.

Generalize FixFunctionBitcasts to handle varargs functions. This in
particular fixes the case where clang bitcasts away a varargs when
calling a K&R-style function.

This avoids interacting with tricky ABI details because it operates
at the LLVM IR level before varargs ABI details are exposed.

This fixes PR35385.

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

6 years agoDAG: Legalize truncstores to illegal int types
Matt Arsenault [Tue, 28 Nov 2017 17:11:30 +0000 (17:11 +0000)]
DAG: Legalize truncstores to illegal int types

Truncate to a legal int type, and produce a new
truncstore from a narrower type.

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

6 years ago[X86][X87] Tag FTST x87 instruction scheduler class
Simon Pilgrim [Tue, 28 Nov 2017 16:57:20 +0000 (16:57 +0000)]
[X86][X87] Tag FTST x87 instruction scheduler class

Looking through Agner, FTST is very similar to generic float compare behaviour, so I've added them to the existing IIC_FCOMI (WriteFAdd) tags.

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

6 years ago[InstCombine] add tests from D39421 to show current transforms; NFC
Sanjay Patel [Tue, 28 Nov 2017 16:40:30 +0000 (16:40 +0000)]
[InstCombine] add tests from D39421 to show current transforms; NFC

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

6 years ago[Support] Add unit test for printLowerCase
Francis Visoiu Mistrih [Tue, 28 Nov 2017 16:11:56 +0000 (16:11 +0000)]
[Support] Add unit test for printLowerCase

Add test case for the function added in r319171.

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

6 years ago[cmake] Remove redundant call to cmake when building host tools.
Don Hinton [Tue, 28 Nov 2017 16:08:57 +0000 (16:08 +0000)]
[cmake] Remove redundant call to cmake when building host tools.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

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

6 years ago[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes
Simon Pilgrim [Tue, 28 Nov 2017 15:03:42 +0000 (15:03 +0000)]
[X86][X87] Tag FABS/FCHS/FSQRT/FSIN/FCOS x87 instruction scheduler classes

Atom's FABS/FCHS/FSQRT latencies taken from Agner.

Note: I just added FSIN and FCOS to the existing IIC_FSINCOS itinerary, which is actually a more costly instruction.

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

6 years agoUse getStoreSize() in various places instead of 'BitSize >> 3'.
Jonas Paulsson [Tue, 28 Nov 2017 14:44:32 +0000 (14:44 +0000)]
Use getStoreSize() in various places instead of 'BitSize >> 3'.

This is needed for cases when the memory access is not as big as the width of
the data type. For instance, storing i1 (1 bit) would be done in a byte (8
bits).

Using 'BitSize >> 3' (or '/ 8') would e.g. give the memory access of an i1 a
size of 0, which for instance makes alias analysis return NoAlias even when
it shouldn't.

There are no tests as this was done as a follow-up to the bugfix for the case
where this was discovered (r318824). This handles more similar cases.

Review: Björn Petterson
https://reviews.llvm.org/D40339

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

6 years ago[X86][X86] Add some x87 schedule tests
Simon Pilgrim [Tue, 28 Nov 2017 14:35:52 +0000 (14:35 +0000)]
[X86][X86] Add some x87 schedule tests

Still missing some instructions: mainly loads/stores/system ops, all flagged as TODO.

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

6 years ago[Support] Merge toLower / toUpper implementations
Francis Visoiu Mistrih [Tue, 28 Nov 2017 14:22:27 +0000 (14:22 +0000)]
[Support] Merge toLower / toUpper implementations

Merge the ones from StringRef and StringExtras.

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

6 years ago[CodeGen] Rename functions PrintReg* to printReg*
Francis Visoiu Mistrih [Tue, 28 Nov 2017 12:42:37 +0000 (12:42 +0000)]
[CodeGen] Rename functions PrintReg* to printReg*

LLVM Coding Standards:
  Function names should be verb phrases (as they represent actions), and
  command-like function should be imperative. The name should be camel
  case, and start with a lower case letter (e.g. openFile() or isFoo()).

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

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

6 years ago[X86][3DNow] Add instruction itinerary and scheduling classes for femms/prefetch...
Simon Pilgrim [Tue, 28 Nov 2017 12:37:35 +0000 (12:37 +0000)]
[X86][3DNow] Add instruction itinerary and scheduling classes for femms/prefetch/prefetchw

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

6 years ago[ARM][AArch64] Workaround ARM/AArch64 peculiarity in clearing icache.
Peter Smith [Tue, 28 Nov 2017 12:34:05 +0000 (12:34 +0000)]
[ARM][AArch64] Workaround ARM/AArch64 peculiarity in clearing icache.

Certain ARM implementations treat icache clear instruction as a memory read,
and CPU segfaults on trying to clear cache on !PROT_READ page.
We workaround this in Memory::protectMappedMemory by adding
PROT_READ to affected pages, clearing the cache, and then setting
desired protection.

This fixes "AllocationTests/MappedMemoryTest.***/3" unit-tests on
affected hardware.

Reviewers: psmith, zatrazz, kristof.beyls, lhames

Reviewed By: lhames

Subscribers: llvm-commits, krytarowski, peter.smith, jgreenhalgh, aemerson,
             rengolin

Patch by maxim-kuvrykov!

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

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

6 years agoAdd a new pass to speculate around PHI nodes with constant (integer) operands when...
Chandler Carruth [Tue, 28 Nov 2017 11:32:31 +0000 (11:32 +0000)]
Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable.

The core idea is to (re-)introduce some redundancies where their cost is
hidden by the cost of materializing immediates for constant operands of
PHI nodes. When the cost of the redundancies is covered by this,
avoiding materializing the immediate has numerous benefits:
1) Less register pressure
2) Potential for further folding / combining
3) Potential for more efficient instructions due to immediate operand

As a motivating example, consider the remarkably different cost on x86
of a SHL instruction with an immediate operand versus a register
operand.

This pattern turns up surprisingly frequently, but is somewhat rarely
obvious as a significant performance problem.

The pass is entirely target independent, but it does rely on the target
cost model in TTI to decide when to speculate things around the PHI
node. I've included x86-focused tests, but any target that sets up its
immediate cost model should benefit from this pass.

There is probably more that can be done in this space, but the pass
as-is is enough to get some important performance on our internal
benchmarks, and should be generally performance neutral, but help with
more extensive benchmarking is always welcome.

One awkward part is that this pass has to be scheduled after
*everything* that can eliminate these kinds of redundancies. This
includes SimplifyCFG, GVN, etc. I'm open to suggestions about better
places to put this. We could in theory make it part of the codegen pass
pipeline, but there doesn't really seem to be a good reason for that --
it isn't "lowering" in any sense and only relies on pretty standard cost
model based TTI queries, so it seems to fit well with the "optimization"
pipeline model. Still, further thoughts on the pipeline position are
welcome.

I've also only implemented this in the new pass manager. If folks are
very interested, I can try to add it to the old PM as well, but I didn't
really see much point (my use case is already switched over to the new
PM).

I've tested this pretty heavily without issue. A wide range of
benchmarks internally show no change outside the noise, and I don't see
any significant changes in SPEC either. However, the size class
computation in tcmalloc is substantially improved by this, which turns
into a 2% to 4% win on the hottest path through tcmalloc for us, so
there are definitely important cases where this is going to make
a substantial difference.

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

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

6 years ago[TailRecursionElimination] Skip debug intrinsics.
Florian Hahn [Tue, 28 Nov 2017 09:32:25 +0000 (09:32 +0000)]
[TailRecursionElimination] Skip debug intrinsics.

Summary:
I think we do not need to analyze debug intrinsics here, as they should
not impact codegen. This has 2 benefits: 1) slightly less work to do and
2) avoiding generating optimization remarks for converting calls to
debug intrinsics to tail calls, which are not really helpful for users.

Based on work by Sander de Smalen.

Reviewers: davide, trentxintong, aprantl

Reviewed By: aprantl

Subscribers: llvm-commits, JDevlieghere

Tags: #debug-info

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

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

6 years agoAMDGPU: Re-organize the outer loop of SILoadStoreOptimizer
Nicolai Haehnle [Tue, 28 Nov 2017 08:42:46 +0000 (08:42 +0000)]
AMDGPU: Re-organize the outer loop of SILoadStoreOptimizer

Summary:
The entire algorithm operates per basic-block, so for cache locality
it should be better to re-optimize a basic-block immediately rather than
in a separate loop.

I don't have performance measurements.

Change-Id: I85106570bd623c4ff277faaa50ee43258e1ddcc5

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

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

6 years agoAMDGPU: Consistently check for immediates in SIInstrInfo::FoldImmediate
Nicolai Haehnle [Tue, 28 Nov 2017 08:41:50 +0000 (08:41 +0000)]
AMDGPU: Consistently check for immediates in SIInstrInfo::FoldImmediate

Summary:
The PeepholeOptimizer pass calls this function solely based on checking
DefMI->isMoveImmediate(), which only checks the MoveImm bit of the
instruction description. So it's up to FoldImmediate itself to properly
check that DefMI *actually* moves from an immediate.

I don't have a separate test case for this, but the next patch introduces
a test case which happens to crash without this change.

This error is caught by the assertion in MachineOperand::getImm().

Change-Id: I88e7cdbcf54d75e1a296822e6fe5f9a5f095bbf8

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

6 years ago[SCEV][NFC] More efficient caching in CompareValueComplexity
Max Kazantsev [Tue, 28 Nov 2017 08:26:43 +0000 (08:26 +0000)]
[SCEV][NFC] More efficient caching in CompareValueComplexity

Currently, we use a set of pairs to cache responces like `CompareValueComplexity(X, Y) == 0`. If we had
proved that `CompareValueComplexity(S1, S2) == 0` and `CompareValueComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareValueComplexity(S1, S3)` is also `0`.

This patch replaces this set with `EquivalenceClasses` that merges Values into equivalence sets so that
any two values from the same set are equal from point of `CompareValueComplexity`. This, in particular,
allows us to prove the fact from example above.

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

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

6 years ago[COFF] Implement constructor priorities
Martin Storsjo [Tue, 28 Nov 2017 08:07:18 +0000 (08:07 +0000)]
[COFF] Implement constructor priorities

The priorities in the section name suffixes are zero padded,
allowing the linker to just do a lexical sort.

Add zero padding for .ctors sections in ELF as well.

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

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

6 years ago[SCEV][NFC] More efficient caching in CompareSCEVComplexity
Max Kazantsev [Tue, 28 Nov 2017 07:48:12 +0000 (07:48 +0000)]
[SCEV][NFC] More efficient caching in CompareSCEVComplexity

Currently, we use a set of pairs to cache responces like `CompareSCEVComplexity(X, Y) == 0`. If we had
proved that `CompareSCEVComplexity(S1, S2) == 0` and `CompareSCEVComplexity(S2, S3) == 0`,
this cache does not allow us to prove that `CompareSCEVComplexity(S1, S3)` is also `0`.

This patch replaces this set with `EquivalenceClasses` any two values from the same set are equal from
point of `CompareSCEVComplexity`. This, in particular, allows us to prove the fact from example above.

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

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

6 years ago[GVN] Prevent ScalarPRE from hoisting across instructions that don't pass control...
Max Kazantsev [Tue, 28 Nov 2017 07:07:55 +0000 (07:07 +0000)]
[GVN] Prevent ScalarPRE from hoisting across instructions that don't pass control flow to successors

This is to address a problem similar to those in D37460 for Scalar PRE. We should not
PRE across an instruction that may not pass execution to its successor unless it is safe
to speculatively execute it.

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

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

6 years agoRevert "Add opt-viewer testing"
Adam Nemet [Tue, 28 Nov 2017 06:22:29 +0000 (06:22 +0000)]
Revert "Add opt-viewer testing"

This reverts commit r319073.

Bot fails with a mismatch that looks like pygments-generated HTML.

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

6 years ago[WebAssembly] Handle errors better in fast-isel.
Dan Gohman [Tue, 28 Nov 2017 05:36:42 +0000 (05:36 +0000)]
[WebAssembly] Handle errors better in fast-isel.

Fast-isel routines need to bail out in the case that fast-isel
fails on the operands.

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

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

6 years ago[X86] Remove some unused pattern fragments from td file. NFC
Craig Topper [Tue, 28 Nov 2017 05:23:57 +0000 (05:23 +0000)]
[X86] Remove some unused pattern fragments from td file. NFC

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

6 years ago[DAGCombine] Disable finding better chains for stores at O0
Simon Dardis [Tue, 28 Nov 2017 04:07:59 +0000 (04:07 +0000)]
[DAGCombine] Disable finding better chains for stores at O0

Unoptimized IR can have linear sequences of stores to an array, where the
initial GEP for the first store is formed from the pointer to the array, and the
GEP for each store after the first is formed from the previous GEP with some
offset in an inductive fashion.

The (large) resulting DAG when analyzed by DAGCombine undergoes an excessive
number of combines as each store node is examined every time its' offset node
is combined with any child of the offset. One of the transformations is
findBetterNeighborChains which assists MergeConsecutiveStores. The former
relies on repeated chain walking to do its' work, however MergeConsecutiveStores
is disabled at O0 which makes the transformation redundant.

Any optimization level other than O0 would invoke InstCombine which would
resolve the chain of GEPs into flat base + offset GEP for each store which
does not exhibit the repeated examination of each store to the array.

Disabling this optimization fixes an excessive compile time issue (30~ minutes
for the test case provided) at O0.

Reviewers: niravd, craig.topper, t.p.northover

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

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

6 years agoMachineVerifier: Improve register operand checks
Matthias Braun [Tue, 28 Nov 2017 03:54:20 +0000 (03:54 +0000)]
MachineVerifier: Improve register operand checks

This fixes cases where we wouldn't perform various register operand
checks just because we didn't happen to have a definition in the
MCInstrDesc. This changes the code to only skip the tests that actually
depend on the MCInstrDesc definition.

This makes the machine verifier spot the problem from
https://llvm.org/PR33071 after the pass that actually caused it.

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

6 years agoMachineVerifier: Improve PHI operand checking
Matthias Braun [Tue, 28 Nov 2017 03:54:19 +0000 (03:54 +0000)]
MachineVerifier: Improve PHI operand checking

Additional checks for phi operands:
- first operand should be a virtual register def. It should not be
  tied, implicit, internalread, earlyclobber or a read.
- The other operands should be register/mbb operands next to each other
- The register operands should not be implicit, internalread,
  earlyclobber, debug or tied.
- We can perform most of the PHI checks even for unreachable blocks.

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

6 years agolit: Bring back -Dtool=xxx feature lost in r313928
Matthias Braun [Tue, 28 Nov 2017 03:23:07 +0000 (03:23 +0000)]
lit: Bring back -Dtool=xxx feature lost in r313928

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

6 years agoUse FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.
Rafael Espindola [Tue, 28 Nov 2017 01:41:22 +0000 (01:41 +0000)]
Use FILE_FLAG_DELETE_ON_CLOSE for TempFile on windows.

We won't see the temp file no more.

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

6 years ago[X86] Make zero extend from v16i1/v8i1 to v16i8/v8i16/v16i16 not scalarize under...
Craig Topper [Tue, 28 Nov 2017 01:36:33 +0000 (01:36 +0000)]
[X86] Make zero extend from v16i1/v8i1 to v16i8/v8i16/v16i16 not scalarize under AVX512.

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

6 years ago[X86] Add command line without AVX512BW/AVX512VL to bitcast-int-to-vector-bool-zext.ll.
Craig Topper [Tue, 28 Nov 2017 01:36:31 +0000 (01:36 +0000)]
[X86] Add command line without AVX512BW/AVX512VL to bitcast-int-to-vector-bool-zext.ll.

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

6 years agoMove code. NFC.
Rafael Espindola [Tue, 28 Nov 2017 01:34:20 +0000 (01:34 +0000)]
Move code. NFC.

This moves the TempFile implementation so that it can use system
specific code.

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

6 years agoReland r319090, "COFF: Do not create SectionChunks for discarded comdat sections...
Peter Collingbourne [Tue, 28 Nov 2017 01:30:07 +0000 (01:30 +0000)]
Reland r319090, "COFF: Do not create SectionChunks for discarded comdat sections." with a fix for debug sections.

If /debug was not specified, readSection will return a null
pointer for debug sections. If the debug section is associative with
another section, we need to make sure that the section returned from
readSection is not a null pointer before adding it as an associative
section.

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

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

6 years agoThis reverts commit r319096 and r319097.
Rafael Espindola [Tue, 28 Nov 2017 01:25:38 +0000 (01:25 +0000)]
This reverts commit r319096 and r319097.

Revert "[SROA] Propagate !range metadata when moving loads."
Revert "[Mem2Reg] Clang-format unformatted parts of this file. NFCI."

Davide says they broke a bot.

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

6 years agoARM: Fix PR32578
Matthias Braun [Tue, 28 Nov 2017 01:17:52 +0000 (01:17 +0000)]
ARM: Fix PR32578

https://llvm.org/PR32578

I simplified and converted the reproducer into a lit test.

Patch by Vedant Kumar!

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

6 years ago[WebAssembly] Fix trapping behavior in fptosi/fptoui.
Dan Gohman [Tue, 28 Nov 2017 01:13:40 +0000 (01:13 +0000)]
[WebAssembly] Fix trapping behavior in fptosi/fptoui.

This adds code to protect WebAssembly's `trunc_s` family of opcodes
from values outside their domain. Even though such conversions have
full undefined behavior in C/C++, LLVM IR's `fptosi` and `fptoui` do
not, and only return undef.

This also implements the proposed non-trapping float-to-int conversion
feature and uses that instead when available.

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

6 years agoSROA: Avoid creating a fragment expression that covers the entire variable.
Adrian Prantl [Tue, 28 Nov 2017 00:57:53 +0000 (00:57 +0000)]
SROA: Avoid creating a fragment expression that covers the entire variable.

Fixes PR35416.

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

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

6 years agoMove getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC)
Adrian Prantl [Tue, 28 Nov 2017 00:57:51 +0000 (00:57 +0000)]
Move getVariableSize from Verifier.cpp into DIVariable::getSize() (NFC)

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

6 years ago[X86] Remove unnecessary fp<->int setOperationAction lines from a hasVLX block. NFCI
Craig Topper [Tue, 28 Nov 2017 00:41:12 +0000 (00:41 +0000)]
[X86] Remove unnecessary fp<->int setOperationAction lines from a hasVLX block. NFCI

These lines all exist identically either under SSE2, AVX2 or AVX512. Given that VLX implies all of those, these aren't providing anything new.

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

6 years ago[X86] Remove duplicate calls to setOperationAction. NFCI
Craig Topper [Tue, 28 Nov 2017 00:16:42 +0000 (00:16 +0000)]
[X86] Remove duplicate calls to setOperationAction. NFCI

These same calls exist a few lines down.

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

6 years agoAdd an F_Delete flag.
Rafael Espindola [Tue, 28 Nov 2017 00:12:44 +0000 (00:12 +0000)]
Add an F_Delete flag.

For now this only changes the handle Access.

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

6 years ago[DAGCombiner] Don't combine aext(setcc) if the setcc is already using the target...
Craig Topper [Mon, 27 Nov 2017 23:51:40 +0000 (23:51 +0000)]
[DAGCombiner] Don't combine aext(setcc) if the setcc is already using the target's preferred result type.

With AVX512 vXi1 types are legal so we shouldn't be extending them.

This change is similar to existing code in the zext(setcc) combine.

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

6 years ago[DAGCombiner] Use EVT::changeVectorElementTypeToInteger() instead of implementing...
Craig Topper [Mon, 27 Nov 2017 23:51:31 +0000 (23:51 +0000)]
[DAGCombiner] Use EVT::changeVectorElementTypeToInteger() instead of implementing manually.

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

6 years agoAdd OpenFlags to the create(Unique|Temporary)File interfaces.
Rafael Espindola [Mon, 27 Nov 2017 23:44:11 +0000 (23:44 +0000)]
Add OpenFlags to the create(Unique|Temporary)File interfaces.

This will allow a future F_Delete flag to be specified when we want
the file to be automatically deleted on close.

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

6 years ago[X86] Teach getSetCCResultType to handle more than just SimpleVTs when looking at...
Craig Topper [Mon, 27 Nov 2017 22:56:10 +0000 (22:56 +0000)]
[X86] Teach getSetCCResultType to handle more than just SimpleVTs when looking at larger than 512-bit vectors.

Which VTs are considered simple is determined by the superset of the legal types of all targets in LLVM. If we're looking at VTs that are going to be split down to 512-bits we should allow any VT not just simple ones since the simple list changes over time as new targets are added.

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

6 years ago[CMake] Pass LLVM_HOST_TRIPLE to external projects
Petr Hosek [Mon, 27 Nov 2017 22:50:48 +0000 (22:50 +0000)]
[CMake] Pass LLVM_HOST_TRIPLE to external projects

LLVM runtimes rely on LLVM_HOST_TRIPLE being set in their builds
and tests so make sure it's being passed down.

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

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

6 years ago[CMake][runtimes] Support monorepo layout with runtimes build
Petr Hosek [Mon, 27 Nov 2017 22:31:11 +0000 (22:31 +0000)]
[CMake][runtimes] Support monorepo layout with runtimes build

We introduce a new variable LLVM_ENABLE_RUNTIMES which works
similarly to LLVM_ENABLE_PROJECTS and allows specifying runtimes
that will be enabled in the runtimes build.

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

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

6 years ago[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Michal Gorny [Mon, 27 Nov 2017 22:23:09 +0000 (22:23 +0000)]
[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading

Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.

Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.

While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.

Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html

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

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

6 years agoFixed the ability to recursively get an attribute value from a DWARFDie.
Greg Clayton [Mon, 27 Nov 2017 22:12:44 +0000 (22:12 +0000)]
Fixed the ability to recursively get an attribute value from a DWARFDie.

The previous implementation would only look 1 DW_AT_specification or DW_AT_abstract_origin deep. This means DWARFDie::getName() would fail in certain cases. I ran into such a case while creating a tool that used the LLVM DWARF parser to generate a symbolication format so I have seen this in the wild.

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

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

6 years ago[X86] Remove lines that set v8f32 FP_ROUND/FP_EXTEND to Legal under AVX512. NFCI
Craig Topper [Mon, 27 Nov 2017 22:01:17 +0000 (22:01 +0000)]
[X86] Remove lines that set v8f32 FP_ROUND/FP_EXTEND to Legal under AVX512. NFCI

We don't do this for narrow vectors under AVX or SSE features. We also don't set them to Expand like we do for many vectors op. Nor does TargetLoweringBase.cpp. This leads me to believe these default to Legal.

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

6 years agoRevert r319090, "COFF: Do not create SectionChunks for discarded comdat sections."
Peter Collingbourne [Mon, 27 Nov 2017 21:37:51 +0000 (21:37 +0000)]
Revert r319090, "COFF: Do not create SectionChunks for discarded comdat sections."

Caused test failures in check-cfi on Windows.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/20284

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

6 years ago[Mem2Reg] Clang-format unformatted parts of this file. NFCI.
Davide Italiano [Mon, 27 Nov 2017 21:25:52 +0000 (21:25 +0000)]
[Mem2Reg] Clang-format unformatted parts of this file. NFCI.

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

6 years ago[SROA] Propagate !range metadata when moving loads.
Davide Italiano [Mon, 27 Nov 2017 21:25:13 +0000 (21:25 +0000)]
[SROA] Propagate !range metadata when moving loads.

This tries to propagate !range metadata to a pre-existing load
when a load is optimized out. This is done instead of adding an
assume because converting loads to and from assumes creates a
lot of IR.

Patch by Ariel Ben-Yehuda.

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

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

6 years ago[PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg...
Sanjay Patel [Mon, 27 Nov 2017 21:15:43 +0000 (21:15 +0000)]
[PartiallyInlineLibCalls][x86] add TTI hook to allow sqrt inlining to depend on arg rather than result

This should fix PR31455:
https://bugs.llvm.org/show_bug.cgi?id=31455

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

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

6 years agoAdd release note about TargetRegistry change from r318352
Daniel Sanders [Mon, 27 Nov 2017 21:12:55 +0000 (21:12 +0000)]
Add release note about TargetRegistry change from r318352

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

6 years ago[AMDGPU] Update test nullptr.ll to use amdgiz environment
Yaxun Liu [Mon, 27 Nov 2017 20:48:21 +0000 (20:48 +0000)]
[AMDGPU] Update test nullptr.ll to use amdgiz environment

This test needs to be manually updated since it is difficult to do it with script.

Addr space 6 to 23 are only used by r600, therefore only check them for r600.

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

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

6 years agoCOFF: Do not create SectionChunks for discarded comdat sections.
Peter Collingbourne [Mon, 27 Nov 2017 20:42:34 +0000 (20:42 +0000)]
COFF: Do not create SectionChunks for discarded comdat sections.

With this change, instead of creating a SectionChunk for each section
in the object file, we only create them when we encounter a prevailing
comdat section.

Also change how symbol resolution occurs between comdat symbols. Now
only the comdat leader participates in comdat resolution, and not any
other external associated symbols. This is more in line with how COFF
semantics are defined, and should allow for a more straightforward
implementation of non-ANY comdat types.

On my machine, this change reduces our runtime linking a release
build of chrome_child.dll with /nopdb from 5.65s to 4.54s (median of
50 runs).

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

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

6 years agoUse LIST_SEPARATOR rather than escaping in ExternalProject_Add
Petr Hosek [Mon, 27 Nov 2017 20:41:53 +0000 (20:41 +0000)]
Use LIST_SEPARATOR rather than escaping in ExternalProject_Add

Escaping ; in list arguments passed to ExternalProject_Add doesn't seem
to be working in newer versions of CMake (see
https://public.kitware.com/Bug/view.php?id=16137 for more details). Use
a custom LIST_SEPARATOR instead which is the officially supported way.

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

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

6 years ago[PowerPC] Remove redundant TOC saves
Zaara Syeda [Mon, 27 Nov 2017 20:26:36 +0000 (20:26 +0000)]
[PowerPC] Remove redundant TOC saves

This patch adds a peep hole optimization to remove any redundant toc save
instructions added as part of the call sequence for indirect calls. It removes
any toc saves within a function that are dominated by another toc save.

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

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

6 years agoRename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header...
David Blaikie [Mon, 27 Nov 2017 19:55:16 +0000 (19:55 +0000)]
Rename MCTargetOptionsCommandFlags.h to .def as it is not a normal/modular header as much as it is for stamping out some global/static variables

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

6 years ago[SelectionDAG] Add a debug message when vector_shuffle nodes are created.
Craig Topper [Mon, 27 Nov 2017 19:54:57 +0000 (19:54 +0000)]
[SelectionDAG] Add a debug message when vector_shuffle nodes are created.

We print a debug message when most nodes are created, but getVectorShuffle was missing.

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

6 years agoRename CommandFlags.h -> CommandFlags.def
David Blaikie [Mon, 27 Nov 2017 19:43:58 +0000 (19:43 +0000)]
Rename CommandFlags.h -> CommandFlags.def

Since this isn't a real header - it includes static functions and had
external linkage variables (though this change makes them static, since
that's what they should be) so can't be included more than once in a
program.

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

6 years agoFix -Werror build for signed/unsigned comparison with use of explicit unsigned literals
David Blaikie [Mon, 27 Nov 2017 19:43:57 +0000 (19:43 +0000)]
Fix -Werror build for signed/unsigned comparison with use of explicit unsigned literals

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

6 years agoRevert r319069 - [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Michal Gorny [Mon, 27 Nov 2017 19:18:36 +0000 (19:18 +0000)]
Revert r319069 - [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading

This breaks one of the unit tests. Need to find a good solution.

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

6 years agoInliner: Don't mark notail calls with the 'tail' attribute
Arnold Schwaighofer [Mon, 27 Nov 2017 19:03:40 +0000 (19:03 +0000)]
Inliner: Don't mark notail calls with the 'tail' attribute

enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2,
                    TCK_NoTail = 3 };

TCK_NoTail is greater than TCK_Tail so taking the min does not do the
correct thing.

rdar://35639547

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

6 years agoAdd opt-viewer testing
Adam Nemet [Mon, 27 Nov 2017 19:00:29 +0000 (19:00 +0000)]
Add opt-viewer testing

Detects whether we have the Python modules (pygments, yaml) required by
opt-viewer and hooks this up to REQUIRES.

This fixes https://bugs.llvm.org/show_bug.cgi?id=34129 (the lack of opt-viewer
testing).

It's also related to https://github.com/apple/swift/pull/12938 and the idea is
to expose LLVM_HAVE_OPT_VIEWER_MODULES to the Swift cmake.

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

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

6 years ago[opt-viewer] Fix option name
Adam Nemet [Mon, 27 Nov 2017 19:00:22 +0000 (19:00 +0000)]
[opt-viewer] Fix option name

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

6 years ago[llvm-objcopy] Add --strip-all-gnu and change --strip-all
Jake Ehrlich [Mon, 27 Nov 2017 18:56:01 +0000 (18:56 +0000)]
[llvm-objcopy] Add --strip-all-gnu and change --strip-all

GNU's --strip-all doesn't strip as aggressively as it could in general.
Currently llvm-objcopy copies the exact behavoir of GNU's --strip-all.
eu-strip is used as a drop in replacement for GNU strip/objcopy in many many
places without issue. eu-strip removes non-allocated sections and keeps
.gnu.warning* sections. Because --strip-all will likely be the most widely
used stripping option we should make --strip-all as aggressive as it can safely
be. Since we have evidence from eu-strip that this is a safe option we should
allow it. For those that might still have an issue afterwards I've added
--strip-all-gnu as an exact drop in replacement for GNU's --strip-all as well.

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

6 years ago[BinaryStream] Support growable streams.
Zachary Turner [Mon, 27 Nov 2017 18:48:37 +0000 (18:48 +0000)]
[BinaryStream] Support growable streams.

The existing library assumed that a stream's length would never
change.  This makes some things simpler, but it's not flexible
enough for what we need, especially for writable streams where
what you really want is for each call to write to actually append.

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

6 years ago[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
Michal Gorny [Mon, 27 Nov 2017 18:34:52 +0000 (18:34 +0000)]
[cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading

Prevent unloading shared libraries on Linux when dlclose() is called.
This is necessary since command-line option parsing API relies on
registering the global option instances in the option parser instance
which can be loaded in a different shared library.

Given that we can't reliably remove those options when a library is
unloaded, the parser ends up containing dangling references. Since glibc
has relatively complex library unloading rules, some of the LLVM
libraries can be unloaded while others (including the Support library)
stay loaded causing quite a mayhem. To reliably prevent that, just
forbid unloading all libraries -- it's a very bad idea anyway.

While the issue arguably happens only with BUILD_SHARED_LIBS, it may
affect any library reusing llvm::cl interface.

Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
Previously hit by Fedora back in Feb 2016:
https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html

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

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

6 years ago[X86] Remove an unused isel pattern that looked for pshufd with v4f32 type.
Craig Topper [Mon, 27 Nov 2017 18:25:54 +0000 (18:25 +0000)]
[X86] Remove an unused isel pattern that looked for pshufd with v4f32 type.

I don't believe our current lowering/combining would ever produce such a node. We only produce integer typed pshufds.

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

6 years ago[InstCombine] use 'auto' with 'dyn_cast'; NFC
Sanjay Patel [Mon, 27 Nov 2017 18:19:32 +0000 (18:19 +0000)]
[InstCombine] use 'auto' with 'dyn_cast'; NFC

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

6 years ago[X86] Teach combineX86ShuffleChain that AllowIntDomain requires at least SSE2.
Craig Topper [Mon, 27 Nov 2017 18:15:14 +0000 (18:15 +0000)]
[X86] Teach combineX86ShuffleChain that AllowIntDomain requires at least SSE2.

I don't have a good test case for this at the moment. I was playing around with a change in legalizing and triggered this code to produce a PSHUFD with sse1 only.

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

6 years ago[X86][AVX512] Tag AVX512 PACKSS/PACKUS/PMADDWD/PMADDUBSW instructions with SSE_PACK...
Simon Pilgrim [Mon, 27 Nov 2017 18:14:18 +0000 (18:14 +0000)]
[X86][AVX512] Tag AVX512 PACKSS/PACKUS/PMADDWD/PMADDUBSW instructions with SSE_PACK/SSE_PMADD schedule classes

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

6 years ago[Hexagon] Implement HexagonSubtarget::isHVXVectorType
Krzysztof Parzyszek [Mon, 27 Nov 2017 18:12:16 +0000 (18:12 +0000)]
[Hexagon] Implement HexagonSubtarget::isHVXVectorType

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

6 years ago[X86] Add avx512bw command lines to vselect-packss.ll
Craig Topper [Mon, 27 Nov 2017 18:00:49 +0000 (18:00 +0000)]
[X86] Add avx512bw command lines to vselect-packss.ll

This shows several places where we fail to use masked move or blendm.

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

6 years agoDelete obsolete function mergeUseListsImpl
Jonas Hahnfeld [Mon, 27 Nov 2017 17:55:47 +0000 (17:55 +0000)]
Delete obsolete function mergeUseListsImpl

mergeUseLists is implemented iteratively since r243590.

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

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

6 years ago[X86] Make getSetCCResultType return vXi1 for any vXi32/vXi64 vector over 512 bits...
Craig Topper [Mon, 27 Nov 2017 17:51:55 +0000 (17:51 +0000)]
[X86] Make getSetCCResultType return vXi1 for any vXi32/vXi64 vector over 512 bits long when AVX512 is enabled.

Similar for vXi16/vXi8 with BWI.

Any vector larger than 512 bits will be split to 512 bits during legalization. But without this we will fold sexts with them before that making it difficult to recover leading to scalarization.

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

6 years ago[X86][SSE] Fix roundpd instructions to correctly use IIC_SSE_ROUNDPD_* itineraries
Simon Pilgrim [Mon, 27 Nov 2017 17:29:49 +0000 (17:29 +0000)]
[X86][SSE] Fix roundpd instructions to correctly use IIC_SSE_ROUNDPD_* itineraries

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

6 years ago[AMDGPU][MC][DISASSEMBLER][GFX9] Corrected decoding of GLOBAL/SCRATCH opcodes
Dmitry Preobrazhensky [Mon, 27 Nov 2017 17:14:35 +0000 (17:14 +0000)]
[AMDGPU][MC][DISASSEMBLER][GFX9] Corrected decoding of GLOBAL/SCRATCH opcodes

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

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

Reviewers: artem.tamazov, SamWot, arsenm

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

6 years ago[Power9] Improvements to vector extract with variable index exploitation
Zaara Syeda [Mon, 27 Nov 2017 17:11:03 +0000 (17:11 +0000)]
[Power9] Improvements to vector extract with variable index exploitation

This patch extends on to rL307174 to not use the power9 vector extract with
variable index instructions when extracting word element 1. For such cases,
the existing selection of MFVSRWZ provides a better sequence.

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

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

6 years ago[XRay] Fix typo in docs. NFC
Fangrui Song [Mon, 27 Nov 2017 16:59:26 +0000 (16:59 +0000)]
[XRay] Fix typo in docs. NFC

Reviewers: dberris

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

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

6 years ago[X86][AVX512] Tag AVX512 sqrt instructions with SSE_SQRT schedule classes
Simon Pilgrim [Mon, 27 Nov 2017 16:43:18 +0000 (16:43 +0000)]
[X86][AVX512] Tag AVX512 sqrt instructions with SSE_SQRT schedule classes

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

6 years ago[llvm-dwarfdump] Display DW_AT_high_pc as absolute value
Jonas Devlieghere [Mon, 27 Nov 2017 16:40:46 +0000 (16:40 +0000)]
[llvm-dwarfdump] Display DW_AT_high_pc as absolute value

DWARF4 relative DW_AT_high_pc values are now displayed as absolute
addresses. The relative value is only shown when explicitly dumping the
forms, i.e. in show-form or verbose mode.

```
DW_AT_low_pc (0x0000000000000049)
DW_AT_high_pc (0x00000019)
```

becomes

```
DW_AT_low_pc (0x0000000000000049)
DW_AT_high_pc (0x0000000000000062)
```

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

rdar://35416943

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

6 years ago[InstSimplify] use m_APFloat to simplify fcmp folds; NFCI
Sanjay Patel [Mon, 27 Nov 2017 16:37:09 +0000 (16:37 +0000)]
[InstSimplify] use m_APFloat to simplify fcmp folds; NFCI

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

6 years ago[InstSimplify] add fcmp with negative constant tests; NFC
Sanjay Patel [Mon, 27 Nov 2017 16:08:34 +0000 (16:08 +0000)]
[InstSimplify] add fcmp with negative constant tests; NFC

This is a superset of the tests proposed with D40012 to show another potential improvement.

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

6 years ago[DAG] Do MergeConsecutiveStores again before Instruction Selection
Nirav Dave [Mon, 27 Nov 2017 15:28:15 +0000 (15:28 +0000)]
[DAG] Do MergeConsecutiveStores again before Instruction Selection

Summary:

Now that store-merge is only generates type-safe stores, do a second
pass just before instruction selection to allow lowered intrinsics to
be merged as well.

Reviewers: jyknight, hfinkel, RKSimon, efriedma, rnk, jmolloy

Subscribers: javed.absar, llvm-commits

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

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

6 years ago[X86] Add INVLPGA to the existing INVLPG scheduling
Simon Pilgrim [Mon, 27 Nov 2017 14:39:50 +0000 (14:39 +0000)]
[X86] Add INVLPGA to the existing INVLPG scheduling

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

6 years ago[mips] fix asmstring of Ext and Ins instructions and mips16 JALRC/JRC
Petar Jovanovic [Mon, 27 Nov 2017 14:25:36 +0000 (14:25 +0000)]
[mips] fix asmstring of Ext and Ins instructions and mips16 JALRC/JRC

Make the print format consistent with other assembler instructions.

Adding a tab character instead of space in asmstring of Ext and Ins
instructions.
Removing space around the tab character for JALRC and replacing space with
tab in JRC.

Patch by Milos Stojanovic.

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

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