]> granicus.if.org Git - llvm/log
llvm
7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 years ago[X86] Add scheduling tests for invlpg/invlpga
Simon Pilgrim [Mon, 27 Nov 2017 14:23:55 +0000 (14:23 +0000)]
[X86] Add scheduling tests for invlpg/invlpga

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

7 years ago[Support] Fix locking of shared variable in threadpool
Jan Korous [Mon, 27 Nov 2017 13:42:03 +0000 (13:42 +0000)]
[Support] Fix locking of shared variable in threadpool

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

7 years ago[AMDGPU] Add custom lowering for llvm.log{,10}.{f16,f32} intrinsics
Vedran Miletic [Mon, 27 Nov 2017 13:26:38 +0000 (13:26 +0000)]
[AMDGPU] Add custom lowering for llvm.log{,10}.{f16,f32} intrinsics

AMDGPU backend errors with "unsupported call to function" upon
encountering a call to llvm.log{,10}.{f16,f32} intrinsics. This patch
adds custom lowering to avoid that error on both R600 and SI.

Reviewers: arsenm, jvesely

Subscribers: tstellar

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

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

7 years ago[CGP] Fix handling of null pointer values in optimizeMemoryInst
John Brawn [Mon, 27 Nov 2017 11:29:15 +0000 (11:29 +0000)]
[CGP] Fix handling of null pointer values in optimizeMemoryInst

The current way that trivial addressing modes are detected incorrectly thinks
that null pointers are non-trivial, leading to an infinite loop where we keep
duplicating the same select. Fix this by aware of null when deciding if an
addressing mode is trivial.

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

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

7 years ago[NFC] Add missing unit tests for EquivalenceClasses
Max Kazantsev [Mon, 27 Nov 2017 11:20:58 +0000 (11:20 +0000)]
[NFC] Add missing unit tests for EquivalenceClasses

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

7 years ago[X86][FMA] Tag all FMA/FMA4 instructions with WriteFMA schedule class
Simon Pilgrim [Mon, 27 Nov 2017 10:41:32 +0000 (10:41 +0000)]
[X86][FMA] Tag all FMA/FMA4 instructions with WriteFMA schedule class

As mentioned on PR17367, many instructions are missing scheduling tags preventing us from setting 'CompleteModel = 1' for better instruction analysis. This patch deals with FMA/FMA4 which is one of the bigger offenders (along with AVX512 in general).

Annoyingly all scheduler models need to define WriteFMA (now that its actually used), even for older targets without FMA/FMA4 support, but that is an existing problem shared by other schedule classes.

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

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

7 years ago[ARM] Fix an off-by-one error when restoring LR for 16-bit Thumb
Momchil Velikov [Mon, 27 Nov 2017 10:13:14 +0000 (10:13 +0000)]
[ARM] Fix an off-by-one error when restoring LR for 16-bit Thumb

The commit https://reviews.llvm.org/rL318143 computes incorrectly to offset to
restore LR from.

The number of tPOP operands is 2 (condition) + 2 (implicit def and use of SP) +
count of the popped registers. We need to load LR from just past the last
register, hence the correct offset should be either getNumOperands() - 4 and
getNumExplicitOperands() - 2 (multiplied by 4).

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

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

7 years agoUpdate BTVER2 sched numbers for SSE42 string instructions.
Andrew V. Tischenko [Mon, 27 Nov 2017 09:58:00 +0000 (09:58 +0000)]
Update BTVER2 sched numbers for SSE42 string instructions.
Differential Revision: https://reviews.llvm.org/D39846

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

7 years ago[SelectionDAG] Teach SplitVecRes_SETCC to call GetSplitVector if the operands have...
Craig Topper [Mon, 27 Nov 2017 05:52:54 +0000 (05:52 +0000)]
[SelectionDAG] Teach SplitVecRes_SETCC to call GetSplitVector if the operands have already been split.

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

7 years ago[SelectionDAG] Fix function name in comment. NFC
Craig Topper [Mon, 27 Nov 2017 05:52:52 +0000 (05:52 +0000)]
[SelectionDAG] Fix function name in comment. NFC

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

7 years ago[X86] Fix an assert that was incorrectly checking for BMI instead of AVX512VBMI.
Craig Topper [Sun, 26 Nov 2017 21:14:48 +0000 (21:14 +0000)]
[X86] Fix an assert that was incorrectly checking for BMI instead of AVX512VBMI.

