platform/upstream/llvm.git
5 years ago[LLD][ELF] - Linkerscript: add a support for expressions for section's filling
George Rimar [Thu, 4 Jul 2019 14:17:31 +0000 (14:17 +0000)]
[LLD][ELF] - Linkerscript: add a support for expressions for section's filling

Imagine the script:

.section: {
...
} = FILL_EXPR
LLD assumes that FILL_EXPR is a number, and does not allow
it to be an expression. Though that is allowed by specification:
https://sourceware.org/binutils/docs-2.32/ld/Output-Section-Fill.html

This patch adds a support for cases when FILL_EXPR is simple math expression.

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

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

llvm-svn: 365143

5 years agoDocument legacy pass manager extension points
Serge Guelton [Thu, 4 Jul 2019 14:03:11 +0000 (14:03 +0000)]
Document legacy pass manager extension points

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

llvm-svn: 365142

5 years ago[NFC] Added tests for D64099
David Bolvansky [Thu, 4 Jul 2019 13:48:32 +0000 (13:48 +0000)]
[NFC] Added tests for D64099

llvm-svn: 365141

5 years ago[clangd] Fix breakage on gcc 5.4
Kadir Cetinkaya [Thu, 4 Jul 2019 13:47:51 +0000 (13:47 +0000)]
[clangd] Fix breakage on gcc 5.4

llvm-svn: 365140

5 years ago[ELF] Allow placing non-string SHF_MERGE sections with different alignments into...
Fangrui Song [Thu, 4 Jul 2019 13:33:27 +0000 (13:33 +0000)]
[ELF] Allow placing non-string SHF_MERGE sections with different alignments into the same MergeSyntheticSection

The difference from D63432/r365015 is that this patch does not place
SHF_STRINGS sections with different alignments into the same
MergeSyntheticSection. Doing that would:

(1) create unnecessary padding and thus waste space.
  Add a test tail-merge-string-align2.s to check no extra padding is created.
(2) make some input sections unaligned when tail merge (-O2) is enabled.
  The alignment of MergeTailAlignment::Builder was out of sync in D63432.
  MOVAPS on such unaligned strings can raise SIGSEGV.

This should fix PR42289: the Linux kernel has a use case that input
files have .rodata.cst32 sections with different alignments. The
expectation (and what ld.bfd and gold do) is that in the -r link, there
is only one .rodata.cst32 (SHF_MERGE sections with different alignments
can be combined), but lld currently creates one for each different
alignment.

The current merging strategy:

1) Group SHF_MERGE sections by (name, sh_flags, sh_entsize and
   sh_addralign). Merging is performed among a group, even if -O0 is specified.
2) Create one output section for each group. This is a special case in
   addInputSec().

This patch changes 1) to:

1) Group SHF_MERGE sections by (name, sh_flags, sh_entsize).
   Merging is performed among a group, even if -O0 is specified.

We will thus create just one .rodata.cst32 . This also improves merging
efficiency when sections with the same name but different alignments are
combined.

Reviewed By: peter.smith

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

llvm-svn: 365139

5 years ago[X86][SSE] Add some partial dereferenceable vector load tests inspired by PR16739
Simon Pilgrim [Thu, 4 Jul 2019 13:31:49 +0000 (13:31 +0000)]
[X86][SSE] Add some partial dereferenceable vector load tests inspired by PR16739

llvm-svn: 365138

5 years ago[AMDGPU] Correct the setting of `FlatScratchInit`.
Michael Liao [Thu, 4 Jul 2019 13:29:45 +0000 (13:29 +0000)]
[AMDGPU] Correct the setting of `FlatScratchInit`.

Summary: - That flag setting should skip spilling stack slot.

Reviewers: arsenm, rampitec

Subscribers: qcolombet, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 365137

5 years ago[X86] Regenerate load fold peephole test.
Simon Pilgrim [Thu, 4 Jul 2019 12:33:37 +0000 (12:33 +0000)]
[X86] Regenerate load fold peephole test.

llvm-svn: 365136

5 years ago[clangd] Some tweaks on semantic highlighting lookuptable.
Haojian Wu [Thu, 4 Jul 2019 12:27:21 +0000 (12:27 +0000)]
[clangd] Some tweaks on semantic highlighting lookuptable.

Summary:
- move toTextMateScope to SemanticHighlighting.h;
- move the buildLookupTable to LSP layer (as LSP requires such form);

Reviewers: sammccall, jvikstrom

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 365135

5 years ago[clangd] Fix a lifetime bug in QueryDriver
Kadir Cetinkaya [Thu, 4 Jul 2019 12:24:17 +0000 (12:24 +0000)]
[clangd] Fix a lifetime bug in QueryDriver

llvm-svn: 365134

5 years ago[CTU] Add support for virtual functions
Gabor Marton [Thu, 4 Jul 2019 11:39:00 +0000 (11:39 +0000)]
[CTU] Add support for virtual functions

Reviewers: Szelethus, xazax.hun

Subscribers: rnkovacs, dkrupp, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 365133

5 years ago[clangd] Query driver reads stderr and passes driver as first argument
Kadir Cetinkaya [Thu, 4 Jul 2019 11:34:23 +0000 (11:34 +0000)]
[clangd] Query driver reads stderr and passes driver as first argument

Summary:
gcc invokes cc1 through a path deduced from argv[0] therefore it must
be correctly set.
Also it prints the search path to stderr not stdout, this also applies to clang.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365132

5 years ago[ELF] Fix weak-undef-shared.s after r365129
Fangrui Song [Thu, 4 Jul 2019 11:10:45 +0000 (11:10 +0000)]
[ELF] Fix weak-undef-shared.s after r365129

llvm-svn: 365131

