platform/upstream/llvm.git
3 years ago[NFC][Asan] Set AP32::kMetadataSize to 0
Vitaly Buka [Tue, 1 Sep 2020 09:12:15 +0000 (02:12 -0700)]
[NFC][Asan] Set AP32::kMetadataSize to 0

Asan does not use metadata with primary allocators.
It should match AP64::kMetadataSize whic is 0.

Depends on D86917.

Reviewed By: morehouse

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

3 years ago[Asan] Cleanup atomic usage in allocator
Vitaly Buka [Tue, 1 Sep 2020 07:54:46 +0000 (00:54 -0700)]
[Asan] Cleanup atomic usage in allocator

There are no know bugs related to this, still it may fix some latent ones.
Main concerns with preexisting code:
1. Inconsistent atomic/non-atomic access to the same field.
2. Assumption that bitfield chunk_state is always the first byte without
    even taking into account endianness.

Reviewed By: morehouse

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

3 years ago[Sema] Fix a -Warc-repeated-use-of-weak false-positive by only calling CheckPlacehold...
Erik Pilkington [Thu, 3 Sep 2020 16:41:34 +0000 (12:41 -0400)]
[Sema] Fix a -Warc-repeated-use-of-weak false-positive by only calling CheckPlaceholderExpr once

Previously, this code discarded the result of CheckPlaceholderExpr for
non-matrix subexpressions. Not only is this wasteful, but it was creating a
Warc-repeated-use-of-weak false-positive on the attached testcase, since the
discarded expression was still registered as a use of the weak property.

rdar://66162246

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

3 years ago[libFuzzer] Scale energy assigned to each input based on input execution time.
Dokyung Song [Mon, 17 Aug 2020 16:59:59 +0000 (16:59 +0000)]
[libFuzzer] Scale energy assigned to each input based on input execution time.

This patch scales the energy computed by the Entropic schedule based on the
execution time of each input. The input execution time is compared with the
average execution time of inputs in the corpus, and, based on the amount by
which they differ, the energy is scaled from 0.1x (for inputs executing slow) to
3x (for inputs executing fast). Note that the exact scaling criteria and formula
is borrowed from AFL.

On FuzzBench, this gives a sizeable throughput increase, which in turn leads to
more coverage on several benchmarks. For details, see the following report.

https://storage.googleapis.com/fuzzer-test-suite-public/exectime-report/index.html

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

3 years ago[gn build] Port 7fff1fbd3ce
LLVM GN Syncbot [Thu, 3 Sep 2020 20:13:38 +0000 (20:13 +0000)]
[gn build] Port 7fff1fbd3ce

3 years ago[MIRVRegNamer] Experimental MachineInstr stable hashing (Fowler-Noll-Vo)
Puyan Lotfi [Thu, 3 Sep 2020 19:38:52 +0000 (15:38 -0400)]
[MIRVRegNamer] Experimental MachineInstr stable hashing (Fowler-Noll-Vo)

This hashing scheme has been useful out of tree, and I want to start
experimenting with it. Specifically I want to experiment on the
MIRVRegNamer, MIRCanononicalizer, and eventually the MachineOutliner.

This diff is a first step, that optionally brings stable hashing to the
MIRVRegNamer (and as a result, the MIRCanonicalizer).  We've tested this
hashing scheme on a lot of MachineOperand types that llvm::hash_value
can not handle in a stable manner.

This stable hashing was also the basis for

"Global Machine Outliner for ThinLTO" in EuroLLVM 2020

http://llvm.org/devmtg/2020-04/talks.html#TechTalk_58

Credits: Kyungwoo Lee, Nikolai Tillmann

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

3 years ago[NewPM][Lint] Port -lint to NewPM
Arthur Eubanks [Thu, 3 Sep 2020 04:54:27 +0000 (21:54 -0700)]
[NewPM][Lint] Port -lint to NewPM

This also changes -lint from an analysis to a pass. It's similar to
-verify, and that is a normal pass, and lives in llvm/IR.

Reviewed By: ychen

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

3 years ago[libFuzzer] Evenly select inputs to cross over with from the corpus regardless of...
Dokyung Song [Tue, 1 Sep 2020 16:22:59 +0000 (16:22 +0000)]
[libFuzzer] Evenly select inputs to cross over with from the corpus regardless of the input's coverage.

This patch adds an option "cross_over_uniform_dist", which, if 1, considers all
inputs in the corpus for the crossover input selection. More specifically, this
patch uses a uniform distribution of all inputs in the corpus for the CrossOver
input selection. Note that input selection for mutation is still fully
determined by the scheduling policy (i.e., vanilla or Entropic); the uniform
distribution only applies to the secondary input selection, only for the
crossover mutation of the base input chosen by the scheduling policy. This way
the corpus inputs that have useful fragments in them, even though they are
deprioritized by the scheduling policy, have chances of getting mixed with other
inputs that are prioritized and selected as base input for mutation.

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

3 years agoReplace CRLF with LF; NFC
Bryan Chan [Thu, 3 Sep 2020 19:29:37 +0000 (15:29 -0400)]
Replace CRLF with LF; NFC

3 years ago[test] Use %t instead of %T to remove race conditions between config-file3.c and...
Fangrui Song [Thu, 3 Sep 2020 18:20:29 +0000 (11:20 -0700)]
[test] Use %t instead of %T to remove race conditions between config-file3.c and target-override.c

Both tests operate on `%T/testbin`. If the two tests run concurrently,
one may fail.

This is likely the root cause of flaky failures reported by
https://lists.llvm.org/pipermail/llvm-dev/2020-September/144781.html

https://llvm.org/docs/CommandGuide/lit.html says:

`%T parent directory of %t (not unique, deprecated, do not use)`

Reviewed By: dblaikie

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

3 years ago[lldb] avoid assert in threadsanitizer tests on linux
Luboš Luňák [Mon, 17 Aug 2020 20:54:45 +0000 (22:54 +0200)]
[lldb] avoid assert in threadsanitizer tests on linux

