platform/upstream/llvm.git
3 years ago[ImplicitNullChecks] NFC: Refactor dependence safety check
Anna Thomas [Wed, 2 Sep 2020 14:19:10 +0000 (10:19 -0400)]
[ImplicitNullChecks] NFC: Refactor dependence safety check

After computing dependence, we check if it is safe to hoist by
identifying if it clobbers any liveIns in the sibling block (NullSucc).
This check is moved to its own function which will be used in the
soon-to-be modified dependence checking algorithm for implicit null
checks pass.

Tests-Run: lit tests on X86/implicit-*

3 years ago[ImplicitNullChecks] NFC: Separated out checks and added comments
Anna Thomas [Wed, 2 Sep 2020 14:06:27 +0000 (10:06 -0400)]
[ImplicitNullChecks] NFC: Separated out checks and added comments

Separated out some checks in isSuitableMemoryOp and added comments
explaining why some of those checks are done.

Tests-Run:X86 implicit null checks tests.

3 years ago[libc++] Make some testing utilities constexpr
Louis Dionne [Tue, 1 Sep 2020 21:13:24 +0000 (17:13 -0400)]
[libc++] Make some testing utilities constexpr

This will be needed in order to test constexpr std::vector.

3 years agoRevert "[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks"
Lei Zhang [Wed, 2 Sep 2020 13:24:36 +0000 (09:24 -0400)]
Revert "[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks"

This reverts commit 94f5d248772ba0f1f9c8b0746fe75a5d246c5540 because
of failing the following tests:

MLIR :: Dialect/Linalg/tensors-to-buffers.mlir
MLIR :: Transforms/buffer-placement-preparation-allowed-memref-results.mlir
MLIR :: Transforms/buffer-placement-preparation.mlir

3 years ago[GlobalOpt] Fix an incorrect Modified status
David Stenberg [Wed, 2 Sep 2020 06:46:53 +0000 (08:46 +0200)]
[GlobalOpt] Fix an incorrect Modified status

When marking a global variable constant, and simplifying users using
CleanupConstantGlobalUsers(), the pass could incorrectly return false if
there were still some uses left, and no further optimizations was done.

This was caught using the check introduced by D80916.

This fixes PR46749.

Reviewed By: fhahn

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

3 years ago[mlir][VectorToSCF] 128 byte alignment of alloc ops
Jakub Lichman [Wed, 26 Aug 2020 16:41:04 +0000 (16:41 +0000)]
[mlir][VectorToSCF] 128 byte alignment of alloc ops

Added 128 byte alignment to alloc ops created in VectorToSCF pass.
128b alignment was already introduced to this pass but not to all alloc
ops. This commit changes that by adding 128b alignment to the remaining ops.
The point of specifying alignment is to prevent possible memory alignment errors
on weakly tested architectures.

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

3 years ago[InstCombine] Transform 1.0/sqrt(X) * X to X/sqrt(X)
Venkataramanan Kumar [Wed, 2 Sep 2020 12:23:48 +0000 (08:23 -0400)]
[InstCombine] Transform 1.0/sqrt(X) * X to X/sqrt(X)

These transforms will now be performed irrespective of the number of uses for the expression "1.0/sqrt(X)":
1.0/sqrt(X) * X => X/sqrt(X)
X * 1.0/sqrt(X) => X/sqrt(X)

We already handle more general cases, and we are intentionally not creating extra (and likely expensive)
fdiv ops in IR. This pattern is the exception to the rule because we always expect the Backend to reduce
X/sqrt(X) to sqrt(X), if it has the necessary (reassoc) fast-math-flags.

Ref: DagCombiner optimizes the X/sqrt(X) to sqrt(X).

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

3 years ago[VectorCombine] allow vector loads with mismatched insert type
Sanjay Patel [Wed, 2 Sep 2020 12:09:24 +0000 (08:09 -0400)]
[VectorCombine] allow vector loads with mismatched insert type

This is an enhancement to D81766 to allow loading the minimum target
vector type into an IR vector with a different number of elements.

In one of the motivating tests from PR16739, SLP creates <2 x float>
load ops mixed with <4 x float> insert ops, so we want to handle that
pattern in addition to potential oversized vectors created by the
vectorizers.

For now, we are assuming the insert/extract subvector with undef is
free because there is no exact corresponding TTI modeling for that.

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

3 years agoMove all fields of '-cc1' option related classes into def file databases
Daniel Grumberg [Wed, 19 Aug 2020 15:16:43 +0000 (16:16 +0100)]
Move all fields of '-cc1' option related classes into def file databases

Once the new option parsing system is committed, this will allow to generate a
check to ensure that correct command line generation happens

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

3 years ago[Test] Simplify test by removing unneeded variable
Max Kazantsev [Wed, 2 Sep 2020 11:26:11 +0000 (18:26 +0700)]
[Test] Simplify test by removing unneeded variable

