platform/upstream/llvm.git
5 years agoceil: Remove llvm intrinsic from the header.
Jan Vesely [Wed, 13 Mar 2019 07:05:58 +0000 (07:05 +0000)]
ceil: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356013

5 years agosqrt: Split function generation to a shared inc file.
Jan Vesely [Wed, 13 Mar 2019 07:05:56 +0000 (07:05 +0000)]
sqrt: Split function generation to a shared inc file.

This will be reused by other unary functions.
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356012

5 years agomad: Convert to standard ternary header
Jan Vesely [Wed, 13 Mar 2019 07:05:53 +0000 (07:05 +0000)]
mad: Convert to standard ternary header

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356011

5 years agotravis: Deduplicate LLVM_CONFIG variable
Jan Vesely [Wed, 13 Mar 2019 06:58:53 +0000 (06:58 +0000)]
travis: Deduplicate LLVM_CONFIG variable

Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356010

5 years agotravis: Use gcc-6 for llvm-7 build
Jan Vesely [Wed, 13 Mar 2019 06:58:51 +0000 (06:58 +0000)]
travis: Use gcc-6 for llvm-7 build

llvm does not expose -std=c++11 in cxx flags.
gcc-6 switched default from c++98 to c++14

Reviewers: Aaron Watry, Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356009

5 years ago[X86] Remove 'cx16' from 'prescott' and 'yonah' as they are 32-bit only CPUs and...
Craig Topper [Wed, 13 Mar 2019 05:14:52 +0000 (05:14 +0000)]
[X86] Remove 'cx16' from 'prescott' and 'yonah' as they are 32-bit only CPUs and cmpxchg16b requires 64-bit mode.

llvm-svn: 356008

5 years ago[X86] Add 'yonah' test to predefined-arch-macros.c test.
Craig Topper [Wed, 13 Mar 2019 05:14:50 +0000 (05:14 +0000)]
[X86] Add 'yonah' test to predefined-arch-macros.c test.

llvm-svn: 356007

5 years ago[ImplicitNullChecks] Support unordered atomic accesses
Philip Reames [Wed, 13 Mar 2019 03:25:20 +0000 (03:25 +0000)]
[ImplicitNullChecks] Support unordered atomic accesses

Update the INC pass to allow folding unordered atomics.  This is the first optimization unblocked by the changes landed from D57601.

llvm-svn: 356006

5 years agoDelete unused declaration of DeclContextPrintAction after the removal of -print-decl...
Fangrui Song [Wed, 13 Mar 2019 03:22:33 +0000 (03:22 +0000)]
Delete unused declaration of DeclContextPrintAction after the removal of -print-decl-contexts by D52529

llvm-svn: 356005

5 years ago[Tests] Expand implicit null check coverage
Philip Reames [Wed, 13 Mar 2019 03:17:58 +0000 (03:17 +0000)]
[Tests] Expand implicit null check coverage

llvm-svn: 356004

5 years ago[TestBatchMode] We already log this output to a file.
Davide Italiano [Wed, 13 Mar 2019 02:47:51 +0000 (02:47 +0000)]
[TestBatchMode] We already log this output to a file.

llvm-svn: 356003

5 years ago[testsuite] Remove other traces broken in python 3.
Davide Italiano [Wed, 13 Mar 2019 02:44:32 +0000 (02:44 +0000)]
[testsuite] Remove other traces broken in python 3.

They can be reinstated in case somebody needs to debug
this test in the future.

llvm-svn: 356002

5 years agoRevert "[llvm] Skip over empty line table entries."
Evgeniy Stepanov [Wed, 13 Mar 2019 01:37:58 +0000 (01:37 +0000)]
Revert "[llvm] Skip over empty line table entries."

This reverts commit r355972.
See the discussion at https://reviews.llvm.org/D58952.

llvm-svn: 356001

5 years ago[testsuite] Remove dead code in TestFormats.
Davide Italiano [Wed, 13 Mar 2019 01:26:01 +0000 (01:26 +0000)]
[testsuite] Remove dead code in TestFormats.

llvm-svn: 356000

5 years ago[test] Some unicode sequences can't be printed, and Py 3 is more picky.
Davide Italiano [Wed, 13 Mar 2019 00:48:32 +0000 (00:48 +0000)]
[test] Some unicode sequences can't be printed, and Py 3 is more picky.

Given this was under trace, it can just be removed. If somebody
ever needs to debug this testcase again and print the data, they
can add a new statement.

llvm-svn: 355999

5 years ago[Python] Fix another batch of python 2/python 3 portability issues.
Davide Italiano [Wed, 13 Mar 2019 00:48:29 +0000 (00:48 +0000)]
[Python] Fix another batch of python 2/python 3 portability issues.

llvm-svn: 355998