The tests are unsupported on linux, but they assert in
Thread::GetStopDescriptionRaw() because of empty stop reason
description. And it is empty because
InstrumentationRuntimeTSan::NotifyBreakpointHit() fails
to get report from InstrumentationRuntimeTSan::RetrieveReportData(),
which is possibly(?) the reason why this is unsupported on linux.
Add a dummy stop reason description for this case, which changes
the test result from failing to unsupported.

3 years agoSVML support for log2
Wenlei He [Thu, 3 Sep 2020 18:52:14 +0000 (11:52 -0700)]
SVML support for log2

Although LLVM supports vectorization of loops containing log2, it did not support using SVML implementation of it. Added support so that when clang is invoked with -fveclib=SVML now an appropriate SVML library log2 implementation will be invoked.

Follow up on: https://reviews.llvm.org/D77114

Tests:
Added unit tests to svml-calls.ll, svml-calls-finite.ll. Can be run with llvm-lint.
Created a simple c++ file that tests log2, and used clang+ to build it, and output final assembly.

Reviewed By: wenlei, craig.topper

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

3 years agoRevert "Add new hidden option -print-changed which only reports changes to IR"
Jamie Schmeiser [Thu, 3 Sep 2020 18:24:00 +0000 (18:24 +0000)]
Revert "Add new hidden option -print-changed which only reports changes to IR"

This reverts commit 7bc9924cb2fbd9f3ae53577607822ace267a04e6 due to
failure caused by missing a space between trailing >>, required by some
versions of C++:wq.

3 years ago[DebugInfo] Make DWARF ignore sizes on forward declared class types.
Amy Huang [Thu, 3 Sep 2020 18:01:49 +0000 (11:01 -0700)]
[DebugInfo] Make DWARF ignore sizes on forward declared class types.

Make sure the sizes for forward declared classes aren't emitted in
DWARF.

This comes before https://reviews.llvm.org/D87062, which adds sizes to
all classes with definitions.

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

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

3 years agoSelectionDAG.h - remove unnecessary FunctionLoweringInfo.h include. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 17:24:06 +0000 (18:24 +0100)]
SelectionDAG.h - remove unnecessary FunctionLoweringInfo.h include. NFCI.

Use forward declarations and move the include down to dependent files that actually use it.

This also exposes a number of implicit dependencies on KnownBits.h

3 years ago[spirv][nfc] Simplify resource limit with default values
Lei Zhang [Thu, 3 Sep 2020 17:29:14 +0000 (13:29 -0400)]
[spirv][nfc] Simplify resource limit with default values

These deafult values are gotten from Vulkan required limits.

Reviewed By: hanchung

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

3 years ago[libc++] Mark std::atomic<_ExtInt> test as unsupported in C++03
Louis Dionne [Thu, 3 Sep 2020 17:27:58 +0000 (13:27 -0400)]
[libc++] Mark std::atomic<_ExtInt> test as unsupported in C++03

3 years ago[libc++] Make ext-int.verify.cpp test compatible with c++03
John Brawn [Thu, 3 Sep 2020 17:11:29 +0000 (18:11 +0100)]
[libc++] Make ext-int.verify.cpp test compatible with c++03

Currently the libcxx/atomics/ext-int.verify.cpp test fails when run with
-std=c++03 because there's an extra error due to using list initialization. Fix
this by using parentheses instead.

3 years ago[ARM] Extra predicate load tests. NFC
David Green [Thu, 3 Sep 2020 16:52:37 +0000 (17:52 +0100)]
[ARM] Extra predicate load tests. NFC

3 years agoWebAssemblyUtilities.h - reduce unnecessary includes to forward declarations. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 16:05:17 +0000 (17:05 +0100)]
WebAssemblyUtilities.h - reduce unnecessary includes to forward declarations. NFCI.

3 years agoPHIEliminationUtils.cpp - remove unnecessary MachineBasicBlock.h include. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 15:47:21 +0000 (16:47 +0100)]
PHIEliminationUtils.cpp - remove unnecessary MachineBasicBlock.h include. NFCI.

This is already included in PHIEliminationUtils.h

3 years agoFix Wdocumentation trailing comments warnings. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 15:42:05 +0000 (16:42 +0100)]
Fix Wdocumentation trailing comments warnings. NFCI.

3 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 15:34:46 +0000 (16:34 +0100)]
Fix Wdocumentation warning. NFCI.

Remove \returns tag from a void function

3 years ago[InstCombine] canonicalize all commutative intrinsics with constant arg
Sanjay Patel [Thu, 3 Sep 2020 16:27:19 +0000 (12:27 -0400)]
[InstCombine] canonicalize all commutative intrinsics with constant arg

3 years ago[InstCombine] add tests for commutative intrinsics; NFC
Sanjay Patel [Thu, 3 Sep 2020 15:36:32 +0000 (11:36 -0400)]
[InstCombine] add tests for commutative intrinsics; NFC

3 years ago[Analyzer][docs][NFC] Fix typo in code example
Jan Korous [Thu, 3 Sep 2020 16:28:34 +0000 (09:28 -0700)]
[Analyzer][docs][NFC] Fix typo in code example

3 years agoEliminate the sizing template parameter N from CoalescingBitVector
Dimitry Andric [Wed, 2 Sep 2020 16:56:12 +0000 (18:56 +0200)]
Eliminate the sizing template parameter N from CoalescingBitVector

Since the parameter is not used anywhere, and the default size of 16
apparently causes PR47359, remove it. This ensures that IntervalMap will
automatically determine the optimal size, using its NodeSizer struct.

Reviewed By: dblaikie

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

3 years ago[lldb-vscode] Fix TestVSCode_module
Walter Erquinigo [Thu, 3 Sep 2020 15:57:13 +0000 (08:57 -0700)]
[lldb-vscode] Fix TestVSCode_module

Caused by D86662. The fix is only checking some fields when the expect_debug_info_size flag is true. For some reason this was not failing on a local linux machine.

3 years ago[libFuzzer] Add an option to keep initial seed inputs around.
Dokyung Song [Fri, 31 Jul 2020 00:07:20 +0000 (00:07 +0000)]
[libFuzzer] Add an option to keep initial seed inputs around.