3 years ago[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks
Ehsan Toosi [Fri, 31 Jul 2020 13:20:37 +0000 (15:20 +0200)]
[mlir] Extend BufferAssignmentTypeConverter with result conversion callbacks

In this PR, the users of BufferPlacement can configure
BufferAssginmentTypeConverter. These new configurations would give the user more
freedom in the process of converting function signature, and return and call
operation conversions.

These are the new features:
    - Accepting callback functions for decomposing types (i.e. 1 to N type
    conversion such as unpacking tuple types).
    - Defining ResultConversionKind for specifying whether a function result
    with a certain type should be appended to the function arguments list or
    should be kept as function result. (Usage:
    converter.setResultConversionKind<MemRefType>(AppendToArgumentList))
    - Accepting callback functions for composing or decomposing values (i.e. N
    to 1 and 1 to N value conversion).

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

3 years ago[SVE] Don't reorder subvector/binop sequences when the resulting binop is not legal.
Paul Walker [Fri, 21 Aug 2020 12:38:55 +0000 (13:38 +0100)]
[SVE] Don't reorder subvector/binop sequences when the resulting binop is not legal.

When lowering fixed length vector operations for SVE the subvector
operations are used extensively to marshall data between scalable
and fixed-length vectors. This means that sequences like:

  extract_subvec(binop(insert_subvec(a), insert_subvec(b)))

are very common. DAGCombine only checks if the resulting binop is
legal or can be custom lowered when undoing such sequences. When
it's custom lowering that is introducing them the result is an
infinite legalise->combine->legalise loop.

This patch extends the isOperationLegalOr... functions to include
a "LegalOnly" parameter to restrict the check to legal operations
only. Although isOperationLegal could be used it's common for
the affected code paths to be visited pre and post legalisation,
so the extra parameter keeps the code tidy.

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

3 years ago[AMDGPU] Fix offset for REL32_HI relocs
Jay Foad [Tue, 1 Sep 2020 13:52:01 +0000 (14:52 +0100)]
[AMDGPU] Fix offset for REL32_HI relocs

The addend in a REL32 reloc needs to be adjusted to account for the
offset from the PC value returned by the s_getpc instruction to the
point where the reloc is applied. This was being done correctly for
(GOTPC)REL32_LO but not for (GOTPC)REL32_HI. This will only make a
difference if the target symbol happens to get loaded almost exactly
a multiple of 4G away from the relocated instructions.

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

3 years ago[AArch64][SVE] Preserve full vector regs over EH edge.
Sander de Smalen [Wed, 2 Sep 2020 09:12:27 +0000 (10:12 +0100)]
[AArch64][SVE] Preserve full vector regs over EH edge.

Unwinders may only preserve the lower 64bits of Neon and SVE registers,
as only the registers in the base ABI are guaranteed to be preserved
over the exception edge. The caller will need to preserve additional
registers for when the call throws an exception and the unwinder has
tried to recover state.

For  e.g.

    svint32_t bar(svint32_t);
    svint32_t foo(svint32_t x, bool *err) {
      try { bar(x); } catch (...) { *err = true; }
      return x;
    }

`z0` needs to be spilled before the call to `bar(x)` and reloaded before
returning from foo, as the exception handler may have clobbered z0.

Reviewed By: efriedma

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

3 years ago[DebugInfo] Emit a 1-byte value as a terminator of entries list in the name index.
Igor Kudrin [Wed, 2 Sep 2020 09:12:39 +0000 (16:12 +0700)]
[DebugInfo] Emit a 1-byte value as a terminator of entries list in the name index.

As stated in section 6.1.1.2, DWARFv5, p. 142,
| The last entry for each name is followed by a zero byte that
| terminates the list. There may be gaps between the lists.

The patch changes emitting a 4-byte zero value to a 1-byte one, which
effectively removes the gap between entry lists, and thus saves
approximately 3 bytes per name; the calculation is not exact because
the total size of the table is aligned to 4.

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

3 years ago[DebugInfo] Remove Dwarf5AccelTableWriter::Header::UnitLength. NFC.
Igor Kudrin [Wed, 2 Sep 2020 09:08:25 +0000 (16:08 +0700)]
[DebugInfo] Remove Dwarf5AccelTableWriter::Header::UnitLength. NFC.

The member is not in use; the unit length for the table is emitted as
a difference between two labels. Moreover, the type of the member might
be misleading, because for DWARF64 the field should be 64 bit long.

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

3 years ago[X86] Remove superfluous trailing semicolons, fixing warnings. NFC.
Martin Storsjö [Wed, 2 Sep 2020 08:43:01 +0000 (11:43 +0300)]
[X86] Remove superfluous trailing semicolons, fixing warnings. NFC.

3 years ago[mlir][VectorOps] Fail fast when a strided memref is passed to vector_transfer
Benjamin Kramer [Tue, 1 Sep 2020 15:21:27 +0000 (17:21 +0200)]
[mlir][VectorOps] Fail fast when a strided memref is passed to vector_transfer

Otherwise we'll silently miscompile things.

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

3 years ago[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add general shuffle combining...
Simon Pilgrim [Wed, 2 Sep 2020 08:24:46 +0000 (09:24 +0100)]
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add general shuffle combining support

This patch uses partial DemandedElts masks to further simplify target shuffle chains and finally starts making target shuffle combining part of SimplifyDemandedBits/SimplifyDemandedVectorElts.

We already manage this for Depth == 0 cases, where combineX86ShuffleChain would early-out if the shuffle combined to the same op, but the patch generalizes this by manipulating the depth handling of combineX86ShufflesRecursively - calling with a new Depth = 0 and reducing the maximum shuffle combine depth accordingly.

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

3 years agoRevert "[libc++] Workaround timespec_get not always being available in Apple SDKs"
Raphael Isemann [Wed, 2 Sep 2020 07:25:31 +0000 (09:25 +0200)]
Revert "[libc++] Workaround timespec_get not always being available in Apple SDKs"

This reverts commit 99f3b231cb21abc567c93813650cd76cfa614325. It breaks
libcxx/modules/stds_include.sh.cpp on macOS as the new include to sys/cdefs.h
causes a dependency from __config to the Darwin module (which already has
a dependency on __config). This cyclic dependency breaks compiling the std
module which breaks compiling pretty much every program with ToT libc++ and
enabled modules.

I'll revert for now to get the bots green again. Sorry for the inconvenience.

3 years ago[Attributor] Make use of AANoUndef in AAUndefinedBehavior
Shinji Okumura [Wed, 2 Sep 2020 07:08:03 +0000 (16:08 +0900)]
[Attributor] Make use of AANoUndef in AAUndefinedBehavior

This patch makes it possible for AAUB to use information from AANoUndef.
This is the next patch of D86983

Reviewed By: jdoerfert

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

3 years ago[Attributor] Fix AANoUndef initialization
Shinji Okumura [Wed, 2 Sep 2020 06:40:43 +0000 (15:40 +0900)]
[Attributor] Fix AANoUndef initialization

When the associated value is undef, we immediately forced to indicate a pessimistic fixpoint so far.
This patch changes the initialization to check the attribute given in IR at first and to indicate an optimistic fixpoint when it is given.
This change will enable us to catch , for example, the following case in AAUB.
```
call void @foo(i32 noundef undef)
```

Reviewed By: jdoerfert

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

3 years ago[mlir] Add Complex Type, Vector Type and Tuple Type subclasses to python bindings
ZHANG Hongbin [Wed, 2 Sep 2020 04:40:28 +0000 (04:40 +0000)]
[mlir] Add Complex Type, Vector Type and Tuple Type subclasses to python bindings

Based on the PyType and PyConcreteType classes, this patch implements the bindings of Complex Type, Vector Type and Tuple Type subclasses.
For the convenience of type checking, this patch defines a `mlirTypeIsAIntegerOrFloat` function to check whether the given type is an integer or float type.
These three subclasses in this patch have similar binding strategy:
- The function pointer `isaFunction` points to `mlirTypeIsA***`.
- The `mlir***TypeGet` C API is bound with the `get_***` method in the python side.
- The Complex Type and Vector Type check whether the given type is an integer or float type.

Reviewed By: mehdi_amini

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

3 years ago[RFC][Target] Add a new triple called Triple::csky
Zi Xuan Wu [Wed, 2 Sep 2020 04:41:38 +0000 (12:41 +0800)]
[RFC][Target] Add a new triple called Triple::csky

Before upstream a new target called CSKY, make a new triple of that called Triple::csky.
For now, it's a 32-bit little endian target and the detail can be referred at D86269.

This is the split part of D86269, which add a new target called CSKY.

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

3 years ago[CMake] Remove -Wl,-allow-shlib-undefined which was added in rL221530
Fangrui Song [Sat, 29 Aug 2020 19:19:34 +0000 (12:19 -0700)]
[CMake] Remove -Wl,-allow-shlib-undefined which was added in rL221530

In GNU ld, gold and LLD, --no-allow-shlib-undefined is the default when
linking an executable. The option disallows unresolved symbols in shared objects.
(gold and LLD catch fewer cases than GNU ld. See D57385 for details)
See D57569 why it is bad idea to use --allow-shlib-undefined for executables [a].

GNU ld traditionally copied DT_NEEDED entries transitively. This was
deemed not good, so GNU ld 2.22 defaulted to --no-copy-dt-needed-entries.
gold and LLD always behave like --no-copy-dt-needed-entries.
rL221530 added -Wl,-allow-shlib-undefined to make some old releases of GNU ld's
--no-copy-dt-needed-entries to actually work.

Due to [a] and [b], this patch drops -Wl,-allow-shlib-undefined.

[b]: In a -DBUILD_SHARED_LIBS=on build, `--as-needed --allow-shlib-undefined`
can unexpectedly suppress some .dynsym entries.  The issue can cause
mlir-cpu-runner to fail at runtime. Note, on Debian, gcc newer than (gcc-9-20190125-2) enable
--as-needed by default.
See https://sourceware.org/bugzilla/show_bug.cgi?id=26551 for a reduced example.

Reviewed By: mehdi_amini, echristo

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

3 years ago[ORC] Remove stray debugging output.
Lang Hames [Wed, 2 Sep 2020 03:53:28 +0000 (20:53 -0700)]
[ORC] Remove stray debugging output.

3 years agoFix build-bots.
Alina Sbirlea [Wed, 2 Sep 2020 03:20:56 +0000 (20:20 -0700)]
Fix build-bots.

BasicAA can be freed (and it is not recomputed).

3 years ago[ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
Lang Hames [Wed, 2 Sep 2020 03:00:21 +0000 (20:00 -0700)]
[ORC] Add an early out for MachOPlatform's init-scraper plugin setup.

If there's no initializer symbol in the current MaterializationResponsibility
then bail out without installing JITLink passes: they're going to be no-ops
anyway.

3 years ago[ORC] Fix MachOPlatform's synthetic symbol dependence registration.
Lang Hames [Wed, 2 Sep 2020 02:55:19 +0000 (19:55 -0700)]
[ORC] Fix MachOPlatform's synthetic symbol dependence registration.

A think-o in the existing code meant that dependencies were never registered.
This failure could lead to crashes rather than orderly error propagation if
initialization dependencies failed to materialize.

No test case: The bug was discovered in an out-of-tree code and requires
pathalogically misconfigured JIT to generate the original error that lead to
the crash.

3 years agoRevert switch based variant temporarily.
Eric Fiselier [Wed, 2 Sep 2020 02:15:33 +0000 (22:15 -0400)]
Revert switch based variant temporarily.

There are currently some failures caused by this change internally. I'm working
to debug them and hopefully these series of patches should be recommitted by
the end of the week.

Thank you to Micheal Park for the contributions, and for allowing the temporary
rollback.

The commits reverted by this change are:

7d15ece79c16dc3237fc514ff56a69e3d58fbd39
e0ec7a02064968c7df11713689107148b4efb993
02197f7e50b938f8167b17b89bdf7c55feff4339
a175a96517c5d9dc05ba13a6481b1b031a53a22f

3 years agoDon't take the expression range into account when looking for widening
Richard Smith [Wed, 2 Sep 2020 00:39:57 +0000 (17:39 -0700)]
Don't take the expression range into account when looking for widening
of a unary - expression.

This fixes an issue where we'd produce bogus diagnostics, and also
should recover ~0.3% compile time.

3 years ago[DebugInfo] Simplify string table dumpers.
Xing GUO [Wed, 2 Sep 2020 00:41:04 +0000 (08:41 +0800)]
[DebugInfo] Simplify string table dumpers.

This patch adds a helper function DumpStrSection to simplify codes.
Besides, nonprintable chars in debug_str and debug_str.dwo sections
are printed as escaped chars.

Reviewed By: jhenderson

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

3 years ago[MemCpyOptimizer] Preserve analyses and replace use of lambdas to get them.
Alina Sbirlea [Fri, 7 Feb 2020 18:51:46 +0000 (10:51 -0800)]
[MemCpyOptimizer] Preserve analyses and replace use of lambdas to get them.

Summary:
Analyses are preserved in MemCpyOptimizer.
Get analyses before running the pass and store the pointers, instead of
using lambdas and getting them every time on demand.

Reviewers: lenary, deadalnix, mehdi_amini, nikic, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

3 years ago[lldb] Move ScriptCommand and RegexCommand under Commands (NFC)
Jonas Devlieghere [Wed, 2 Sep 2020 00:28:29 +0000 (17:28 -0700)]
[lldb] Move ScriptCommand and RegexCommand under Commands (NFC)

Move the CommandObjectScript and CommandObjectRegexCommand under
Commands where all the other CommandObject implementations live.

Although neither implementations currently use the TableGen-generated
CommandOptions.inc, this move would have been necessary anyway if they
were to in the future.

3 years ago[NFC] Fix unused var in release builds.
Jordan Rupprecht [Tue, 1 Sep 2020 23:37:39 +0000 (16:37 -0700)]
[NFC] Fix unused var in release builds.

This was always unused, but the change in D86354 upgraded this to a compiler warning.

3 years agoSimplify Symbol Status Message to Only Debug Info Size
Yifan Shen [Tue, 1 Sep 2020 22:59:51 +0000 (15:59 -0700)]
Simplify Symbol Status Message to Only Debug Info Size

The Symbol Status in modules view is simplified so that only when the module has debug info and its size is non-zero, will the status message be displayed. The symbol status message is renamed to debug info size and flag message like "Symbols not found" and "Symbols loaded" is deleted.

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

3 years ago[lldb/interpreter] Improve REPL init file compatibility
Med Ismail Bennani [Tue, 1 Sep 2020 22:47:16 +0000 (00:47 +0200)]
[lldb/interpreter] Improve REPL init file compatibility

This patch changes the command interpreter sourcing logic for the REPL
init file. Instead of looking for a arbitrary file name, it standardizes
the REPL init file name to match to following scheme:

                          `.lldbinit-<language>-repl`

This will make the naming more homogenous and the sourcing logic future-proof.

rdar://65836048

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[clangd] Handle templates more consistently in type hierarchy
Nathan Ridge [Mon, 31 Aug 2020 07:00:58 +0000 (03:00 -0400)]
[clangd] Handle templates more consistently in type hierarchy

If the tree includes types derived from all specializations of
a template, do not misleadingly label the root node with the
name of a single specialization.

Fixes https://github.com/clangd/clangd/issues/507

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

3 years ago[clang] Do not consider the template arguments of bases to be bases themselves
Nathan Ridge [Mon, 24 Aug 2020 02:15:12 +0000 (22:15 -0400)]
[clang] Do not consider the template arguments of bases to be bases themselves

Fixes https://github.com/clangd/clangd/issues/504

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

3 years ago[ADT] Make Optional a literal type.
Varun Gandhi [Fri, 21 Aug 2020 08:45:44 +0000 (01:45 -0700)]
[ADT] Make Optional a literal type.

This allows returning Optional values from constexpr contexts.

Reviewed By: fhahn, dblaikie, rjmccall

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

3 years ago[clang] consistently use getLangOpts()
Nick Desaulniers [Tue, 25 Aug 2020 02:03:04 +0000 (19:03 -0700)]
[clang] consistently use getLangOpts()

File was inconsistent.

3 years ago[mlir][vulkan-runner] Explicitly export vulkan-runtime-wrapper entry points.
Thomas Raoux [Tue, 1 Sep 2020 22:37:54 +0000 (15:37 -0700)]
[mlir][vulkan-runner] Explicitly export vulkan-runtime-wrapper entry points.

This ensure that the symbols are being exported no matter what default
visibility is set.

3 years ago[libFuzzer] Break dependency on common_interface_defs.h
Matt Morehouse [Tue, 1 Sep 2020 22:35:01 +0000 (15:35 -0700)]
[libFuzzer] Break dependency on common_interface_defs.h

Some libFuzzer users build using the build.sh script, without access to
the <sanitizer/common_interface_defs.h> include.

Update https://github.com/rust-fuzz/libfuzzer/issues/65.

Reviewed By: dokyungs

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

3 years ago[PowerPC] Implement builtins for xvcvspbf16 and xvcvbf16spn
Amy Kwan [Tue, 1 Sep 2020 17:39:47 +0000 (12:39 -0500)]
[PowerPC] Implement builtins for xvcvspbf16 and xvcvbf16spn

This patch adds the builtin implementation for the xvcvspbf16 and xvcvbf16spn
instructions.

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

3 years ago[llvm] [unittests] Fix failing test 'FileCollectorTest.addDirectory'
Sergej Jaskiewicz [Tue, 1 Sep 2020 21:54:20 +0000 (00:54 +0300)]
[llvm] [unittests] Fix failing test 'FileCollectorTest.addDirectory'

This fixes a regression in the test suite introduced by
fad75598d272b9a5591fb7d9b591cf00cdf5022c

3 years ago[SVE] Update INSERT_SUBVECTOR DAGCombine to use getVectorElementCount().
Cameron McInally [Tue, 1 Sep 2020 21:24:53 +0000 (16:24 -0500)]
[SVE] Update INSERT_SUBVECTOR DAGCombine to use getVectorElementCount().

A small piece of the project to replace getVectorNumElements() with getVectorElementCount().

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

3 years ago[Docs] Remove outdated OS limitation
Julian Lettner [Tue, 1 Sep 2020 21:29:49 +0000 (14:29 -0700)]
[Docs] Remove outdated OS limitation

Thread Sanitizer is supported on macOS.

rdar://68159753

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

3 years ago[llvm] [unittests] Remove temporary files after they're not needed
Sergej Jaskiewicz [Mon, 6 Jul 2020 12:55:49 +0000 (15:55 +0300)]
[llvm] [unittests] Remove temporary files after they're not needed

Some LLVM unit tests forget to clean up temporary files and
directories. Introduce RAII classes for cleaning them up.

Refactor the tests to use those classes.

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

3 years agoRevert "Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _...
Amara Emerson [Tue, 1 Sep 2020 21:22:53 +0000 (14:22 -0700)]
Revert "Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)" (and dependent patch "Optimize away a Not feeding a brcond by using tbz instead of tbnz.")"

This reverts commit 8693ddc74371dedc742c9f3d3e4eda1da72c13ea.

Re-committing with the test requiring asserts.

3 years ago[builtins] Fix divtf3_test.c
Anatoly Trosinenko [Tue, 1 Sep 2020 21:14:27 +0000 (00:14 +0300)]
[builtins] Fix divtf3_test.c

Fixes 93eed63d2f3188 [builtins] Make __div[sdt]f3 handle denormal results.

3 years agoThread safety analysis: More consistent warning message
Aaron Puchert [Tue, 1 Sep 2020 21:13:28 +0000 (23:13 +0200)]
Thread safety analysis: More consistent warning message

Other warning messages for negative capabilities also mention their
kind, and the double space was ugly.

Reviewed By: aaron.ballman

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

3 years ago[mlir][ODS] Use c++ types for integer attributes of fixed width when possible.
River Riddle [Tue, 1 Sep 2020 20:32:14 +0000 (13:32 -0700)]
[mlir][ODS] Use c++ types for integer attributes of fixed width when possible.

Unsigned and Signless attributes use uintN_t and signed attributes use intN_t, where N is the fixed width. The 1-bit variants use bool.

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

3 years ago[LangRef] Fix condition for when a loop is considered parallel.
Michael Kruse [Tue, 1 Sep 2020 20:40:27 +0000 (15:40 -0500)]
[LangRef] Fix condition for when a loop is considered parallel.

The wording before this patch applies to llvm.mem.parallel_loop_access, not access groups.

Reviewed By: mppf, hfinkel

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

3 years agoRevert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)" (and...
Jordan Rupprecht [Tue, 1 Sep 2020 20:28:42 +0000 (13:28 -0700)]
Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)" (and dependent patch "Optimize away a Not feeding a brcond by using tbz instead of tbnz.")

This reverts commit 8ad8f484b63ca507417b58c9016d2761f2b1a1a8. It causes crashes when running `ninja check-llvm-codegen-aarch64-globalisel`, e.g.
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/24132/steps/test-stage1-compiler/logs/stdio.
Note that the crash does not seem to reproduce in debug builds.

5ded4442520d3dbb1aa72e6fe03cddef8828c618 depends on this, so revert that too.

3 years ago[amdgpu] Run SROA after loop unrolling.
Michael Liao [Mon, 20 Jul 2020 05:09:13 +0000 (01:09 -0400)]
[amdgpu] Run SROA after loop unrolling.

Summary: - There are promotable `alloca`s after loop unrolling.

Reviewers: rampitec, arsenm

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

Tags: #llvm

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

3 years ago[NFC] Fix unused var in release build
Jordan Rupprecht [Tue, 1 Sep 2020 20:05:56 +0000 (13:05 -0700)]
[NFC] Fix unused var in release build

3 years ago[Loads] Add canReplacePointersIfEqual helper.
Florian Hahn [Tue, 1 Sep 2020 19:54:12 +0000 (20:54 +0100)]
[Loads] Add canReplacePointersIfEqual helper.

This patch adds an initial, incomeplete and unsound implementation of
canReplacePointersIfEqual to check if a pointer value A can be replaced
by another pointer value B, that are deemed to be equivalent through
some means (e.g. information from conditions).

Note that is in general not sound to blindly replace pointers based on
equality, for example if they are based on different underlying objects.

LLVM's memory model is not completely settled as of now; see
https://bugs.llvm.org/show_bug.cgi?id=34548 for a more detailed
discussion.

The initial version of canReplacePointersIfEqual only rejects a very
specific case: replacing a pointer with a constant expression that is
not dereferenceable. Such a replacement is problematic and can be
restricted relatively easily without impacting most code. Using it to
limit replacements in GVN/SCCP/CVP only results in small differences in
7 programs out of MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto.

This patch is supposed to be an initial step to improve the current
situation and the helper should be made stricter in the future. But this
will require careful analysis of the impact on performance.

Reviewed By: aqjune

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

3 years agoRevert "[libfuzzer] Reduce default verbosity when printing large mutation sequences"
Matt Morehouse [Tue, 1 Sep 2020 19:49:00 +0000 (12:49 -0700)]
Revert "[libfuzzer] Reduce default verbosity when printing large mutation sequences"

This reverts commit 2665425908e00618074e42155ec922a37f7c9002 due to
buildbot failure.

3 years ago[LV] Interleave to expose ILP for small loops with scalar reductions.
Aaron Liu [Tue, 1 Sep 2020 19:42:08 +0000 (19:42 +0000)]
[LV] Interleave to expose ILP for small loops with scalar reductions.

Interleave for small loops that have reductions inside,
which breaks dependencies and expose.

This gives very significant performance improvements for some benchmarks.
Because small loops could be in very hot functions in real applications.

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

3 years ago[MachineCopyPropagation] In isNopCopy, check the destination registers match in addit...
Craig Topper [Tue, 1 Sep 2020 19:14:32 +0000 (12:14 -0700)]
[MachineCopyPropagation] In isNopCopy, check the destination registers match in addition to the source registers.

Previously if the source match we asserted that the destination
matched. But GPR <-> mask register copies on X86 can violate this
since we use the same K-registers for multiple sizes.

Fixes this ISPC issue https://github.com/ispc/ispc/issues/1851

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

3 years ago[Bindings] Add LLVMAddInstructionSimplifyPass
Arthur Eubanks [Fri, 28 Aug 2020 07:34:42 +0000 (00:34 -0700)]
[Bindings] Add LLVMAddInstructionSimplifyPass

Reviewed By: sroland

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

3 years agoDo not emit "-tune-cpu generic" for PS4 platform
Douglas Yung [Tue, 1 Sep 2020 19:36:14 +0000 (12:36 -0700)]
Do not emit "-tune-cpu generic" for PS4 platform

For the PS4, do not emit "-tune-cpu generic" since the platform only has 1 known CPU and we do not want to prevent optimizations by tuning for a generic rather than the specific processor it contains.

Reviewed By: probinson

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

3 years ago[ORC] Add unit test for HasMaterializationSideEffectsOnly failure behavior.
Lang Hames [Tue, 1 Sep 2020 19:10:23 +0000 (12:10 -0700)]
[ORC] Add unit test for HasMaterializationSideEffectsOnly failure behavior.

3 years agoRevert "Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain""
Owen Anderson [Tue, 1 Sep 2020 19:25:30 +0000 (19:25 +0000)]
Revert "Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain""

This reverts commit bc9a29b9ee6ade4894252b1470977142c32b4602.

The reasoning that this patch was wrong was itself incorrect
(see discussion on llvm-commits). This patch does seem to be exposing
a latent SVE code generation bug on non-public tests, which should
not block a correctness fix for public, non-SVE use cases.

3 years ago[OpenMP] Consolidate error handling and debug messages in Libomptarget
Joseph Huber [Fri, 28 Aug 2020 19:11:23 +0000 (15:11 -0400)]
[OpenMP] Consolidate error handling and debug messages in Libomptarget

Summary:

This patch consolidates the error handling and messaging routines to a single
file omptargetmessage. The goal is to simplify the error handling interface
prior to adding more error handling support

Reviewers: jdoerfert grokos ABataev AndreyChurbanov ronlieb JonChesterfield ye-luo tianshilei1992

Subscribers: danielkiss guansong jvesely kerbowa nhaehnle openmp-commits sstefan1 yaxunl

3 years ago[libc++] Workaround timespec_get not always being available in Apple SDKs
Louis Dionne [Tue, 1 Sep 2020 19:05:33 +0000 (15:05 -0400)]
[libc++] Workaround timespec_get not always being available in Apple SDKs

timespec_get is not available in Apple SDKs when (__DARWIN_C_LEVEL >= __DARWIN_C_FULL)
isn't true, which leads to libc++ trying to import ::timespec_get into
namespace std when it's not available. This issue has been reported to
Apple's libc, but we need a workaround in the meantime.

https://llvm.org/PR47208
rdar://68157284

3 years agoRevert "[fuzzer] Create user provided fuzzer writeable directories when requested...
Matt Morehouse [Tue, 1 Sep 2020 19:05:46 +0000 (12:05 -0700)]
Revert "[fuzzer] Create user provided fuzzer writeable directories when requested if they dont exist"

This reverts commit cb8912799d4372a3a1c0bf528bb4c4885caf4c45, since the
test fails on Windows.

3 years ago[MemorySSA] Update phi map with replacement value.
Alina Sbirlea [Tue, 1 Sep 2020 18:56:17 +0000 (11:56 -0700)]
[MemorySSA] Update phi map with replacement value.

3 years ago[builtins] Make __div[sdt]f3 handle denormal results
Anatoly Trosinenko [Thu, 27 Aug 2020 15:33:56 +0000 (18:33 +0300)]
[builtins] Make __div[sdt]f3 handle denormal results

This patch introduces denormal result support to soft-float division
implementation unified by D85031.

Reviewed By: sepavloff

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

3 years ago[fuzzer] Create user provided fuzzer writeable directories when requested if they...
Matt Morehouse [Tue, 1 Sep 2020 18:19:00 +0000 (11:19 -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 agoFirst commit on the release/11.x branch.
Hans Wennborg [Wed, 15 Jul 2020 10:12:18 +0000 (12:12 +0200)]
First commit on the release/11.x branch.

3 years ago[gn build] Port 3e1e5f54492
LLVM GN Syncbot [Tue, 1 Sep 2020 18:30:13 +0000 (18:30 +0000)]
[gn build] Port 3e1e5f54492

3 years ago[gn build] Port 3d90a61cf2e
LLVM GN Syncbot [Tue, 1 Sep 2020 18:30:13 +0000 (18:30 +0000)]
[gn build] Port 3d90a61cf2e

3 years ago[gn build] port 5ffd940ac02 a bit more
Nico Weber [Tue, 1 Sep 2020 18:30:01 +0000 (14:30 -0400)]
[gn build] port 5ffd940ac02 a bit more

3 years ago[libfuzzer] Reduce default verbosity when printing large mutation sequences
mhl [Tue, 1 Sep 2020 17:50:27 +0000 (10:50 -0700)]
[libfuzzer] Reduce default verbosity when printing large mutation sequences

When using a custom mutator (e.g. thrift mutator, similar to LPM)
that calls back into libfuzzer's mutations via `LLVMFuzzerMutate`, the mutation
sequences needed to achieve new coverage can get prohibitively large.

Printing these large sequences has two downsides:

1) It makes the logs hard to understand for a human.
2) The performance cost slows down fuzzing.

In this patch I change the `PrintMutationSequence` function to take a max
number of entries, to achieve this goal. I also update `PrintStatusForNewUnit`
to default to printing only 10 entries, in the default verbosity level (1),
requiring the user to set verbosity to 2 if they want the full mutation
sequence.

For our use case, turning off verbosity is not an option, as that would also
disable `PrintStats()` which is very useful for infrastructure that analyzes
the logs in realtime. I imagine most users of libfuzzer always want those logs
in the default.

I built a fuzzer locally with this patch applied to libfuzzer.

When running with the default verbosity, I see logs like this:

    #65 NEW    cov: 4799 ft: 10443 corp: 41/1447Kb lim: 64000 exec/s: 1 rss: 575Mb L: 28658/62542 MS: 196 Custom-CrossOver-ChangeBit-EraseBytes-ChangeBit-ChangeBit-ChangeBit-CrossOver-ChangeBit-CrossOver- DE: "\xff\xff\xff\x0e"-"\xfe\xff\xff\x7f"-"\xfe\xff\xff\x7f"-"\x17\x00\x00\x00\x00\x00\x00\x00"-"\x00\x00\x00\xf9"-"\xff\xff\xff\xff"-"\xfa\xff\xff\xff"-"\xf7\xff\xff\xff"-"@\xff\xff\xff\xff\xff\xff\xff"-"E\x00"-
    #67 NEW    cov: 4810 ft: 10462 corp: 42/1486Kb lim: 64000 exec/s: 1 rss: 577Mb L: 39823/62542 MS: 135 Custom-CopyPart-ShuffleBytes-ShuffleBytes-ChangeBit-ChangeBinInt-EraseBytes-ChangeBit-ChangeBinInt-ChangeBit- DE: "\x01\x00\x00\x00\x00\x00\x01\xf1"-"\x00\x00\x00\x07"-"\x00\x0d"-"\xfd\xff\xff\xff"-"\xfe\xff\xff\xf4"-"\xe3\xff\xff\xff"-"\xff\xff\xff\xf1"-"\xea\xff\xff\xff"-"\x00\x00\x00\xfd"-"\x01\x00\x00\x05"-

Staring hard at the logs it's clear that the cap of 10 is applied.

When running with verbosity level 2, the logs look like the below:

    #66    NEW    cov: 4700 ft: 10188 corp: 37/1186Kb lim: 64000 exec/s: 2 rss: 509Mb L: 47616/61231 MS: 520 Custom-CopyPart-ChangeBinInt-ChangeBit-ChangeByte-EraseBytes-PersAutoDict-CopyPart-ShuffleBytes-ChangeBit-ShuffleBytes-CopyPart-EraseBytes-CopyPart-ChangeBinInt-CopyPart-ChangeByte-ShuffleBytes-ChangeBinInt-ShuffleBytes-ChangeBit-CMP-ShuffleBytes-ChangeBit-CrossOver-ChangeBinInt-ChangeByte-ShuffleBytes-CrossOver-EraseBytes-ChangeBinInt-InsertRepeatedBytes-PersAutoDict-InsertRepeatedBytes-InsertRepeatedBytes-CrossOver-ChangeByte-ShuffleBytes-CopyPart-ShuffleBytes-CopyPart-CrossOver-ChangeBit-ShuffleBytes-CrossOver-PersAutoDict-ChangeByte-ChangeBit-ShuffleBytes-CrossOver-ChangeByte-EraseBytes-CopyPart-ChangeBinInt-PersAutoDict-CrossOver-ShuffleBytes-CrossOver-CrossOver-EraseBytes-CrossOver-EraseBytes-CrossOver-ChangeBit-ChangeBinInt-ChangeByte-EraseBytes-ShuffleBytes-ShuffleBytes-ChangeBit-EraseBytes-ChangeBinInt-ChangeBit-ChangeBinInt-CopyPart-EraseBytes-PersAutoDict-EraseBytes-CopyPart-ChangeBinInt-ChangeByte-CrossOver-ChangeBinInt-ShuffleBytes-PersAutoDict-PersAutoDict-ChangeBinInt-CopyPart-ChangeBinInt-CrossOver-ChangeBit-ChangeBinInt-CopyPart-ChangeByte-ChangeBit-CopyPart-CrossOver-ChangeByte-ChangeBit-ChangeByte-ShuffleBytes-CMP-ChangeBit-CopyPart-ChangeBit-ChangeByte-ChangeBinInt-PersAutoDict-ChangeBinInt-CrossOver-ChangeBinInt-ChangeBit-ChangeBinInt-ChangeBinInt-PersAutoDict-ChangeBinInt-ChangeBinInt-ChangeByte-CopyPart-ShuffleBytes-ChangeByte-ChangeBit-ChangeByte-ChangeByte-EraseBytes-CrossOver-ChangeByte-ChangeByte-EraseBytes-EraseBytes-InsertRepeatedBytes-ShuffleBytes-CopyPart-CopyPart-ChangeBit-ShuffleBytes-PersAutoDict-ShuffleBytes-ChangeBit-ChangeByte-ChangeBit-ShuffleBytes-ChangeByte-ChangeBinInt-CrossOver-ChangeBinInt-ChangeBit-EraseBytes-CopyPart-ChangeByte-CrossOver-EraseBytes-CrossOver-ChangeByte-ShuffleBytes-ChangeByte-ChangeBinInt-CrossOver-ChangeByte-InsertRepeatedBytes-InsertByte-ShuffleBytes-PersAutoDict-ChangeBit-ChangeByte-ChangeBit-ShuffleBytes-ShuffleBytes-CopyPart-ShuffleBytes-EraseBytes-ShuffleBytes-ShuffleBytes-CrossOver-ChangeBinInt-CopyPart-CopyPart-CopyPart-EraseBytes-EraseBytes-ChangeByte-ChangeBinInt-ShuffleBytes-CMP-InsertByte-EraseBytes-ShuffleBytes-CopyPart-ChangeBit-CrossOver-CopyPart-CopyPart-ShuffleBytes-ChangeByte-ChangeByte-ChangeBinInt-EraseBytes-ChangeByte-ChangeBinInt-ChangeBit-ChangeBit-ChangeByte-ShuffleBytes-PersAutoDict-PersAutoDict-CMP-ChangeBit-ShuffleBytes-PersAutoDict-ChangeBinInt-EraseBytes-EraseBytes-ShuffleBytes-ChangeByte-ShuffleBytes-ChangeBit-EraseBytes-CMP-ShuffleBytes-ChangeByte-ChangeBinInt-EraseBytes-ChangeBinInt-ChangeByte-EraseBytes-ChangeByte-CrossOver-ShuffleBytes-EraseBytes-EraseBytes-ShuffleBytes-ChangeBit-EraseBytes-CopyPart-ShuffleBytes-ShuffleBytes-CrossOver-CopyPart-ChangeBinInt-ShuffleBytes-CrossOver-InsertByte-InsertByte-ChangeBinInt-ChangeBinInt-CopyPart-EraseBytes-ShuffleBytes-ChangeBit-ChangeBit-EraseBytes-ChangeByte-ChangeByte-ChangeBinInt-CrossOver-ChangeBinInt-ChangeBinInt-ShuffleBytes-ShuffleBytes-ChangeByte-ChangeByte-ChangeBinInt-ShuffleBytes-CrossOver-EraseBytes-CopyPart-CopyPart-CopyPart-ChangeBit-ShuffleBytes-ChangeByte-EraseBytes-ChangeByte-InsertRepeatedBytes-InsertByte-InsertRepeatedBytes-PersAutoDict-EraseBytes-ShuffleBytes-ChangeByte-ShuffleBytes-ChangeBinInt-ShuffleBytes-ChangeBinInt-ChangeBit-CrossOver-CrossOver-ShuffleBytes-CrossOver-CopyPart-CrossOver-CrossOver-CopyPart-ChangeByte-ChangeByte-CrossOver-ChangeBit-ChangeBinInt-EraseBytes-ShuffleBytes-EraseBytes-CMP-PersAutoDict-PersAutoDict-InsertByte-ChangeBit-ChangeByte-CopyPart-CrossOver-ChangeByte-ChangeBit-ChangeByte-CopyPart-ChangeBinInt-EraseBytes-CrossOver-ChangeBit-CrossOver-PersAutoDict-CrossOver-ChangeByte-CrossOver-ChangeByte-ChangeByte-CrossOver-ShuffleBytes-CopyPart-CopyPart-ShuffleBytes-ChangeByte-ChangeByte-ChangeBinInt-ChangeBinInt-ChangeBinInt-ChangeBinInt-ShuffleBytes-CrossOver-ChangeBinInt-ShuffleBytes-ChangeBit-PersAutoDict-ChangeBinInt-ShuffleBytes-ChangeBinInt-ChangeByte-CrossOver-ChangeBit-CopyPart-ChangeBit-ChangeBit-CopyPart-ChangeByte-PersAutoDict-ChangeBit-ShuffleBytes-ChangeByte-ChangeBit-CrossOver-ChangeByte-CrossOver-ChangeByte-CrossOver-ChangeBit-ChangeByte-ChangeBinInt-PersAutoDict-CopyPart-ChangeBinInt-ChangeBit-CrossOver-ChangeBit-PersAutoDict-ShuffleBytes-EraseBytes-CrossOver-ChangeByte-ChangeBinInt-ShuffleBytes-ChangeBinInt-InsertRepeatedBytes-PersAutoDict-CrossOver-ChangeByte-Custom-PersAutoDict-CopyPart-CopyPart-ChangeBinInt-ShuffleBytes-ChangeBinInt-ChangeBit-ShuffleBytes-CrossOver-CMP-ChangeByte-CopyPart-ShuffleBytes-CopyPart-CopyPart-CrossOver-CrossOver-CrossOver-ShuffleBytes-ChangeByte-ChangeBinInt-ChangeBit-ChangeBit-ChangeBit-ChangeByte-EraseBytes-ChangeByte-ChangeBit-ChangeByte-ChangeByte-CopyPart-PersAutoDict-ChangeBinInt-PersAutoDict-PersAutoDict-PersAutoDict-CopyPart-CopyPart-CrossOver-ChangeByte-ChangeBinInt-ShuffleBytes-ChangeBit-CopyPart-EraseBytes-CopyPart-CopyPart-CrossOver-ChangeByte-EraseBytes-ShuffleBytes-ChangeByte-CopyPart-EraseBytes-CopyPart-CrossOver-ChangeBinInt-ChangeBinInt-InsertByte-ChangeBinInt-ChangeBit-ChangeByte-CopyPart-ChangeByte-EraseBytes-ChangeByte-ChangeBit-ChangeByte-ShuffleBytes-CopyPart-ChangeBinInt-EraseBytes-CrossOver-ChangeBit-ChangeBit-CrossOver-EraseBytes-ChangeBinInt-CopyPart-CopyPart-ChangeBinInt-ChangeBit-EraseBytes-InsertRepeatedBytes-EraseBytes-ChangeBit-CrossOver-CrossOver-EraseBytes-EraseBytes-ChangeByte-CopyPart-CopyPart-ShuffleBytes-ChangeByte-ChangeBit-ChangeByte-EraseBytes-ChangeBit-ChangeByte-ChangeByte-CrossOver-CopyPart-EraseBytes-ChangeByte-EraseBytes-ChangeByte-ShuffleBytes-ShuffleBytes-ChangeByte-CopyPart-ChangeByte-ChangeByte-ChangeBit-CopyPart-ChangeBit-ChangeBinInt-CopyPart-ShuffleBytes-ChangeBit-ChangeBinInt-ChangeBit-EraseBytes-CMP-CrossOver-CopyPart-ChangeBinInt-CrossOver-CrossOver-CopyPart-CrossOver-CrossOver-InsertByte-InsertByte-CopyPart-Custom- DE: "warn"-"\x00\x00\x00\x80"-"\xfe\xff\xff\xfb"-"\xff\xff"-"\x10\x00\x00\x00"-"\xfe\xff\xff\xff"-"\xff\xff\xff\xf6"-"U\x01\x00\x00\x00\x00\x00\x00"-"\xd9\xff\xff\xff"-"\xfe\xff\xff\xea"-"\xf0\xff\xff\xff"-"\xfc\xff\xff\xff"-"warn"-"\xff\xff\xff\xff"-"\xfe\xff\xff\xfb"-"\x00\x00\x00\x80"-"\xfe\xff\xff\xf1"-"\xfe\xff\xff\xea"-"\x00\x00\x00\x00\x00\x00\x012"-"\xe2\x00"-"\xfb\xff\xff\xff"-"\x00\x00\x00\x00"-"\xe9\xff\xff\xff"-"\xff\xff"-"\x00\x00\x00\x80"-"\x01\x00\x04\xc9"-"\xf0\xff\xff\xff"-"\xf9\xff\xff\xff"-"\xff\xff\xff\xff\xff\xff\xff\x12"-"\xe2\x00"-"\xfe\xff\xff\xff"-"\xfe\xff\xff\xea"-"\xff\xff\xff\xff"-"\xf4\xff\xff\xff"-"\xe9\xff\xff\xff"-"\xf1\xff\xff\xff"-
    #48    NEW    cov: 4502 ft: 9151 corp: 27/750Kb lim: 64000 exec/s: 2 rss: 458Mb L: 50772/50772 MS: 259 ChangeByte-ShuffleBytes-ChangeBinInt-ChangeByte-ChangeByte-ChangeByte-ChangeByte-ChangeBit-CopyPart-CrossOver-CopyPart-ChangeByte-CrossOver-CopyPart-ChangeBit-ChangeByte-EraseBytes-ChangeByte-CopyPart-CopyPart-CopyPart-ChangeBit-EraseBytes-ChangeBinInt-CrossOver-CopyPart-CrossOver-CopyPart-ChangeBit-ChangeByte-ChangeBit-InsertByte-CrossOver-InsertRepeatedBytes-InsertRepeatedBytes-InsertRepeatedBytes-ChangeBinInt-EraseBytes-InsertRepeatedBytes-InsertByte-ChangeBit-ShuffleBytes-ChangeBit-ChangeBit-CopyPart-ChangeBit-ChangeByte-CrossOver-ChangeBinInt-ChangeByte-CrossOver-CMP-ChangeByte-CrossOver-ChangeByte-ShuffleBytes-ShuffleBytes-ChangeByte-ChangeBinInt-CopyPart-EraseBytes-CrossOver-ChangeBit-ChangeBinInt-InsertByte-ChangeBit-CopyPart-ChangeBinInt-ChangeByte-CrossOver-ChangeBit-EraseBytes-CopyPart-ChangeBinInt-ChangeBit-ChangeBit-ChangeByte-CopyPart-ChangeBinInt-CrossOver-PersAutoDict-ChangeByte-ChangeBit-ChangeByte-ChangeBinInt-ChangeBinInt-EraseBytes-CopyPart-CopyPart-ChangeByte-ChangeByte-EraseBytes-PersAutoDict-CopyPart-ChangeByte-ChangeByte-EraseBytes-CrossOver-CopyPart-CopyPart-CopyPart-ChangeByte-ChangeBit-CMP-CopyPart-ChangeBinInt-ChangeBinInt-CrossOver-ChangeBit-ChangeBit-EraseBytes-ChangeByte-ShuffleBytes-ChangeBit-ChangeBinInt-CMP-InsertRepeatedBytes-CopyPart-Custom-ChangeByte-CrossOver-EraseBytes-ChangeBit-CopyPart-CrossOver-CMP-ShuffleBytes-EraseBytes-CrossOver-PersAutoDict-ChangeByte-CrossOver-CopyPart-CrossOver-CrossOver-ShuffleBytes-ChangeBinInt-CrossOver-ChangeBinInt-ShuffleBytes-PersAutoDict-ChangeByte-EraseBytes-ChangeBit-CrossOver-EraseBytes-CrossOver-ChangeBit-ChangeBinInt-EraseBytes-InsertByte-InsertRepeatedBytes-InsertByte-InsertByte-ChangeByte-ChangeBinInt-ChangeBit-CrossOver-ChangeByte-CrossOver-EraseBytes-ChangeByte-ShuffleBytes-ChangeBit-ChangeBit-ShuffleBytes-CopyPart-ChangeByte-PersAutoDict-ChangeBit-ChangeByte-InsertRepeatedBytes-CMP-CrossOver-ChangeByte-EraseBytes-ShuffleBytes-CrossOver-ShuffleBytes-ChangeBinInt-ChangeBinInt-CopyPart-PersAutoDict-ShuffleBytes-ChangeBit-CopyPart-ShuffleBytes-CopyPart-EraseBytes-ChangeByte-ChangeBit-ChangeBit-ChangeBinInt-ChangeByte-CopyPart-EraseBytes-ChangeBinInt-EraseBytes-EraseBytes-PersAutoDict-CMP-PersAutoDict-CrossOver-CrossOver-ChangeBit-CrossOver-PersAutoDict-CrossOver-CopyPart-ChangeByte-EraseBytes-ChangeByte-ShuffleBytes-ChangeByte-ChangeByte-CrossOver-ChangeBit-EraseBytes-ChangeByte-EraseBytes-ChangeBinInt-CrossOver-CrossOver-EraseBytes-ChangeBinInt-CrossOver-ChangeBit-ShuffleBytes-ChangeBit-ChangeByte-EraseBytes-ChangeBit-CrossOver-CrossOver-CrossOver-ChangeByte-ChangeBit-ShuffleBytes-ChangeBit-ChangeBit-EraseBytes-CrossOver-CrossOver-CopyPart-ShuffleBytes-ChangeByte-ChangeByte-CopyPart-CrossOver-CopyPart-CrossOver-CrossOver-EraseBytes-EraseBytes-ShuffleBytes-InsertRepeatedBytes-ChangeBit-CopyPart-Custom- DE: "\xfe\xff\xff\xfc"-"\x00\x00\x00\x00"-"F\x00"-"\xf3\xff\xff\xff"-"St9exception"-"_\x00\x00\x00"-"\xf6\xff\xff\xff"-"\xfe\xff\xff\xff"-"\x00\x00\x00\x00"-"p\x02\x00\x00\x00\x00\x00\x00"-"\xfe\xff\xff\xfb"-"\xff\xff"-"\xff\xff\xff\xff"-"\x01\x00\x00\x07"-"\xfe\xff\xff\xfe"-

These are prohibitively large and of limited value in the default case (when
someone is running the fuzzer, not debugging it), in my opinion.

Reviewed By: morehouse

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

3 years ago[PowerPC][AIX] Update save/restore offset for frame and base pointers.
Sean Fertile [Tue, 1 Sep 2020 15:16:37 +0000 (11:16 -0400)]
[PowerPC][AIX] Update save/restore offset for frame and base pointers.

General purpose registers 30 and 31 are handled differently when they are
reserved as the base-pointer and frame-pointer respectively. This fixes the
offset of their fixed-stack objects when there are fpr calle-saved registers.

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

3 years ago[Bitstream] Use alignTo to make code more readable. NFC
Craig Topper [Tue, 1 Sep 2020 17:42:50 +0000 (10:42 -0700)]
[Bitstream] Use alignTo to make code more readable. NFC

I was recently debugging a similar issue to https://reviews.llvm.org/D86500 only with a large metadata section. Only after I finished debugging it did I discover it was fixed very recently.

My version of the fix was going to alignTo since that uses uint64_t and improves the readability of the code. So I though I would go ahead and share it.

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

3 years ago[AArch64][GlobalISel] Optimize away a Not feeding a brcond by using tbz instead of...
Amara Emerson [Sun, 23 Aug 2020 06:28:07 +0000 (23:28 -0700)]
[AArch64][GlobalISel] Optimize away a Not feeding a brcond by using tbz instead of tbnz.

Usually brconds are fed by compares, but not always, in which case we would
miss this fold.

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

3 years ago[flang] Version information in flang/f18
Camille Coti [Tue, 25 Aug 2020 08:27:20 +0000 (09:27 +0100)]
[flang] Version information in flang/f18

Fixed some version information in flang/f18:

  - fixed the behavior of the -v switch: this flag enables verbosity with used with arguments, but just displays the version when used alone (related to this bug: https://bugs.llvm.org/show_bug.cgi?id=46017)
 - added __FLANG, __FLANG_MAJOR__, __FLANG_MINOR__ and __FLANG_PATCHLEVEL__ (similar to their __F18* counterparts) for compatibility purpose

Reviewed By: AlexisPerry, richard.barton.arm, tskeith

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

3 years ago[flang] Fix integer CASE constant typing
peter klausler [Mon, 31 Aug 2020 19:33:12 +0000 (12:33 -0700)]
[flang] Fix integer CASE constant typing

Don't use just 128-bit integer as the type for integer
CASE statement constants.  Use the actual type of the
literal constants that appeared.

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

3 years ago[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)
Amara Emerson [Fri, 21 Aug 2020 22:52:21 +0000 (15:52 -0700)]
[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)

This is needed for an upcoming change to how we translate conditional branches
which might generate these.

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

3 years agox87 FPU state instructions do not use an f32 memory location
Eric Astor [Tue, 1 Sep 2020 17:49:35 +0000 (13:49 -0400)]
x87 FPU state instructions do not use an f32 memory location

These instructions actually use a 512-byte location, where bytes 464-511 are ignored.

Reviewed By: craig.topper

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

3 years ago[tsan] Fix "failed to intercept sysctlnametomib" on FreeBSD
Alex Richardson [Tue, 1 Sep 2020 09:46:35 +0000 (10:46 +0100)]
[tsan] Fix "failed to intercept sysctlnametomib" on FreeBSD

The sysctlnametomib function is called from __tsan::Initialize via
__sanitizer::internal_sysctlbyname (see stack trace below). This results
in a fatal error since sysctlnametomib has not been intercepted yet.
This patch allows internal_sysctlbyname to be called before
__tsan::Initialize() has completed. On FreeBSD >= 1300045 sysctlbyname()
is a real syscall, but for older versions it calls sysctlnametomib()
followed by sysctl(). To avoid calling the intercepted version, look up
the real sysctlnametomib() followed by internal_sysctl() if the
syscall is not available.

This reduces check-sanitizer failures from 62 to 11 for me.

==34433==FATAL: ThreadSanitizer: failed to intercept sysctlnametomib
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp:51
    name=0x7fffffffce10, namelenp=0x7fffffffce08)
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:7908
    oldp=0x7fffffffcf2c, oldlenp=0x7fffffffcf20, newp=0x0, newlen=0)
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:803
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:2152
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp:367
    fname=0x21c731 "readlink", pc=34366042556)
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:255
    bufsiz=1024)
    at /exports/users/alr48/sources/upstream-llvm-project/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:7151