The check is actually unnecessary since AVX512VBMI implies AVX512BW which is the other part of the assert.

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

7 years ago[X86][3DNow] Add 3DNow! instruction itinerary and scheduling classes
Simon Pilgrim [Sun, 26 Nov 2017 20:50:29 +0000 (20:50 +0000)]
[X86][3DNow] Add 3DNow! instruction itinerary and scheduling classes

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

7 years ago[X86][SSE] Add SSE42 tests to the clear upper tests
Simon Pilgrim [Sun, 26 Nov 2017 20:03:53 +0000 (20:03 +0000)]
[X86][SSE] Add SSE42 tests to the clear upper tests

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

7 years ago[utils][mips] Add support for mips for update_llc_checks.py
Simon Dardis [Sun, 26 Nov 2017 19:22:44 +0000 (19:22 +0000)]
[utils][mips] Add support for mips for update_llc_checks.py

Add support for mips, particularly skipping the matching of .frame, .(f)mask
and LLVM's usage of the .set no(reorder|at|macro) directives.

Reviewers: spatel

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

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

7 years ago[X86][3DNow] Remove unused I3DNow_binop_rm/I3DNow_conv_rm templates. NFCI
Simon Pilgrim [Sun, 26 Nov 2017 19:22:37 +0000 (19:22 +0000)]
[X86][3DNow] Remove unused I3DNow_binop_rm/I3DNow_conv_rm templates. NFCI

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

7 years ago[X86][MMX] Add IIC_MMX_MOVMSK instruction itinerary class
Simon Pilgrim [Sun, 26 Nov 2017 17:56:07 +0000 (17:56 +0000)]
[X86][MMX] Add IIC_MMX_MOVMSK instruction itinerary class

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

7 years ago[SCEV] Adding a check on outgoing branches of a terminator instr for SCEVBackedgeCond...
Jatin Bhateja [Sun, 26 Nov 2017 15:08:41 +0000 (15:08 +0000)]
[SCEV] Adding a check on outgoing branches of a terminator instr for SCEVBackedgeConditionFolder, NFC.

Summary:
For a given loop, getLoopLatch returns a non-null value
when a loop has only one latch block. In the modified
context adding an assertion to check that both the outgoing branches of
a terminator instruction (of latch) does not target same header.
+
few minor code reorganization.

Reviewers: jbhateja

Reviewed By: jbhateja

Subscribers: sanjoy

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

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

7 years agoControl-Flow Enforcement Technology - Shadow Stack support (LLVM side)
Oren Ben Simhon [Sun, 26 Nov 2017 13:02:45 +0000 (13:02 +0000)]
Control-Flow Enforcement Technology - Shadow Stack support (LLVM side)

Shadow stack solution introduces a new stack for return addresses only.
The HW has a Shadow Stack Pointer (SSP) that points to the next return address.
If we return to a different address, an exception is triggered.
The shadow stack is managed using a series of intrinsics that are introduced in this patch as well as the new register (SSP).
The intrinsics are mapped to new instruction set that implements CET mechanism.

The patch also includes initial infrastructure support for IBT.

For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

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

Change-Id: I4daa1f27e88176be79a4ac3b4cd26a459e88fed4

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

7 years ago[x86][icelake]GFNI
Coby Tayree [Sun, 26 Nov 2017 09:36:41 +0000 (09:36 +0000)]
[x86][icelake]GFNI
galois field arithmetic (GF(2^8)) insns:
gf2p8affineinvqb
gf2p8affineqb
gf2p8mulb
Differential Revision: https://reviews.llvm.org/D40373

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

7 years ago[SCEV] NFC : Removing unnecessary check on outgoing branches of a branch instr.
Jatin Bhateja [Sun, 26 Nov 2017 02:01:01 +0000 (02:01 +0000)]
[SCEV] NFC : Removing unnecessary check on outgoing branches of a branch instr.

Summary:
For a given loop, getLoopLatch returns a non-null value
when a loop has only one latch block. In the modified
context a check on both the outgoing branches of a terminator instruction (of latch) to same header is redundant.

Reviewers: jbhateja

Reviewed By: jbhateja

Subscribers: sanjoy

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

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

