platform/upstream/llvm.git
4 years agoFix f5314d15af4f4514103ea12c74cb208538b8bef5 - [Support] On Unix, let the CrashRecove...
Alexandre Ganea [Thu, 24 Sep 2020 13:07:13 +0000 (09:07 -0400)]
Fix f5314d15af4f4514103ea12c74cb208538b8bef5 - [Support] On Unix, let the CrashRecoveryContext return the signal code

This was causing bots to fail: http://green.lab.llvm.org/green/job/clang-stage1-RA/14828/consoleFull#6384962949ba4694-19c4-4d7e-bec5-911270d8a58c

4 years agoImprove 723fea23079f9c85800e5cdc90a75414af182bfd - Silence 'warning: unused variable...
Alexandre Ganea [Thu, 24 Sep 2020 12:24:10 +0000 (08:24 -0400)]
Improve 723fea23079f9c85800e5cdc90a75414af182bfd - Silence 'warning: unused variable' when compiling with Clang 10.0

4 years agoRecommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"
Yaxun (Sam) Liu [Wed, 23 Sep 2020 22:00:23 +0000 (18:00 -0400)]
Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions"

This recommits 7f1f89ec8d9944559042bb6d3b1132eabe3409de and
40df06cdafc010002fc9cfe1dda73d689b7d27a6 after fixing memory
sanitizer failure.

4 years ago[AArch64] Regenerate dag-combine-mul-shl.ll checks
Simon Pilgrim [Thu, 24 Sep 2020 12:41:47 +0000 (13:41 +0100)]
[AArch64] Regenerate dag-combine-mul-shl.ll checks

4 years ago[ARM] LowoverheadLoops: add an option to disable tail-predication
Sjoerd Meijer [Thu, 24 Sep 2020 10:47:30 +0000 (11:47 +0100)]
[ARM] LowoverheadLoops: add an option to disable tail-predication

This might be useful for testing. We already have an option -tail-predication
but that controls the MVETailPredication pass.  This
-arm-loloops-disable-tail-pred is just for disabling it in the LowoverheadLoops
pass.

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

4 years ago[ARM] Check for LSTP side-effects.
Sam Parker [Thu, 24 Sep 2020 11:55:17 +0000 (12:55 +0100)]
[ARM] Check for LSTP side-effects.

If the LSTP instruction is inserted with an element count low enough
to immediately predicate some lanes as false, this can have some
unintended effects on any proceeding MVE instructions in the
preheader.

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

4 years ago[Support] On Unix, let the CrashRecoveryContext return the signal code
Alexandre Ganea [Thu, 24 Sep 2020 12:14:45 +0000 (08:14 -0400)]
[Support] On Unix, let the CrashRecoveryContext return the signal code

Before this patch, the CrashRecoveryContext was returning -2 upon a signal, like ExecuteAndWait does. This didn't match the behavior on Windows, where the the exception code was returned.

We now return the signal's code, which optionally allows for re-throwing the signal later. Doing so requires all custom handlers to be removed first, through llvm::sys::unregisterHandlers() which we made a public API.

This is part of https://reviews.llvm.org/D70378

4 years ago[lit] Support running tests on Windows without GnuWin32
Zachary Turner [Wed, 23 Sep 2020 21:19:21 +0000 (17:19 -0400)]
[lit] Support running tests on Windows without GnuWin32

Historically, we have told contributors that GnuWin32 is a pre-requisite
because our tests depend on utilities such as sed, grep, diff, and more.
However, Git on Windows includes versions of these utilities in its
installation.  Furthermore, GnuWin32 has not been updated in many years.
For these reasons, it makes sense to have the ability to run llvm tests
in a way that is both:
  a) Easier on the user (less stuff to install)
  b) More up-to-date (The verions that ship with git are at least as
     new, if not newer, than the versions in GnuWin32.

We add support for this here by attempting to detect where Git is
installed using the Windows registry, confirming the existence of
several common Unix tools, and then adding this location to lit's PATH
environment.

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

4 years ago[Support] On Windows, ensure abort() can be catched several times in a row with Crash...
Alexandre Ganea [Tue, 22 Sep 2020 22:22:01 +0000 (18:22 -0400)]
[Support] On Windows, ensure abort() can be catched several times in a row with CrashRecoveryContext

Before this patch, the CrashRecoveryContext would only catch the first abort(). Any further calls to abort() inside subsquent CrashRecoveryContexts would not be catched. This is because the Windows CRT removes the abort() handler before calling it.

This is part of https://reviews.llvm.org/D70378

4 years agoFix a builtbot failure after 3ed04f93e30121867a813a220452b97aebeb1730.
Alexey Lapshin [Thu, 24 Sep 2020 12:07:18 +0000 (15:07 +0300)]
Fix a builtbot failure after 3ed04f93e30121867a813a220452b97aebeb1730.

4 years ago [flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs.
Praveen G [Thu, 24 Sep 2020 12:08:11 +0000 (13:08 +0100)]
[flang] [OpenMP 4.5] Adding lit test cases for OpenMP Constructs.

 1. Section 2.5   : Parallel Construct
 2. Section 2.7.1 : Loop Construct
 3. Section 2.7.2 : Sections Construct
 4. Section 2.7.3 : Single Construct
 5. Section 2.7.4 : Workshare Construct
 6. Section 2.8.1 : Simd Construct
 7. Section 2.8.3 : Loop Simd Construct
 8. Section 2.9.1 : Task Construct
 9. Section 2.9.2 : Taskloop Construct
10. Section 2.9.3 : Taskloop Simd Construct

Most of the test cases added as part of this change contains semantic errors except few cases which are semantically correct but thrown a semantic error.

Currently flang is not throwing the errors for these cases and throwing semantic errors for the following correct test cases

{omp-do03.f90 , omp-loop-simd01.f90 , omp-simd02.f90 , omp-taskloop01.f90}

Hence, all the test cases are marked as XFAIL.

Reviewed By: DavidTruby

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

4 years ago[flang][driver] Remove unnecessary includes in the unittest (NFC)
Andrzej Warzynski [Thu, 24 Sep 2020 11:54:07 +0000 (12:54 +0100)]
[flang][driver] Remove unnecessary includes in the unittest (NFC)

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

4 years ago[APFloat] add tests for convert of NAN; NFC
Sanjay Patel [Thu, 24 Sep 2020 11:29:18 +0000 (07:29 -0400)]
[APFloat] add tests for convert of NAN; NFC

More coverage for the bug fix proposed in D87835.

4 years ago[llvm-objcopy][NFC] refactor error handling. part 1.
Alexey Lapshin [Tue, 22 Sep 2020 17:47:02 +0000 (20:47 +0300)]
[llvm-objcopy][NFC] refactor error handling. part 1.

Remove usages of special error reporting functions(error(),
reportError()). This patch is extracted from D87987.
Errors are reported as Expected<>/Error returning values.
This part is for MachO subfolder of llvm-objcopy.

Testing: check-all.

Reviewed By: jhenderson, alexshap

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

4 years ago[NFC][Docs] fix clang-docs compilation
Jonas Toth [Thu, 24 Sep 2020 11:13:27 +0000 (13:13 +0200)]
[NFC][Docs] fix clang-docs compilation

4 years ago[lld][ELF][test] Add a couple of test cases for LTO behaviour
James Henderson [Tue, 22 Sep 2020 13:36:53 +0000 (14:36 +0100)]
[lld][ELF][test] Add a couple of test cases for LTO behaviour

This patch expands two LTO test cases to check other aspects.

1) weak.ll has been expanded to show that it doesn't matter whether the
   first appearance of a weak symbol appears in a bitcode file or native
   object - that one is picked.
2) reproduce-lto.ll has been expanded to show that the bitcode files are
   stored in the reproduce package and that intermediate files (such as
   the LTO-compiled object) are not.

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