5 years ago[clangd] Add a hidden tweak to annotate all highlighting tokens of the file.
Haojian Wu [Thu, 4 Jul 2019 10:49:32 +0000 (10:49 +0000)]
[clangd] Add a hidden tweak to annotate all highlighting tokens of the file.

Reviewers: sammccall, jvikstrom

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 365130

5 years ago[ELF] resolveUndefined: ignore undefined symbols in SharedFile for Undefined and...
Fangrui Song [Thu, 4 Jul 2019 10:38:04 +0000 (10:38 +0000)]
[ELF] resolveUndefined: ignore undefined symbols in SharedFile for Undefined and SharedSymbol

If %t1.o has a weak reference on foo, and %t2.so has a non-weak
reference on foo: `ld.lld %t1.o %t2.so -o %t`

We incorrectly set the binding of the undefined foo to STB_GLOBAL.
Fix this by ignoring undefined symbols in a SharedFile for Undefined and
SharedSymbol.

This fixes the binding of pthread_once when the program links against
both librt.so and libpthread.so

```
a.o: STB_WEAK reference to pthread_once
librt.so: STB_GLOBAL reference to pthread_once    # should be ignored
libstdc++.so: STB_WEAK reference to pthread_once  # should be ignored
libgcc_s.so.1: STB_WEAK reference to pthread_once # should be ignored
```

The STB_GLOBAL pthread_once issue (not fixed by D63974) can cause a link error when the result
DSO is used to link another DSO with -z defs if -lpthread is not specified. (libstdc++.so.6 not having a dependency on libpthread.so is a really nasty hack...)

We happened to create a weak undef before D63974 because libgcc_s.so.1
was linked the last and it changed the binding again to weak.

Reviewed By: ruiu

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

llvm-svn: 365129

5 years agoFix -Wdocumentation param warning.
Simon Pilgrim [Thu, 4 Jul 2019 10:35:31 +0000 (10:35 +0000)]
Fix -Wdocumentation param warning.

Don't put the full stop at the end of a param name - it confuses the doxygen parser

llvm-svn: 365128

5 years agoFix -Wdocumentation warning.
Simon Pilgrim [Thu, 4 Jul 2019 10:33:21 +0000 (10:33 +0000)]
Fix -Wdocumentation warning.

llvm-svn: 365127

5 years agoFix -Wdocumentation warning.
Simon Pilgrim [Thu, 4 Jul 2019 10:28:31 +0000 (10:28 +0000)]
Fix -Wdocumentation warning.

llvm-svn: 365126

5 years ago[X86][AVX1] Combine concat_vectors(pshufd(x,c),pshufd(y,c)) -> vpermilps(concat_vecto...
Simon Pilgrim [Thu, 4 Jul 2019 10:17:10 +0000 (10:17 +0000)]
[X86][AVX1] Combine concat_vectors(pshufd(x,c),pshufd(y,c)) -> vpermilps(concat_vectors(x,y),c)

Bitcast v4i32 to v8f32 and back again - it might be worth adding isel patterns for X86PShufd v8i32 on AVX1 targets like we did for X86Blendi to avoid the bitcasts?

llvm-svn: 365125

5 years ago[clangd] Turn background-index on by default
Kadir Cetinkaya [Thu, 4 Jul 2019 09:56:24 +0000 (09:56 +0000)]
[clangd] Turn background-index on by default

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365124

5 years ago[clangd] Make HadErrors part of background index's internal state
Kadir Cetinkaya [Thu, 4 Jul 2019 09:52:12 +0000 (09:52 +0000)]
[clangd] Make HadErrors part of background index's internal state

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365123

5 years ago[clangd] Add HadErrors field into shards
Kadir Cetinkaya [Thu, 4 Jul 2019 09:52:04 +0000 (09:52 +0000)]
[clangd] Add HadErrors field into shards

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365122

5 years ago[clangd] Store hash of command line in index shards.
Kadir Cetinkaya [Thu, 4 Jul 2019 09:51:53 +0000 (09:51 +0000)]
[clangd] Store hash of command line in index shards.

Summary: This is to enable cache invalidation when command line flags changes.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365121

5 years ago[clangd] Also cache failures while indexing
Kadir Cetinkaya [Thu, 4 Jul 2019 09:51:43 +0000 (09:51 +0000)]
[clangd] Also cache failures while indexing

Summary:
Clangd currently doesn't cache any indexing failures, which results in
retrying those failed files even if their contents haven't changed.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365120

5 years agoFix MSVC "not all control paths return a value" warnings. NFCI.
Simon Pilgrim [Thu, 4 Jul 2019 09:46:06 +0000 (09:46 +0000)]
Fix MSVC "not all control paths return a value" warnings. NFCI.

llvm-svn: 365119

5 years ago[Remarks] Silence gcc warning by catching unhandled values in switches
Mikael Holmen [Thu, 4 Jul 2019 09:29:18 +0000 (09:29 +0000)]
[Remarks] Silence gcc warning by catching unhandled values in switches

Without this fix gcc (7.4) complains with
 ../lib/Remarks/RemarkParser.cpp: In function 'std::unique_ptr<llvm::remarks::ParserImpl> formatToParserImpl(llvm::remarks::ParserFormat, llvm::StringRef)':
 ../lib/Remarks/RemarkParser.cpp:29:1: error: control reaches end of non-void function [-Werror=return-type]
  }
  ^
 ../lib/Remarks/RemarkParser.cpp: In function 'std::unique_ptr<llvm::remarks::ParserImpl> formatToParserImpl(llvm::remarks::ParserFormat, llvm::StringRef, const llvm::remarks::ParsedStringTable&)':
 ../lib/Remarks/RemarkParser.cpp:38:1: error: control reaches end of non-void function [-Werror=return-type]
  }
  ^

The Format enum currently only contains the value YAML which is indeed
already handled in the switches, but gcc complains anyway.