This patch adds an option "keep_seed" to keep all initial seed inputs in the
corpus. Previously, only the initial seed inputs that find new coverage were
added to the corpus, and all the other initial inputs were discarded. We
observed in some circumstances that useful initial seed inputs are discarded as
they find no new coverage, even though they contain useful fragments in them
(e.g., SQLITE3 FuzzBench benchmark). This newly added option provides a way to
keeping seed inputs in the corpus for those circumstances. With this patch, and
with -keep_seed=1, all initial seed inputs are kept in the corpus regardless of
whether they find new coverage or not. Further, these seed inputs are not
replaced with smaller inputs even if -reduce_inputs=1.

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

3 years agoAdd new hidden option -print-changed which only reports changes to IR
Jamie Schmeiser [Thu, 3 Sep 2020 15:52:27 +0000 (15:52 +0000)]
Add new hidden option -print-changed which only reports changes to IR

A new hidden option -print-changed is added along with code to support
printing the IR as it passes through the opt pipeline in the new pass
manager. Only those passes that change the IR are reported, with others
only having the banner reported, indicating that they did not change the
IR, were filtered out or ignored. Filtering of output via the
-filter-print-funcs is supported and a new supporting hidden option
-filter-passes is added. The latter takes a comma separated list of pass
names and filters the output to only show those passes in the list that
change the IR. The output can also be modified via the -print-module-scope
function.

The code introduces a template base class that generalizes the comparison
of IRs that takes an IR representation as template parameter. The
constructor takes a series of lambdas that provide an event based API
for generalized reporting of IRs as they are changed in the opt pipeline
through the new pass manager.

The first of several instantiations is provided that prints the IR
in a form similar to that produced by -print-after-all with the above
mentioned filtering capabilities. This version, and the others to
follow will be introduced at the upcoming developer's conference.
See https://hotcrp.llvm.org/usllvm2020/paper/29 for more information.

Reviewed By: yrouban (Yevgeny Rouban)

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

3 years agoStep down from security group
JF Bastien [Thu, 3 Sep 2020 15:44:27 +0000 (08:44 -0700)]
Step down from security group

Propose Ahmed as a replacement. He's fixed many security issues in LLVM for Apple in the last few years, as such he'll fit the "Individual contributors" description.

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

3 years ago[fuzzer] Create user provided fuzzer writeable directories when requested if they...
Matt Morehouse [Thu, 3 Sep 2020 14:58:45 +0000 (07:58 -0700)]
[fuzzer] Create user provided fuzzer writeable directories when requested if they dont exist

Currently, libFuzzer will exit with an error message if a non-existent
directory is provided for any of the appropriate arguments. For cases
where libFuzzer is used in a specialized embedded environment, it would
be much easier to have libFuzzer create the directories for the user.

This patch accommodates for this scenario by allowing the user to provide
the argument `-create_missing_dirs=1` which makes libFuzzer attempt to
create the `artifact_prefix`, `exact_artifact_path`,
`features_dir` and/or corpus directory if they don't already exist rather
than throw an error and exit.

Split off from D84808 as requested [here](https://reviews.llvm.org/D84808#2208546).

Reviewed By: morehouse

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

3 years agoGlobalISel/Utils.h - remove unused includes. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 14:58:55 +0000 (15:58 +0100)]
GlobalISel/Utils.h - remove unused includes. NFCI.

Twine is unused, and TargetLowering can be reduced to a forward declaration and moved to Utils.cpp

3 years ago[libTooling] Provide overloads of `rewriteDescendants` that operate directly on an...
Yitzhak Mandelbaum [Wed, 2 Sep 2020 14:10:22 +0000 (14:10 +0000)]
[libTooling] Provide overloads of `rewriteDescendants` that operate directly on an AST node.

The new overloads apply directly to a node, like the
`clang::ast_matchers::match` functions, Rather than generating an
`EditGenerator` combinator.

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

3 years agoX86/X86TargetObjectFile.cpp - remove unused headers. NFCI.
Simon Pilgrim [Thu, 3 Sep 2020 14:17:30 +0000 (15:17 +0100)]
X86/X86TargetObjectFile.cpp - remove unused headers. NFCI.

3 years agoFix spelling mistake. NFC.
Simon Pilgrim [Thu, 3 Sep 2020 14:11:56 +0000 (15:11 +0100)]
Fix spelling mistake. NFC.

3 years ago[IR][GVN] add/allow commutative intrinsics with >2 args
Sanjay Patel [Thu, 3 Sep 2020 14:12:59 +0000 (10:12 -0400)]
[IR][GVN] add/allow commutative intrinsics with >2 args

Follow-up to D86798 and rGe25449f.

3 years ago[GVN] add tests for >2 arg commutable intrinsics; NFC
Sanjay Patel [Thu, 3 Sep 2020 13:27:16 +0000 (09:27 -0400)]
[GVN] add tests for >2 arg commutable intrinsics; NFC

3 years ago[LLD][PowerPC][test] Fix out-of-memory issue running ppc64-pcrel-long-branch-error.s
Victor Huang [Thu, 3 Sep 2020 14:08:24 +0000 (09:08 -0500)]
[LLD][PowerPC][test] Fix out-of-memory issue running ppc64-pcrel-long-branch-error.s

Following 97febb1, fix the out-of-memory error associated with buffering the output
in-memory by writing to an allocated file with the minimum offset and running it
on ppc system-linux only.

Peer reviewed by: nemanjai

3 years ago[mlir][VectorOps] Fall back to a loop when accessing a vector from a strided memref
Benjamin Kramer [Thu, 3 Sep 2020 11:49:04 +0000 (13:49 +0200)]
[mlir][VectorOps] Fall back to a loop when accessing a vector from a strided memref

The scalar loop is slow but correct.

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

3 years ago[mlir] Support default valued attribute in StructsGen
Lei Zhang [Thu, 3 Sep 2020 13:44:37 +0000 (09:44 -0400)]
[mlir] Support default valued attribute in StructsGen