7 years agoRemove dead code
David Blaikie [Sat, 25 Nov 2017 20:06:04 +0000 (20:06 +0000)]
Remove dead code

(this header is not fully implemented (the out of line function
writeTypeRecordKind is called in an inline function but never
implemented - this fails to link under modular code generation) and not
included anywhere)

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

7 years ago[X86] Remove GCCBuiltin from intrinsics that are no longer used by clang.
Craig Topper [Sat, 25 Nov 2017 20:00:37 +0000 (20:00 +0000)]
[X86] Remove GCCBuiltin from intrinsics that are no longer used by clang.

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

7 years ago[X86] Add separate intrinsics for scalar FMA4 instructions.
Craig Topper [Sat, 25 Nov 2017 18:32:43 +0000 (18:32 +0000)]
[X86] Add separate intrinsics for scalar FMA4 instructions.

Summary:
These instructions zero the non-scalar part of the lower 128-bits which makes them different than the FMA3 instructions which pass through the non-scalar part of the lower 128-bits.

I've only added fmadd because we should be able to derive all other variants using operand negation in the intrinsic header like we do for AVX512.

I think there are still some missed negate folding opportunities with the FMA4 instructions in light of this behavior difference that I hadn't noticed before.

I've split the tests so that we can use different intrinsics for scalar testing between the two. I just copied the tests split the RUN lines and changed out the scalar intrinsics.

fma4-fneg-combine.ll is a new test to make sure we negate the fma4 intrinsics correctly though there are a couple TODOs in it.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

7 years ago[X86] Don't report gather is legal on Skylake CPUs when AVX2/AVX512 is disabled....
Craig Topper [Sat, 25 Nov 2017 18:09:37 +0000 (18:09 +0000)]
[X86] Don't report gather is legal on Skylake CPUs when AVX2/AVX512 is disabled. Allow gather on SKX/CNL/ICL when AVX512 is disabled by using AVX2 instructions.

Summary:
This adds a new fast gather feature bit to cover all CPUs that support fast gather that we can use independent of whether the AVX512 feature is enabled. I'm only using this new bit to qualify AVX2 codegen. AVX512 is still implicitly assuming fast gather to keep tests working and to match the scatter behavior.

Test command lines have been added for these two cases.

Reviewers: magabari, delena, RKSimon, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

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

7 years ago[SelectionDAG] Remove some dead code from vector scalaring
Craig Topper [Sat, 25 Nov 2017 17:59:00 +0000 (17:59 +0000)]
[SelectionDAG] Remove some dead code from vector scalaring

Summary:
Currently ScalarizeVecRes_SETCC checks for the result type being a vector and jumps to ScalarizeVecRes_VSETCC. But if we're scalarizing a vector result, aren't we guaranteed to be looking at a vector type?

This patch deletes the current ScalarizeVecRes_SETCC and renames  ScalarizeVecRes_VSETCC to ScalarizeVecRes_SETCC.

Reviewers: RKSimon, arsenm, eladcohen, zvi

Reviewed By: RKSimon

Subscribers: wdng, llvm-commits

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

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

7 years agoAdd BTVER2 sched support for SHLD/SHRD.
Andrew V. Tischenko [Sat, 25 Nov 2017 10:46:53 +0000 (10:46 +0000)]
Add BTVER2 sched support for SHLD/SHRD.
Differential Revision: https://reviews.llvm.org/D40124

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

7 years ago[X86] Simplify some code in combineSetCC. NFCI
Craig Topper [Sat, 25 Nov 2017 07:20:24 +0000 (07:20 +0000)]
[X86] Simplify some code in combineSetCC. NFCI

Make the condition for doing a std::swap simpler so we don't have to repeat the full checks.

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

7 years ago[X86] Qualify some vector specific code with VT.isVector(). NFCI
Craig Topper [Sat, 25 Nov 2017 07:20:23 +0000 (07:20 +0000)]
[X86] Qualify some vector specific code with VT.isVector(). NFCI

Other checks inside require a build_vector, but we this lets us stop earlier and makes the code more clear.

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

7 years ago[X86] Support folding to andnps with SSE1 only.
Craig Topper [Sat, 25 Nov 2017 07:20:22 +0000 (07:20 +0000)]
[X86] Support folding to andnps with SSE1 only.

With SSE1 only, we emit FAND and FXOR nodes for v4f32.

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