Reviewed By: #sanitizers, vitalybuka

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

3 years agoGlobalISel: Implement computeNumSignBits for G_SELECT
Matt Arsenault [Thu, 27 Aug 2020 19:28:24 +0000 (15:28 -0400)]
GlobalISel: Implement computeNumSignBits for G_SELECT

3 years agoGlobalISel: Port smarter known bits for umin/umax from DAG
Matt Arsenault [Thu, 27 Aug 2020 22:05:34 +0000 (18:05 -0400)]
GlobalISel: Port smarter known bits for umin/umax from DAG

3 years agoGlobalISel: Implement computeKnownBits for G_BSWAP and G_BITREVERSE
Matt Arsenault [Thu, 27 Aug 2020 21:55:35 +0000 (17:55 -0400)]
GlobalISel: Implement computeKnownBits for G_BSWAP and G_BITREVERSE

3 years ago[PowerPC] Handle STRICT_FSETCC(S) in more cases
Qiu Chaofan [Tue, 1 Sep 2020 16:29:12 +0000 (00:29 +0800)]
[PowerPC] Handle STRICT_FSETCC(S) in more cases

On -O0, i1 strict_fsetcc will be promoted to i32. We don't handle that
in TD patterns. This patch fills logic in PPCISelDAGToDAG to handle more
cases.