Its handling is similar to optional attributes, except for the
getter method.

Reviewed By: rsuderman

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

3 years ago[spirv] Add SPIR-V GLSL extended Round op
Zhibin Li [Thu, 3 Sep 2020 13:29:07 +0000 (09:29 -0400)]
[spirv] Add SPIR-V GLSL extended Round op

Reviewed By: mravishankar, antiagainst

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

3 years agoLowerEmuTLS.cpp - remove unused TargetLowering.h include. NFC.
Simon Pilgrim [Thu, 3 Sep 2020 13:39:57 +0000 (14:39 +0100)]
LowerEmuTLS.cpp - remove unused TargetLowering.h include. NFC.

We only needed llvm/IR/Constants.h.

3 years ago[mlir] Add Acos, Asin, Atan, Sinh, Cosh, Pow to SPIRVGLSLOps
Ling, Liyang [Thu, 3 Sep 2020 13:24:43 +0000 (09:24 -0400)]
[mlir] Add Acos, Asin, Atan, Sinh, Cosh, Pow to SPIRVGLSLOps

Reviewed By: mravishankar, antiagainst

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

3 years ago[X86] Avoid llvm-qualified-auto warning by not using auto. NFC.
Simon Pilgrim [Thu, 3 Sep 2020 13:05:43 +0000 (14:05 +0100)]
[X86] Avoid llvm-qualified-auto warning by not using auto. NFC.

Try to consistently use the actual type name in the file.

3 years ago[X86] Fix llvm-qualified-auto warning by using auto*. NFC.
Simon Pilgrim [Thu, 3 Sep 2020 12:52:40 +0000 (13:52 +0100)]
[X86] Fix llvm-qualified-auto warning by using auto*. NFC.

3 years ago[X86] Fix llvm-qualified-auto warning by using const auto*. NFC.
Simon Pilgrim [Thu, 3 Sep 2020 12:46:51 +0000 (13:46 +0100)]
[X86] Fix llvm-qualified-auto warning by using const auto*. NFC.

3 years ago[EarlyCSE] add tests for fma/fmuladd; NFC
Sanjay Patel [Thu, 3 Sep 2020 13:04:49 +0000 (09:04 -0400)]
[EarlyCSE] add tests for fma/fmuladd; NFC

3 years ago[PassManager] Move load/store motion pass after DSE in LTO pipeline.
Florian Hahn [Thu, 3 Sep 2020 11:30:36 +0000 (12:30 +0100)]
[PassManager] Move load/store motion pass after DSE in LTO pipeline.

As far as I am aware, the placement of MergedLoadStoreMotion in the
pipeline is not heavily tuned currently. It seems to not matter much if
we do it after DSE in the LTO pipeline (no binary changes for -O3 -flto
on MultiSource/SPEC2000/SPEC2006). Moving it after DSE however has a
major benefit: MemorySSA is constructed by LICM and is consumed by DSE,
so if MergedLoadStoreMotion happens after DSE, we do not need to
preserve MemorySSA in it.

If there are any concerns with this move, I can also update
MergedLoadStoreMotion to preserve MemorySSA.

This patch together with D86651 (preserve MemSSA in MemCpyOpt) and
D86534 (preserve MemSSA in GVN) are the remaining patches to bring down
compile-time for DSE + MemorySSA to the levels outlined in
http://lists.llvm.org/pipermail/llvm-dev/2020-August/144417.html

Once they land, we should be able to start with flipping the switch on
enabling DSE + MmeorySSA.

Reviewed By: asbirlea

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

3 years ago[lldb] Improve test failure reporting for expect()
David Spickett [Fri, 28 Aug 2020 11:30:56 +0000 (12:30 +0100)]
[lldb] Improve test failure reporting for expect()

This updates the errors reported by expect()
to something like:

```
Ran command:
"help"

Got output:
Debugger commands:
<...>

Expecting start string: "Debugger commands:" (was found)
Expecting end string: "foo" (was not found)
```
(see added tests for more examples)

This shows the user exactly what was run,
what checks passed and which failed. Along with
whether that check was supposed to pass.
(including what regex patterns matched)

These lines are also output to the test
trace file, whether the test passes or not.

Note that expect() will still fail at the first failed
check, in line with previous behaviour.

Also I have flipped the wording of the assert
message functions (.*_MSG) to describe failures
not successes. This makes more sense as they are
only shown on assert failures.

Reviewed By: labath

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

3 years ago[X86][SSE] Fold select(X > -1, A, B) -> select(0 > X, B, A) (PR47404)
Simon Pilgrim [Thu, 3 Sep 2020 11:55:14 +0000 (12:55 +0100)]
[X86][SSE] Fold select(X > -1, A, B) -> select(0 > X, B, A) (PR47404)

Help PBLENDVB peek through to the sign bit source of the selection mask by swapping the select condition and inputs.

3 years ago[NFC][RISCV] Simplify pass arg of RISCVMergeBaseOffsetOpt
Ben Shi [Thu, 3 Sep 2020 12:01:23 +0000 (20:01 +0800)]
[NFC][RISCV] Simplify pass arg of RISCVMergeBaseOffsetOpt

Reviewed By: lenary, asb

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

3 years ago[Test] Add test showing some simple cases that IndVarSimplify does not cover
Max Kazantsev [Thu, 3 Sep 2020 11:18:40 +0000 (18:18 +0700)]
[Test] Add test showing some simple cases that IndVarSimplify does not cover

3 years ago[GVN] Preserve MemorySSA if it is available.
Florian Hahn [Thu, 3 Sep 2020 11:16:17 +0000 (12:16 +0100)]
[GVN] Preserve MemorySSA if it is available.

Preserve MemorySSA if it is available before running GVN.

DSE with MemorySSA will run closely after GVN. If GVN and 2 other
passes preserve MemorySSA, DSE can re-use MemorySSA used by LICM
when doing LTO.

Reviewed By: asbirlea

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

3 years ago[X86][SSE] Add PR47404 test case
Simon Pilgrim [Thu, 3 Sep 2020 11:05:35 +0000 (12:05 +0100)]
[X86][SSE] Add PR47404 test case