5 years ago[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will...
Craig Topper [Wed, 13 Mar 2019 00:43:03 +0000 (00:43 +0000)]
[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will print without an immediate when the immediate is 10.

llvm-svn: 355997

5 years ago[WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs
Heejin Ahn [Wed, 13 Mar 2019 00:37:31 +0000 (00:37 +0000)]
[WebAssembly] Place 'try' and 'catch' correctly wrt EH_LABELs

Summary:
After instruction selection phase, possibly-throwing calls, which were
previously invoke, are wrapped in `EH_LABEL` instructions. For example:
```
  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>
```

`EH_LABEL` is placed also in the beginning of EH pads:
```
bb.1 (landing-pad):
  EH_LABEL <mcsymbol .Ltmp2>
  ...
```

And we'd like to maintian this relationship, so when we place a `try`,
```
  TRY ...
  EH_LABEL <mcsymbol .Ltmp0>
  CALL_VOID @foo ...
  EH_LABEL <mcsymbol .Ltmp1>
```

When we place a `catch`,
```
bb.1 (landing-pad):
  EH_LABEL <mcsymbol .Ltmp2>
  %0:except_ref = CATCH ...
  ...
```

Previously we didn't treat EH_LABELs specially, so `try` was placed
right before a call, and `catch` was placed in the beginning of an EH
pad.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 355996

5 years agoUse AIX version detection at LLVM run-time
Hubert Tong [Wed, 13 Mar 2019 00:12:43 +0000 (00:12 +0000)]
Use AIX version detection at LLVM run-time

Summary:
AIX compilers define macros based on the version of the operating
system.

This patch implements updating of versionless AIX triples to include the
host AIX version. Also, the host triple detection in the build system is
adjusted to strip the AIX version information so that the run-time
detection is preferred.

Reviewers: xingxue, stefanp, nemanjai, jasonliu

Reviewed By: xingxue

Subscribers: mgorny, kristina, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355995

5 years agoUpdate the macOS implementation of ComputeClangResourceDirectory to
Adrian Prantl [Tue, 12 Mar 2019 23:59:02 +0000 (23:59 +0000)]
Update the macOS implementation of ComputeClangResourceDirectory to
comply with the more pedantic TestPaths.py

llvm-svn: 355994

5 years ago[X86] Add ImmArg markings to intrinsics.
Craig Topper [Tue, 12 Mar 2019 23:48:07 +0000 (23:48 +0000)]
[X86] Add ImmArg markings to intrinsics.

Remove test cases that checked for not crashing when immediate operands were passed not an immediate. These are now considered ill-formed in IR.

This was done by manually scanning the intrinsic file for llvm_i32_ty and llvm_i8_ty which are the predominant types we use for immediates. Most of them are on vector intrinsics. I might have missed some other intrinsics.

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

llvm-svn: 355993

5 years agoThis test is failing on and off on the bots.
Jim Ingham [Tue, 12 Mar 2019 23:15:48 +0000 (23:15 +0000)]
This test is failing on and off on the bots.
Disable it for now till I can figure out what's going wrong.

llvm-svn: 355992

5 years agoFix the broken Batch test by passing a custom module cache to the inferior lldb.
Adrian Prantl [Tue, 12 Mar 2019 22:20:29 +0000 (22:20 +0000)]
Fix the broken Batch test by passing a custom module cache to the inferior lldb.

llvm-svn: 355991

5 years agoRevert "Temporarily add more logging to TestBatchMode"
Adrian Prantl [Tue, 12 Mar 2019 22:20:26 +0000 (22:20 +0000)]
Revert "Temporarily add more logging to TestBatchMode"

llvm-svn: 355990

5 years agoAdd XCOFF triple object format type for AIX
Jason Liu [Tue, 12 Mar 2019 22:01:10 +0000 (22:01 +0000)]
Add XCOFF triple object format type for AIX

This patch adds an XCOFF triple object format type into LLVM.
This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform.

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

llvm-svn: 355989

5 years ago[WebAssembly] Handle undefined data symbols in shared libraries
Sam Clegg [Tue, 12 Mar 2019 21:53:23 +0000 (21:53 +0000)]
[WebAssembly] Handle undefined data symbols in shared libraries

When linking shared libraries, we import a mutable wasm global
to represent the address of each undefined data symbol.

This is a step towards supporting dynamic linking and shared
libraries.

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

llvm-svn: 355988

5 years ago[NFC][clang][PCH][ObjC] Add some missing `VisitStmt(S);`
Roman Lebedev [Tue, 12 Mar 2019 21:31:00 +0000 (21:31 +0000)]
[NFC][clang][PCH][ObjC] Add some missing `VisitStmt(S);`

Summary:
These ObjC AST classes inherit from Stmt, but don't call `VisitStmt(S);`.
Some were founded with help of existing tests (with `NumStmtFields` bumped to `1`),
but some of them don't even have PCH test coverage. :/

Reviewers: arphaman, sammccall, smeenai, aprantl, rsmith, jordan_rose

Reviewed By: jordan_rose

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 355987

5 years agoTemporarily add more logging to TestBatchMode
Adrian Prantl [Tue, 12 Mar 2019 21:30:50 +0000 (21:30 +0000)]
Temporarily add more logging to TestBatchMode

llvm-svn: 355986

5 years agoAdd more logging to ClangModulesDeclVendor.cpp
Adrian Prantl [Tue, 12 Mar 2019 21:30:47 +0000 (21:30 +0000)]
Add more logging to ClangModulesDeclVendor.cpp

llvm-svn: 355985

5 years agoReland "[Remarks] Add -foptimization-record-passes to filter remark emission"
Francis Visoiu Mistrih [Tue, 12 Mar 2019 21:22:27 +0000 (21:22 +0000)]
Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"

Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

Original llvm-svn: 355964

llvm-svn: 355984

5 years ago[Test] Add tests for implicit null checks on atomic/volatile instructions
Philip Reames [Tue, 12 Mar 2019 21:09:58 +0000 (21:09 +0000)]
[Test] Add tests for implicit null checks on atomic/volatile instructions

llvm-svn: 355983

5 years agoFor faulting ops, include a comment w/the fault destination
Philip Reames [Tue, 12 Mar 2019 21:05:31 +0000 (21:05 +0000)]
For faulting ops, include a comment w/the fault destination

A faulting_op is one that has specified behavior when a fault occurs, generally redirecting control flow to another location.  This change just adds a comment to the assembly output which makes it both human readable, and machine checkable w/o having to parse the FaultMap section.  This is used to split a test file into two parts, so that I can (in a near future commit) easily extend the test file to demonstrate another case.

llvm-svn: 355982

5 years agoIR: Add immarg attribute
Matt Arsenault [Tue, 12 Mar 2019 21:02:54 +0000 (21:02 +0000)]
IR: Add immarg attribute

This indicates an intrinsic parameter is required to be a constant,
and should not be replaced with a non-constant value.

Add the attribute to all AMDGPU and generic intrinsics that comments
indicate it should apply to. I scanned other target intrinsics, but I
don't see any obvious comments indicating which arguments are intended
to be only immediates.

This breaks one questionable testcase for the autoupgrade. I'm unclear
on whether the autoupgrade is supposed to really handle declarations
which were never valid. The verifier fails because the attributes now
refer to a parameter past the end of the argument list.

llvm-svn: 355981

5 years agoAddressSanitizer: 64-bit SPARC/Linux port
Vitaly Buka [Tue, 12 Mar 2019 21:02:24 +0000 (21:02 +0000)]
AddressSanitizer: 64-bit SPARC/Linux port

Summary:
This patch contains the bits required to make the AddressSanitizer work on SPARC64/Linux (SPARC-T4 and later).

Patch by Eric Botcazou.

Reviewers: #sanitizers, vitalybuka, krytarowski

Reviewed By: #sanitizers, vitalybuka

Subscribers: brad, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

llvm-svn: 355980

5 years agoAddressSanitizer: fix for SPARC with GCC
Vitaly Buka [Tue, 12 Mar 2019 21:02:15 +0000 (21:02 +0000)]
AddressSanitizer: fix for SPARC with GCC

Summary:
This patch contains a fixlet for the AddressSanitizer on the SPARC with GCC, which would otherwise generate a problematic call to the intercepted memcpy routine.  It was tested with GCC on SPARC/Solaris and SPARC/Linux.

Patch by Eric Botcazou.

Reviewers: #sanitizers, vitalybuka

Reviewed By: #sanitizers, vitalybuka

Subscribers: vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

llvm-svn: 355979

5 years agoSanitizerCommon: 64-bit SPARC/Linux port
Vitaly Buka [Tue, 12 Mar 2019 21:02:04 +0000 (21:02 +0000)]
SanitizerCommon: 64-bit SPARC/Linux port

Summary:
This patch contains the bits required to make the common 32-bit allocator work on SPARC64/Linux.

Patch by Eric Botcazou.

Reviewers: #sanitizers, vitalybuka

Reviewed By: #sanitizers, vitalybuka

Subscribers: krytarowski, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

llvm-svn: 355978

5 years agoELF: Don't add .dynamic strings to .dynstr early.
Peter Collingbourne [Tue, 12 Mar 2019 20:58:34 +0000 (20:58 +0000)]
ELF: Don't add .dynamic strings to .dynstr early.

This does not appear to be necessary because StringTableSection does not
need to be finalized, which also means that we can remove the call to
finalizeSynthetic on .dynstr.

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

llvm-svn: 355977

5 years agoRevert "[Remarks] Add -foptimization-record-passes to filter remark emission"
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:54:18 +0000 (20:54 +0000)]
Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"

This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5.

llvm-svn: 355976

5 years agoRemove support for DWARF64.
Zachary Turner [Tue, 12 Mar 2019 20:51:05 +0000 (20:51 +0000)]
Remove support for DWARF64.

LLVM doesn't produce DWARF64, and neither does GCC.  LLDB's support
for DWARF64 is only partial, and if enabled appears to also not work.
Finally, it's untested.  Removing this makes merging LLVM and
LLDB's DWARF parsing implementations simpler.

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

llvm-svn: 355975

5 years agoRemove DWARFDIECollection.
Zachary Turner [Tue, 12 Mar 2019 20:50:46 +0000 (20:50 +0000)]
Remove DWARFDIECollection.

This is a very thin wrapper over a std::vector<DWARFDIE> and does
not seem to provide any real value over just using a container
directly.

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

llvm-svn: 355974

5 years agoMove ElaboratingDIEIterator into implementation file.
Zachary Turner [Tue, 12 Mar 2019 20:50:29 +0000 (20:50 +0000)]
Move ElaboratingDIEIterator into implementation file.

This is not used outside of the private implementation of the class,
so hiding in the implementation file is a nice way of simplifying
the external interface.

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

llvm-svn: 355973

5 years ago[llvm] Skip over empty line table entries.
Mircea Trofin [Tue, 12 Mar 2019 20:48:45 +0000 (20:48 +0000)]
[llvm] Skip over empty line table entries.

Summary:
This is similar to how addr2line handles consecutive entries with the
same address - pick the last one.

Reviewers: dblaikie, friss, JDevlieghere

Reviewed By: dblaikie

Subscribers: ormris, echristo, JDevlieghere, probinson, aprantl, hiraditya, rupprecht, jdoerfert, llvm-commits

Tags: #llvm, #debug-info

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

llvm-svn: 355972

5 years agoFix missing C++ mode comments
Matt Arsenault [Tue, 12 Mar 2019 20:42:14 +0000 (20:42 +0000)]
Fix missing C++ mode comments

llvm-svn: 355971

5 years agoMIR: Stop reinitializing target information for every use
Matt Arsenault [Tue, 12 Mar 2019 20:42:12 +0000 (20:42 +0000)]
MIR: Stop reinitializing target information for every use

Every time a physical register reference was parsed, this would
initialize a string map for every register in in target, and discard
it for the next. The same applies for the other fields initialized
from target information.

Follow along with how the function state is tracked, and add a new
tracking class for target information.

The string->register class/register bank for some reason were kept
separately, so track them in the same place.

llvm-svn: 355970

5 years ago[lldb/thirdparty] Remove unneeded files, asked by Jonas.
Davide Italiano [Tue, 12 Mar 2019 20:41:36 +0000 (20:41 +0000)]
[lldb/thirdparty] Remove unneeded files, asked by Jonas.

llvm-svn: 355969

5 years ago[lldb-mi] Make this test more reliable. NFC.
Davide Italiano [Tue, 12 Mar 2019 20:41:29 +0000 (20:41 +0000)]
[lldb-mi] Make this test more reliable. NFC.

Except that it will probably stop failing on and off on my machine.

llvm-svn: 355968

5 years ago[third-party] Update pexpect to 4.6.
Davide Italiano [Tue, 12 Mar 2019 20:41:24 +0000 (20:41 +0000)]
[third-party] Update pexpect to 4.6.

Reviewers: labath, jdevlieghere

Subscribers: lldb-commits

Tags: #llvm

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

llvm-svn: 355967

5 years agoELF: Use bump pointer allocator for uncompressed section buffers. NFCI.
Peter Collingbourne [Tue, 12 Mar 2019 20:32:30 +0000 (20:32 +0000)]
ELF: Use bump pointer allocator for uncompressed section buffers. NFCI.

This shaves another word off SectionBase and makes it possible to clone a
section using the implicit copy constructor.

This basically reverts r311056, which removed the mutex in order to
make the code easier to understand. On balance I think it's probably more
straightforward to have a mutex here than to have an unusual copy constructor
in SectionBase.

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

llvm-svn: 355966

5 years agoSanitizerCommon: fixes for unwinding & backtrace on SPARC
Vitaly Buka [Tue, 12 Mar 2019 20:31:53 +0000 (20:31 +0000)]
SanitizerCommon: fixes for unwinding & backtrace on SPARC

Summary:
This patch contains various fixes for the unwinding and backtrace machinery on the SPARC, which doesn't work correctly in various cases.  It was tested with GCC on SPARC/Solaris and SPARC/Linux.

Patch by Eric Botcazou.

Reviewers: #sanitizers, vitalybuka

Reviewed By: #sanitizers, vitalybuka

Subscribers: jrtc27, delcypher, vitalybuka, ro, jyknight, kubamracek, fedor.sergeev, jdoerfert, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

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

llvm-svn: 355965

5 years ago[Remarks] Add -foptimization-record-passes to filter remark emission
Francis Visoiu Mistrih [Tue, 12 Mar 2019 20:28:50 +0000 (20:28 +0000)]
[Remarks] Add -foptimization-record-passes to filter remark emission

Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

llvm-svn: 355964

5 years agoFix compiler warning
Jonas Devlieghere [Tue, 12 Mar 2019 20:24:13 +0000 (20:24 +0000)]
Fix compiler warning

Fixes warning: comparison of integers of different signs.

llvm-svn: 355963

5 years ago[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type
Philip Reames [Tue, 12 Mar 2019 20:15:05 +0000 (20:15 +0000)]
[SROA] Fix a crash when trying to convert a memset to an non-integral pointer type

The included test case currently crashes on tip of tree. Rather than adding a bailout, I chose to restructure the code so that the existing helper function could be used. Given that, the majority of the diff is NFC-ish, but the key difference is that canConvertValue returns false when only one side is a non-integral pointer.

Thanks to Cherry Zhang for the test case.

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

llvm-svn: 355962

5 years ago[libc++] Enable deprecation warnings by default
Louis Dionne [Tue, 12 Mar 2019 20:10:06 +0000 (20:10 +0000)]
[libc++] Enable deprecation warnings by default

Summary:
In r342843, I added deprecation warnings to some facilities that were
deprectated in C++14 and C++17. However, those deprecation warnings
were not enabled by default.

After discussing this on IRC, we had finally gotten consensus to enable
those warnings by default, and I'm getting around to doing that only
now.

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, jdoerfert, libcxx-commits

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

llvm-svn: 355961

5 years ago[OPENMP]Allow to redefine entry for the variables definitions.
Alexey Bataev [Tue, 12 Mar 2019 20:05:17 +0000 (20:05 +0000)]
[OPENMP]Allow to redefine entry for the variables definitions.

If the variable was declared and marked as declare target, a new offload
entry with size 0 is created. But if later a definition is created and
marked as declare target, this definition is not added to the entry set
and the definition remains not mapped to the target. Patch fixes this
problem allowing to redefine the size and linkage for
previously registered declaration.

llvm-svn: 355960

5 years agoFixup test to work after changes in r355878.
Douglas Yung [Tue, 12 Mar 2019 20:04:03 +0000 (20:04 +0000)]
Fixup test to work after changes in r355878.

This should fix the PS4 Windows build bot.

llvm-svn: 355959

5 years agoRework how lldb warngs about kexts that failed to load in a
Jason Molenda [Tue, 12 Mar 2019 19:42:34 +0000 (19:42 +0000)]
Rework how lldb warngs about kexts that failed to load in a
darwin kernel debug session.

Originally, the kext name & uuid were emitted in the middle of the
kext-loading period's.  Last week I decided to try not printing
any details about kexts that failed to load, only printing a summary
of how many failed to load.

This time I'm print different progress characters depending on whether
the kext loaded or not ("-" for not), then at the end I will print a
summary of how many kexts failed to load and a sorted list of the
kexts with the bundle ID and the uuid.  It's a lot more readable.

<rdar://problem/48654569>

llvm-svn: 355958

5 years agoCheck the result of creating a node from __next_ in the std::list formatter.
Jim Ingham [Tue, 12 Mar 2019 19:27:39 +0000 (19:27 +0000)]
Check the result of creating a node from __next_ in the std::list formatter.

There's a single report of a crash coming from this current_sp being NULL.  I don't
have a repro case, and I couldn't get it to happen by hand-corrupting a list.  We
always get an error instead.  So I don't have a test case.  But checking for null
is clearly right here.

<rdar://problem/48503320>

llvm-svn: 355957

5 years agoRe-enable this test, the underlying bug was fixed and the test now passes.
Jim Ingham [Tue, 12 Mar 2019 19:25:29 +0000 (19:25 +0000)]
Re-enable this test, the underlying bug was fixed and the test now passes.

llvm-svn: 355956

5 years ago[x86] scalarize extractelement 0 of FP vselect
Sanjay Patel [Tue, 12 Mar 2019 19:20:45 +0000 (19:20 +0000)]
[x86] scalarize extractelement 0 of FP vselect

llvm-svn: 355955

5 years agoELF: Simplify. NFCI.
Peter Collingbourne [Tue, 12 Mar 2019 19:19:23 +0000 (19:19 +0000)]
ELF: Simplify. NFCI.

We don't need to take a slice of SectionCommands in addOrphanSections()
because it is not modified until the end of the function.

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

llvm-svn: 355954

5 years ago[CodeGen] Add MMOs to statepoint nodes during SelectionDAG
Philip Reames [Tue, 12 Mar 2019 19:12:33 +0000 (19:12 +0000)]
[CodeGen] Add MMOs to statepoint nodes during SelectionDAG

The existing statepoint lowering code does something odd; it adds machine memory operands post instruction selection. This was copied from the stackmap/patchpoint implementation, but appears to be non-idiomatic.

This change is largely NFC. It moves the MMO creation logic into SelectionDAG building. It ends up not quite being NFC because the size of the stack slot is reflected in the MMO. The old code blindly used pointer size for the MMO size, which appears to have always been incorrect for larger values. It just happened nothing actually relied on the MMOs, so it worked out okay.

For context, I'm planning on removing the MOVolatile flag from these in a future commit, and then removing the MOStore flag from deopt spill slots in a separate one. Doing so is motivated by a small test case where we should be able to better schedule spill slots, but don't do so due to a memory use/def implied by the statepoint.

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

llvm-svn: 355953

5 years ago[OPENMP 5.0]Initial support for 'allocator' clause.
Alexey Bataev [Tue, 12 Mar 2019 18:52:33 +0000 (18:52 +0000)]
[OPENMP 5.0]Initial support for 'allocator' clause.

Added parsing/sema analysis/serialization/deserialization for the
'allocator' clause of the 'allocate' directive.

llvm-svn: 355952

5 years agoFix the project for r355939 (ASTUtils.{h,c})
Jim Ingham [Tue, 12 Mar 2019 18:48:58 +0000 (18:48 +0000)]
Fix the project for r355939 (ASTUtils.{h,c})

llvm-svn: 355951

5 years agoModules: Add LangOptions::CacheGeneratedPCH
Duncan P. N. Exon Smith [Tue, 12 Mar 2019 18:38:04 +0000 (18:38 +0000)]
Modules: Add LangOptions::CacheGeneratedPCH

Add an option to cache the generated PCH in the ModuleCache when
emitting it.  This protects clients that build PCHs and read them in the
same process, allowing them to avoid race conditions between parallel
jobs the same way that Clang's implicit module build system does.

rdar://problem/48740787

llvm-svn: 355950

5 years ago[SCEV] Use depth limit for trunc analysis
Teresa Johnson [Tue, 12 Mar 2019 18:28:05 +0000 (18:28 +0000)]
[SCEV] Use depth limit for trunc analysis

Summary:
This fixes an extremely long compile time caused by recursive analysis
of truncs, which were not previously subject to any depth limits unlike
some of the other ops. I decided to use the same control used for
sext/zext, since the routines analyzing these are sometimes mutually
recursive with the trunc analysis.

Reviewers: mkazantsev, sanjoy

Subscribers: sanjoy, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355949

5 years agoSet useful flags for vector imm setting instructions
Jinsong Ji [Tue, 12 Mar 2019 18:27:09 +0000 (18:27 +0000)]
Set useful flags for vector imm setting instructions

Vector imm setting instructions like XXLXORz/XXLXORspz/XXLXORdpz
Should behave like LI8.

We should set corresponding flags to allow rematerialization and other
opts in LICM, RA, Scheduling etc.

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

llvm-svn: 355948

5 years ago[SanitizerCoverage] Avoid splitting critical edges when destination is a basic block...
Craig Topper [Tue, 12 Mar 2019 18:20:25 +0000 (18:20 +0000)]
[SanitizerCoverage] Avoid splitting critical edges when destination is a basic block containing unreachable

This patch adds a new option to SplitAllCriticalEdges and uses it to avoid splitting critical edges when the destination basic block ends with unreachable. Otherwise if we split the critical edge, sanitizer coverage will instrument the new block that gets inserted for the split. But since this block itself shouldn't be reachable this is pointless. These basic blocks will stick around and generate assembly, but they don't end in sane control flow and might get placed at the end of the function. This makes it look like one function has code that flows into the next function.

This showed up while compiling the linux kernel with clang. The kernel has a tool called objtool that detected the code that appeared to flow from one function to the next. https://github.com/ClangBuiltLinux/linux/issues/351#issuecomment-461698884

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

llvm-svn: 355947

5 years ago[RISCV][MC] Find matching pcrel_hi fixup in more cases.
Eli Friedman [Tue, 12 Mar 2019 18:14:16 +0000 (18:14 +0000)]
[RISCV][MC] Find matching pcrel_hi fixup in more cases.

If a symbol points to the end of a fragment, instead of searching for
fixups in that fragment, search in the next fragment.

Fixes spurious assembler error with subtarget change next to "la"
pseudo-instruction, or expanded equivalent.

Alternate proposal to fix the problem discussed in
https://reviews.llvm.org/D58759.

Testcase by Ana Pazos.

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

llvm-svn: 355946

5 years ago[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py
Jinsong Ji [Tue, 12 Mar 2019 17:55:32 +0000 (17:55 +0000)]
[NFC][PowerPC] Update testcases using utils/update_llc_test_checks.py

llvm-svn: 355945

5 years agoAdd a creduce script for clang crashes
George Burgess IV [Tue, 12 Mar 2019 17:48:53 +0000 (17:48 +0000)]
Add a creduce script for clang crashes

This CL adds a script that calls C-Reduce on an input file and given the
clang crash script, which is used to generate an interestingness test
for C-Reduce.

Patch by Amy Huang!

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

llvm-svn: 355944

5 years agoCorrecting some comments in PdbIndex.cpp [NFC]
Adrian McCarthy [Tue, 12 Mar 2019 17:40:51 +0000 (17:40 +0000)]
Correcting some comments in PdbIndex.cpp [NFC]

ICF can cause multiple symbols to start at the same virtual address.
I plan to handle this shortly, but I wanted to correct the comment for
now.

Deleted an obsolete comment about adjusting the offset for the magic
number at the beginning of the debug info stream.  This adjustment is
handled at a lower level now.

llvm-svn: 355943

5 years agoTest commit: add a blank line in test case ppc64-dq-expr.s
Jason Liu [Tue, 12 Mar 2019 17:33:07 +0000 (17:33 +0000)]
Test commit: add a blank line in test case ppc64-dq-expr.s

llvm-svn: 355942

5 years ago[Reproducers] Add a test to ensure we can reuse the reproducer dir.
Jonas Devlieghere [Tue, 12 Mar 2019 17:31:04 +0000 (17:31 +0000)]
[Reproducers] Add a test to ensure we can reuse the reproducer dir.

Yesterday I noticed a reproducer test failing after making a local
change. Removing the reproducer directory solved the issue. Add a test
case that detects this.

llvm-svn: 355941

5 years ago[Reproducers] Stop recording instead of deallocating
Jonas Devlieghere [Tue, 12 Mar 2019 17:10:28 +0000 (17:10 +0000)]
[Reproducers] Stop recording instead of deallocating

The command interpreter holds a pointer to a DataRecorder. After
generating the reproducer, we deallocated all the DataRecorders, causing
the command interpreter to hold a non-null reference to an invalid
object.

This patch changes the behavior of the command provider to stop the
DataRecorders when a reproducer is generated, rather than deallocating
them.

llvm-svn: 355940

5 years agoAdd ability to import std module into expression parser to improve C++ debugging
Raphael Isemann [Tue, 12 Mar 2019 17:09:33 +0000 (17:09 +0000)]
Add ability to import std module into expression parser to improve C++ debugging

Summary:
This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging.

What happens in this patch is that we inject a `@import std` into our expression source code. We also
modify our internal Clang instance for parsing this expression to work with modules and debug info
at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The
C++ include paths for building are extracted from the debug info, which means that this currently only
works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths
are currently specified by LLDB.

I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests
for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific
C include paths for them).

With this patch we can now:
* Build a libc++ as a module and import it into the expression parser.
* Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`.

What doesn't work (yet):
* Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work.
* Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't
call yet any function that returns a non-trivial type.
* Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches.

Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille

Reviewed By: aprantl

Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 355939

5 years ago[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names
James Henderson [Tue, 12 Mar 2019 17:00:25 +0000 (17:00 +0000)]
[yaml2obj]Allow explicit symbol indexes in relocations and emit error for bad names

Prior to this change, the "Symbol" field of a relocation would always be
assumed to be a symbol name, and if no such symbol existed, the
relocation would reference index 0. This confused me when I tried to use
a literal symbol index in the field: since "0x1" was not a known symbol
name, the symbol index was set as 0. This change falls back to treating
unknown symbol names as integers, and emits an error if the name is not
found and the string is not an integer.

Note that the Symbol field is optional, so if a relocation doesn't
reference a symbol, it shouldn't be specified. The new error required a
number of test updates.

Reviewed by: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D58510

llvm-svn: 355938

5 years ago[SDAG] Expand pow2 mulo using shifts
Nikita Popov [Tue, 12 Mar 2019 16:57:25 +0000 (16:57 +0000)]
[SDAG] Expand pow2 mulo using shifts

Expand MULO with constant power of two operand into a shift. The
overflow is checked with (x << shift) >> shift == x, where the right
shift will be logical for umulo and arithmetic for smulo (with
exception for multiplications by signed_min).

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

llvm-svn: 355937

5 years ago[Reproducers] Support capturing a reproducer without an explicit path.
Jonas Devlieghere [Tue, 12 Mar 2019 16:44:18 +0000 (16:44 +0000)]
[Reproducers] Support capturing a reproducer without an explicit path.

Tablegen doesn't support options that are both flags and take values as
an argument. I noticed this when doing the tablegen rewrite, but forgot
that that affected the reproducer --capture flag.

This patch makes --capture a flag and adds --capture-path to specify a
path for the reproducer. In reality I expect this to be mostly used for
testing, but it could be useful nonetheless.

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

llvm-svn: 355936

5 years ago[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI
Craig Topper [Tue, 12 Mar 2019 16:35:30 +0000 (16:35 +0000)]
[X86] Arrange more CPU features to inherit from earlier CPUs. NFCI

This makes SandyBridge inherit back to Westmere/Nehalem.

Make bdver1-4 inherit from each other and btver2 inherit from btver1.

llvm-svn: 355935

5 years ago[clang-tidy] NOLINT support for "clang-diagnostic-*".
Haojian Wu [Tue, 12 Mar 2019 16:11:46 +0000 (16:11 +0000)]
[clang-tidy] NOLINT support for "clang-diagnostic-*".

Reviewers: alexfh, aaron.ballman

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 355934

5 years agoRegenerate sign_extend.ll test.
Simon Pilgrim [Tue, 12 Mar 2019 16:00:59 +0000 (16:00 +0000)]
Regenerate sign_extend.ll test.

This will change as part of the fix for the regressions in D58017.

llvm-svn: 355933

5 years ago[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.
Simon Pilgrim [Tue, 12 Mar 2019 15:58:28 +0000 (15:58 +0000)]
[DAGCombine] Pull out repeated demanded bitmask generation. NFCI.

llvm-svn: 355932

5 years agoRevert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs...
Stefan Granitz [Tue, 12 Mar 2019 15:54:35 +0000 (15:54 +0000)]
Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"

This reverts commit 511066858d44101703d61eded9abf8caff0f9fe0.
This turned out unnecessary to fix the bot.

llvm-svn: 355931

5 years ago[Docs] Add note about legacy PM to Ch4 of tutorial
Kristina Brooks [Tue, 12 Mar 2019 15:44:18 +0000 (15:44 +0000)]
[Docs] Add note about legacy PM to Ch4 of tutorial

Add a note about legacy FunctionPassManager to the LLVM tutorial.

It seems to confuse some people, worth adding a warning to the tutorial
to elaborate and suggest using `llvm::legacy::FunctionPassManager` for
now. Not a perfect solution but hopefully will avoid confusion
in the meantime.

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

llvm-svn: 355930

5 years ago[llvm-cxxfilt]Add test to show that empty lines can be handled
James Henderson [Tue, 12 Mar 2019 15:42:38 +0000 (15:42 +0000)]
[llvm-cxxfilt]Add test to show that empty lines can be handled

I recently discovered a bug in llvm-cxxfilt introduced in r353743 but
was fixed later incidentally due to r355031. Specifically, llvm-cxxfilt
was attempting to call .back() on an empty string any time there was a
new line in the input. This was causing a crash in my debug builds only.
This patch simply adds a test that explicitly tests that llvm-cxxfilt
handles empty lines correctly. It may pass under release builds under
the broken behaviour, but it fails at least in debug builds.

Reviewed by: mattd

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

llvm-svn: 355929

5 years ago[FileCheck]Remove assertions that prevent matching an empty string at file start...
James Henderson [Tue, 12 Mar 2019 15:37:34 +0000 (15:37 +0000)]
[FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

This patch removes two assertions that were preventing writing of a test
that checked an empty line followed by some text. For example:

CHECK: {{^$}}
CHECK-NEXT: foo()

The assertion was because the current location the CHECK-NEXT was
scanning from was the start of the buffer. A similar issue occurred with
CHECK-SAME. These assertions don't protect against anything, as there is
already an error check that checks that CHECK-NEXT/EMPTY/SAME don't
appear first in the checks, and the following code works fine if the
pointer is at the start of the input.

Reviewed by: probinson, thopre, jdenny
Differential Revision: https://reviews.llvm.org/D58784

llvm-svn: 355928

5 years ago[CMake] Tell libc++ that we're using compiler-rt on Apple platforms
Louis Dionne [Tue, 12 Mar 2019 15:32:00 +0000 (15:32 +0000)]
[CMake] Tell libc++ that we're using compiler-rt on Apple platforms

Reviewers: beanz, arphaman, EricWF

Subscribers: dberris, mgorny, jkorous, dexonsmith, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355927

5 years agoCodeGenPrep: preserve inbounds attribute when sinking GEPs.
Tim Northover [Tue, 12 Mar 2019 15:22:23 +0000 (15:22 +0000)]
CodeGenPrep: preserve inbounds attribute when sinking GEPs.

Targets can potentially emit more efficient code if they know address
computations never overflow. For example ILP32 code on AArch64 (which only has
64-bit address computation) can ignore the possibility of overflow with this
extra information.

llvm-svn: 355926

5 years agofix break tests after rL355922. NFCI
Xing GUO [Tue, 12 Mar 2019 14:58:01 +0000 (14:58 +0000)]
fix break tests after rL355922. NFCI

llvm-svn: 355925

5 years ago[format] \t => ' '
Liang Zou [Tue, 12 Mar 2019 14:48:32 +0000 (14:48 +0000)]
[format] \t => '  '

Summary:
1. \t => '  '
2. test commit access

Reviewers: Higuoxing, liangdzou

Reviewed By: Higuoxing, liangdzou

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 355924

5 years ago[scudo][standalone] Implement checksumming functions
Kostya Kortchinsky [Tue, 12 Mar 2019 14:46:31 +0000 (14:46 +0000)]
[scudo][standalone] Implement checksumming functions

Summary:
This CL implements the checksumming functions. This departs from the
current Scudo code in one aspect: the software version is no longer
CRC32 but a BSD checksum. This is because the software CRC32 was too
impactful in terms of performances, the BSD checksum has no array
lookup which is better (and saves 1KB of data).

As with the current version, we only flip the CRC compiler flag for
a single compilation unit by default, to allow for a library compiled
with HW CRC32 to work on a system without HW CRC32.

There is some platform & hardware specific code in those files, but
since departs from a mere platform split, it felt right to me to have
it that way.

Reviewers: morehouse, eugenis, vitalybuka, hctim, mcgrathr

Reviewed By: morehouse

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

Tags: #llvm, #sanitizers

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

llvm-svn: 355923

5 years ago[llvm-readobj] Print symbol version when dumping relocations (PR31564)
Xing GUO [Tue, 12 Mar 2019 14:30:13 +0000 (14:30 +0000)]
[llvm-readobj] Print symbol version when dumping relocations (PR31564)

Summary: This helps resolve https://bugs.llvm.org/show_bug.cgi?id=31564

Reviewers: jhenderson, grimar

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 355922

5 years ago[SimplifyLibCalls] Simplify optimizePuts
Fangrui Song [Tue, 12 Mar 2019 14:20:22 +0000 (14:20 +0000)]
[SimplifyLibCalls] Simplify optimizePuts

The code might intend to replace puts("") with putchar('\n') even if the
return value is used. It failed because use_empty() was used to guard
the whole block. While returning '\n' (putchar('\n')) is technically
correct (puts is only required to return a nonnegative number on
success), doing this looks weird and there is really little benefit to
optimize puts whose return value is used. So don't do that.

llvm-svn: 355921

5 years ago[NFC][PowerPC]Assert when trying to generate directmove below P8.
Jinsong Ji [Tue, 12 Mar 2019 14:01:29 +0000 (14:01 +0000)]
[NFC][PowerPC]Assert when trying to generate directmove below P8.

This was found when we generated COPY from G8RC to F8RC in
EmitInstrWithCustomInserter without checking proper architecture,
we silently generated mtvsrd, which require P8 and up.

This is a NFC patch to add assert when we call copyPhysReg, in case
someone accidentally generate COPY between G8RC to F8RC for P7 and
below.

llvm-svn: 355920

5 years ago[pstl] Deprecate non-CMake based build
Louis Dionne [Tue, 12 Mar 2019 13:54:37 +0000 (13:54 +0000)]
[pstl] Deprecate non-CMake based build

All of LLVM builds with CMake, so it doesn't make sense to maintain a
separate set of build files just for pstl.

Thanks to Thomas Rodgers for the patch.
Differential Revision: https://reviews.llvm.org/D59111

llvm-svn: 355919

5 years ago[pstl] Properly extract the version number from pstl_config.h
Louis Dionne [Tue, 12 Mar 2019 13:48:25 +0000 (13:48 +0000)]
[pstl] Properly extract the version number from pstl_config.h

Previously, we'd be performing math on `#define PSTL_VERSION NNN` instead
of just `NNN`. It seems like older CMakes didn't complain, but newer
CMakes do complain because it doesn't make sense.

llvm-svn: 355918

5 years ago[XRay][docs] Fix option name
Fangrui Song [Tue, 12 Mar 2019 13:44:42 +0000 (13:44 +0000)]
[XRay][docs] Fix option name

llvm-svn: 355917

5 years ago[PR41007][OpenCL] Allow printf in C++ mode.
Anastasia Stulova [Tue, 12 Mar 2019 12:46:56 +0000 (12:46 +0000)]
[PR41007][OpenCL] Allow printf in C++ mode.

As for OpenCL C, we need to allow using printf and toolchain variadic
functions (prefixed by "__") in C++ mode.

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

llvm-svn: 355915

5 years ago[llvm-objcopy] Remove unneeded checks. NFC
Eugene Leviant [Tue, 12 Mar 2019 12:41:06 +0000 (12:41 +0000)]
[llvm-objcopy] Remove unneeded checks. NFC

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

llvm-svn: 355914

5 years agoRevert rL355906: [SLP] Remove redundancy of performing operand reordering twice:...
Simon Pilgrim [Tue, 12 Mar 2019 11:51:59 +0000 (11:51 +0000)]
Revert rL355906: [SLP] Remove redundancy of performing operand reordering twice: once in buildTree() and later in vectorizeTree().

This is a refactoring patch that removes the redundancy of performing operand reordering twice, once in buildTree() and later in vectorizeTree().
To achieve this we need to keep track of the operands within the TreeEntry struct while building the tree, and later in vectorizeTree() we are just accessing them from the TreeEntry in the right order.

This patch is the first in a series of patches that will allow for better operand reordering across chains of instructions (e.g., a chain of ADDs), as presented here: https://www.youtube.com/watch?v=gIEn34LvyNo

Patch by: @vporpo (Vasileios Porpodas)

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

Reverted due to buildbot failures that I don't have time to track down.

llvm-svn: 355913