Reviewed By: uweigand

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

3 years ago[builtins] Unify the softfloat division implementation
Anatoly Trosinenko [Tue, 1 Sep 2020 16:03:29 +0000 (19:03 +0300)]
[builtins] Unify the softfloat division implementation

This patch replaces three different pre-existing implementations of
__div[sdt]f3 LibCalls with a generic one - like it is already done for
many other LibCalls.

Reviewed By: sepavloff

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

3 years ago[libc++] Improve REQUIRES for _ExtInt test on recent Clangs
Louis Dionne [Tue, 1 Sep 2020 15:13:44 +0000 (11:13 -0400)]
[libc++] Improve REQUIRES for _ExtInt test on recent Clangs

The previous REQUIRES: would cause the test to run only on Clang-11, not
even on following versions of Clang, which was mostly not the intent.

3 years ago[DAGCombiner] Fold an AND of a masked load into a zext_masked_load
Sam Tebbs [Tue, 1 Sep 2020 14:36:47 +0000 (15:36 +0100)]
[DAGCombiner] Fold an AND of a masked load into a zext_masked_load

This patch folds an AND of a masked load and build vector into a zero
extended masked load.

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

3 years ago[PowerPC] Implement instruction definitions/MC Tests for xvcvspbf16 and xvcvbf16spn
Amy Kwan [Tue, 1 Sep 2020 15:15:45 +0000 (10:15 -0500)]
[PowerPC] Implement instruction definitions/MC Tests for xvcvspbf16 and xvcvbf16spn