3 years ago[X86][AVX] Test SSE41 BLENDV combines on AVX targets as well
Simon Pilgrim [Thu, 3 Sep 2020 11:01:46 +0000 (12:01 +0100)]
[X86][AVX] Test SSE41 BLENDV combines on AVX targets as well

Show up any differences due to SSE41 variant being locked to use xmm0

3 years ago[MemCpyOptimizer] Change required analysis order for BasicAA/PhiValuesAnalysis
David Green [Thu, 3 Sep 2020 11:01:51 +0000 (12:01 +0100)]
[MemCpyOptimizer] Change required analysis order for BasicAA/PhiValuesAnalysis

This is a followup to 1ccfb52a61748, which made a number of changes
including the apparently innocuous reordering of required passes in
MemCpyOptimizer. This however altered the creation order of BasicAA vs
Phi Values analysis, meaning BasicAA did not pick up PhiValues as a
cached result. Instead if we require MemoryDependence first it will
require PhiValuesAnalysis allowing BasicAA to use it for better results.

I don't claim this is an excellent design, but it fixes a nasty little
regressions where a query later in JumpThreading was getting worse
results.

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

3 years ago[PowerPC] Fix missing TLS symbol type.
Stefan Pintilie [Wed, 2 Sep 2020 20:23:55 +0000 (15:23 -0500)]
[PowerPC] Fix missing TLS symbol type.

Previous implementations for the TLS models General Dynamic and Initial Exec
were missing the ELF::STT_TLS type on symbols that required the type. This patch
adds the type.

Reviewed By: sfertile, MaskRay

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

3 years ago[llvm-readelf] - Move a bit of common code to printDynamicRelocHeader(). NFC.
Georgii Rymar [Wed, 2 Sep 2020 10:16:42 +0000 (13:16 +0300)]
[llvm-readelf] - Move a bit of common code to printDynamicRelocHeader(). NFC.

This helps to isolate printing of the relocation's summary header
in a single place.

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

3 years ago[llvm-readobj/elf] - Improve warning messages, reported for .stack_sizes sections.
Georgii Rymar [Tue, 1 Sep 2020 12:24:14 +0000 (15:24 +0300)]
[llvm-readobj/elf] - Improve warning messages, reported for .stack_sizes sections.

Instead of referring to stack sizes sections only by name, we can add
section indexes and types to warnings reported.

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

3 years agoRevert "Adding GDB PrettyPrinter for mlir::Identifier."
OCHyams [Thu, 3 Sep 2020 07:28:15 +0000 (08:28 +0100)]
Revert "Adding GDB PrettyPrinter for mlir::Identifier."

This reverts commit 9e9e6e698d8ef5dc5b7576058f2022aab2534a52.

This commit is causing builds that include the 'debuginfo-tests' project to
fail.

Apple has a public bot which shows the failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/23667/console

3 years ago[clang][aarch64] Drop experimental from __ARM_FEATURE_SVE_BITS macro
Cullen Rhodes [Thu, 3 Sep 2020 09:19:41 +0000 (09:19 +0000)]
[clang][aarch64] Drop experimental from  __ARM_FEATURE_SVE_BITS macro

The __ARM_FEATURE_SVE_BITS feature macro is specified in the Arm C
Language Extensions (ACLE) for SVE [1] (version 00bet5). From the spec,
where __ARM_FEATURE_SVE_BITS==N:

    When N is nonzero, indicates that the implementation is generating
    code for an N-bit SVE target and that the arm_sve_vector_bits(N)
    attribute is available.

This was defined in D83550 as __ARM_FEATURE_SVE_BITS_EXPERIMENTAL and
enabled under the -msve-vector-bits flag to simplify initial tests.
This patch drops _EXPERIMENTAL now there is support for the feature.

[1] https://developer.arm.com/documentation/100987/latest

Reviewed By: david-arm

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

3 years agoRevert "[SCCP] Do not replace deref'able ptr with un-deref'able one."
Florian Hahn [Thu, 3 Sep 2020 09:28:42 +0000 (10:28 +0100)]
Revert "[SCCP] Do not replace deref'able ptr with un-deref'able one."

This reverts commit 3542feeb2077f267bff1ab98fb4bf20099f44bb8.

This seems to be causing issues with a sanitizer build
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/21677

3 years ago[SCCP] Do not replace deref'able ptr with un-deref'able one.
Florian Hahn [Thu, 3 Sep 2020 09:17:09 +0000 (10:17 +0100)]
[SCCP] Do not replace deref'able ptr with un-deref'able one.

Currently IPSCCP (and others like CVP/GVN) blindly propagate pointer
equalities. In certain cases, that leads to dereferenceable pointers
being replaced, as in the example test case.

I think this is not allowed, as it introduces an access of an
un-dereferenceable pointer. Note that the pointer is inbounds, but one
past the last element, so it is valid, but not dereferenceable.

This patch is mostly to highlight the issue and start a discussion.
Currently it only checks for specifically looking
one-past-the-last-element pointers with array typed bases.

This causes the mis-compile outlined in
https://stackoverflow.com/questions/55754313/is-this-gcc-clang-past-one-pointer-comparison-behavior-conforming-or-non-standar

In the test case, if we replace %p with the GEP for the store, we
subsequently determine that the store and the load cannot alias, because
they are to different underlying objects.

Note that Alive2 seems to think that the replacement is valid:
https://alive2.llvm.org/ce/z/2rorhk

Reviewed By: efriedma

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

3 years ago[llvm-readelf/obj] - Cleanup the interface of `DumpStyle`. NFCI.
Georgii Rymar [Wed, 2 Sep 2020 15:06:45 +0000 (18:06 +0300)]
[llvm-readelf/obj] - Cleanup the interface of `DumpStyle`. NFCI.

We have 2 DumpStyles currently:
`class GNUStyle : public DumpStyle<ELFT>` and `class LLVMStyle : public DumpStyle<ELFT>`.