Adding a default case with an llvm_unreachable silences gcc.

llvm-svn: 365118

5 years ago[ARM] Favour PL/MI over GE/LT when possible
David Green [Thu, 4 Jul 2019 08:58:58 +0000 (08:58 +0000)]
[ARM] Favour PL/MI over GE/LT when possible

The arm condition codes for GE is N==V (and for LT is N!=V). If the source of
flags cannot set V (overflow), such as a cmp against #0, then we can use the
simpler PL and MI conditions that only check N. As these PL/MI conditions are
simpler than GE/LT, other passes like the peephole optimiser can have a better
time optimising away the redundant CMPs.

The exception is the VSEL instruction, which cannot take the PL code, so there
the transform favours GE.

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

llvm-svn: 365117

5 years ago[ARM] Added testing for D64160. NFC
David Green [Thu, 4 Jul 2019 08:49:32 +0000 (08:49 +0000)]
[ARM] Added testing for D64160. NFC

Adds some extra vsel testing and regenerates long shift and saturation bitop
tests.

llvm-svn: 365116

5 years ago[docs][llvm-dwarfdump] Remove unnecessary reference to --show-children
James Henderson [Thu, 4 Jul 2019 08:49:04 +0000 (08:49 +0000)]
[docs][llvm-dwarfdump] Remove unnecessary reference to --show-children

The --show-children option description describes what it does, and
references the =<offset> parameter of section dump switches. I don't
think it needs to be explained again in the documentation of the
section dump switches too.

Reviewed by: JDevlieghere

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

llvm-svn: 365115

5 years ago[TableGen] Allow DAG isel patterns to override default operands.
Simon Tatham [Thu, 4 Jul 2019 08:43:20 +0000 (08:43 +0000)]
[TableGen] Allow DAG isel patterns to override default operands.

When a Tablegen instruction description uses `OperandWithDefaultOps`,
isel patterns for that instruction don't have to fill in the default
value for the operand in question. But the flip side is that they
actually //can't// override the defaults even if they want to.

This will be very inconvenient for the Arm backend, when we start
wanting to write isel patterns that generate the many MVE predicated
vector instructions, in the form with predication actually enabled. So
this small Tablegen fix makes it possible to write an isel pattern
either with or without values for a defaulted operand, and have the
default values filled in only if they are not overridden.

If all the defaulted operands come at the end of the instruction's
operand list, there's a natural way to match them up to the arguments
supplied in the pattern: consume pattern arguments until you run out,
then fill in any missing instruction operands with their default
values. But if defaulted and non-defaulted operands are interleaved,
it's less clear what to do. This does happen in existing targets (the
first example I came across was KILLGT, in the AMDGPU/R600 backend),
and of course they expect the previous behaviour (that the default for
those operands is used and a pattern argument is not consumed), so for
backwards compatibility I've stuck with that.

Reviewers: nhaehnle, hfinkel, dmgreen

Subscribers: mehdi_amini, javed.absar, tpr, kristof.beyls, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 365114

5 years ago[ARM] MVE bitwise instruction patterns
David Green [Thu, 4 Jul 2019 08:41:23 +0000 (08:41 +0000)]
[ARM] MVE bitwise instruction patterns

This adds patterns for the simpler VAND, VORR and VEOR bitwise vector
instructions. It also adjusts the top16Zero PatLeaf to not match on vector
instructions, which can otherwise cause problems.

Code written by David Sherwood.

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

llvm-svn: 365113

5 years ago[clangd] Add missing changes for 365111
Johan Vikstrom [Thu, 4 Jul 2019 08:06:48 +0000 (08:06 +0000)]
[clangd] Add missing changes for 365111

llvm-svn: 365112

5 years ago[clangd] Emit publishSemanticHighlighting in LSP if enabled
Johan Vikstrom [Thu, 4 Jul 2019 07:53:12 +0000 (07:53 +0000)]
[clangd] Emit publishSemanticHighlighting in LSP if enabled

Summary: Emit publishSemanticHighlighting in LSP if enabled

Reviewers: hokein, kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 365111

5 years ago[NFC][PowerPC] Make the PowerPC scheduling strategy feature only control the strategy...
QingShan Zhang [Thu, 4 Jul 2019 07:43:51 +0000 (07:43 +0000)]
[NFC][PowerPC] Make the PowerPC scheduling strategy feature only control the strategy instead of the scheduler.

llvm-svn: 365110

5 years ago[X86] Use pointer sized indices instead of i32 for EXTRACT_VECTOR_ELT and INSERT_VECT...
Craig Topper [Thu, 4 Jul 2019 06:21:54 +0000 (06:21 +0000)]
[X86] Use pointer sized indices instead of i32 for EXTRACT_VECTOR_ELT and INSERT_VECTOR_ELT in a couple places.

Most places already did this.

llvm-svn: 365109

5 years ago[AVR] Fix tests after r363757
Dylan McKay [Thu, 4 Jul 2019 06:12:47 +0000 (06:12 +0000)]
[AVR] Fix tests after r363757

r363757 renamed ExpandISelPseudo to FinalizeISel, so the RUN line in
select-must-add-unconditional-jump.mir needed updating to refer to finalize-isel.

llvm-svn: 365108

5 years ago[LoopPeel] Some small comment update. NFC.
Serguei Katkov [Thu, 4 Jul 2019 05:10:14 +0000 (05:10 +0000)]
[LoopPeel] Some small comment update. NFC.

Follow-up change of comment after
https://reviews.llvm.org/D63917 is landed.

llvm-svn: 365107

5 years ago[PowerPC] Support constraint code "ww"
Fangrui Song [Thu, 4 Jul 2019 04:44:42 +0000 (04:44 +0000)]
[PowerPC] Support constraint code "ww"