This patch adds the td instruction definitions of the xvcvspbf16 and xvcvbf16spn
instructions, along with their respective MC tests.

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

3 years ago[flang] Improve compile-time shape conformance checking
peter klausler [Mon, 31 Aug 2020 19:06:41 +0000 (12:06 -0700)]
[flang] Improve compile-time shape conformance checking

Conformance checking of the shapes of the operands of
array expressions can't, of course, always be done at
compilation time; but when the shapes are known and
nonconformable, we should catch the errors that we can.

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

3 years agoGlobalISel: Add combines for extend operations
Volkan Keles [Tue, 1 Sep 2020 15:50:06 +0000 (08:50 -0700)]
GlobalISel: Add combines for extend operations

https://reviews.llvm.org/D86516

3 years agoGlobalISel: Implement computeNumSignBits for G_SEXTLOAD/G_ZEXTLOAD
Matt Arsenault [Fri, 28 Aug 2020 14:52:32 +0000 (10:52 -0400)]
GlobalISel: Implement computeNumSignBits for G_SEXTLOAD/G_ZEXTLOAD

3 years agoGlobalISel: Implement computeKnownBits for G_UNMERGE_VALUES
Matt Arsenault [Thu, 27 Aug 2020 20:17:41 +0000 (16:17 -0400)]
GlobalISel: Implement computeKnownBits for G_UNMERGE_VALUES