The problem of `DumpStyle` interface is that almost for each method
we provide `const ELFFile<ELFT> *` as argument. But in fact each of
dump styles keeps `ELFDumper<ELFT> *Dumper` which can be used to get an object from.

But since we use the `Obj` too often, I've decided to introduce a one more reference member
instead of reading it from the `Dumper` each time:
`const ELFFile<ELFT> &Obj;` This is kind of similar to `FileName` member which we have already:
it is also used to store a the file name which can be read from `Dumper->getElfObject()->getFileName()`.

I had to adjust the code which previously worked with a pointer to an object
and now works with a reference.

In a follow-up I am going to try to get rid of `const ELFObjectFile<ELFT>` arguments
which are still passed to a set of functions.

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

3 years ago[SCCP] Add test where dereferenceable ptr is replaced with un-dereferenceable one
Florian Hahn [Fri, 7 Aug 2020 12:21:53 +0000 (13:21 +0100)]
[SCCP] Add test where dereferenceable ptr is replaced with un-dereferenceable one

3 years ago[lldb/Interpreter] Fix language detection for the REPL InitFile
Med Ismail Bennani [Thu, 3 Sep 2020 08:05:51 +0000 (10:05 +0200)]
[lldb/Interpreter] Fix language detection for the REPL InitFile

Previously, before loading the REPL language-specific init file, lldb
checked the selected target language in which case it returned an unknown
language type with the REPL target.

Instead, the patch calls `Language::GetLanguagesSupportingREPLs` and
look for the first element of that set. In case lldb was not configured
with a REPL language, then, it will just stop sourcing the REPL init
file and fallback to the original logic (continuing with the default
init file).

rdar://65836048

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb] Make symbol list output from `image dump symtab` not depend on internal orderi...
Raphael Isemann [Thu, 3 Sep 2020 08:26:33 +0000 (10:26 +0200)]
[lldb] Make symbol list output from `image dump symtab` not depend on internal ordering of DenseMap

`image dump symtab` seems to output the symbols in whatever order they appear in
the DenseMap that is used to filter out symbols with non-unique addresses. As
DenseMap is a hash map this order can change at any time so the output of this
command is pretty unstable. This also causes the `Breakpad/symtab.test` to fail
with enabled reverse iteration (which reverses the DenseMap order to find issues
like this).

This patch makes the DenseMap a std::vector and uses a separate DenseSet to do
the address filtering. The output order is now dependent on the order in which
the symbols are read (which should be deterministic). It might also avoid a bit
of work as all the work for creating the Symbol constructor parameters is only
done when we can actually emplace a new Symbol.

Reviewed By: labath

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

3 years ago[lldb] Remove a stray semicolon, fixing pedantic GCC warnings. NFC.
Martin Storsjö [Thu, 3 Sep 2020 08:19:40 +0000 (11:19 +0300)]
[lldb] Remove a stray semicolon, fixing pedantic GCC warnings. NFC.

3 years ago[AArch64] Add asm directives for the remaining SEH unwind codes
Martin Storsjö [Sat, 15 Aug 2020 21:26:24 +0000 (00:26 +0300)]
[AArch64] Add asm directives for the remaining SEH unwind codes

Add support in llvm-readobj for displaying them and support in the
asm parsser, AArch64TargetStreamer and MCWin64EH for emitting them.

The directives for the remaining basic opcodes have names that
match the opcode in the documentation.

The directives for custom stack cases, that are named
MSFT_OP_TRAP_FRAME, MSFT_OP_MACHINE_FRAME, MSFT_OP_CONTEXT
and MSFT_OP_CLEAR_UNWOUND_TO_CALL, are given matching assembler
directive names that fit into the rest of the opcode naming;
.seh_trap_frame, .seh_context, .seh_clear_unwound_to_call

The opcode MSFT_OP_MACHINE_FRAME is mapped to the existing
opecode enum UOP_PushMachFrame that is used on x86_64, and also
uses the corresponding existing x86_64 directive name
.seh_pushframe.

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

3 years ago[lldb] Remove debugserver specific string from TestAbortExitCode check
Raphael Isemann [Thu, 3 Sep 2020 07:54:37 +0000 (09:54 +0200)]
[lldb] Remove debugserver specific string from TestAbortExitCode check

The test only checks the exit code that the debug server sends back, but
not the following explanation which is different for debugserver and lldb-server.

3 years agoFix broken HUGE_VALF macro in llvm-c/DataTypes.h
Raphael Isemann [Thu, 3 Sep 2020 07:36:12 +0000 (09:36 +0200)]
Fix broken HUGE_VALF macro in llvm-c/DataTypes.h

Commit 3a29393b4709d15069130119cf1d136af4a92d77 removes the cmath/math.h
includes from the DataTypes.h header to speed up parsing. However the
DataTypes.h header was using this header to get the macro `HUGE_VAL` for its own
`HUGE_VALF` macro definition. Now the macro instead just expands into a plain
`HUGE_VAL` token which leads to compiler errors unless `math.h` was previously
included by the including source file. It also leads to compiler warnings with
enabled module builds which point out this inconsistency.

The correct way to fix this seems to be to just remove HUGE_VALF from the
header. llvm-c is not referencing that macro from what I can see and users
probably should just include the math headers if they need it (or define it on
their own for really old C versions).

Reviewed By: JDevlieghere

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

3 years ago[debugserver] Fix that debugserver's stop reply packets always return signal code 0
Raphael Isemann [Thu, 3 Sep 2020 07:17:03 +0000 (09:17 +0200)]
[debugserver] Fix that debugserver's stop reply packets always return signal code 0

If our process terminates due to an unhandled signal, we are supposed to get the
signal code via WTERMSIG. However, we instead try to get the exit status via
WEXITSTATUS which just ends up always calculating signal code 0 (at least on the
macOS implementation where it just shifts the signal code bits away and we're
left with only 0 bits).

The exit status calculation on the LLDB side also seems a bit off as it claims
an exit status that is just the signal code (instead of for example 128 + signal
code), but that will be another patch.

Reviewed By: jasonmolenda

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