Summary:
"ww" and "ws" are both constraint codes for VSX vector registers that
hold scalar double data. "ww" is preferred for float while "ws" is
preferred for double.

Reviewed By: jsji

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

llvm-svn: 365106

5 years ago[docs] [NFC] Removed excess spacing
Alex Brachet [Thu, 4 Jul 2019 04:41:06 +0000 (04:41 +0000)]
[docs] [NFC] Removed excess spacing

Summary: Removed excess new lines from documentations. As far as I can tell, it seems as though restructured text is agnostic to new lines, the use of new lines was inconsistent and had no effect on how the files were being displayed.

Reviewers: jhenderson, rupprecht, JDevlieghere

Reviewed By: jhenderson

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 365105

5 years ago[PowerPC] Hardware Loop branch instruction's condition may not be icmp.
Chen Zheng [Thu, 4 Jul 2019 01:51:47 +0000 (01:51 +0000)]
[PowerPC] Hardware Loop branch instruction's condition may not be icmp.
This fixes pr42492.
Differential Revision: https://reviews.llvm.org/D64124

llvm-svn: 365104

5 years ago[analyzer] ReturnValueChecker: Model the guaranteed boolean return value of function...
Csaba Dabis [Thu, 4 Jul 2019 00:50:50 +0000 (00:50 +0000)]
[analyzer] ReturnValueChecker: Model the guaranteed boolean return value of function calls

Summary: It models the known LLVM methods paired with their class.

Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus

Reviewed By: NoQ

Subscribers: dschuff, aheejin, mgorny, szepet, rnkovacs, a.sidorin,
             mikhail.ramalho, donat.nagy, dkrupp, cfe-commits

Tags: #clang

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

llvm-svn: 365103

5 years ago[Remarks] Require an explicit format to the parser
Francis Visoiu Mistrih [Thu, 4 Jul 2019 00:31:03 +0000 (00:31 +0000)]
[Remarks] Require an explicit format to the parser

Make the parser require an explicit format.

This allows new formats to be easily added by following YAML as an
example.

llvm-svn: 365102

5 years ago[Remarks][NFC] Move the string table parsing out of the parser constructor
Francis Visoiu Mistrih [Thu, 4 Jul 2019 00:30:58 +0000 (00:30 +0000)]
[Remarks][NFC] Move the string table parsing out of the parser constructor

Make the parser take an already-parsed string table.

llvm-svn: 365101

5 years ago[WebAssembly] Update test failure explanations
Derek Schuff [Thu, 4 Jul 2019 00:24:35 +0000 (00:24 +0000)]
[WebAssembly] Update test failure explanations

llvm-svn: 365100

5 years ago[MachO] Add valid architecture function
Shoaib Meenai [Thu, 4 Jul 2019 00:17:02 +0000 (00:17 +0000)]
[MachO] Add valid architecture function

Added array of valid architectures and function returning array.
Modified llvm-lipo to include list of valid architectures in error message for invalid arch.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

llvm-svn: 365099

5 years ago[JITLink][ORC] Add EHFrameRegistrar interface, use in EHFrameRegistrationPlugin.
Lang Hames [Thu, 4 Jul 2019 00:05:12 +0000 (00:05 +0000)]
[JITLink][ORC] Add EHFrameRegistrar interface, use in EHFrameRegistrationPlugin.

Replaces direct calls to eh-frame registration with calls to methods on an
EHFrameRegistrar instance. This allows clients to substitute a registrar that
registers frames in a remote process via IPC/RPC.

llvm-svn: 365098

5 years agoRevert [ThinLTO] Optimize writeonly globals out
Reid Kleckner [Thu, 4 Jul 2019 00:03:30 +0000 (00:03 +0000)]
Revert [ThinLTO] Optimize writeonly globals out

This reverts r365040 (git commit 5cacb914758c7f436b47c8362100f10cef14bbc4)

Speculatively reverting, since this appears to have broken check-lld on
Linux. Partial analysis in https://crbug.com/981168.

llvm-svn: 365097

5 years ago[WebAssembly] Enable IndirectBrExpandPass
Derek Schuff [Wed, 3 Jul 2019 23:54:06 +0000 (23:54 +0000)]
[WebAssembly] Enable IndirectBrExpandPass

Wasm doesn't have a direct way to lower indirectbr, so hook up the
IndirectBrExpandPass to lower indirectbr into a switch.

Fixes PR42498

Reviewers: aheejin

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

llvm-svn: 365096

5 years agoAMDGPU: Add pass to lower SGPR spills
Matt Arsenault [Wed, 3 Jul 2019 23:32:29 +0000 (23:32 +0000)]
AMDGPU: Add pass to lower SGPR spills

This is split out from my patches to split register allocation into a
separate SGPR and VGPR phase, and has some parts that aren't yet used
(like maintaining LiveIntervals).

This simplifies making the frame pointer register callee saved. As it
is now, the code to determine callee saves needs to predict all the
possible SGPR spills and how many callee saved VGPRs are needed. By
handling this before PrologEpilogInserter, it's possible to just check
the spill objects that already exist.

Change-Id: I29e6df4034afcf949e06f8ef44206acb94696f04
llvm-svn: 365095

5 years ago[JumpThreading] Fix threading with unusual PHI nodes.
Eli Friedman [Wed, 3 Jul 2019 23:12:39 +0000 (23:12 +0000)]
[JumpThreading] Fix threading with unusual PHI nodes.

If the block being cloned contains a PHI node, in general, we need to
clone that PHI node, even though it's trivial. If the operand of the PHI
is an instruction in the block being cloned, the correct value for the
operand doesn't exist until SSAUpdater constructs it.

We usually don't hit this issue because we try to avoid threading across
loop headers, but it's possible to hit this in some cases involving
irreducible CFGs.  I added a flag to allow threading across loop headers
to make the testcase easier to understand.

