platform/upstream/llvm.git
3 years ago[SLP][X86] Extend target coverage for PR47629
Simon Pilgrim [Fri, 30 Oct 2020 15:18:01 +0000 (15:18 +0000)]
[SLP][X86] Extend target coverage for PR47629

As suggested on D90445, add tests for various SSE/AVX levels and more complex gep pointer offsets

3 years agoUse cast<> instead of dyn_cast<> as we dereference the pointers immediately. NFCI.
Simon Pilgrim [Fri, 30 Oct 2020 15:05:23 +0000 (15:05 +0000)]
Use cast<> instead of dyn_cast<> as we dereference the pointers immediately. NFCI.

Fix clang static analyzer warnings - we're better off relying on cast<> asserting on failure rather than a null dereference crash.

3 years ago[VE][NFC] Split up lowering init
Simon Moll [Fri, 30 Oct 2020 15:14:42 +0000 (16:14 +0100)]
[VE][NFC] Split up lowering init

Split up the monolithic VETargetLowering ctor into three initialization phases:
1. initRegisterClasses()
2. initSPUActions()
3. // TODO initVPUActions()

Reviewed By: kaz7

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

3 years agoAMDGPU: Fix missing writelane cases to skip with exec=0
Matt Arsenault [Sat, 17 Oct 2020 00:33:02 +0000 (20:33 -0400)]
AMDGPU: Fix missing writelane cases to skip with exec=0

3 years ago[clang][aarch64] Address various fixed-length SVE vector operations
Cullen Rhodes [Thu, 29 Oct 2020 11:04:35 +0000 (11:04 +0000)]
[clang][aarch64] Address various fixed-length SVE vector operations

This patch adds tests and support for operations on SVE vectors created
by the 'arm_sve_vector_bits' attribute, described by the Arm C Language
Extensions (ACLE, version 00bet6, section 3.7.3.3) for SVE [1].

This covers the following:
* VLSTs support the same forms of element-wise initialization as GNU
  vectors.
* VLSTs support the same built-in C and C++ operators as GNU vectors.
* Conditional and binary expressions containing GNU and SVE vectors
  (fixed or sizeless) are invalid since the ambiguity around the result
  type affects the ABI.

No functional changes were required to support vector initialization and
operators. The functional changes are to address unsupported conditional and
binary expressions.

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

Reviewed By: fpetrogalli

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

3 years agoRevert "[MLIR][SPIRV] Start module combiner"
Mehdi Amini [Fri, 30 Oct 2020 15:09:09 +0000 (15:09 +0000)]
Revert "[MLIR][SPIRV] Start module combiner"

This reverts commit 316593ce839f05af936e705182747743e4638f3c.
Build is broken with:

TestModuleCombiner.cpp:(.text._ZN12_GLOBAL__N_122TestModuleCombinerPass14runOnOperationEv+0x195): undefined reference to `mlir::spirv::combine(llvm::MutableArrayRef<mlir::spirv::ModuleOp>, mlir::OpBuilder&, llvm::function_ref<void (mlir::spirv::ModuleOp, llvm::StringRef, llvm::StringRef)>)'

3 years ago[ARM] Update target triple in tests. NFC
David Green [Fri, 30 Oct 2020 15:06:49 +0000 (15:06 +0000)]
[ARM] Update target triple in tests. NFC

3 years ago[VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).
Florian Hahn [Fri, 30 Oct 2020 14:45:08 +0000 (14:45 +0000)]
[VPlan] Use isa<> instead getVPRecipeID in getFirstNonPhi (NFC).

As per the comment in VPRecipeBase, clients should not rely on
getVPRecipeID, as it may change in the future. It should only be used in
classof implementations. Use isa instead in getFirstNonPhi.

3 years ago[SCEV] SCEVExpander::InsertNoopCastOfTo - reduce scope of pointer type. NFCI.
Simon Pilgrim [Fri, 30 Oct 2020 14:54:52 +0000 (14:54 +0000)]
[SCEV] SCEVExpander::InsertNoopCastOfTo - reduce scope of pointer type. NFCI.

By reducing the scope of the dyn_cast<PointerType> we can make this a cast<PointerType> and avoid clang static analyzer null deference warnings.

3 years ago[MLIR] Use `llvm::is_one_of` in walk templates
Frederik Gossen [Fri, 30 Oct 2020 14:41:37 +0000 (14:41 +0000)]
[MLIR] Use `llvm::is_one_of` in walk templates

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

3 years ago[lit] Ship and bundle license for lit package
serge-sans-paille [Mon, 26 Oct 2020 08:09:25 +0000 (09:09 +0100)]
[lit] Ship and bundle license for lit package

lit is bundled independently from LLVM in at least one location
(https://pypi.org/project/lit/), it's easier to state its license locally.

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

3 years ago[stack-clash] Fix probing of dynamic alloca
serge-sans-paille [Tue, 27 Oct 2020 09:59:42 +0000 (10:59 +0100)]
[stack-clash] Fix probing of dynamic alloca

- Perform the probing in the correct direction.
  Related to https://github.com/rust-lang/rust/pull/77885#issuecomment-711062924

- The first touch on a dynamic alloca cannot use a mov because it clobbers
  existing space. Use a xor 0 instead

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

3 years agoUse cast<> instead of dyn_cast<> as we dereference the pointer immediately. NFCI.
Simon Pilgrim [Fri, 30 Oct 2020 14:27:50 +0000 (14:27 +0000)]
Use cast<> instead of dyn_cast<> as we dereference the pointer immediately. NFCI.

Fix clang static analyzer warning - we know that the arg should be ConstantInt and we're better off relying on cast<> asserting on failure rather than a null dereference crash.

3 years agoBitcodeReader::popValue - pass SmallVectorImpl<> as const reference. NFCI.
Simon Pilgrim [Fri, 30 Oct 2020 12:05:39 +0000 (12:05 +0000)]
BitcodeReader::popValue - pass SmallVectorImpl<> as const reference. NFCI.

Fixes cppcheck warning.

3 years ago[clang] add fexperimental-strict-floating-point to test cases that fail on arm and...
Melanie Blower [Fri, 30 Oct 2020 14:29:37 +0000 (07:29 -0700)]
[clang] add fexperimental-strict-floating-point to test cases that fail on arm and aarch not sure this will work due to commit rG13bfd89c4962

3 years ago[lldb/DWARF] Fix dwo flavour of TestTypeGetModule
Pavel Labath [Fri, 30 Oct 2020 14:18:11 +0000 (15:18 +0100)]
[lldb/DWARF] Fix dwo flavour of TestTypeGetModule

SymbolFileDWARF::GetTypes was not handling dwo correctly. The fix is
simple -- adding a GetNonSkeletonUnit call -- but I've snuck in a small
refactor as well.

3 years agoAddress ABI issues introduced with CXCursor_CXXAddrspaceCastExpr
Marco Antognini [Thu, 29 Oct 2020 10:30:11 +0000 (10:30 +0000)]
Address ABI issues introduced with CXCursor_CXXAddrspaceCastExpr

Revert values in CXCursorKind as they were before
CXCursor_CXXAddrspaceCastExpr was introduced in a6a237f2046a ([OpenCL]
Added addrspace_cast operator in C++ mode., 2020-05-18).

Insert CXCursor_CXXAddrspaceCastExpr after the last expression in
CXCursorKind using the next available value.

Reviewed By: akyrtzi, svenvh

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

3 years ago[NFCI][SCEV] getPtrToIntExpr(): use SCEVRewriteVisitor<> for ptrtoint cast sinking
Roman Lebedev [Fri, 30 Oct 2020 12:34:11 +0000 (15:34 +0300)]
[NFCI][SCEV] getPtrToIntExpr(): use SCEVRewriteVisitor<> for ptrtoint cast sinking

This is functionally-identical to the previous implementation,
just using a generic interface to do that instead of hand-rolled one,
with caching as a bonus. Thought the sinking is still recursive..

Note that SCEVRewriteVisitor<>'s default implementations
don't preserve NoWrap flags on Add/Mul (but does on AddRec!),
but here we know we can preserve them,
so `visitAddExpr()`/`visitMulExpr()` are specialized.

3 years ago[TTI] Add VecPred argument to getCmpSelInstrCost.
Florian Hahn [Fri, 30 Oct 2020 13:48:28 +0000 (13:48 +0000)]
[TTI] Add VecPred argument to getCmpSelInstrCost.

On some targets, like AArch64, vector selects can be efficiently lowered
if the vector condition is a compare with a supported predicate.

This patch adds a new argument to getCmpSelInstrCost, to indicate the
predicate of the feeding select condition. Note that it is not
sufficient to use the context instruction when querying the cost of a
vector select starting from a scalar one, because the condition of the
vector select could be composed of compares with different predicates.

This change greatly improves modeling the costs of certain
compare/select patterns on AArch64.

I am also planning on putting up patches to make use of the new argument in
SLPVectorizer & LV.

Reviewed By: dmgreen, RKSimon

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

3 years agoPR47372: Fix Lambda invoker calling conventions
Erich Keane [Fri, 16 Oct 2020 16:09:09 +0000 (09:09 -0700)]
PR47372: Fix Lambda invoker calling conventions

As mentioned in the defect, the lambda static invoker does not follow
the calling convention of the lambda itself, which seems wrong. This
patch ensures that the calling convention of operator() is passed onto
the invoker and conversion-operator type.

This is accomplished by extracting the calling-convention determination
code out into a separate function in order to better reflect the 'thiscall'
work, as well as somewhat better support the future implementation of
https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623

For any target (basically just win32) that has a different free and
static function calling convention, this generates BOTH alternatives.
This required some work to get the Windows mangler to work correctly for
this, as well as some tie-breaking for the unary operators.

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

3 years ago[MLIR][SPIRV] Start module combiner
ergawy [Fri, 30 Oct 2020 13:18:29 +0000 (09:18 -0400)]
[MLIR][SPIRV] Start module combiner

This commit adds a new library that merges/combines a number of spv
modules into a combined one. The library has a single entry point:
combine(...).

To combine a number of MLIR spv modules, we move all the module-level ops
from all the input modules into one big combined module. To that end, the
combination process can proceed in 2 phases:

  (1) resolving conflicts between pairs of ops from different modules
  (2) deduplicate equivalent ops/sub-ops in the merged module. (TODO)

This patch implements only the first phase.

Reviewed By: antiagainst

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

3 years ago[SVE] Add fatal error for unnamed SVE variadic arguments
David Sherwood [Tue, 27 Oct 2020 13:59:29 +0000 (13:59 +0000)]
[SVE] Add fatal error for unnamed SVE variadic arguments

We don't currently support passing unnamed variadic SVE arguments
so I've added a fatal error if we hit such cases to prevent any
silent ABI issues in future.

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

3 years ago[ARM] Match MVE vqdmulh
David Green [Fri, 30 Oct 2020 13:34:27 +0000 (13:34 +0000)]
[ARM] Match MVE vqdmulh

This adds ISel matching for a form of VQDMULH. There are several ir
patterns that we could match to that instruction, this one is for:

min(ashr(mul(sext(a), sext(b)), 7), 127)

Which is what llvm will optimize to once it has removed the max that
usually makes up the min/max saturate pattern, as in this case the
compare will always be false. The additional complication to match i32
patterns (which extend into an i64) is that the min will be a
vselect/setcc, as vmin is not supported for i64 vectors. Tablegen
patterns have also been updated to attempt to reuse the MVE_TwoOpPattern
patterns.

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

3 years ago[lldb/test] Remove a double debugserver launch in TestGdbRemoteGPacket
Pavel Labath [Fri, 30 Oct 2020 13:24:21 +0000 (14:24 +0100)]
[lldb/test] Remove a double debugserver launch in TestGdbRemoteGPacket

Debug server is already launched by prep_debug_monitor_and_inferior. The
second seems to have been benign so far, but after 8cc49bec2 this test
started failing frequently on GreenDragon, and this is the only unusual
thing about it.

3 years ago[lldb/test] Simplify/generalize YAMLModuleTester
Pavel Labath [Thu, 29 Oct 2020 13:25:24 +0000 (14:25 +0100)]
[lldb/test] Simplify/generalize YAMLModuleTester

The class only supports a single DWARF unit (needed for my new test), and it
reimplements chunks of object and symbol file classes. We can just make it use
the real thing, save some LOC and get the full feature set.

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

3 years ago[libc++] Add a new concept of ConfigAction, and use it in the DSL
Louis Dionne [Thu, 29 Oct 2020 20:02:21 +0000 (16:02 -0400)]
[libc++] Add a new concept of ConfigAction, and use it in the DSL

This will allow adding bare compiler flags through the new
configuration DSL. Previously, this would have required adding
a Lit feature for each such flag.

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

3 years ago[yaml2obj] - Make `Section::Link` field to be `Optional<>`.
Georgii Rymar [Thu, 29 Oct 2020 13:04:45 +0000 (16:04 +0300)]
[yaml2obj] - Make `Section::Link` field to be `Optional<>`.

`Link` is not an optional field currently.
Because of this it is not convenient to write macros.

This makes it optional and fixes corresponding test cases.

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

3 years ago[clang][FPEnv] Diagnose Strict FP pragmas if target does not support StrictFP
Melanie Blower [Wed, 28 Oct 2020 16:23:21 +0000 (09:23 -0700)]
[clang][FPEnv] Diagnose Strict FP pragmas if target does not support StrictFP

Reviewers: sepavloff, kpn, aaron.ballman

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

3 years ago[mlir] Implement lowering to LLVM of async.execute ops with token dependencies
Eugene Zhulenev [Fri, 30 Oct 2020 12:19:42 +0000 (05:19 -0700)]
[mlir] Implement lowering to LLVM of async.execute ops with token dependencies

Add support for lowering `async.execute` operations with token dependencies

Example:

```
%dep = ... : !async.token
%token = async.execute[%dep] {
...
}
```

Token dependencies lowered to `async.await` operations inside the outline coroutine body.

Reviewed By: herhut, mehdi_amini, ftynse

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

3 years ago[AST] Fix traversal over CXXConstructExpr in Syntactic mode
Stephen Kelly [Sun, 21 Jun 2020 12:31:27 +0000 (13:31 +0100)]
[AST] Fix traversal over CXXConstructExpr in Syntactic mode

Summary:
Skip over elidable nodes, and ensure that intermediate
CXXFunctionalCastExpr nodes are also skipped if they are semantic.

Reviewers: klimek, ymandel

Subscribers: cfe-commits

Tags: #clang

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

3 years ago[Aarch64] Fix assumption that Windows implies x86
David Truby [Mon, 26 Oct 2020 14:45:11 +0000 (14:45 +0000)]
[Aarch64] Fix assumption that Windows implies x86

When compiling for Windows on Arm the amd64 debug interfce from the Visual
Studio SDK is used as the cmake currently only distinguishes between x86 and
amd64 by checking the pointer size. Instead we can get the target
architecture for the compilier and check that to distinguish between
architectures.

3 years agoRevert rG22c383763456 "[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseIn...
Simon Pilgrim [Fri, 30 Oct 2020 11:59:21 +0000 (11:59 +0000)]
Revert rG22c383763456 "[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h"

This reverts commit 22c38376345670c1883963e5e1cccd597a15b3a5.

This is causing a build failure with MSVC - reported on D90322

3 years ago[Flang] Fix build failures (NFC)
Andrzej Warzynski [Fri, 30 Oct 2020 11:27:04 +0000 (11:27 +0000)]
[Flang] Fix build failures (NFC)

Some changes introduced in https://reviews.llvm.org/D88655 cause compiler
warnings. Since in Flang warnings are treated as errors (`-Werror` is on by
default), these are in practice compiler errors (verified with clang-10 and
clang-11, gcc-10). This patches fixes these warning/failures.

Warning/error 1:
```
llvm-project/flang/lib/Semantics/check-omp-structure.cpp:107:3: error:
unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
```

Warning/error 2:
```
llvm-project/flang/lib/Semantics/check-directive-structure.h:39:9: error: field
'currentDirective_' will be initialized after field 'upperCaseDirName_'
[-Werror,-Wreorder-ctor]
```

Failing buildbot:
* http://lab.llvm.org:8011/#/builders/33/builds/386

3 years ago[AMDGPU] SILowerControlFlow::removeMBBifRedundant. Refactoring plus fix for the null...
alex-t [Wed, 28 Oct 2020 16:01:02 +0000 (19:01 +0300)]
[AMDGPU] SILowerControlFlow::removeMBBifRedundant. Refactoring plus fix for the null MBB pointer in MF->splice

Detailed description: This change addresses the refactoring adviced by foad. It also contain the fix for the case when getNextNode is null if the successor block is the last in MachineFunction.

Reviewed By: foad

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

3 years ago[clangd] Fix MSVC implicit capture build failure.
Simon Pilgrim [Fri, 30 Oct 2020 11:36:27 +0000 (11:36 +0000)]
[clangd] Fix MSVC implicit capture build failure.

MSVC builds were failing because the constexpr wasn't couldn't be captured by the lamdba.

Fix an implicit double to float truncation warning as well.

3 years ago[SROA] Pass Twine by const reference. NFCI.
Simon Pilgrim [Thu, 29 Oct 2020 17:43:24 +0000 (17:43 +0000)]
[SROA] Pass Twine by const reference. NFCI.

Fixes clang-tidy warnings.

3 years ago[ADT][NFC] Silence some misc-unconventional-assign-operator warnings
Nathan James [Fri, 30 Oct 2020 10:57:25 +0000 (10:57 +0000)]
[ADT][NFC] Silence some misc-unconventional-assign-operator warnings

3 years ago[NFC] Simplify code in IndVars
Max Kazantsev [Fri, 30 Oct 2020 10:37:03 +0000 (17:37 +0700)]
[NFC] Simplify code in IndVars

3 years ago[ARM] Additional MVE VQDMULH tests. NFC
David Green [Fri, 30 Oct 2020 10:20:59 +0000 (10:20 +0000)]
[ARM] Additional MVE VQDMULH tests. NFC

3 years ago[ADT] Add methods to SmallString for efficient concatenation
Nathan James [Fri, 30 Oct 2020 10:07:39 +0000 (10:07 +0000)]
[ADT] Add methods to SmallString for efficient concatenation

A common pattern when using SmallString is to repeatedly call append to build a larger string.
The issue here is the optimizer can't see through this and often has to check there is enough space in the storage for each string you try to append.
This results in lots of conditional branches and potentially multiple calls to grow needing to be emitted if the buffer wasn't large enough.
By taking an initializer_list of StringRefs, SmallString can preallocate the storage it needs for all of the StringRefs which only need to grow one time at most, then use a fast path of copying all the strings into its storage knowing there is guaranteed to be enough capacity.
By using StringRefs, this also means you can append different string like types in one go as they will all be implicitly converted to a StringRef.

Reviewed By: dblaikie

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

3 years ago[mlir] Add lowering for IsBroadcastable to Std dialect.
Tres Popp [Thu, 29 Oct 2020 16:13:26 +0000 (17:13 +0100)]
[mlir] Add lowering for IsBroadcastable to Std dialect.

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

3 years ago[DSE] Remove noop stores after killing stores for a MemoryDef.
Florian Hahn [Fri, 30 Oct 2020 09:32:43 +0000 (09:32 +0000)]
[DSE] Remove noop stores after killing stores for a MemoryDef.

Currently we fail to eliminate some noop stores if there is a kill-able
store between the starting def and the load. This is because we
eliminate noop stores first.

In practice it seems like eliminating noop stores after the main
elimination for a def covers slightly more cases.

This patch improves the number of stores slightly in 2 cases for X86 -O3
-flto

Same hash: 235 (filtered out)
Remaining: 2
Metric: dse.NumRedundantStores

Program                                          base      patch diff
 test-suite...ce/Benchmarks/PAQ8p/paq8p.test     2.00   3.00 50.0%
 test-suite...006/453.povray/453.povray.test    18.00  21.00 16.7%

There might be other phase ordering issues, but it appears that they do
not show up in the test-suite/SPEC2000/SPEC2006. We can always tune the
ordering later.

Partly fixes PR47887.

Reviewed By: asbirlea, zoecarver

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

3 years ago[compiler-rt] Don't include libc++ headers from the source tree in MSAN
Louis Dionne [Wed, 21 Oct 2020 23:14:48 +0000 (16:14 -0700)]
[compiler-rt] Don't include libc++ headers from the source tree in MSAN

We shouldn't be including the libc++ headers from the source tree directly, since those headers are not configured (i.e. they don't use the __config_site) header like they should, which could mean up to ABI differences

Reviewed By: vitalybuka, phosek, ldionne

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

3 years ago[mlir] Add shape.is_broadcastable.
Tres Popp [Thu, 29 Oct 2020 14:32:26 +0000 (15:32 +0100)]
[mlir] Add shape.is_broadcastable.

This op returns a boolean value indicating whether 2 ops are
broadcastable or not. This follows the same logic as the other ops with
broadcast in their names in the shape dialect.

Concretely, shape.is_broadcastable returning true implies that
shape.broadcast will not give an error, and shape.cstr_broadcastable
will not result in an assertion failure. Similarly, false implies an
error or assertion failure.

3 years ago[sanitizer] Use __atomic_load/store() built-ins for generic 32-bit targets
Dmitry Vyukov [Fri, 30 Oct 2020 08:17:46 +0000 (09:17 +0100)]
[sanitizer] Use __atomic_load/store() built-ins for generic 32-bit targets

Simplifies the code and fixes the build on SPARC.
See discussion in: http://lists.llvm.org/pipermail/llvm-dev/2020-October/145937.html

Author: glaubitz (John Paul Adrian Glaubitz)
Reviewed-in: https://reviews.llvm.org/D89940

3 years ago[SCEV] SCEVPtrToIntExpr simplifications
Roman Lebedev [Fri, 30 Oct 2020 06:12:49 +0000 (09:12 +0300)]
[SCEV] SCEVPtrToIntExpr simplifications

If we've got an SCEVPtrToIntExpr(op), where op is not an SCEVUnknown,
we want to sink the SCEVPtrToIntExpr into an operand,
so that the operation is performed on integers,
and eventually we end up with just an `SCEVPtrToIntExpr(SCEVUnknown)`.

Reviewed By: mkazantsev

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

3 years ago[SCEV] Introduce SCEVPtrToIntExpr (PR46786)
Roman Lebedev [Fri, 30 Oct 2020 06:12:17 +0000 (09:12 +0300)]
[SCEV] Introduce SCEVPtrToIntExpr (PR46786)

And use it to model LLVM IR's `ptrtoint` cast.

This is essentially an alternative to D88806, but with no chance for
all the problems it caused due to having the cast as implicit there.
(see rG7ee6c402474a2f5fd21c403e7529f97f6362fdb3)

As we've established by now, there are at least two reasons why we want this:
* It will allow SCEV to actually model the `ptrtoint` casts
  and their operands, instead of treating them as `SCEVUnknown`
* It should help with initial problem of PR46786 - this should eventually allow us
  to not loose pointer-ness of an expression in more cases

As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=46786 | PR46786 ]], in principle,
we could just extend `SCEVUnknown` with a `is ptrtoint` cast, because `ScalarEvolution::getPtrToIntExpr()`
should sink the cast as far down into the expression as possible,
so in the end we should always end up with `SCEVPtrToIntExpr` of `SCEVUnknown`.

But i think that it isn't the best solution, because it doesn't really matter
from memory consumption side - there probably won't be *that* many `SCEVPtrToIntExpr`s
for it to matter, and it allows for much better discoverability.

Reviewed By: mkazantsev

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

3 years ago[mips] Implement add.ps, mul.ps and sub.ps
Michael Roe [Fri, 30 Oct 2020 07:57:22 +0000 (10:57 +0300)]
[mips] Implement add.ps, mul.ps and sub.ps

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

3 years ago[NFC] Fix "ambiguous overload for ‘operator=’"
Vitaly Buka [Fri, 30 Oct 2020 07:36:50 +0000 (00:36 -0700)]
[NFC] Fix "ambiguous overload for ‘operator=’"

From D89768

3 years ago[mlir][ASM] Refactor how attribute/type aliases are specified.
River Riddle [Fri, 30 Oct 2020 07:30:59 +0000 (00:30 -0700)]
[mlir][ASM] Refactor how attribute/type aliases are specified.

Previously they were separated into "instance" and "kind" aliases, and also required that the dialect know ahead of time all of the instances that would have a corresponding alias. This approach was very clunky and not ergonomic to interact with. The new approach is to provide the dialect with an instance  of an attribute/type to provide an alias for, fully replacing the original split approach.

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

3 years ago[NFC] Fix "ambiguous overload for ‘operator=’"
Vitaly Buka [Fri, 30 Oct 2020 07:36:50 +0000 (00:36 -0700)]
[NFC] Fix "ambiguous overload for ‘operator=’"

3 years ago[Coroutine] Properly determine whether an alloca should live on the frame
Xun Li [Fri, 30 Oct 2020 06:54:28 +0000 (23:54 -0700)]
[Coroutine] Properly determine whether an alloca should live on the frame

The existing logic in determining whether an alloca should live on the frame only looks explicit def-use relationships. However a value defined by an alloca may be implicitly needed across suspension points, either because an alias has across-suspension-point def-use relationship, or escaped by store/call/memory intrinsics. To properly handle all these cases, we have to properly visit the alloca pointer up-front. Thie patch extends the exisiting alloca use visitor to determine whether an alloca should live on the frame.

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

3 years ago[llvm-readobj][test][NFC] - Use "--check-prefix" instead of "--check-prefixes".
Georgii Rymar [Fri, 30 Oct 2020 06:50:00 +0000 (09:50 +0300)]
[llvm-readobj][test][NFC] - Use "--check-prefix" instead of "--check-prefixes".

We have the `--check-prefixes` invocation for a single suffix.
It is cleaner to use `--check-prefix` in this case.

3 years ago[NFC] Don't run python binding tests with sanitizers
Vitaly Buka [Fri, 30 Oct 2020 06:46:22 +0000 (23:46 -0700)]
[NFC] Don't run python binding tests with sanitizers

Almost any sanitizer can try to install interceptors.

3 years ago[OpenMP][Docs] Structure and content for the OpenMP documentation
Johannes Doerfert [Tue, 27 Oct 2020 18:16:03 +0000 (13:16 -0500)]
[OpenMP][Docs] Structure and content for the OpenMP documentation

This adds some initial content as well as structure to the new OpenMP
Sphinx documentation hosted at http://openmp.llvm.org/docs/ .

The content contains some useful links but most pages are still empty.

This uses a "custom" theme which is a copy of the default "agogo" one
with minor modifications to get a nicer table of content in the sidebar.
This way we can also adjust the theme as we go.

Reviewed By: jhuber6, JonChesterfield

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

3 years ago[OpenMP][NFC] Clang format ParseOpenMP
Johannes Doerfert [Thu, 29 Oct 2020 23:44:28 +0000 (18:44 -0500)]
[OpenMP][NFC] Clang format ParseOpenMP

ParseOpenMP.cpp was pretty much clang-formatted except a few minor
locations. Let's make it a clang formatted file.

Reviewed By: JonChesterfield

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

3 years ago[MC] Fix an assert in MCAssembler::writeSectionData to be aware of errors
Fangrui Song [Fri, 30 Oct 2020 06:09:57 +0000 (23:09 -0700)]
[MC] Fix an assert in MCAssembler::writeSectionData to be aware of errors

If MCContext has an error, MCAssembler::layout may stop early
and some MCFragment's may not finalize.

In the Linux kernel, arch/x86/lib/memcpy_64.S could trigger the assert before
"x86_64: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S"

3 years ago[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.
sameeran joshi [Fri, 30 Oct 2020 04:50:05 +0000 (10:20 +0530)]
[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.

From below mentioned standard references
OpenACC 3.0 Standards document
840 • A program may not branch into or out of an OpenACC parallel construct

OpenMP 5.0 Standards document
A program that branches into or out of a parallel region is non-conforming.

This patch
Resolves the issue of exit out of a parallel region, other branching out issues like goto statements are not handled with this patch.
Moves code from D87906 to be reused by other OpenMP/OpenACC to check-directive-structure.h.
Adds support in OpenMP parallel construct and a test case to verify.

Reviewed By: clementval

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

3 years ago[NFC] Don't run clang/bindings/python/tests with msan
Vitaly Buka [Fri, 30 Oct 2020 01:13:23 +0000 (18:13 -0700)]
[NFC] Don't run clang/bindings/python/tests with msan

Fixes check-all with LLVM_USE_SANITIZER=Memory

3 years agoFix "incorrect" assertions in Linalg/EDSC/Builders.cpp (NFC)
Mehdi Amini [Fri, 30 Oct 2020 05:16:59 +0000 (05:16 +0000)]
Fix "incorrect" assertions in Linalg/EDSC/Builders.cpp (NFC)

It is semantically equivalent, but the intent was really lost there.
This fixes a warning/error from MSVC as well, see PR48013

3 years ago[test] Fix unused check prefixes in test/Linker/ and test/Other/
Fangrui Song [Fri, 30 Oct 2020 04:54:45 +0000 (21:54 -0700)]
[test] Fix unused check prefixes in test/Linker/ and test/Other/

3 years agoFix shared build.
Michael Liao [Fri, 30 Oct 2020 04:44:42 +0000 (00:44 -0400)]
Fix shared build.

3 years ago[RISCV] Fix unused check prefixes in test/MC/RISCV/
Fangrui Song [Fri, 30 Oct 2020 04:18:00 +0000 (21:18 -0700)]
[RISCV] Fix unused check prefixes in test/MC/RISCV/

3 years ago[llvm] Export LLVM_LIT_ARGS in LLVMConfig.cmake
Jonas Devlieghere [Fri, 30 Oct 2020 03:24:37 +0000 (20:24 -0700)]
[llvm] Export LLVM_LIT_ARGS in LLVMConfig.cmake

Allow standalone builds to inherit the LLVM_LIT_ARGS.

3 years ago[MC] Add SMLoc to MCStreamer::emitSymbolAttribute and report changed binding warnings...
Fangrui Song [Fri, 30 Oct 2020 02:41:59 +0000 (19:41 -0700)]
[MC] Add SMLoc to MCStreamer::emitSymbolAttribute and report changed binding warnings/errors for ELF

3 years ago[gn build] Port 00090a2b826
LLVM GN Syncbot [Fri, 30 Oct 2020 02:36:24 +0000 (02:36 +0000)]
[gn build] Port 00090a2b826

3 years agoSupport complex target features combinations
Liu, Chen3 [Sat, 10 Oct 2020 10:42:05 +0000 (18:42 +0800)]
Support complex target features combinations

This patch is mainly doing two things:

1. Adding support for parentheses, making the combination of target features
   more diverse;
2. Making the priority of ’,‘ is higher than that of '|' by default. So I need
   to make some change with PTX Builtin function.

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

3 years ago[lldb] XFAIL TestTypeGetModule.py (temporarily)
Jonas Devlieghere [Fri, 30 Oct 2020 01:37:44 +0000 (18:37 -0700)]
[lldb] XFAIL TestTypeGetModule.py (temporarily)

Temporarily XFAIL'ing TestTypeGetModule.py while the DWO failure is
being investigated.

3 years ago[lldb] Update TestTypeGetModule.py
Ilya Bukonkin [Fri, 30 Oct 2020 01:27:47 +0000 (18:27 -0700)]
[lldb] Update TestTypeGetModule.py

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

3 years ago[PruneEH] Pin tests to legacy PM
Arthur Eubanks [Fri, 23 Oct 2020 05:26:21 +0000 (22:26 -0700)]
[PruneEH] Pin tests to legacy PM

prune-eh will not be ported to the NPM. Instead, a combination of
function-attrs and simplifycfg should be used (as described in
https://reviews.llvm.org/D44415).

This pins most tests using -prune-eh to the legacy PM. Some of these
were testing legacy PM infra (mostly the CGPassManager). Some of these
can be tested in the NPM using function-attrs and simplifycfg.

One interesting case is simplenoreturntest.ll. function-attrs +
simplifycfg does not yet make a caller of a caller of a noreturn
function end with unreachable like prune-eh does. That can be added in
the future.

Reviewed By: asbirlea

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

3 years ago[AA] Pass query info.
Alina Sbirlea [Fri, 30 Oct 2020 00:55:07 +0000 (17:55 -0700)]
[AA] Pass query info.

Pass AAQI in places where it was missed.

Part of D89991.
Author: haoranxu510 (Haoran Xu)

3 years ago[dwarfdump] Recognize __apple sections as debug info sections
Jonas Devlieghere [Fri, 30 Oct 2020 00:48:21 +0000 (17:48 -0700)]
[dwarfdump] Recognize __apple sections as debug info sections

Recognize the __apple_ sections as debug info sections and make sure
they're included in the --show-sections-sizes output.

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

3 years ago[llvm-readobj][NFC] Remove unused prefix from FileCheck tests
Keith Smiley [Fri, 30 Oct 2020 00:47:26 +0000 (17:47 -0700)]
[llvm-readobj][NFC] Remove unused prefix from FileCheck tests

This is to enable --allow-unused-duplicates=false. This prefix appears
to be outdated and intentionally unused.

Reviewed By: rupprecht

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

3 years agoAdd InsertionPoint and context managers to the Python API.
Stella Laurenzo [Thu, 29 Oct 2020 06:16:36 +0000 (23:16 -0700)]
Add InsertionPoint and context managers to the Python API.

* Removes index based insertion. All insertion now happens through the insertion point.
* Introduces thread local context managers for implicit creation relative to an insertion point.
* Introduces (but does not yet use) binding the Context to the thread local context stack. Intent is to refactor all methods to take context optionally and have them use the default if available.
* Adds C APIs for mlirOperationGetParentOperation(), mlirOperationGetBlock() and mlirBlockGetTerminator().
* Removes an assert in PyOperation creation that was incorrectly constraining. There is already a TODO to rework the keepAlive field that it was guarding and without the assert, it is no worse than the current state.

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

3 years ago[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files
Wouter van Oortmerssen [Mon, 26 Oct 2020 21:38:09 +0000 (14:38 -0700)]
[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files

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

3 years agoclang-tidy: Make tests more hermetic
Nico Weber [Fri, 30 Oct 2020 00:12:50 +0000 (20:12 -0400)]
clang-tidy: Make tests more hermetic

Make check_clang_tidy.py not just pass -format-style=none by default
but a full -config={}. Without this, with a build dir outside of
the llvm root dir and a .clang-tidy config further up that contains

  CheckOptions:
    - key:          modernize-use-default-member-init.UseAssignment
      value:        1

these tests would fail:

   Clang Tools :: clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-modernize-use-default-member-init.cpp
   Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init-bitfield.cpp
   Clang Tools :: clang-tidy/checkers/modernize-use-default-member-init.cpp

After this change, they pass fine, despite the unrelated
.clang-tidy file further up.

3 years ago[Hexagon] Handle additional shuffles that can be made perfect
Krzysztof Parzyszek [Thu, 29 Oct 2020 21:09:46 +0000 (16:09 -0500)]
[Hexagon] Handle additional shuffles that can be made perfect

3 years agoThis is a preliminary version of the test for https://reviews.llvm.org/D88483.
Jim Ingham [Thu, 29 Oct 2020 23:37:34 +0000 (16:37 -0700)]
This is a preliminary version of the test for https://reviews.llvm.org/D88483.

The test can be cleaned up a bit, but this should be good to see why the
Debian bot is failing...

3 years agoThread safety analysis: Consider static class members as inaccessible
Aaron Puchert [Thu, 29 Oct 2020 23:35:14 +0000 (00:35 +0100)]
Thread safety analysis: Consider static class members as inaccessible

This fixes the issue pointed out in D84604#2363134. For now we exclude
static members completely, we'll take them into account later.

3 years ago[NFC] Fix typo function -> module
Arthur Eubanks [Thu, 29 Oct 2020 23:10:17 +0000 (16:10 -0700)]
[NFC] Fix typo function -> module

3 years ago[NFC][AMDGPU] Resize Memory Model columns in AMDGPUUsage.rst
Scott Linder [Thu, 29 Oct 2020 21:45:46 +0000 (21:45 +0000)]
[NFC][AMDGPU] Resize Memory Model columns in AMDGPUUsage.rst

Make all of the "AMDGPU Machine Code GFX*" columns in the Memory Model
table a consistent width of 32-characters.

Best viewed with something like --word-diff

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

3 years ago[AMDGPU] Update Memory Model in AMDGPUUsage.rst
Scott Linder [Thu, 22 Oct 2020 16:42:05 +0000 (16:42 +0000)]
[AMDGPU] Update Memory Model in AMDGPUUsage.rst

Mostly NFC, but some changes are "bug fixes" rather than just e.g.
formatting changes or typo corrections.

- Fix typo "competing" -> "completing".
- Document why waintcnt is added to stores and not loads for
  sequentially consistent ordering.
- Lowercase some mentions of `buffer_gl{0,1}_inv`.
- Make mentions of `*cnt(0)` consistently include the `(0)` count.
- Remove some mentions of instructions for incorrect address spaces. For
  example, remove mention of `flat_load` from
  `load atomic acquire workgroup global`.
- Re-flow some text to get all the target columns to fit in a
  32-character wide column. Makes a future NFC patch to make these columns
  both 32-character wide more straightforward.

Modified cherry-pick of patch by Tony Tye

Reviewed By: t-tye

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

3 years ago[GWP-ASan] Add mutexes for Fuchsia
Kostya Kortchinsky [Wed, 28 Oct 2020 23:04:02 +0000 (16:04 -0700)]
[GWP-ASan] Add mutexes for Fuchsia

Mitch expressed a preference to not have `#ifdef`s in platform agnostic
code, this change tries to accomodate this.