3 years ago[StackProtector] Fix crash with vararg due to not checking LocationSize validity.
Amara Emerson [Thu, 3 Sep 2020 06:17:48 +0000 (23:17 -0700)]
[StackProtector] Fix crash with vararg due to not checking LocationSize validity.

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

3 years agoAdding GDB PrettyPrinter for mlir::Identifier.
Christian Sigg [Tue, 1 Sep 2020 13:43:38 +0000 (15:43 +0200)]
Adding GDB PrettyPrinter for mlir::Identifier.

This is the first bit from D73546. Primarily setting up the corresponding test. Will add more pretty printers in a separate revision.

Reviewed By: dblaikie

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

3 years agoDecouple OpPassManager from the the MLIRContext (NFC)
Mehdi Amini [Thu, 3 Sep 2020 05:57:57 +0000 (05:57 +0000)]
Decouple OpPassManager from the the MLIRContext (NFC)

This is allowing to build an OpPassManager from a StringRef instead of an
Identifier, which enables building pipelines without an MLIRContext.
An identifier is still cached on-demand on the OpPassManager for efficiency
during the IR traversal.

3 years ago[mlir][Linalg] Wrong tile size for convolutions fixed
Jakub Lichman [Wed, 2 Sep 2020 14:02:40 +0000 (14:02 +0000)]
[mlir][Linalg] Wrong tile size for convolutions fixed

Sizes of tiles (subviews) are bigger by 1 than they should. Let's consider
1D convolution without batches or channels. Furthermore let m iterate over
the output and n over the kernel then input is accessed with m + n. In tiling
subview sizes for convolutions are computed by applying requested tile size
together with kernel size to the above mentioned expression thus let's say
for tile size of 2 the subview size is 2 + size(n), which is bigger by one
than it should since we move kernel only once. The problem behind it is that
range is not turned into closed interval before the composition. This commit
fixes the problem by turning ranges first into closed intervals by substracting
1 and after the composition back to half open by adding 1.

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

3 years ago[lldb] Add reproducer verifier
Jonas Devlieghere [Mon, 31 Aug 2020 22:13:49 +0000 (15:13 -0700)]
[lldb] Add reproducer verifier

Add a reproducer verifier that catches:

 - Missing or invalid home directory
 - Missing or invalid working directory
 - Missing or invalid module/symbol paths
 - Missing files from the VFS

The verifier is enabled by default during replay, but can be skipped by
passing --reproducer-no-verify.

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

3 years ago[lldb] Pass -fno-objc-exceptions for objcxx targets
Jonas Devlieghere [Thu, 3 Sep 2020 04:58:06 +0000 (21:58 -0700)]
[lldb] Pass -fno-objc-exceptions for objcxx targets

When compiling an Objective-C++ file, __has_feature(cxx_exceptions) will
return true with -fno-exceptions but without -fno-objc-exceptions. This
was causing LLVM_ENABLE_EXCEPTIONS to be defined for a subset of files.

3 years agoRevert "[NewPM][Lint] Port -lint to NewPM"
Arthur Eubanks [Thu, 3 Sep 2020 04:34:20 +0000 (21:34 -0700)]
Revert "[NewPM][Lint] Port -lint to NewPM"

This reverts commit 883399c8402188520870f99e7d8b3244f000e698.

3 years ago[NewPM][Lint] Port -lint to NewPM
Arthur Eubanks [Wed, 2 Sep 2020 21:28:27 +0000 (14:28 -0700)]
[NewPM][Lint] Port -lint to NewPM

This also changes -lint from an analysis to a pass. It's similar to
-verify, and that is a normal pass, and lives in llvm/IR.

Reviewed By: ychen

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

3 years ago[lldb] Always record both the working and home directory.
Jonas Devlieghere [Thu, 3 Sep 2020 03:48:50 +0000 (20:48 -0700)]
[lldb] Always record both the working and home directory.

Treat the home directory like the current working directory and always
capture both in the VFS.

3 years ago[CodeGenPrepare][X86] Teach optimizeGatherScatterInst to turn a splat pointer into...
Craig Topper [Thu, 3 Sep 2020 03:44:12 +0000 (20:44 -0700)]
[CodeGenPrepare][X86] Teach optimizeGatherScatterInst to turn a splat pointer into GEP with scalar base and 0 index

This helps SelectionDAGBuilder recognize the splat can be used as a uniform base.

Reviewed By: RKSimon

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

3 years ago[X86] Add a /tune: option for clang-cl
Craig Topper [Thu, 3 Sep 2020 02:03:28 +0000 (19:03 -0700)]
[X86] Add a /tune: option for clang-cl

We recently added support for -mtune. This patch adds /tune: so we can specify the tune CPU from clang-cl. MSVC doesn't support this but icc does.

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

3 years ago[mlir][spirv] Add block read and write from SPV_INTEL_subgroups
Artur Bialas [Thu, 3 Sep 2020 02:52:29 +0000 (19:52 -0700)]
[mlir][spirv] Add block read and write from SPV_INTEL_subgroups

Added support to OpSubgroupBlockReadINTEL and OpSubgroupBlockWriteINTEL

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

3 years ago[lldb/Gui] zero-initialize children_stop_id
Jordan Rupprecht [Thu, 3 Sep 2020 02:42:54 +0000 (19:42 -0700)]
[lldb/Gui] zero-initialize children_stop_id

This is currently causing msan warnings in the API tests when run under msan, e.g. `commands/gui/basic/TestGuiBasic.py`.

Reviewed By: clayborg

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

3 years agoAdd code owners of new MachO port
Greg McGary [Thu, 3 Sep 2020 02:32:12 +0000 (19:32 -0700)]
Add code owners of new MachO port

3 years agoFix for PR46384. Failure on weak dllimport.
Sunil Srivastava [Thu, 3 Sep 2020 02:12:24 +0000 (19:12 -0700)]
Fix for PR46384. Failure on weak dllimport.

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

3 years ago[compiler-rt] Don't build llvm-lit in RUNTIMES-BUILD
Jinsong Ji [Wed, 2 Sep 2020 20:41:15 +0000 (20:41 +0000)]
[compiler-rt] Don't build llvm-lit in RUNTIMES-BUILD