Thanks to Brian Rzycki for reducing the testcase.

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

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

llvm-svn: 365094

5 years agoGlobalISel: Fix widenScalar for pointer typed G_MERGE_VALUES
Matt Arsenault [Wed, 3 Jul 2019 23:08:06 +0000 (23:08 +0000)]
GlobalISel: Fix widenScalar for pointer typed G_MERGE_VALUES

llvm-svn: 365093

5 years agocmake: Add CLANG_LINK_CLANG_DYLIB option
Tom Stellard [Wed, 3 Jul 2019 22:45:55 +0000 (22:45 +0000)]
cmake: Add CLANG_LINK_CLANG_DYLIB option

Summary:
Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against
libclang_shared.so instead of the individual component libraries.

Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru

Subscribers: arphaman, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 365092

5 years ago[Bitcode] Move Bitstream to a separate library
Francis Visoiu Mistrih [Wed, 3 Jul 2019 22:40:07 +0000 (22:40 +0000)]
[Bitcode] Move Bitstream to a separate library

This moves Bitcode/Bitstream*, Bitcode/BitCodes.h to Bitstream/.

This is needed to avoid a circular dependency when using the bitstream
code for parsing optimization remarks.

Since Bitcode uses Core for the IR part:

libLLVMRemarks -> Bitcode -> Core

and Core uses libLLVMRemarks to generate remarks (see
IR/RemarkStreamer.cpp):

Core -> libLLVMRemarks

we need to separate the Bitstream and Bitcode part.

For clang-doc, it seems that it doesn't need the whole bitcode layer, so
I updated the CMake to only use the bitstream part.

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

llvm-svn: 365091

5 years agoRefactor ObjectFile::GetSDKVersion
Raphael Isemann [Wed, 3 Jul 2019 22:21:10 +0000 (22:21 +0000)]
Refactor ObjectFile::GetSDKVersion

Summary: This patch modernizes the GetSDKVersion API and hopefully prevents problems such as the ones discovered in D61218.

Reviewers: aprantl, jasonmolenda, clayborg

Reviewed By: aprantl, clayborg

Subscribers: clayborg, labath, lldb-commits

Tags: #lldb

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

llvm-svn: 365090

5 years ago[WebAssembly][NFC] simplify SjLj inline assembly test
Guanzhong Chen [Wed, 3 Jul 2019 22:11:14 +0000 (22:11 +0000)]
[WebAssembly][NFC] simplify SjLj inline assembly test

Summary:
Per feedback in D64115, simplify the test.

`hidden` is left in though, because every test in the file has it.

Reviewers: aheejin, tlively

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 365089

5 years ago[WebAssembly] Add option to emit passive segments
Thomas Lively [Wed, 3 Jul 2019 22:04:54 +0000 (22:04 +0000)]
[WebAssembly] Add option to emit passive segments

Summary:
Adds `--passive-segments` and `--active-segments` flags to control
what kind of segments are emitted. For now the default is always
to emit active segments so this is not a breaking change, but in
the future the default will be changed to passive segments when
shared memory is requested and active segments otherwise. When
passive segments are emitted, corresponding memory.init and
data.drop instructions are emitted in a `__wasm_init_memory`
function that is automatically called at the beginning of
`__wasm_call_ctors`.

Reviewers: sbc100, aheejin, dschuff

Subscribers: azakai, dschuff, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 365088

5 years agoRevert "[AMDGPU] Kernel arg metadata: added support for "__hip_texture" type."
Matt Arsenault [Wed, 3 Jul 2019 21:34:34 +0000 (21:34 +0000)]
Revert "[AMDGPU] Kernel arg metadata: added support for "__hip_texture" type."

This reverts commit r365073.

This is crashing, and is improperly relying on IR type names.

llvm-svn: 365087

5 years ago[Docs] Remove stale builder
Jonas Devlieghere [Wed, 3 Jul 2019 20:53:57 +0000 (20:53 +0000)]
[Docs] Remove stale builder

llvm-svn: 365086

5 years ago[analyzer] exploded-graph-rewriter: Implement a black-and-white color scheme.
Artem Dergachev [Wed, 3 Jul 2019 20:48:23 +0000 (20:48 +0000)]
[analyzer] exploded-graph-rewriter: Implement a black-and-white color scheme.

For accessibility!

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

llvm-svn: 365085

5 years agoRevert "[llvm-ar][test] Add to MRI test coverage"
JF Bastien [Wed, 3 Jul 2019 20:47:53 +0000 (20:47 +0000)]
Revert "[llvm-ar][test] Add to MRI test coverage"

This reverts commit 250015bacf7f255abcfb646fb8b6b56ce8be7e01.
r365039 was re-commit of D63197 and failed on Mac. Reid XFAIL'd it, but I'd rather jsut revert and have it fixed properly.

llvm-svn: 365084

5 years ago[Docs] Update documentation build instructions.
Jonas Devlieghere [Wed, 3 Jul 2019 20:47:49 +0000 (20:47 +0000)]
[Docs] Update documentation build instructions.

Given that we use Ninja as the build system in the instructions below,
we might as well use it to build the documentation as well.

llvm-svn: 365083

5 years agoRemove code-signing.txt now that it's part of the docs
Jonas Devlieghere [Wed, 3 Jul 2019 20:47:46 +0000 (20:47 +0000)]
Remove code-signing.txt now that it's part of the docs

The file's content is part of the website:
https://lldb.llvm.org/resources/build.html

llvm-svn: 365082

5 years ago[Docs] Unify build instructions
Jonas Devlieghere [Wed, 3 Jul 2019 20:45:06 +0000 (20:45 +0000)]
[Docs] Unify build instructions

The current build instructions are structured according the host
platform. Instead of having instructions on how to build with CMake
repeated for every platform, I unified them, using subsections if things
are different for between platforms. I also added the code signing
instructions, which were hidden in a text file in the repository.