I am not attached to the method this CL proposes, so if anyone has a
suggestion, I am open.

We move the platform specific member of the mutex into its own platform
specific class that the main `Mutex` class inherits from. Functions are
implemented in their respective platform specific compilation units.

For Fuchsia, we use the sync APIs, as those are also the ones being
used in Scudo.

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

3 years ago[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in complex wrapper headers.
Joachim Meyer [Thu, 29 Oct 2020 18:45:49 +0000 (19:45 +0100)]
[OpenMP] Use __OPENMP_NVPTX__ instead of _OPENMP in complex wrapper headers.

This is very similar to 7f1e6fcff942, just fixing a left-over.
With this, it should be possible to use both, -x cuda and -fopenmp in the same invocation,
enabling to use both OpenMP, targeting CPU, and CUDA, targeting the GPU.

Reviewed By: jdoerfert

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

3 years agoProvide a reasonable value for PATH_MAX if the lldb headers don't provide it.
Jim Ingham [Thu, 29 Oct 2020 22:02:51 +0000 (15:02 -0700)]
Provide a reasonable value for PATH_MAX if the lldb headers don't provide it.

3 years ago[mlir][vector] Improve vector distribute integration test and fix block distribution
Thomas Raoux [Thu, 29 Oct 2020 21:28:01 +0000 (14:28 -0700)]
[mlir][vector] Improve vector distribute integration test and fix block distribution

Fix semantic in the distribute integration test based on offline feedback. This
exposed a bug in block distribution, we need to make sure the id is multiplied
by the stride of the vector. Fix the transformation and unit test.

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

3 years ago[RISCV] Improve worklist management in the DAG combine for SLLW/SRLW/SRAW
Craig Topper [Thu, 29 Oct 2020 21:16:12 +0000 (14:16 -0700)]
[RISCV] Improve worklist management in the DAG combine for SLLW/SRLW/SRAW

This combine makes two calls to SimplifyDemandedBits, one for the LHS and one
for the RHS. If the LHS call returns true, we don't make the RHS call. When
SimplifyDemandedBits makes a change, it will add the nodes around the change to
the DAG combiner worklist. If the simplification happens on the first recursion
step, the N will get added to the worklist. But if the simplification happens
deeper in the recursion, then N will not be revisited until the next time the
DAG combiner runs.

This patch explicitly addes N to the worklist anytime a Simplification is made.
Without this we might miss additional simplifications on the LHS or never
simplify the RHS. Special care also needs to be taken to not add N if it has
been CSEd by the simplification. There are similar examples in DAGCombiner and
the X86 target, but I don't have a test for it for RISC-V. I've also returned
SDValue(N, 0) instead of SDValue() so DAGCombiner knows a change was made and
will update its Statistic variable.

The test here was constructed so that 2 simplifications happen to the LHS.
Without this fix one happens in the post type legalization DAG combine and the
other happens after LegalizeDAG. This prevents the RHS from ever being
simplified causing the left and right shift to clear the upper 32 bits of the
RHS to be left behind.

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

3 years ago[RISCV] Add test case for D90339
Craig Topper [Thu, 29 Oct 2020 21:15:37 +0000 (14:15 -0700)]
[RISCV] Add test case for D90339

3 years agoUse !hasLocalLinkage instead of listing the symbol types
Jim Ingham [Thu, 29 Oct 2020 21:43:03 +0000 (14:43 -0700)]
Use !hasLocalLinkage instead of listing the symbol types
we should be exporting one by one.

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

3 years agoMark the execution of stop-hooks as non-interactive.
Jim Ingham [Wed, 28 Oct 2020 18:58:25 +0000 (11:58 -0700)]
Mark the execution of stop-hooks as non-interactive.

The intention is not to allow stop-hook commands to query the
user, so this is correct.  It also works around a deadlock in
switching to the Python Session to execute python based commands
in the stop hook when the Debugger stdin is backed by a FILE *.

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

3 years ago[mlir][gpu] Add pass to make GPU ops within a region execute asynchronously.
Christian Sigg [Thu, 29 Oct 2020 17:13:01 +0000 (18:13 +0100)]
[mlir][gpu] Add pass to make GPU ops within a region execute asynchronously.

Do not use the pass yet, except in a test.

Reviewed By: herhut

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

3 years ago[mlir][gpu] Handle async in gpu.launch_func lowering.
Christian Sigg [Thu, 29 Oct 2020 16:58:48 +0000 (17:58 +0100)]
[mlir][gpu] Handle async in gpu.launch_func lowering.

For the synchronous case, destroy the stream after synchronization.

Sneak in a unrelated change to report why the gpu.wait conversion pattern didn't match.

Reviewed By: herhut

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

3 years ago[SDAG] Extract helper to determine neutral element (NFC)
Nikita Popov [Thu, 29 Oct 2020 20:59:58 +0000 (21:59 +0100)]
[SDAG] Extract helper to determine neutral element (NFC)

Make the existing VECREDUCE based code more generic, but expressing
it in terms of the neutral value of the base opcode instead.

3 years ago[LCSSA] Doc for special treatment of PHIs
Stefanos Baziotis [Thu, 29 Oct 2020 20:50:07 +0000 (22:50 +0200)]
[LCSSA] Doc for special treatment of PHIs

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

3 years ago[mlir][gpu] Allow gpu.launch_func to be async.
Christian Sigg [Thu, 22 Oct 2020 05:49:50 +0000 (07:49 +0200)]
[mlir][gpu] Allow gpu.launch_func to be async.

This is a roll-forward of rGec7780ebdab4, now that the remaining
gpu.launch_func have been converted to custom form in rGb22f111023ba.

Reviewed By: antiagainst

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

3 years ago[LoopUtils] Fix neutral value for vector.reduce.fadd
Nikita Popov [Thu, 29 Oct 2020 20:41:58 +0000 (21:41 +0100)]
[LoopUtils] Fix neutral value for vector.reduce.fadd

Use -0.0 instead of 0.0 as the start value. The previous use of 0.0
was fine for all existing uses of this function though, as it is
always generated with fast flags right now, and thus nsz.

3 years agoGetModule, GetExeModule methods added
Ilya Bukonkin [Tue, 29 Sep 2020 12:51:49 +0000 (15:51 +0300)]
GetModule, GetExeModule methods added

3 years ago[SLP] Consider alternatives for cost of select instructions.
Florian Hahn [Thu, 29 Oct 2020 19:46:34 +0000 (19:46 +0000)]
[SLP] Consider alternatives for cost of select instructions.

Some architectures do not have general vector select instructions (e.g.
AArch64). But some cmp/select patterns can be vectorized using other
instructions/intrinsics.

One example is using min/max instructions for certain patterns.

This patch updates the cost calculations for selects in the SLP
vectorizer to consider using min/max intrinsics.

This patch does not change SLP vectorizer's codegen itself to actually
generate those intrinsics, but relies on the backends to lower the
vector cmps & selects. This keeps things simple on the SLP side and
works well in practice for AArch64.

This exposes additional SLP vectorization opportunities in some
benchmarks on AArch64 (-O3 -flto).

Metric: SLP.NumVectorInstructions

Program                                        base    slp     diff
 test-suite...ications/JM/ldecod/ldecod.test   502.00  697.00  38.8%
 test-suite...ications/JM/lencod/lencod.test   1023.00 1414.00 38.2%
 test-suite...-typeset/consumer-typeset.test    56.00   65.00  16.1%
 test-suite...6/464.h264ref/464.h264ref.test   804.00  822.00   2.2%
 test-suite...006/453.povray/453.povray.test   3335.00 3357.00  0.7%
 test-suite...CFP2000/177.mesa/177.mesa.test   2110.00 2121.00  0.5%
 test-suite...:: External/Povray/povray.test   2378.00 2382.00  0.2%

Reviewed By: RKSimon, samparker

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

3 years ago[WebAssembly] Remove unused FileCheck test prefixes
Thomas Lively [Thu, 29 Oct 2020 20:37:55 +0000 (13:37 -0700)]
[WebAssembly] Remove unused FileCheck test prefixes

This commit removes unused FileCheck prefixes from WebAssembly test files to
avoid causing test failures once FileCheck disallows unused prefixes by default.
See D90281 and the corresponding llvm-dev thread for context.

Reviewed By: aardappel

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

3 years ago[SDAG] Fix neutral value for vecreduce_fadd
Nikita Popov [Thu, 29 Oct 2020 20:27:59 +0000 (21:27 +0100)]
[SDAG] Fix neutral value for vecreduce_fadd

The neutral value for FADD is -0.0, not 0.0, so this is what we
need to pad vectors with.