With runtimes-build, we lost map config for llvm-lit, so we can NOT run
lit from source dir anymore.
All the subdir target like: ninja check-llvm-codegen-powerpc will fail
too.

We will get some cfg error like:
  File "../lvm-project/llvm/test/lit.cfg.py", line 21, in <module>
    config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
AttributeError: 'NoneType' object has no attribute 'use_lit_shell'

This is reset of map config in llvm-lit rebuild.
We already have llvm-lit in runtimes-build, so don't build it.

Reviewed By: phosek

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

3 years ago[InstCombine] Fix a couple crashes with extractelement on a scalable vector.
Eli Friedman [Tue, 1 Sep 2020 23:20:18 +0000 (16:20 -0700)]
[InstCombine] Fix a couple crashes with extractelement on a scalable vector.

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

3 years ago[llvm-dwarfdump] Warn user when it encounters no null terminated strings.
Xing GUO [Thu, 3 Sep 2020 00:49:51 +0000 (08:49 +0800)]
[llvm-dwarfdump] Warn user when it encounters no null terminated strings.

When llvm-dwarfdump encounters no null terminated strings, we should
warn user about it rather than ignore it and print nothing.

Before this patch, when llvm-dwarfdump dumps a .debug_str section whose
content is "abc", it prints:

```
.debug_str contents:
```

After this patch:

```
.debug_str contents:
warning: no null terminated string at offset 0x0
```

Reviewed By: jhenderson, MaskRay

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

3 years ago[asan_symbolize] Remove --use-symbol-table=true which is the default
Fangrui Song [Thu, 3 Sep 2020 00:34:35 +0000 (17:34 -0700)]
[asan_symbolize] Remove --use-symbol-table=true which is the default

3 years agoRevert de6caf871be79dc7549aebe4e4fb57d52f6ed202 and 51128b670d4f757132e927c4f3dd78d25...
Walter Erquinigo [Thu, 3 Sep 2020 00:05:19 +0000 (17:05 -0700)]
Revert de6caf871be79dc7549aebe4e4fb57d52f6ed202 and 51128b670d4f757132e927c4f3dd78d257d37f70 (https://reviews.llvm.org/D84974)

The tests seem to be timing out in all linux bots. Need further analysis.

Revert "run in terminal"

This reverts commit de6caf871be79dc7549aebe4e4fb57d52f6ed202.

3 years agoTweak `mlir-linalg-ods-gen` library dependency: only MLIRIR is needed, not the entire...
Mehdi Amini [Wed, 2 Sep 2020 23:57:47 +0000 (23:57 +0000)]
Tweak `mlir-linalg-ods-gen` library dependency: only MLIRIR is needed, not the entire parser (NFC)

3 years ago[MLIR][Affine][VectorOps] Vectorize uniform values in SuperVectorizer
Diego Caballero [Wed, 2 Sep 2020 21:56:43 +0000 (00:56 +0300)]
[MLIR][Affine][VectorOps] Vectorize uniform values in SuperVectorizer

This patch adds basic support for vectorization of uniform values to SuperVectorizer.
For now, only invariant values to the target vector loops are considered uniform. This
enables the vectorization of loops that use function arguments and external definitions
to the vector loops. We could extend uniform support in the future if we implement some
kind of divergence analysis algorithm.

Reviewed By: nicolasvasilache, aartbik

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

3 years ago[libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime>
Louis Dionne [Wed, 2 Sep 2020 22:11:26 +0000 (18:11 -0400)]
[libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime>

3 years ago[PowerPC] Fix broken kill flag after MI peephole
Nemanja Ivanovic [Wed, 2 Sep 2020 22:04:35 +0000 (17:04 -0500)]
[PowerPC] Fix broken kill flag after MI peephole

The test case in https://bugs.llvm.org/show_bug.cgi?id=47373 exposed
two bugs in the PPC back end. The first one was fixed in commit
27714075848e7f05a297317ad28ad2570d8e5a43 but the test case had to
be added without -verify-machineinstrs due to the second bug.
This commit fixes the use-after-kill that is left behind by the
PPC MI peephole optimization.

3 years agoFix de6caf871be79dc7549aebe4e4fb57d52f6ed202
Walter Erquinigo [Wed, 2 Sep 2020 21:46:20 +0000 (14:46 -0700)]
Fix de6caf871be79dc7549aebe4e4fb57d52f6ed202

Failure found in
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/16855

The issue is a header not being included

3 years ago[VectorCombine][SVE] Do not fold bitcast shuffle for scalable type.
Huihui Zhang [Wed, 2 Sep 2020 22:02:04 +0000 (15:02 -0700)]
[VectorCombine][SVE] Do not fold bitcast shuffle for scalable type.

First, shuffle cost for scalable type is not known for scalable type;
Second, we cannot reason if the narrowed shuffle mask for scalable type
is a splat or not.

E.g., Bitcast splat vector from type <vscale x 4 x i32> to <vscale x 8 x i16>
will involve narrowing shuffle mask <vscale x 4 x i32> zeroinitializer to
<vscale x 8 x i32> with element sequence of <0, 1, 0, 1, ...>, which cannot be
reasoned if it's a valid splat or not.

Reviewed By: spatel

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

3 years agoImprove error handling for SmallVector programming errors
Geoffrey Martin-Noble [Wed, 2 Sep 2020 22:00:26 +0000 (15:00 -0700)]
Improve error handling for SmallVector programming errors

This patch changes errors in `SmallVector::grow` that are independent of
memory capacity to be reported using report_fatal_error or
std::length_error instead of report_bad_alloc_error, which falsely signals
an OOM.

It also cleans up a few related things:
- makes report_bad_alloc_error to print the failure reason passed
  to it.
- fixes the documentation to indicate that report_bad_alloc_error
  calls `abort()` not "an assertion"
- uses a consistent name for the size/capacity argument to `grow`
  and `grow_pod`

Reviewed By: mehdi_amini, MaskRay

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