llvm-svn: 365081

5 years agoAdd tests for regex_match ambiguity (aka LWG2273). NFC. Reviewed as https://reviews...
Marshall Clow [Wed, 3 Jul 2019 20:32:35 +0000 (20:32 +0000)]
Add tests for regex_match ambiguity (aka LWG2273). NFC. Reviewed as https://reviews.llvm.org/D63051

llvm-svn: 365080

5 years agoTeach ValueTracking that aarch64.irg result aliases its input.
Evgeniy Stepanov [Wed, 3 Jul 2019 20:19:14 +0000 (20:19 +0000)]
Teach ValueTracking that aarch64.irg result aliases its input.

Reviewers: javed.absar, olista01

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 365079

5 years agoFixed a link in ReleaseNotes.rst (follow-up to r365007)
Dmitri Gribenko [Wed, 3 Jul 2019 20:18:34 +0000 (20:18 +0000)]
Fixed a link in ReleaseNotes.rst (follow-up to r365007)

llvm-svn: 365078

5 years ago[LoopBase] Strengthen isLoopExiting by requiring that BB must be inside the loop.
Florian Hahn [Wed, 3 Jul 2019 20:15:14 +0000 (20:15 +0000)]
[LoopBase] Strengthen isLoopExiting by requiring that BB must be inside the loop.

Currently isLoopExiting returns true for BBs that are not part of the
loop. To avoid hiding subtle bugs, this patch adds an assertion to make
sure the passed BB is inside the loop

Reviewers: reames, efriedma, hfinkel, arsenm, nhaehnle

Reviewed By: reames

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

llvm-svn: 365077

5 years agoTry to XFAIL mri-utf8.test on Mac
Reid Kleckner [Wed, 3 Jul 2019 20:14:54 +0000 (20:14 +0000)]
Try to XFAIL mri-utf8.test on Mac

llvm-svn: 365076

5 years ago[LFTR] Use SCEVExpander for the pointer limit case instead of manual IR gen
Philip Reames [Wed, 3 Jul 2019 20:03:46 +0000 (20:03 +0000)]
[LFTR] Use SCEVExpander for the pointer limit case instead of manual IR gen

As noted in the test change, this is not trivially NFC, but all of the changes in output are cases where the SCEVExpander form is more canonical/optimal than the hand generation.

llvm-svn: 365075

5 years agoFix tuple's conditionally explicit constructors for very weird user
Eric Fiselier [Wed, 3 Jul 2019 19:21:40 +0000 (19:21 +0000)]
Fix tuple's conditionally explicit constructors for very weird user
types.

It seems some people like to write types that can explicitly convert
to anything, but cannot be used to explicitly construct anything.

This patch makes tuple tolerate such types, as is required
by the standard.

llvm-svn: 365074

5 years ago[AMDGPU] Kernel arg metadata: added support for "__hip_texture" type.
Konstantin Pyzhov [Wed, 3 Jul 2019 19:11:35 +0000 (19:11 +0000)]
[AMDGPU] Kernel arg metadata: added support for "__hip_texture" type.

Summary:
Hip texture type is equivalent to OpenCL image. So, we need to set the Image type for kernel arguments with __hip_texture type.

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

llvm-svn: 365073

5 years ago[LFTR] Remove a stray variable shadow *of the same value* [NFC]
Philip Reames [Wed, 3 Jul 2019 19:08:43 +0000 (19:08 +0000)]
[LFTR] Remove a stray variable shadow *of the same value* [NFC]

llvm-svn: 365072

5 years ago[LFTR] Style and comment changes to clarify the narrow vs wide bitwidth evaluation...
Philip Reames [Wed, 3 Jul 2019 19:03:37 +0000 (19:03 +0000)]
[LFTR] Style and comment changes to clarify the narrow vs wide bitwidth evaluation behavior [NFC]

llvm-svn: 365071

5 years ago[LFTR] Sink the decision not use truncate scheme for constants into genLoopLimit...
Philip Reames [Wed, 3 Jul 2019 18:41:03 +0000 (18:41 +0000)]
[LFTR] Sink the decision not use truncate scheme for constants into genLoopLimit [NFC]

We might as well just evaluate the constants using SCEV, and having the cases grouped makes the logic slightly easier to read anyway.

llvm-svn: 365070

5 years agoFix precedence in assert from r364961
Jessica Paquette [Wed, 3 Jul 2019 18:30:01 +0000 (18:30 +0000)]
Fix precedence in assert from r364961

Precedence was wrong in an assert added in r364961. Add braces around the
assertion condition to make it right.

See: https://reviews.llvm.org/D64084
llvm-svn: 365069

5 years ago[libc++] Update availability markup for Filesystem on Apple platforms
Louis Dionne [Wed, 3 Jul 2019 18:29:02 +0000 (18:29 +0000)]
[libc++] Update availability markup for Filesystem on Apple platforms

llvm-svn: 365068

5 years ago[LFTR] Remove falsely generalized (dead) code [NFC]
Philip Reames [Wed, 3 Jul 2019 18:24:06 +0000 (18:24 +0000)]
[LFTR] Remove falsely generalized (dead) code [NFC]

llvm-svn: 365067

5 years ago[LFTR] Hoist extend expressions outside of loops w/o waiting for LICM
Philip Reames [Wed, 3 Jul 2019 18:18:36 +0000 (18:18 +0000)]
[LFTR] Hoist extend expressions outside of loops w/o waiting for LICM

The motivation for this is two fold:
1) Make the output (and thus tests)  a bit more readable to a human trying to understand the result of the transform
2) Reduce spurious diffs in a potential future change to restructure all of this logic to use SCEVExpander (which hoists by default)

llvm-svn: 365066