3 years agoRevert "Reapply D70800: Fix AArch64 AAPCS frame record chain"
Paul Walker [Tue, 1 Sep 2020 14:52:59 +0000 (15:52 +0100)]
Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain"

This reverts commit e9d9a612084b47fc4277523561d61e675370c854.

This patch was previously revert by 04879086b44348cad600a0a1ccbe1f7776cc3cf9
with the reapplication being done after breaking the assert used to
ensure SP is always 16-byte aligned, which is a requirement of the AAPCS.

For extra context the latest patch caused runtime failures when
building with "-march=armv8-a+sve -mllvm -aarch64-sve-vector-bits-min=256".

3 years agoGlobalISel: Artifact combine unmerge of unmerge
Matt Arsenault [Thu, 20 Aug 2020 12:55:08 +0000 (08:55 -0400)]
GlobalISel: Artifact combine unmerge of unmerge

Unmerges have the same fundamental problem as G_TRUNC, and G_TRUNC
could be implemented in terms of G_UNMERGE_VALUES. Reducing the number
of elements in unmerge results ends up producing the original unmerge
type profile, so the artifact combiner needs to eliminate the
intermediate illegal registers. This avoids infinite looping in the
legalizer in a future change.

Assuming an unmerge has each result unmerged the same way, this ends
up producing a new unmerge of the source for every definition. I'm not
sure if the artifact combiner should either insert temporary merges
here and erase the original merge, or if the combiner should look at
uses from defs rather than defs from uses for unmerges.

In a few cases this regresses from using 16-bit shifts for 8-bit
values to using 32-bit shifts, but I think these can be legalized
later (the other legalization rules don't try very hard to use 16-bit
shifts either).

3 years agoPowerPC: Switch test to generated checks
Matt Arsenault [Tue, 1 Sep 2020 14:33:49 +0000 (10:33 -0400)]
PowerPC: Switch test to generated checks

3 years agoAMDGPU: Check some offsets in test
Matt Arsenault [Mon, 31 Aug 2020 20:13:23 +0000 (16:13 -0400)]
AMDGPU: Check some offsets in test

This will make updating the checks easier in a future change.

3 years agoAMDGPU: Convert test to MIR
Matt Arsenault [Mon, 31 Aug 2020 18:13:25 +0000 (14:13 -0400)]
AMDGPU: Convert test to MIR

Currently the dbg_value ends up in the relaxed branch block. A future
commit will push the dbg_value out of this block, and I'm not sure how
to coax the IR into producing the same MIR at the relevant point.