Reviewed by: grimar, MaskRay

4 years agoUse different name for auto variable
Serge Pavlov [Thu, 24 Sep 2020 10:27:27 +0000 (17:27 +0700)]
Use different name for auto variable

Without this change GCC 5.4.0 failed to compile JSON.cpp with the error:

    .../llvm-project/llvm/lib/Support/JSON.cpp: In lambda function:
    .../llvm-project/llvm/lib/Support/JSON.cpp:291:29: error: use of 'V' before deduction of 'auto'
           for (const auto &V : *V.getAsArray())

4 years ago[llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non...
Georgii Rymar [Mon, 21 Sep 2020 15:07:49 +0000 (18:07 +0300)]
[llvm-readelf/obj] - Stop printing wrong addresses for arm32 unwind info for non-relocatable objects.

This is the first patch for https://bugs.llvm.org/show_bug.cgi?id=47581.

Currently -u does not compute function addresses correctly and
dumps broken addresses for non-relocatable objects.

ARM spec says:
"An index table entry consists of 2 words.
The first word contains a prel31 offset (see Relocations) to the start of a function, with bit 31 clear."
...
"The relocated 31 bits form a place-relative signed offset to the referenced entity.
For brevity, this document will refer to the results of these relocations as "prel31 offsets"."

(https://developer.arm.com/documentation/ihi0038/c/?lang=en#index-table-entries)
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#relocations)

Currently we use an address of the SHT_ARM_EXIDX section instead of an address of an entry
in computations. As a result we compute an offset that is not really "place-relative",
but section relative, what is wrong.

The patch fixes this issue.

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

4 years ago[llvm-readobj] - Fix a warning.
Georgii Rymar [Thu, 24 Sep 2020 10:12:51 +0000 (13:12 +0300)]
[llvm-readobj] - Fix a warning.

In a post review comments for D88097 it was mentioned that code
triggers bunch of warnings of the form:

llvm/tools/llvm-readobj/ELFDumper.cpp:5299:28: warning: loop variable 'Note' is always a copy because
the range of type 'iterator_range<llvm::object::ELFFile<llvm::object::ELFType<llvm::support::big, true> >::Elf_Note_Iterator>'
(aka 'iterator_range<Elf_Note_Iterator_Impl<ELFType<(llvm::support::endianness)0U, true> > >') does not return a reference [-Wrange-loop-analysis]
      for (const Elf_Note &Note : this->Obj.notes(P, Err))

It happens because Elf_Note is always copied here:

Elf_Note_Impl<ELFT> operator*() const {
  assert(Nhdr && "dereferenced ELF note end iterator");
  return Elf_Note_Impl<ELFT>(*Nhdr);
}

This patch fixes the issue by removing a reference.

4 years ago[SCEV] Use loop guard info when computing the max BE taken count in howFarToZero.
Florian Hahn [Thu, 24 Sep 2020 10:06:55 +0000 (11:06 +0100)]
[SCEV] Use loop guard info when computing the max BE taken count in howFarToZero.

For some expressions, we can use information from loop guards when
we are looking for a maximum. This patch applies information from
loop guards to the expression used to compute the maximum backedge
taken count in howFarToZero. It currently replaces an unknown
expression X with UMin(X, Y), if the loop is guarded by
X ult Y.

This patch is minimal in what conditions it applies, and there
are a few TODOs to generalize.

This partly addresses PR40961. We will also need an update to
LV to address it completely.

Reviewed By: reames

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

4 years ago[asan][test] Disable malloc-no-intercept.c on Solaris
Rainer Orth [Thu, 24 Sep 2020 09:58:25 +0000 (11:58 +0200)]
[asan][test] Disable malloc-no-intercept.c on Solaris

`TestCases/malloc-no-intercept.c` `FAIL`s on Solaris/x86, e.g. with
`-Dtestfunc=mallinfo`:

  /usr/bin/ld: /tmp/malloc-no-intercept-586529.o: in function `main':
  /vol/llvm/src/llvm-project/dist/compiler-rt/test/asan/TestCases/malloc-no-intercept.c:30: undefined reference to `nonexistent_function'
  clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

This is not surprising, actually:

- `mallinfo` and `mallopt` only exist in `libmalloc`
- `pvalloc` doesn't exist all all
- `cfree` does exist in `libc`, but isn't declared in any public header and
  the OpenSolaris sources reveal that it has a different signature than on
  Linux
- only `memalign` is a public interface

To avoid this, this patch disables the interceptors for all but `meminfo`.
Additionally, the test is marked `UNSUPPORTED` on Solaris since the
`memalign` and `cfree` variants **do** link on Solaris.

Tested on `amd64-pc-solaris2.11`.

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

4 years ago[clangd] Reorder a little bit of init code. NFC
Sam McCall [Thu, 24 Sep 2020 09:55:50 +0000 (11:55 +0200)]
[clangd] Reorder a little bit of init code. NFC

This makes it possible to do something else (run checks) instead of
starting the server, with all config applied.

4 years ago[MLIR][docs] Fix typos
Junda Su [Thu, 24 Sep 2020 09:44:14 +0000 (12:44 +0300)]
[MLIR][docs] Fix typos

Fixed typos in SPIR-V to LLVM manual.

Reviewed By: georgemitenkov

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

4 years ago[llvm] Use instead of in IRSimilarityIdentifierTest.cpp.
Alexander Belyaev [Thu, 24 Sep 2020 09:27:42 +0000 (11:27 +0200)]
[llvm] Use instead of  in IRSimilarityIdentifierTest.cpp.

4 years ago[unittests] Use std::make_tuple to make some toolchains happy again
Mikael Holmen [Thu, 24 Sep 2020 09:18:21 +0000 (11:18 +0200)]
[unittests] Use std::make_tuple to make some toolchains happy again

My toolchain stopped working (LLVM 8.0, libstdc++ 5.4.0) after 577adda:

06:25:37 ../unittests/Support/Path.cpp:91:7: error: chosen constructor is explicit in copy-initialization
06:25:37       {"", false, false},  {"/", true, true},      {"/foo", true, true},
06:25:37       ^~~~~~~~~~~~~~~~~~
06:25:37 /proj/flexasic/app/llvm/8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../../include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
06:25:37         constexpr tuple(_UElements&&... __elements)
06:25:37                   ^

This commit adds explicit calls to std::make_tuple to work around
the problem.

4 years ago[clang][Sema] Use enumerator instead of hard-coded constant
Mikhail Maltsev [Thu, 24 Sep 2020 09:22:54 +0000 (10:22 +0100)]
[clang][Sema] Use enumerator instead of hard-coded constant

Sema::DiagnoseSwiftName uses the constant 12 instead of the
corresponding enumerator ExpectedFunctionWithProtoType. This is
fragile and will fail if a new value gets added in the middle of the
enum.

Reviewed By: aaron.ballman

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

4 years ago[SVE] Add new isKnownXX comparison functions to TypeSize
David Sherwood [Tue, 22 Sep 2020 13:54:25 +0000 (14:54 +0100)]
[SVE] Add new isKnownXX comparison functions to TypeSize

This patch introduces four new comparison functions:

  isKnownLT, isKnownLE, isKnownGT, isKnownGE

that return true if we know at compile time that a particular
condition is met, i.e. that one size is definitely greater than
another. The existing operators <,>,<=,>= remain in the code for
now, but over time we would like to remove them and change the
code to use the isKnownXY routines instead. These functions do
not assert like the existing operators because the caller is
expected to properly deal with cases where we return false by
analysing the scalable properties. I've made more of an effort
to deal with cases where there are mixed comparisons, i.e. between
fixed width and scalable types.

I've also added some knownBitsXY routines to the EVT and MVT
classes that call the equivalent TypeSize::isKnownXY routines.
I've changed the existing bitsXY functions to call their knownBitsXY
equivalents and added asserts that the scalable properties match.
Again, over time we expect to migrate callers to use knownBitsXY
and make the code more aware of the scalable nature of the sizes.

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

4 years ago[mlir] Stop allowing LLVMType Int arguments for GPULaunchFuncOp.
Alexander Belyaev [Wed, 23 Sep 2020 15:31:55 +0000 (17:31 +0200)]
[mlir] Stop allowing LLVMType Int arguments for GPULaunchFuncOp.

Conversion to LLVM becomes confusing and incorrect if someone tries to lower
STD -> LLVM and only then GPULaunchFuncOp to LLVM separately. Although it is
technically allowed now, it works incorrectly because of the argument
promotion. The correct way to use this conversion pattern is to add to the
STD->LLVM patterns before running the pass.

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

4 years ago[llvm-objcopy][MachO] Fix --add-section
Alexander Shaposhnikov [Thu, 24 Sep 2020 08:48:21 +0000 (01:48 -0700)]
[llvm-objcopy][MachO] Fix --add-section

This diff fixes --add-section functionality and simplifies the tests organization.

Test plan: make check-all

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

4 years ago[clangd] Fix comment. NFC
Sam McCall [Thu, 24 Sep 2020 08:49:32 +0000 (10:49 +0200)]
[clangd] Fix comment. NFC

4 years ago[clangd] Disable suffix matching fallback for C during include insertion
Kadir Cetinkaya [Wed, 23 Sep 2020 12:28:57 +0000 (14:28 +0200)]
[clangd] Disable suffix matching fallback for C during include insertion

Clangd currently doesn't respect language and breaks the builds with
include insertion for C. This patch aims to stop the bleeding by not mapping
back to CPP standard library headers.

Improves https://github.com/clangd/clangd/issues/376.

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

4 years ago[flang][NFC] Fix CMake variable name in README.md
Andrzej Warzynski [Thu, 24 Sep 2020 08:34:43 +0000 (09:34 +0100)]
[flang][NFC] Fix CMake variable name in README.md

The CMake variable for the new flang driver is FLANG_BUILD_NEW_DRIVER
rather than BUILD_FLANG_NEW_DRIVER.

4 years ago[flang][driver] Add missing dependency in CMake files
Andrzej Warzynski [Tue, 22 Sep 2020 18:38:04 +0000 (19:38 +0100)]
[flang][driver] Add missing dependency in CMake files

The Flang driver depends on libclangBasic. This means, among other
things, that some of the tablegen files (e.g. diagnostic definitions)
need to be generated before various libclangBasic header files can be
included (e.g. DiagnosticIDs.h). If we are lucky, libclangBasic is
indeed built before various flang driver libraries that depend on it
are. This patch makes sure that this is deterministic - i.e.
libclangBasic is built before the Flang driver libraries are.

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

4 years ago[OpenMP][MLIR] Add assembly format for master op
Kiran Chandramohan [Fri, 11 Sep 2020 20:38:25 +0000 (21:38 +0100)]
[OpenMP][MLIR] Add assembly format for master op

Reviewed By: SouraVX, kiranktp

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

4 years ago[flang][driver] Fix options flag in the frontend driver
Andrzej Warzynski [Tue, 22 Sep 2020 18:08:18 +0000 (19:08 +0100)]
[flang][driver] Fix options flag in the frontend driver

In the frontend driver we should be using FC1Option (frontend driver
options) instead of FlangOption (flang driver options).

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

4 years agoRevert "[lld-macho] Initial support for common symbols"
Muhammad Omair Javaid [Thu, 24 Sep 2020 07:26:40 +0000 (12:26 +0500)]
Revert "[lld-macho] Initial support for common symbols"

This reverts commit 63ace77962543f961f1d566dd1243b1fb37129ef.

Breaks LLDB Arm build:
http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4409

4 years agoRevert "[lld-macho] Implement and test resolution of common symbols"
Muhammad Omair Javaid [Thu, 24 Sep 2020 07:25:47 +0000 (12:25 +0500)]
Revert "[lld-macho] Implement and test resolution of common symbols"

This reverts commit cd7cb0c30305501982ba37b4905bb264b3539ad0.
Break lldb Arm build:
http://lab.llvm.org:8011/builders/lldb-arm-ubuntu/builds/4409

4 years ago[IRSim] Adding a basic similarity identifier.
Andrew Litteken [Thu, 17 Sep 2020 20:12:08 +0000 (15:12 -0500)]
[IRSim] Adding a basic similarity identifier.

This takes the mapped instructions from the IRInstructionMapper, and
passes it to the Suffix Tree to find the repeated substrings.  Within
each set of repeated substrings, the IRSimilarityCandidates are compared
against one another for structure, and ensuring that the operands in the
instructions are used in the same way.  Each of these structurally
similarity IRSimilarityCandidates are contained in a SimilarityGroup.

Tests checking for identifying identity of structure, different
isomorphic structure, and different
nonisomoprhic structure are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

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

4 years ago[DWARFYAML] Make the ExtLen field of extended opcodes optional.
Xing GUO [Thu, 24 Sep 2020 06:11:47 +0000 (14:11 +0800)]
[DWARFYAML] Make the ExtLen field of extended opcodes optional.

This patch makes the 'ExtLen' field of extended opcodes optional. We
don't need to manually calculate it in the future.

Reviewed By: jhenderson, MaskRay

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

4 years ago[IRSim][NFC] Removing warning from IRSimilarityIdentifier
Andrew Litteken [Thu, 24 Sep 2020 05:26:21 +0000 (00:26 -0500)]
[IRSim][NFC] Removing warning from IRSimilarityIdentifier

4 years agoDebugInfo: Filter DWARFv5 TUs out of the debug_info unit list when CUs requested
David Blaikie [Fri, 18 Sep 2020 18:30:50 +0000 (11:30 -0700)]
DebugInfo: Filter DWARFv5 TUs out of the debug_info unit list when CUs requested

Since DWARFv5 places TUs in debug_info, some of DWARFContext's APIs have
become a bit erroneous, including TUs in the CU list by accident.
Correct that by providing compile_units (& dwo_compile_units) that
filter out the type units from the debug_info units.

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

4 years ago[dwarfdump] Warn for tags with DW_CHILDREN_yes but no children.
Jonas Devlieghere [Thu, 24 Sep 2020 05:00:57 +0000 (22:00 -0700)]
[dwarfdump] Warn for tags with DW_CHILDREN_yes but no children.

Flag DIEs that have DW_CHILDREN_yes set in their abbreviation but don't
actually have any children.

rdar://59809554

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

4 years ago[Power10] Implement custom codegen for the vec_replace_elt and vec_replace_unaligned...
Amy Kwan [Wed, 23 Sep 2020 22:14:24 +0000 (17:14 -0500)]
[Power10]  Implement custom codegen for the vec_replace_elt and vec_replace_unaligned builtins.

This patch implements custom codegen for the vec_replace_elt and
vec_replace_unaligned builtins.

These builtins map to the @llvm.ppc.altivec.vinsw and @llvm.ppc.altivec.vinsd
intrinsics depending on the arguments. The main motivation for doing custom
codegen for these intrinsics is because there are float and double versions of
the builtin. Normally, the converting the float to an integer would be done via
fptoui in the IR. This is incorrect as fptoui truncates the value and we must
ensure the value is not truncated. Therefore, we provide custom codegen to utilize
bitcast instead as bitcasts do not truncate.

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

4 years ago[IRSim] Adding structural comparison to IRSimilarityCandidate.
Andrew Litteken [Wed, 23 Sep 2020 16:04:39 +0000 (11:04 -0500)]
[IRSim] Adding structural comparison to IRSimilarityCandidate.

Just because sequences of instructions are similar to one another,
doesn't mean they are doing the same thing.

This introduces a structural check for the IRSimilarityCandidate that
compares two IRSimilarityCandidates against one another, and in each
instruction creates a mapping between the operands and results, or
checks that the existing mapping is valid.  If this check passes, it
means we have structurally similar IRSimilarityCandidates.

Tests for whether the candidates are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Recommit of: b27db2bb68163fa5bcb4a8f631a305eb5adb44e5 for Differential
URL.

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

4 years agoRevert "[IRSim] Adding structural comparison to IRSimilarityCandidate."
Andrew Litteken [Thu, 24 Sep 2020 03:40:37 +0000 (22:40 -0500)]
Revert "[IRSim] Adding structural comparison to IRSimilarityCandidate."

This reverts commit b27db2bb68163fa5bcb4a8f631a305eb5adb44e5.

4 years ago[IRSim] Adding structural comparison to IRSimilarityCandidate.
Andrew Litteken [Wed, 23 Sep 2020 16:04:39 +0000 (11:04 -0500)]
[IRSim] Adding structural comparison to IRSimilarityCandidate.

Just because sequences of instructions are similar to one another,
doesn't mean they are doing the same thing.

This introduces a structural check for the IRSimilarityCandidate that
compares two IRSimilarityCandidates against one another, and in each
instruction creates a mapping between the operands and results, or
checks that the existing mapping is valid.  If this check passes, it
means we have structurally similar IRSimilarityCandidates.

Tests for whether the candidates are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

4 years ago[lld-macho][NFC] Make `!= nullptr` implicit
Jez Ng [Thu, 24 Sep 2020 03:09:49 +0000 (20:09 -0700)]
[lld-macho][NFC] Make `!= nullptr` implicit

4 years ago[lld-macho][NFC] Refactor syslibroot / library path lookup
Jez Ng [Sat, 19 Sep 2020 03:51:38 +0000 (20:51 -0700)]
[lld-macho][NFC] Refactor syslibroot / library path lookup

* Move computation of systemLibraryRoots into a separate function, so we
  can add more functionality to it without things becoming unwieldy
* Have `getSearchPaths` and related functions return by value instead of
  by output parameter. NRVO should ensure that performance is unaffected.

Reviewed By: #lld-macho, smeenai

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

4 years ago[lld-macho] Support -weak_lx, -weak_library, -weak_framework
Jez Ng [Fri, 18 Sep 2020 18:38:15 +0000 (11:38 -0700)]
[lld-macho] Support -weak_lx, -weak_library, -weak_framework

They cause their corresponding libraries / frameworks to be loaded via
`LC_LOAD_WEAK_DYLIB` instead of `LC_LOAD_DYLIB`.

Reviewed By: #lld-macho, gkm

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

4 years ago[lld-macho] Ignore `-mllvm` and its argument
Jez Ng [Wed, 16 Sep 2020 23:07:21 +0000 (16:07 -0700)]
[lld-macho] Ignore `-mllvm` and its argument

Test Plan:

Reviewed By: #lld-macho, compnerd, MaskRay

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

4 years ago[lld-macho] Emit indirect symbol table
Jez Ng [Sat, 5 Sep 2020 01:02:07 +0000 (18:02 -0700)]
[lld-macho] Emit indirect symbol table

Makes it a little easier to read objdump's disassembly.

Reviewed By: #lld-macho, gkm

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

4 years ago[lld-macho] Implement and test resolution of common symbols
Jez Ng [Tue, 1 Sep 2020 03:57:19 +0000 (20:57 -0700)]
[lld-macho] Implement and test resolution of common symbols

Handle the case where there are both common and non-common definitions
of the same symbol. Add a bunch of tests to ensure compatibility with ld64.

Reviewed By: #lld-macho, gkm

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

4 years ago[lld-macho] Initial support for common symbols
Jez Ng [Fri, 28 Aug 2020 05:54:43 +0000 (22:54 -0700)]
[lld-macho] Initial support for common symbols

On Unix, it is traditionally allowed to write variable definitions without
initialization expressions (such as "int foo;") to header files. These are
called tentative definitions.

The compiler creates common symbols when it sees tentative definitions. When
linking the final binary, if there are remaining common symbols after name
resolution is complete, the linker converts them to regular defined symbols in
a `__common` section.

This diff implements most of that functionality, though we do not yet handle
the case where there are both common and non-common definitions of the same
symbol.

Reviewed By: #lld-macho, gkm

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

4 years ago[GlobalISel][AMDGPU] Lower G_SMULH/G_UMULH
Pushpinder Singh [Mon, 10 Aug 2020 09:47:50 +0000 (05:47 -0400)]
[GlobalISel][AMDGPU] Lower G_SMULH/G_UMULH

Reviewed By: arsenm, foad

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

4 years ago[NFC] Remove unnecessary default constructors
Arthur Eubanks [Thu, 24 Sep 2020 01:52:35 +0000 (18:52 -0700)]
[NFC] Remove unnecessary default constructors

4 years ago[AMDGPU] Consider all SGPR uses as unique in constant bus verify
Carl Ritson [Thu, 24 Sep 2020 01:28:46 +0000 (10:28 +0900)]
[AMDGPU] Consider all SGPR uses as unique in constant bus verify

Fix the verifier so that overlapping SGPR operands are counted
independently.  We cannot assume that overlapping SGPR accesses
only count as a single constant bus use.
The exception is implicit uses which do not add to constant bus
usage (only) when overlapping.

Reviewed By: rampitec

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

4 years agoRevert "[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass"
Arthur Eubanks [Thu, 24 Sep 2020 01:43:13 +0000 (18:43 -0700)]
Revert "[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass"

This reverts commit 111aa4e36614d9a056cf5040d4d7bbfddeb9ebb2.

4 years ago[X86] Parse data32 call in .code16 as CALLpcrel32
Fangrui Song [Thu, 24 Sep 2020 01:36:50 +0000 (18:36 -0700)]
[X86] Parse data32 call in .code16 as CALLpcrel32

Used by kexec-tools (PR46942)
In GNU as, tc-i386.c:output_jump uses 4-byte immediate if a data32 prefix is present.

Reviewed By: craig.topper

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

4 years ago[X86] Add TDX instructions.
Freddy Ye [Thu, 24 Sep 2020 01:12:28 +0000 (09:12 +0800)]
[X86] Add TDX instructions.

For more details about these instructions, please refer to the latest TDX document: https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html

Reviewed By: craig.topper

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

4 years agoUtility: ignore OS version on non-Darwin targets in `ArchSpec`
Saleem Abdulrasool [Wed, 23 Sep 2020 20:57:55 +0000 (20:57 +0000)]
Utility: ignore OS version on non-Darwin targets in `ArchSpec`

The OS version field is generally not very helpful for non-Darwin
targets.  On Linux, it identifies the kernel version which moves
out-of-sync with the userspace.  On Windows, this field actually ends up
corresponding to the Visual Studio toolset version instead of the OS
version.  Consider non-Darwin targets without an OS version to be fully
specified.

Differential Revision: https://reviews.llvm.org/D88181
Reviewed By: Jonas Devlieghere, Dave Lee

4 years agoExplicitly specify CMAKE_AR in WinMsvc.cmake
Gwen Mittertreiner [Wed, 23 Sep 2020 23:20:06 +0000 (16:20 -0700)]
Explicitly specify CMAKE_AR in WinMsvc.cmake

As of cmake 3.18, cmake changes how it searches for compilers for
Windows (see
https://gitlab.kitware.com/cmake/cmake/-/commit/55196a1440e26917d40e6a7a3eb8d9fb323fa657)
and now finds llvm-ar instead of llvm-lib as CMAKE_AR. This explicitly
specifies CMAKE_AR as llvm-lib so the correct program is found.

Reviewed By: smeenai

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

4 years ago[CGProfile] don't emit cgprofile entry if called function is dllimport
Zequan Wu [Wed, 23 Sep 2020 01:10:26 +0000 (18:10 -0700)]
[CGProfile] don't emit cgprofile entry if called function is dllimport

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

4 years ago[clangd] Improve bad-RPC-payload error messages slightly
Sam McCall [Wed, 23 Sep 2020 23:51:29 +0000 (01:51 +0200)]
[clangd] Improve bad-RPC-payload error messages slightly

4 years ago[libc++] Fix spurious test failure in -fno-exceptions
Louis Dionne [Wed, 23 Sep 2020 23:44:03 +0000 (19:44 -0400)]
[libc++] Fix spurious test failure in -fno-exceptions

4 years agoFix LLDB tweak in 62a47e994fcf5b73e29547d26cd9676b30cb69a3
Sam McCall [Wed, 23 Sep 2020 23:30:42 +0000 (01:30 +0200)]
Fix LLDB tweak in 62a47e994fcf5b73e29547d26cd9676b30cb69a3

4 years ago[JSON] Add error reporting to fromJSON and ObjectMapper
Sam McCall [Wed, 23 Sep 2020 23:14:12 +0000 (01:14 +0200)]
[JSON] Add error reporting to fromJSON and ObjectMapper

Translating between JSON objects and C++ strutctures is common.
From experience in clangd, fromJSON/ObjectMapper work well and save a lot of
code, but aren't adopted elsewhere at least partly due to total lack of error
reporting beyond "ok"/"bad".

The recently-added error model should be rich enough for most applications.
It requires tracking the path within the root object and reporting local
errors at appropriate places.
To do this, we exploit the fact that the call graph of recursive
parse functions mirror the structure of the JSON itself.
The current path is represented as a linked list of segments, each of which is
on the stack as a parameter. Concretely, fromJSON now looks like:
  bool fromJSON(const Value&, T&, Path);

Beyond the signature change, this is reasonably unobtrusive: building
the path segments is mostly handled by ObjectMapper and the vector<T> fromJSON.
However the root caller of fromJSON must now create a Root object to
store the errors, which is a little clunky.

I've added high-level parse<T>(StringRef) -> Expected<T>, but it's not
general enough to be the primary interface I think (at least, not usable in
clangd).

All existing users (mostly just clangd) are updated in this patch,
making this change backwards-compatible is a bit hairy.

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

4 years ago[libunwind] Optimize dl_iterate_phdr's findUnwindSectionsByPhdr
Ryan Prichard [Wed, 23 Sep 2020 21:25:23 +0000 (14:25 -0700)]
[libunwind] Optimize dl_iterate_phdr's findUnwindSectionsByPhdr

Currently, findUnwindSectionsByPhdr is slightly micro-optimized for the
case where the first callback has the target address, and is otherwise
very inefficient -- it decodes .eh_frame_hdr even when no PT_LOAD
matches the PC. (If the FrameHeaderCache is enabled, then the
micro-optimization only helps the first time unwind info is looked up.)

Instead, it makes more sense to optimize for the case where the
callback *doesn't* find the target address, so search for a PT_LOAD
segment first, and only look for the unwind info section if a matching
PT_LOAD is found.

This change helps on an Android benchmark with 100 shared objects,
where the DSO at the end of the dl_iterate_phdr list throws 10000
exceptions. Assuming the frame cache is disabled, this change cuts
about 30-40% off the benchmark's runtime.

Reviewed By: compnerd, saugustine, #libunwind

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

4 years ago[libunwind] Combine dl_iterate_phdr codepaths for DWARF and EHABI
Ryan Prichard [Wed, 23 Sep 2020 21:25:13 +0000 (14:25 -0700)]
[libunwind] Combine dl_iterate_phdr codepaths for DWARF and EHABI

dl_iterate_phdr is used to search for unwind info provided by either
PT_GNU_EH_FRAME or PT_ARM_EXIDX. Most of the code between the two is
the same, so combine them, and factor out what's different into
checkForUnwindInfoSegment.

Details:
 - The FrameHeaderCache can now be enabled for ARM EHABI.
 - findUnwindSectionsByPhdr now finds the last PT_ARM_EXIDX rather than
   the first. There should only be one segment.
 - The dso_base and text_segment_length fields of UnwindInfoSections
   are now needed for dl_iterate_phdr when using EHABI, to hold the
   low and high PC values for a cache entry.

Reviewed By: compnerd, danielkiss, #libunwind, saugustine

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

4 years ago[JSON] Display errors associated with Paths in context
Sam McCall [Wed, 23 Sep 2020 22:28:52 +0000 (00:28 +0200)]
[JSON] Display errors associated with Paths in context

When an error occurs processing a JSON object, seeing the actual
surrounding data helps. Dumping just the node where the problem
was identified can be too much or too little information.

printErrorContext() shows the error message in its context, as a comment.
JSON values along the path to the broken place are shown in some detail,
the rest of the document is elided. For example:

```
{
  "credentials": [
    {
      "username": /* error: expected string */ 42,
      "password": "secret"
    },
    { ... }
  ]
  "backups": { ... }
}
```

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

4 years ago[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass
Arthur Eubanks [Tue, 22 Sep 2020 16:34:46 +0000 (09:34 -0700)]
[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass

This is in preparation for supporting -debugify-each, which adds a debug
info pass before and after each pass.

Switch VerifyEach to use this.

Reviewed By: ychen

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

4 years ago[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass
Arthur Eubanks [Wed, 16 Sep 2020 20:49:31 +0000 (13:49 -0700)]
[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass

This seems to fit the CGSCC updates model better than calling
addNewFunctionInto{Ref,}SCC() on newly created/outlined functions.
Now addNewFunctionInto{Ref,}SCC() are no longer necessary.

However, this doesn't work on newly outlined functions that aren't
referenced by the original function. e.g. if a() was outlined into b()
and c(), but c() is only referenced by b() and not by a(), this will
trigger an assert.

This also fixes an issue I was seeing with newly created functions not
having passes run on them.

Ran check-llvm with expensive checks.

Reviewed By: asbirlea

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

4 years ago[NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency
Arthur Eubanks [Wed, 23 Sep 2020 01:33:42 +0000 (18:33 -0700)]
[NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency

Reviewed By: asbirlea

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

4 years ago[JSON] Facility to track position within an object and report errors.
Sam McCall [Wed, 23 Sep 2020 22:01:45 +0000 (00:01 +0200)]
[JSON] Facility to track position within an object and report errors.

This error model should be rich enough for most applications. It comprises:

- a name for the root object, so the user knows what we're parsing
- a path from the root object to the JSON node most associated with the error
- a local error message

This can be presented as an llvm::Error e.g.
  "expected string at ConfigFile.credentials[0].username"

It's designed to be cheap: Paths are a linked list of lightweight
objects on the stack. No heap allocations unless errors are encountered.

A subsequent commit will make use of this in the JSON-to-object
translation facilities: fromJSON and ObjectMapper.
However it's independent of these and can be used for e.g. validation alone.

Another subsequent commit will support showing the error in its context
within the parsed value.

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

4 years ago[lld-macho] handle options -search_paths_first, -search_dylibs_first
Greg McGary [Sun, 20 Sep 2020 15:37:20 +0000 (08:37 -0700)]
[lld-macho] handle options -search_paths_first, -search_dylibs_first

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

4 years ago[X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers...
Craig Topper [Wed, 23 Sep 2020 21:53:16 +0000 (14:53 -0700)]
[X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target

I believe the inline asm emitted here should have a memory clobber since it writes to memory.

It was also missing the dirflag clobber that we use by default along with flags and fpsr. To avoid missing defaults in the future, get the default list from the target

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

4 years ago[lld-macho] cleanup unimplemented-option warnings
Greg McGary [Wed, 23 Sep 2020 15:53:37 +0000 (08:53 -0700)]
[lld-macho] cleanup unimplemented-option warnings

Remove all spurious `HelpHidden` flags from  `lld/MachO/Options.td`. Add test for `HelpHidden` to `warnIfUnimplementedOption()` so that the empty `// handled elsewhere` case is unnecessary.

Reviewed By: #lld-macho, int3, smeenai

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

4 years ago[JSON] Allow emitting comments in json::OStream
Sam McCall [Wed, 23 Sep 2020 21:33:19 +0000 (23:33 +0200)]
[JSON] Allow emitting comments in json::OStream

This isn't standard JSON, but is a popular extension.
It will be used to show errors in context, rendering pseudo-json for humans.

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

4 years ago[SelectionDAG][GISel] Make LegalizeDAG lower FNEG using integer ops.
Eli Friedman [Wed, 23 Sep 2020 21:10:33 +0000 (14:10 -0700)]
[SelectionDAG][GISel] Make LegalizeDAG lower FNEG using integer ops.

Previously, if a floating-point type was legal, but FNEG wasn't legal,
we would use FSUB.  Instead, we should use integer ops, to preserve the
semantics.  (Alternatively, there's a compiler-rt call we could use, but
there isn't much reason to use that.)

It turns out we actually are still using this obscure codepath in a few
cases: on some targets, we have "legal" floating-point types that don't
actually support any floating-point operations.  In particular, ARM and
AArch64 are using this path.

The implementation for SelectionDAG is pretty simple because we can
reuse the infrastructure from FCOPYSIGN.

See also 9a3dc3e, the corresponding change to type legalization.

Also includes a "bonus" change to STRICT_FSUB legalization, so we can
lower a STRICT_FSUB to a float libcall.

Includes the changes to both LegalizeDAG and GlobalISel so we don't have
inconsistent results in the future.

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

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

4 years ago[AArch64] Expand some vector of i64 reductions on NEON
Cameron McInally [Wed, 23 Sep 2020 20:55:06 +0000 (15:55 -0500)]
[AArch64] Expand some vector of i64 reductions on NEON

With the exception of VECREDUCE_ADD, there are no NEON instructions to support vector of i64 reductions. This patch removes the Custom lowerings for those and adds some test coverage to confirm.

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

4 years agoRecommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic
Yaxun (Sam) Liu [Wed, 23 Sep 2020 20:16:00 +0000 (16:16 -0400)]
Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic

This recommits 829d14ee0a6aa79c89f7f3d9fcd9d27d3efd2b91.

The patch was reverted due to a regression in some CUDA app
which was thought to be caused by this patch. However, investigation
showed that the regression was due to some other issues, therefore
recommit this patch.

4 years ago[PowerPC] Implement the 128-bit vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins...
Amy Kwan [Wed, 23 Sep 2020 20:46:54 +0000 (16:46 -0400)]
[PowerPC] Implement the 128-bit vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins in Clang/LLVM

This patch implements the vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins for vector signed/unsigned __int128.

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

4 years ago[PowerPC] Implement Vector signed/unsigned __int128 overloads for the comparison...
Albion Fung [Wed, 23 Sep 2020 20:37:48 +0000 (16:37 -0400)]
[PowerPC] Implement Vector signed/unsigned __int128 overloads for the comparison builtins

This patch implements Vector signed/unsigned __int128 overloads for the comparison builtins.

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

4 years agoClean up test file, NFC
Krzysztof Parzyszek [Wed, 23 Sep 2020 19:59:13 +0000 (14:59 -0500)]
Clean up test file, NFC

4 years ago[LoopTerminology][NFC] Fix formatting typo
Stefanos Baziotis [Wed, 23 Sep 2020 19:53:05 +0000 (22:53 +0300)]
[LoopTerminology][NFC] Fix formatting typo

4 years ago[lldb] Normalize paths in new test
Joseph Tremoulet [Wed, 23 Sep 2020 16:20:10 +0000 (09:20 -0700)]
[lldb] Normalize paths in new test

The minidump-sysroot test I added in commit 20f84257 compares two paths
using a string comparison.  This causes the Windows buildbot to fail
because of mismatched forward slashes and backslashes.  Use
os.path.normcase to normalize before comparing.

4 years agoAllow init_priority values <= 100 and > 65535 within system headers.
Aaron Ballman [Wed, 23 Sep 2020 19:24:52 +0000 (15:24 -0400)]
Allow init_priority values <= 100 and > 65535 within system headers.

This also adds some bare-bones documentation for the attribute rather
than leaving it undocumented.

4 years ago[AArch64][SVE] Add lowering for llvm frecpx
Muhammad Asif Manzoor [Wed, 23 Sep 2020 19:22:13 +0000 (15:22 -0400)]
[AArch64][SVE] Add lowering for llvm frecpx

Add the functionality to lower frecpx for passthru variant

Reviewed By: paulwalker-arm

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

4 years agoRevert "[lsan] On Fuchsia, don't use atexit hook for leak checks"
Nikita Popov [Wed, 23 Sep 2020 19:08:15 +0000 (21:08 +0200)]
Revert "[lsan] On Fuchsia, don't use atexit hook for leak checks"

This reverts commit 0caad9fe441d5ee562e96d8b30b5574b492a933a.
This reverts commit c96d0cceb684fa176b51d7df5f4f8370e2c983f4.

Causes linker errors which were not fixed by the subsequent commit
either:

/home/nikic/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:503: error: undefined reference to '__asan::InstallAtExitCheckLeaks()'

4 years ago[scudo][standalone] Fix tests under ASan/UBSan
Kostya Kortchinsky [Wed, 23 Sep 2020 17:22:15 +0000 (10:22 -0700)]
[scudo][standalone] Fix tests under ASan/UBSan

Fix a potential UB in `appendSignedDecimal` (with -INT64_MIN) by making
it a special case.

Fix the terrible test cases for `isOwned`: I was pretty sloppy on those
and used some stack & static variables, but since `isOwned` accesses
memory prior to the pointer to check for the validity of the Scudo
header, it ended up being detected as some global and stack buffer out
of bounds accesses. So not I am using buffers with enough room so that
the test will not access memory prior to the variables.

With those fixes, the tests pass on the ASan+UBSan Fuchsia build.

Thanks to Roland for pointing those out!

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

4 years agoasan: Use `#if` to test CAN_SANITIZE_LEAKS
Roland McGrath [Wed, 23 Sep 2020 18:41:09 +0000 (11:41 -0700)]
asan: Use `#if` to test CAN_SANITIZE_LEAKS

The `if (0)` isn't necessarily optimized out so as not to create
a link-time reference to LSan runtime functions that might not
exist.  So use explicit conditional compilation instead.

Reviewed By: phosek

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

4 years ago[PowerPC][PCRelative] Thread Local Storage Support for Local Dynamic
Victor Huang [Wed, 23 Sep 2020 18:43:33 +0000 (13:43 -0500)]
[PowerPC][PCRelative] Thread Local Storage Support for Local Dynamic

This patch is the initial support for the Local Dynamic Thread Local Storage
model to produce code sequence and relocation correct to the ABI for the model
when using PC relative memory operations.

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

4 years ago[IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData.
Andrew Litteken [Tue, 15 Sep 2020 22:30:31 +0000 (17:30 -0500)]
[IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData.

The IRSimilarityCandidate is a container to hold a region of
IRInstructions and offer interfaces for the starting instruction, ending
instruction, parent function, length.  It also assigns a global value
number for each unique instance of a value in the region.

It also contains an interface to compare two IRSimilarity as to whether
they have the same sequence of similar instructions.

Tests for whether the instructions are similar are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Recommit of: 4944bb190fed8861d4d043eaf45e3c1e12aa2dc5

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

4 years ago[AMDGPU] Make ds fp atomics overloadable
Stanislav Mekhanoshin [Fri, 18 Sep 2020 20:20:00 +0000 (13:20 -0700)]
[AMDGPU] Make ds fp atomics overloadable

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

4 years agoAdd `breakpoint delete --disabled`: deletes all disabled breakpoints.
Jim Ingham [Wed, 23 Sep 2020 01:05:46 +0000 (18:05 -0700)]
Add `breakpoint delete --disabled`: deletes all disabled breakpoints.

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

4 years ago[AArch64][SVE] Fix frame offset calculation when d8 is saved.
Eli Friedman [Tue, 22 Sep 2020 22:05:13 +0000 (15:05 -0700)]
[AArch64][SVE] Fix frame offset calculation when d8 is saved.

If d8 is saved, the fp is not actually adjacent to the SVE
spills/allocations.  Fix the offset calculation to account for this.

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

4 years ago[mlir][OpFormatGen] Update "custom" directives for attributes.
Mike Urbach [Wed, 23 Sep 2020 18:01:39 +0000 (18:01 +0000)]
[mlir][OpFormatGen] Update "custom" directives for attributes.

This tweaks the generated code for parsing attributes with a custom
directive to call `addAttribute` on the `OperationState` directly,
and adds a newline after this call. Previously, the generated code
would call `addAttribute` on the `OperationState` field `attributes`,
which has no such method and fails to compile. Furthermore, the lack
of newline would generate code with incorrectly formatted single line
`if` statements. Added tests for parsing and printing attributes with
a custom directive.

Reviewed By: mehdi_amini

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

4 years ago[gn build] Allow option to build with asan/tsan/ubsan
Arthur Eubanks [Mon, 21 Sep 2020 23:28:21 +0000 (16:28 -0700)]
[gn build] Allow option to build with asan/tsan/ubsan

Reviewed By: thakis

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

4 years ago[lsan] On Fuchsia, don't use atexit hook for leak checks
Roland McGrath [Wed, 23 Sep 2020 01:02:56 +0000 (18:02 -0700)]
[lsan] On Fuchsia, don't use atexit hook for leak checks

Fuchsia's system libraries are instrumented and use the lsan
allocator for internal purposes.  So leak checking needs to run
after all atexit hooks and after the system libraries' internal
exit-time hooks.  The <zircon/sanitizer.h> hook API calls the
__sanitizer_process_exit_hook function at exactly the right time.

Reviewed By: vitalybuka, phosek

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

4 years agoDocument the `--verbatim` flag from arc to update the description for a phabricator...
Mehdi Amini [Wed, 23 Sep 2020 18:00:37 +0000 (18:00 +0000)]
Document the `--verbatim` flag from arc to update the description for a phabricator revision

4 years agoUpdate Phabricator doc to remove the warning on "arc land": tags a properly handled...
Mehdi Amini [Wed, 23 Sep 2020 17:57:27 +0000 (17:57 +0000)]
Update Phabricator doc to remove the warning on "arc land": tags a properly handled server side now