5 years ago[clang-scan-deps] use `-Wno-error` when scanning for dependencies
Alex Lorenz [Wed, 3 Jul 2019 18:01:32 +0000 (18:01 +0000)]
[clang-scan-deps] use `-Wno-error` when scanning for dependencies

Warnings can be promoted to errors.
But that shouldn't prevent us from getting the dependencies!

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

llvm-svn: 365065

5 years ago[macCatalyst] Print out macCatalyst in llvm-objdump for the platform
Alex Lorenz [Wed, 3 Jul 2019 17:46:30 +0000 (17:46 +0000)]
[macCatalyst] Print out macCatalyst in llvm-objdump for the platform

'macCatalyst' is more readable than 'maccatalyst'.

llvm-svn: 365064

5 years ago[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for selectArithImmed
Jessica Paquette [Wed, 3 Jul 2019 17:46:23 +0000 (17:46 +0000)]
[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for selectArithImmed

Instead of just stopping to see if we have a G_CONSTANT, instead, look through
G_TRUNCs, G_SEXTs, and G_ZEXTs.

This gives an average ~1.3% code size improvement on CINT2000 at -O3.

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

llvm-svn: 365063

5 years ago[X86] Update test; NFC
Robert Lougher [Wed, 3 Jul 2019 17:45:24 +0000 (17:45 +0000)]
[X86] Update test; NFC

This updates pr38743.ll after D62605.

llvm-svn: 365062

5 years ago[X86] Avoid SFB - Skip meta instructions
Robert Lougher [Wed, 3 Jul 2019 17:43:55 +0000 (17:43 +0000)]
[X86] Avoid SFB - Skip meta instructions

This patch generalizes the fix in D61680 to ignore all meta instructions,
not just debug info.

Patch by Chris Dawson.

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

llvm-svn: 365061

5 years ago[Bitcode] Update CHECK-DAG usage in tests
Joel E. Denny [Wed, 3 Jul 2019 17:31:43 +0000 (17:31 +0000)]
[Bitcode] Update CHECK-DAG usage in tests

This patch adjusts tests not to depend on deprecated FileCheck
behavior that permits overlapping matches within a block of
`CHECK-DAG` directives:

1. `thinlto-function-summary-originalnames.ll`: The directive with the
pattern `<COMBINED` is surely intended to match `<COMBINED ` (note the
trailing space), but it instead matches
`<COMBINED_GLOBALVAR_INIT_REFS`, for which there is a separate
directive.  With the deprecated behavior, both directives match the
latter text and neither match the former text.  I've adjusted the
former directive so it matches only the former text.

2. `thinlto-summary-local-5.0.ll`: Two directives have identical
patterns when they were clearly meant to have different patterns.

3. `upgrade-pointer-address-space.ll`: There are three identical
directives but only two occurrences of the matching text.  With the
deprecated behavior, they always match exactly the same text, so the
behavior can't have been useful.  I removed one of the directives and
converted the other two from `CHECK-DAG` to `CHECK`.

Reviewed By: probinson, aprantl

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

llvm-svn: 365060

5 years agoAdd plugin.process.gdb-remote.use-libraries-svr4 option
Antonio Afonso [Wed, 3 Jul 2019 17:30:07 +0000 (17:30 +0000)]
Add plugin.process.gdb-remote.use-libraries-svr4 option

Summary:
This option allow the toggling of the libraries-svr4 usage in ProcessGDBRemote. It's a follow up of https://reviews.llvm.org/D62503#1564296 and it's meant to test / tweak this new packet with, hopefully, minimum impact and in a faster way.

Enable it with `settings set plugin.process.gdb-remote.use-libraries-svr4 true`. For now, by default it's false.

I didn't put tests up for this but I did test it manually.

Reviewers: labath, jankratochvil

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 365059

5 years ago[CodeGen] Make branch funnels pass the machine verifier
Francis Visoiu Mistrih [Wed, 3 Jul 2019 17:16:45 +0000 (17:16 +0000)]
[CodeGen] Make branch funnels pass the machine verifier

We previously marked all the tests with branch funnels as
`-verify-machineinstrs=0`.

This is an attempt to fix it.

1) `ICALL_BRANCH_FUNNEL` has no defs. Mark it as `let OutOperandList =
(outs)`

2) After that we hit an assert: ``` Assertion failed: (Op.getValueType()
!= MVT::Other && Op.getValueType() != MVT::Glue && "Chain and glue
operands should occur at end of operand list!"), function AddOperand,
file
/Users/francisvm/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp,
line 461.  ```

The chain operand was added at the beginning of the operand list. Move
that to the end.

3) After that we hit another verifier issue in the pseudo expansion
where the registers used in the cmps and jmps are not added to the
livein lists. Add the `EFLAGS` to all the new MBBs that we create.

PR39436

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

llvm-svn: 365058

5 years ago[X86] ComputeNumSignBitsForTargetNode - add target shuffle support.
Simon Pilgrim [Wed, 3 Jul 2019 17:06:59 +0000 (17:06 +0000)]
[X86] ComputeNumSignBitsForTargetNode - add target shuffle support.

llvm-svn: 365057

5 years ago[NFC][InstCombine] onehot_merge.ll: add last few tests in the state they regress...
Roman Lebedev [Wed, 3 Jul 2019 16:48:53 +0000 (16:48 +0000)]
[NFC][InstCombine] onehot_merge.ll: add last few tests in the state they regress to in D62818

llvm-svn: 365056

5 years ago[SLP] add tests for bitcasted vector pointer load; NFC
Sanjay Patel [Wed, 3 Jul 2019 16:46:14 +0000 (16:46 +0000)]
[SLP] add tests for bitcasted vector pointer load; NFC

I'm not sure if this falls within the scope of SLP,
but we could create vector loads for some of these
patterns.

llvm-svn: 365055

5 years agoUse getAllOnesConstants instead of -1 in DAGCombiner. NFC
Amaury Sechet [Wed, 3 Jul 2019 16:34:36 +0000 (16:34 +0000)]
Use getAllOnesConstants instead of -1 in DAGCombiner. NFC

llvm-svn: 365054

5 years ago[SCEV] Preserve flags on add/muls in getSCEVATScope
Philip Reames [Wed, 3 Jul 2019 16:34:08 +0000 (16:34 +0000)]
[SCEV] Preserve flags on add/muls in getSCEVATScope

We haven't changed the set of users, just specialized an operand for those users.  Given that, the previous wrap flags must still be correct.

Sorry for the lack of test case.  Noticed this while working on something else, and haven't figured out to exercise this standalone.

llvm-svn: 365053

5 years ago[scudo][standalone] Link tests against libatomic
Kostya Kortchinsky [Wed, 3 Jul 2019 16:32:01 +0000 (16:32 +0000)]
[scudo][standalone] Link tests against libatomic

Summary:
Some clang versions (< 6.0) do not inline the atomic builtin functions
leaving unresolved references to `__atomic_load_8` and so on (seems to
be mostly 64-bit atomics on 32-bit platforms).
I tried without success to use some cmake magic to detect when that
would be the case, and decided to fall back to unconditionally
linking libatomic.

Reviewers: morehouse, eugenis, vitalybuka, hctim, tejohnson

Reviewed By: tejohnson

Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365052

5 years ago[DAGCombine] More diamong carry pattern optimization.
Amaury Sechet [Wed, 3 Jul 2019 16:15:59 +0000 (16:15 +0000)]
[DAGCombine] More diamong carry pattern optimization.

Summary:
This diff improve the capability of DAGCOmbine to generate linear carries propagation in presence of a diamond pattern. It is now able to match a large variety of different patterns rather than some hardcoded one.

Arguably, the codegen in test cases is not better, but this is to be expected. The goal of this transformation is more about canonicalisation than actual optimisation.

Reviewers: hfinkel, RKSimon, craig.topper

Subscribers: llvm-commits

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

llvm-svn: 365051

5 years ago[X86][AVX] combineX86ShufflesRecursively - peek through extract_subvector
Simon Pilgrim [Wed, 3 Jul 2019 15:46:08 +0000 (15:46 +0000)]
[X86][AVX] combineX86ShufflesRecursively - peek through extract_subvector

If we have more then 2 shuffle ops to combine, try to use combineX86ShuffleChainWithExtract to see if some are from the same super vector.

llvm-svn: 365050

5 years ago[ELF][RISCV] Error on R_RISCV_PCREL_LO12_[IS] that point to absolute symbols
Fangrui Song [Wed, 3 Jul 2019 15:38:59 +0000 (15:38 +0000)]
[ELF][RISCV] Error on R_RISCV_PCREL_LO12_[IS] that point to absolute symbols

The referenced symbol is expected to point to an R_RISCV_*_HI20
relocation. An absolute symbol has no associated section, therefore
there cannot be a matching R_RISCV_*_HI20.

This fixes the crash reported by PR42038. For reference, ld.bfd errors:

    (.init+0x4): dangerous relocation: %pcrel_lo missing matching %pcrel_hi

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

llvm-svn: 365049

5 years agoRevert D63432 "[ELF] Allow placing SHF_MERGE sections with different alignments into...
Fangrui Song [Wed, 3 Jul 2019 15:26:54 +0000 (15:26 +0000)]
Revert D63432 "[ELF] Allow placing SHF_MERGE sections with different alignments into the same MergeSyntheticSection"

This reverts r365015.

David Zarzycki reported this change broke stage2 and stage3 tests.  The
root cause is still not very clear, but I guess some SHF_MERGE sections
with the same name have different alignments. They were not merged
before but were merged after r365015.

Something that assumes address uniqueness of such mergeable data caused
the bug.

llvm-svn: 365048

5 years ago[ThinLTO] Fix gcc warnings from commit
Teresa Johnson [Wed, 3 Jul 2019 15:12:38 +0000 (15:12 +0000)]
[ThinLTO] Fix gcc warnings from commit

Remove an unnecessary const from an Optional return type introduced
in r364960 that gcc 7.4.0 warns about. It is unnecessary and possibly
incorrect.

llvm-svn: 365047

5 years ago[ARM] Fix for NDEBUG builds
Sam Parker [Wed, 3 Jul 2019 14:39:23 +0000 (14:39 +0000)]
[ARM] Fix for NDEBUG builds

Fix unused variable warning as well as a nonsense assert.

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

llvm-svn: 365046

5 years ago[scudo][standalone] Potential fix for missing sized delete
Kostya Kortchinsky [Wed, 3 Jul 2019 14:38:47 +0000 (14:38 +0000)]
[scudo][standalone] Potential fix for missing sized delete

Summary:
In some setups, using `-fsized-deallocation` would end up not finding
a sized delete operator at link time. For now, avoid using the flag
and declare the sized delete operator in the cpp test only.

This is a tentative fix as I do not have the failing setup.

Reviewers: rnk, morehouse, hctim, eugenis, vitalybuka

Reviewed By: rnk, hctim

Subscribers: mgorny, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365045

5 years ago[X86][AVX] Combine vpermi(bitcast(x)) -> bitcast(vpermi(x))
Simon Pilgrim [Wed, 3 Jul 2019 14:34:16 +0000 (14:34 +0000)]
[X86][AVX] Combine vpermi(bitcast(x)) -> bitcast(vpermi(x))

iff the number of elements doesn't change.

This gets around an issue with combineX86ShuffleChain not being able to hint which domain is preferred for shuffles that can be done with either.

Fixes regression introduced in rL365041

llvm-svn: 365044