platform/upstream/llvm.git
3 years ago[Scudo] Use GWP-ASan's aligned allocations and fixup postalloc hooks.
Mitch Phillips [Fri, 23 Apr 2021 16:47:07 +0000 (09:47 -0700)]
[Scudo] Use GWP-ASan's aligned allocations and fixup postalloc hooks.

This patch does a few cleanup things:
 1. The non-standalone scudo has a problem where GWP-ASan allocations
 may not meet alignment requirements where Scudo was requested to have
 alignment >= 16. Use the new GWP-ASan API to fix this.
 2. The standalone variant loses some debugging information inside of
 GWP-ASan because we ask GWP-ASan to allocate an aligned size in the
 frontend. This means reports end up with 'UaF on a 16-byte allocation'
 for a 1-byte allocation with 16-byte alignment. Also use the new API to
 fix this.
 3. Add post-alloc hooks for GWP-ASan intercepted allocations, and add
 stats tracking for GWP-ASan allocations.
 4. Add a small test that checks the alignment of the frontend
 allocator, so that it can be used under GWP-ASan torture mode.
 5. Add GWP-ASan torture mode as a testing configuration to catch these
 regressions.

Depends on D94830, D95889.

Reviewed By: cryptoad

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

3 years ago[PR49761] Fix variadic arg handling in matcher
Chris Hamilton [Thu, 22 Apr 2021 20:39:36 +0000 (15:39 -0500)]
[PR49761] Fix variadic arg handling in matcher

Mishandling of variadic arguments in a function call caused a crash
(runtime assert fail) in bugprone-infinite-loop tidy checker.  Fix
is to limit argument matching to the lesser of the number of variadic
params in the prototype or the number of actual args in the call.

Reviewed By: aaron.ballman

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

3 years agoMark type test intrinsics as speculatable to fix inline cost
Teresa Johnson [Fri, 23 Apr 2021 16:30:28 +0000 (09:30 -0700)]
Mark type test intrinsics as speculatable to fix inline cost

There is already code in InlineCost.cpp to identify and ignore ephemeral
values (llvm.assume intrinsics and other side-effect free instructions
only feeding the assumes). However, because llvm.type.test intrinsics
were not marked speculatable, they and any instructions specifically
feeding the type test (typically a bitcast) were being counted towards
the instruction cost when inlining. This was causing profile matching
issues in some cases when enabling -fwhole-program-vtables for whole
program devirtualization.

According to the language reference, the speculatable attribute means:
"the function does not have any effects besides calculating its result
and does not have undefined behavior". I see no reason why type tests
cannot be marked with this attribute.

There are 2 test changes:

llvm/test/Transforms/Inline/ephemeral.ll: I added a type test intrinsic
here to verify the fix. Also, I found the test was not actually testing
what it originally intended. Many of the existing instructions were
optimized away by -Oz, and the cost of inlining was negative due to the
benefit of removing the call. So I changed the test to simply invoke the
inline pass and check the number of instructions computed by InlineCost.
I also fixed an instruction that was not actually used anywhere.

llvm/test/Transforms/SimplifyCFG/no-md-sink.ll needed to be made more
robust to code changes that reordered the metadata.

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

3 years ago[NFC] Use hasSection instead of getSection().empty()
Snehasish Kumar [Fri, 23 Apr 2021 00:38:13 +0000 (17:38 -0700)]
[NFC] Use hasSection instead of getSection().empty()

Use the optimized check hasSection() instead of calling
getSection().empty(). Originally suggested in D101004, but was dropped
in the commit.

3 years ago[AST] Update tests to query for introspection support
Stephen Kelly [Fri, 23 Apr 2021 15:24:14 +0000 (16:24 +0100)]
[AST] Update tests to query for introspection support

3 years ago[libc++] Rewrite the tuple constructors to be strictly Standards conforming
Louis Dionne [Wed, 10 Feb 2021 21:19:50 +0000 (16:19 -0500)]
[libc++] Rewrite the tuple constructors to be strictly Standards conforming

This nasty patch rewrites the tuple constructors to match those defined
by the Standard. We were previously providing several extensions in those
constructors - those extensions are removed by this patch.

The issue with those extensions is that we've had numerous bugs filed
against us over the years for problems essentially caused by them. As a
result, people are unable to use tuple in ways that are blessed by the
Standard, all that for the perceived benefit of providing them extensions
that they never asked for.

Since this is an API break, I communicated it in the release notes.
I do not foresee major issues with this break because I don't think the
extensions are too widely relied upon, but we can ship it and see if we
get complaints before the next LLVM release - that will give us some
amount of information regarding how much use these extensions have.

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

3 years agoDrop a REQUIRES: lldb on a dexter regression test
Jeremy Morse [Fri, 23 Apr 2021 16:38:44 +0000 (17:38 +0100)]
Drop a REQUIRES: lldb on a dexter regression test

As this is a test that actually gets to operating the debugger, it
needs to be limited to scenarios where the debugger is available.

(We'll file this in the set of things Dexter doesn't handle gracefully..)

3 years ago[RISCV] Remove GetVRegNoV0 from the output register class of masked compare pseudo...
Craig Topper [Fri, 23 Apr 2021 16:33:24 +0000 (09:33 -0700)]
[RISCV] Remove GetVRegNoV0 from the output register class of masked compare pseudo instructions.

Theses instructions are allowed to write v0 when they are masked.
We'll still never use v0 because of the earlyclobber constraint so
this doesn't really help anything. It just makes the definitions
correct.

While I was there remove an unused multiclass I noticed.

Reviewed By: HsiangKai

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

3 years ago[RISCV] Have assembler check that the temp register is different than dest register...
Craig Topper [Fri, 23 Apr 2021 16:33:09 +0000 (09:33 -0700)]
[RISCV] Have assembler check that the temp register is different than dest register for vmsgeu.vx pseudo.

Reviewed By: HsiangKai

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

3 years agoscudo: Store header on deallocation before retagging memory.
Peter Collingbourne [Fri, 23 Apr 2021 05:41:01 +0000 (22:41 -0700)]
scudo: Store header on deallocation before retagging memory.

From a cache perspective it's better to store the header immediately
after loading it. If we delay this operation until after we've
retagged it's more likely that our header will have been evicted from
the cache and we'll need to fetch it again in order to perform the
compare-exchange operation.

For similar reasons, store the deallocation stack before retagging
instead of afterwards.

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

3 years ago[VPlan] Add GraphTraits impl to traverse through VPRegionBlock.
Florian Hahn [Fri, 23 Apr 2021 10:33:38 +0000 (11:33 +0100)]
[VPlan] Add GraphTraits impl to traverse through VPRegionBlock.

This patch adds a new iterator to traverse through VPRegionBlocks and a
GraphTraits specialization using the iterator to traverse through
VPRegionBlocks.

Because there is already a GraphTraits specialization for VPBlockBase *
and co, a new VPBlockRecursiveTraversalWrapper helper is introduced.
This allows us to provide a new GraphTraits specialization for that
type. Users can use the new recursive traversal by using this wrapper.

The graph trait visits both the entry block of a region, as well as all
its successors. Exit blocks of a region implicitly have their parent
region's successors. This ensures all blocks in a region are visited
before any blocks in a successor region when doing a reverse post-order
traversal of the graph.

Reviewed By: a.elovikov

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

3 years ago[OpenMP] Avoid reading uninitialized parallel level values
Johannes Doerfert [Fri, 23 Apr 2021 01:36:18 +0000 (01:36 +0000)]
[OpenMP] Avoid reading uninitialized parallel level values

In a last minute change request for a2dbfb6b72db we introduced a
read of the uninitialized parallel level value in SPMD-mode.
We go back to initializing the array early and checking for an
adjusted level.

Found by the miniqmc unit tests:
  https://cdash.qmcpack.org/CDash/viewTest.php?onlyfailed&buildid=203434

Reviewed By: JonChesterfield

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

3 years ago[Clang] Allow the combination of loader_uninitialized and address spaces
Johannes Doerfert [Wed, 21 Apr 2021 07:27:32 +0000 (02:27 -0500)]
[Clang] Allow the combination of loader_uninitialized and address spaces

When an object is allocated in a non-default address space we do not
need to check for a constructor if it is not initialized and has a
trivial constructor (which we won't call then).

Reviewed By: JonChesterfield

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

3 years ago[libcxx] Fixed build break on buildbots with -Werror
Dávid Bolvanský [Fri, 23 Apr 2021 16:16:22 +0000 (18:16 +0200)]
[libcxx] Fixed build break on buildbots with -Werror

3 years ago[AMDGPU] Save WWM registers in functions
Sebastian Neubauer [Fri, 23 Apr 2021 14:09:31 +0000 (16:09 +0200)]
[AMDGPU] Save WWM registers in functions

The values of registers in inactive lanes needs to be saved during
function calls.

Save all registers used for whole wave mode, similar to how it is done
for VGPRs that are used for SGPR spilling.

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

Reapply with fixed tests on window.

3 years ago[TableGen] [docs] Improve BNF for the 'multiclass' statement [NFC]
Paul C. Anagnostopoulos [Fri, 23 Apr 2021 16:03:48 +0000 (12:03 -0400)]
[TableGen] [docs] Improve BNF for the 'multiclass' statement [NFC]

3 years ago[PowerPC] Add vec_ctsl and vec_ctul to altivec.h
Nemanja Ivanovic [Fri, 23 Apr 2021 15:29:49 +0000 (10:29 -0500)]
[PowerPC] Add vec_ctsl and vec_ctul to altivec.h

These are added for compatibility with XLC. They are similar to
vec_cts and vec_ctu except that the result is a doubleword vector
regardless of the parameter type.

3 years ago[cmake] Configure policy CMP0116
Dave Lee [Thu, 22 Apr 2021 17:08:53 +0000 (10:08 -0700)]
[cmake] Configure policy CMP0116

Using `cmake` >=3.20 results in many warnings about this new policy. This change silences the warnings by explicitly declaring use of the "OLD" behavior.

This policy currently affects only one place: the `tablegen()` function in `TableGen.cmake`.

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

3 years ago[CostModel][X86] Improve v2f32 fadd reduction cost
Simon Pilgrim [Fri, 23 Apr 2021 15:55:59 +0000 (16:55 +0100)]
[CostModel][X86] Improve v2f32 fadd reduction cost

This was being reported as a similar cost to v4f32 when its a lot cheaper (just a shufps+addps).

3 years agofix comment typo to cycle bots
Nico Weber [Fri, 23 Apr 2021 15:45:49 +0000 (11:45 -0400)]
fix comment typo to cycle bots

3 years ago[Analyzer][StdLibraryFunctionsChecker] Describe arg constraints
Gabor Marton [Thu, 22 Apr 2021 13:12:40 +0000 (15:12 +0200)]
[Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

In this patch, I provide a detailed explanation for each argument
constraint. This explanation is added in an extra 'note' tag, which is
displayed alongside the warning.
Since these new notes describe clearly the constraint, there is no need
to provide the number of the argument (e.g. 'Arg3') within the warning.
However, I decided to keep the name of the constraint in the warning (but
this could be a subject of discussion) in order to be able to identify
the different kind of constraint violations easily in a bug database
(e.g. CodeChecker).

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

3 years ago[AST] Sort introspection results without instantiating other data
Stephen Kelly [Thu, 22 Apr 2021 11:53:52 +0000 (12:53 +0100)]
[AST] Sort introspection results without instantiating other data

Avoid string allocation in particular, but also avoid attempting to
impose any particular ordering based on formatted results.

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

3 years ago[flang] Switch from %f18 to %flang_fc1 in a test
Andrzej Warzynski [Fri, 23 Apr 2021 14:49:10 +0000 (14:49 +0000)]
[flang] Switch from %f18 to %flang_fc1 in a test

This patch updates the final test that can be shared between the old and
the new Flang drivers and that has not been ported yet. %f18 (always
expanded as `f18`) is replaced with %flang_fc1 (expanded as either `f18`
or `flang-new -fc1`, depending on `FLANG_BUILD_NEW_DRIVER`).

This test should've been updated in https://reviews.llvm.org/D100309,
but I missed it then. That's because this test contains non-ascii
characters and `grep -I %f18` (as well as other grep-like tools) skips
it because it's interpreted as a data/binary file. In fact, it's just a
text file with non-ascii chars.

Since this is an obvious omission from D100309 (reviewed, accepted and
merged), I'm sending this without a review to reduce the noise on
Phabricator.

3 years ago[TTI] NFC: Change getIntImmCost[Inst|Intrin] to return InstructionCost
Sander de Smalen [Wed, 27 Jan 2021 15:01:16 +0000 (15:01 +0000)]
[TTI] NFC: Change getIntImmCost[Inst|Intrin] to return InstructionCost

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

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

3 years ago[TTI] NFC: Change getScalingFactorCost to return InstructionCost
Sander de Smalen [Wed, 27 Jan 2021 13:32:39 +0000 (13:32 +0000)]
[TTI] NFC: Change getScalingFactorCost to return InstructionCost

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

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

3 years ago[TTI] NFC: Change getMemcpyCost to return InstructionCost
Sander de Smalen [Wed, 27 Jan 2021 13:25:18 +0000 (13:25 +0000)]
[TTI] NFC: Change getMemcpyCost to return InstructionCost

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

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

3 years ago[TTI] NFC: Change getGEPCost to return InstructionCost
Sander de Smalen [Wed, 27 Jan 2021 13:15:21 +0000 (13:15 +0000)]
[TTI] NFC: Change getGEPCost to return InstructionCost

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

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

3 years ago[TTI] NFC: Change getAddressComputationCost to return InstructionCost
Sander de Smalen [Wed, 27 Jan 2021 13:12:56 +0000 (13:12 +0000)]
[TTI] NFC: Change getAddressComputationCost to return InstructionCost

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

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

3 years ago[TTI] NFC: Use InstructionCost to store ScalarizationCost in IntrinsicCostAttributes.
dfukalov [Thu, 22 Apr 2021 11:52:25 +0000 (14:52 +0300)]
[TTI] NFC: Use InstructionCost to store ScalarizationCost in IntrinsicCostAttributes.

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

Reviewed By: samparker

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

3 years ago[TTI] Fix ScalarizationCost initialization.
Daniil Fukalov [Thu, 22 Apr 2021 19:14:49 +0000 (22:14 +0300)]
[TTI] Fix ScalarizationCost initialization.

In cases when ScalarizationCostPassed has no value, UINT_MAX is actually used
for cost estimation in `return ScalarCalls * ScalarCost + ScalarizationCost`.

Reviewed By: sdesmalen

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

3 years ago[AArch64][SVE] Fix bug in lowering of fixed-length integer vector divides
Joe Ellis [Wed, 14 Apr 2021 09:50:57 +0000 (09:50 +0000)]
[AArch64][SVE] Fix bug in lowering of fixed-length integer vector divides

The function AArch64TargetLowering::LowerFixedLengthVectorIntDivideToSVE
previously assumed the operands were full vectors, but this is not
always true. This function would produce bogus if the division operands
are not full vectors, resulting in miscompiles when dividing 8-bit or
16-bit vectors.

The fix is to perform an extend + div + truncate for non-full vectors,
instead of the usual unpacking and unzipping logic. This is an additive
change which reduces the non-full integer vector divisions to a pattern
recognised by the existing lowering logic.

For future reference, an example of code that would miscompile before
this patch is below:

     1  int8_t foo(unsigned N, int8_t *a, int8_t *b, int8_t *c) {
     2      int8_t result = 0;
     3      for (int i = 0; i < N; ++i) {
     4          result += (a[i] / b[i]) / c[i];
     5      }
     6      return result;
     7  }

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

3 years ago[AMDGPU] Fix typo in implicit operand lists
Jay Foad [Wed, 21 Apr 2021 14:32:00 +0000 (15:32 +0100)]
[AMDGPU] Fix typo in implicit operand lists

Several tests had a typo where they mentioned sgpr17 twice instead of
sgpr17 and sgpr27. This had a significant effect on the
"scavenge_sgpr_pei_no_sgprs" tests because there was actually an sgpr
available, namely sgpr27.

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

3 years agoRevert "[AMDGPU] Save WWM registers in functions"
Sebastian Neubauer [Fri, 23 Apr 2021 14:38:23 +0000 (16:38 +0200)]
Revert "[AMDGPU] Save WWM registers in functions"

This reverts commit 91464c30bfcf731ccb7f9d6ef6d26e8c1657a6e6.

Seems to break tests on windows.

3 years ago[AMDGPU][NFC] Update auto-gen test
Piotr Sobczak [Fri, 23 Apr 2021 14:19:04 +0000 (16:19 +0200)]
[AMDGPU][NFC] Update auto-gen test

Most likely the "glc" was not added to the test when
the volatile loads started generating those bits.

3 years ago[Hexagon] Remove redundant HVX intrinsic selection patterns, NFC
Krzysztof Parzyszek [Fri, 23 Apr 2021 13:11:59 +0000 (08:11 -0500)]
[Hexagon] Remove redundant HVX intrinsic selection patterns, NFC

Deleted HexagonMapAsm2IntrinV65.gen.td that wasn't included anywhere,
moved V6_vrmpy*_rtt* patterns to HexagonIntrinsics.td.

Touch CMakeLists.txt to force re-cmake (somehow the unused file was
listed as a dependency in the generated makefiles).

3 years ago[AMDGPU] Save WWM registers in functions
Sebastian Neubauer [Fri, 23 Apr 2021 14:09:31 +0000 (16:09 +0200)]
[AMDGPU] Save WWM registers in functions

The values of registers in inactive lanes needs to be saved during
function calls.

Save all registers used for whole wave mode, similar to how it is done
for VGPRs that are used for SGPR spilling.

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

3 years ago[TableGen] Correct some comments in the TableGen parser [NFC]
Paul C. Anagnostopoulos [Thu, 22 Apr 2021 17:26:19 +0000 (13:26 -0400)]
[TableGen] Correct some comments in the TableGen parser [NFC]

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

3 years ago[X86] Add Win32/64 mulo test coverage
Simon Pilgrim [Fri, 23 Apr 2021 13:51:25 +0000 (14:51 +0100)]
[X86] Add Win32/64 mulo test coverage

Part of an investigation to solve the windows regressions caused by rG13ec913bdf50

3 years ago[TableGen] [docs] Improve description of NAME in Programmer's Reference
Paul C. Anagnostopoulos [Tue, 20 Apr 2021 17:05:56 +0000 (13:05 -0400)]
[TableGen] [docs] Improve description of NAME in Programmer's Reference

Also use "parent class" consistently and add a note about the term.

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

3 years ago[OpenMP] Replace global InfoLevel with a reference to an internal one.
Joseph Huber [Thu, 22 Apr 2021 19:29:28 +0000 (15:29 -0400)]
[OpenMP] Replace global InfoLevel with a reference to an internal one.

Summary:
This patch improves the implementation of D100774 by replacing the global
variable introduced with a function that returns a reference to an internal
one. This removes the need to define the variable in every plugin that uses it.

Reviewed By: JonChesterfield

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

3 years ago[OpenCL] Fix typo in the test.
Anastasia Stulova [Fri, 23 Apr 2021 13:35:44 +0000 (14:35 +0100)]
[OpenCL] Fix typo in the test.

3 years ago[InstCombine] Added tests for PR50096; NFC
Dávid Bolvanský [Fri, 23 Apr 2021 13:25:27 +0000 (15:25 +0200)]
[InstCombine] Added tests for PR50096; NFC

3 years ago[lld-macho] Have tests default to targeting macos 10.15
Jez Ng [Thu, 22 Apr 2021 23:37:47 +0000 (19:37 -0400)]
[lld-macho] Have tests default to targeting macos 10.15

D101114 enforced proper version checks, which exposed a variety of version
mismatch issues in our tests. We previously changed the test inputs to
target 10.0, which was the simpler thing to do, but we should really
just have our lit.local.cfg default to targeting 10.15, which is what is done
here. We're not likely to ever have proper support for the older versions
anyway, as that would require more work for unclear benefit; for instance,
llvm-mc seems to generate a different compact unwind format for older macOS
versions, which would cause our compact-unwind.s test to fail.

Targeting 10.15 by default causes the following behavioral changes:
* `__mh_execute_header` is now a section symbol instead of an absolute symbol
* LC_BUILD_VERSION gets emitted instead of LC_VERSION_MIN_MACOSX. The former is
  32 bytes in size whereas the latter is 16 bytes, so a bunch of hardcoded
  address offsets in our tests had to be updated.
* >= 10.6 executables are PIE by default

Note that this diff was stacked atop of a local revert of most of the test
changes in rG8c17a875150f8e736e8f9061ddf084397f45f4c5, to make review easier.

Reviewed By: #lld-macho, oontvoo

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

3 years ago[X86] combineSetCCAtomicArith - pull out repeated ops. NFCI.
Simon Pilgrim [Fri, 23 Apr 2021 13:19:24 +0000 (14:19 +0100)]
[X86] combineSetCCAtomicArith - pull out repeated ops. NFCI.

Reduces diff in D101074

3 years agoAMDGPU: Fix assert on inline asm on gfx90a
Matt Arsenault [Fri, 23 Apr 2021 02:34:17 +0000 (22:34 -0400)]
AMDGPU: Fix assert on inline asm on gfx90a

This was assuming all mayLoad instructions have one def.

3 years ago[llvm][NFC] Fix assert indentation
Timm Bäder [Fri, 23 Apr 2021 12:36:17 +0000 (14:36 +0200)]
[llvm][NFC] Fix assert indentation

This triggers GCC's misleading-indentation checker.

3 years ago[InstCombine] Fixed newly added tests; NFC
Dávid Bolvanský [Fri, 23 Apr 2021 12:42:37 +0000 (14:42 +0200)]
[InstCombine] Fixed newly added tests; NFC

3 years ago[InstCombine][NFC] add tests for printf("%s", str) --> puts(str)/noop transformation.
Dawid Jurczak [Fri, 23 Apr 2021 12:24:19 +0000 (14:24 +0200)]
[InstCombine][NFC] add tests for printf("%s", str) --> puts(str)/noop transformation.

Split off from D100724.

Reviewed By: xbolva00

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

3 years agoReland "[Clang] Propagate guaranteed alignment for malloc and others"
Dávid Bolvanský [Fri, 23 Apr 2021 12:05:57 +0000 (14:05 +0200)]
Reland "[Clang] Propagate guaranteed alignment for malloc and others"

This relands commit 6914a0ed2b30924b188968e59a83efa07ac5fe57. Crash in InstCombine was fixed.

3 years ago[InstCombine] Fixed crash when setting align attr for memalign
Dávid Bolvanský [Fri, 23 Apr 2021 12:03:49 +0000 (14:03 +0200)]
[InstCombine] Fixed crash when setting align attr for memalign

3 years ago[clang] Do not crash on template specialization following a fatal error
Adam Czachorowski [Thu, 15 Apr 2021 20:33:05 +0000 (22:33 +0200)]
[clang] Do not crash on template specialization following a fatal error

There was a missing isInvalid() check leading to an attempt to
instantiate template with an empty instantiation stack.

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

3 years ago[RISCV] Custom lower vector F(MIN|MAX)NUM to vf(min|max)
Fraser Cormack [Thu, 22 Apr 2021 08:55:27 +0000 (09:55 +0100)]
[RISCV] Custom lower vector F(MIN|MAX)NUM to vf(min|max)

This patch adds support for both scalable- and fixed-length vector code
lowering of the llvm.minnum and llvm.maxnum intrinsics to the equivalent
RVV instructions.

Reviewed By: craig.topper

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

3 years ago[lldb][NFC] Remove a stray unicode character in the LLDB test docs
Raphael Isemann [Fri, 23 Apr 2021 11:20:06 +0000 (13:20 +0200)]
[lldb][NFC] Remove a stray unicode character in the LLDB test docs

There was a U+2028 character in this line (a special paragraph separator).

3 years ago[dexter] Add keyword argument 'on_line' to DexLabel
OCHyams [Fri, 23 Apr 2021 11:00:16 +0000 (12:00 +0100)]
[dexter] Add keyword argument 'on_line' to DexLabel

Add optional keyword argument 'on_line' to DexLabel to label the specifed line
instead of the line the command is found on.

This will be helpful when used alongside DexDeclareFile (D99651).

Reviewed By: TWeaver

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

3 years ago[doc] Clarify constrained fcmps behavior
Thomas Preud'homme [Thu, 22 Apr 2021 12:17:42 +0000 (13:17 +0100)]
[doc] Clarify constrained fcmps behavior

Reviewed By: uweigand

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

3 years agoRecommit "[NewGVN] Track simplification dependencies for phi-of-ops."
Florian Hahn [Fri, 23 Apr 2021 08:57:03 +0000 (09:57 +0100)]
Recommit "[NewGVN] Track simplification dependencies for phi-of-ops."

This recommits 4f5da356ff35a218f23f0b0c4d08aee90da7de6e, including
explicit implementations of move a constructor and deleted copy
constructors/assignment operators, to fix failures with some compilers.

This reverts the revert 74854d00e854196445727a49df58fe5768d9ed5b.

3 years agoRe-reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs...
Stephen Tozer [Thu, 22 Apr 2021 11:06:52 +0000 (12:06 +0100)]
Re-reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands"

Previous build failures were caused by an error in bitcode reading and
writing for DIArgList metadata, which has been fixed in e5d844b587.
There were also some unnecessary asserts that were being triggered on
certain builds, which have been removed.

This reverts commit dad5caa59e6b2bde8d6cf5b64a972c393c526c82.

3 years ago[X86][AMX][NFC] Make comparison operators to be complete
Wang, Pengfei [Fri, 23 Apr 2021 09:11:45 +0000 (17:11 +0800)]
[X86][AMX][NFC] Make comparison operators to be complete

The previous D101039 didn't fix the SmallSet insertion issue, due to we
always return false for the comparison between 2 different nonnull BBs.
This patch makes the the comparison to be complete by comparing `MBB`
first, so that we can always get the invariant order by a single
operator.

3 years agoRevert "[Clang] Propagate guaranteed alignment for malloc and others"
Dávid Bolvanský [Fri, 23 Apr 2021 09:33:12 +0000 (11:33 +0200)]
Revert "[Clang] Propagate guaranteed alignment for malloc and others"

This reverts commit c2297544c04764237cedc523083c7be2fb3833d4. Some buildbots are broken.

3 years ago[gn build] Port c623945d707c
LLVM GN Syncbot [Fri, 23 Apr 2021 09:26:02 +0000 (09:26 +0000)]
[gn build] Port c623945d707c

3 years ago[mlir] Support masked N-D vector transfer ops in ProgressiveVectorToSCF.
Matthias Springer [Fri, 23 Apr 2021 09:11:07 +0000 (18:11 +0900)]
[mlir] Support masked N-D vector transfer ops in ProgressiveVectorToSCF.

Mask vectors are handled similar to data vectors in N-D TransferWriteOp. They are copied into a temporary memory buffer, which can be indexed into with non-constant values.

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

3 years agollvm-objdump: refactor SourcePrinter into separate file. NFC.
Tim Northover [Mon, 15 Feb 2021 11:58:35 +0000 (11:58 +0000)]
llvm-objdump: refactor SourcePrinter into separate file. NFC.

Preparatory patch for MachO feature.

3 years ago[mlir] Support masked 1D vector transfer ops in ProgressiveVectorToSCF
Matthias Springer [Fri, 23 Apr 2021 09:04:58 +0000 (18:04 +0900)]
[mlir] Support masked 1D vector transfer ops in ProgressiveVectorToSCF

Support for masked N-D vector transfer ops will be added in a subsequent commit.

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

3 years ago[Clang] Propagate guaranteed alignment for malloc and others
Dávid Bolvanský [Fri, 23 Apr 2021 08:11:59 +0000 (10:11 +0200)]
[Clang] Propagate guaranteed alignment for malloc and others

LLVM should be smarter about *known* malloc's alignment and this knowledge may enable other optimizations.

Originally started as LLVM patch - https://reviews.llvm.org/D100862 but this logic should be really in Clang.

Reviewed By: rjmccall

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

3 years ago[mlir] Support broadcast dimensions in ProgressiveVectorToSCF
Matthias Springer [Fri, 23 Apr 2021 08:59:46 +0000 (17:59 +0900)]
[mlir] Support broadcast dimensions in ProgressiveVectorToSCF

This commit adds support for broadcast dimensions in permutation maps of vector transfer ops.

Also fixes a bug in VectorToSCF that generated incorrect in-bounds checks for broadcast dimensions.

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

3 years agoRevert "[NewGVN] Track simplification dependencies for phi-of-ops."
Florian Hahn [Fri, 23 Apr 2021 08:56:17 +0000 (09:56 +0100)]
Revert "[NewGVN] Track simplification dependencies for phi-of-ops."

This reverts commit 4f5da356ff35a218f23f0b0c4d08aee90da7de6e.

This causes some  buildbot failures, e.g.
https://lab.llvm.org/buildbot/#/builders/139/builds/3019

3 years ago[mlir] Use SCF for loops in ProgressiveVectorToSCF
Matthias Springer [Thu, 22 Apr 2021 02:33:23 +0000 (11:33 +0900)]
[mlir] Use SCF for loops in ProgressiveVectorToSCF

Use SCF for loops instead of Affine for loops.

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

3 years ago[mlir][docs] Update `add_mlir_doc` usage
Marius Brehler [Fri, 23 Apr 2021 08:45:57 +0000 (08:45 +0000)]
[mlir][docs] Update `add_mlir_doc` usage

Updates the docs to reflect the changes introduced to the `add_mlir_doc`
CMake macro with https://reviews.llvm.org/D100517.

3 years ago[NewGVN] Track simplification dependencies for phi-of-ops.
Florian Hahn [Fri, 23 Apr 2021 08:27:06 +0000 (09:27 +0100)]
[NewGVN] Track simplification dependencies for phi-of-ops.

If we are using a simplified value, we need to add an extra
dependency this value , because changes to the class of the
simplified value may require us to invalidate any decision based on
that value.

This is done by adding such values as additional users, however the
current code does not excludes temporary instructions.

At the moment, this means that we miss those dependencies for
phi-of-ops, because they are temporary instructions at this point. We
instead need to add the extra dependencies to the root instruction of
the phi-of-ops.

This patch pushes the responsibility of adding extra users to the
callers of createExpression & performSymbolicEvaluation. At those
points, it is clearer which real instruction to pick.

Alternatively we could either pass the 'real' instruction as additional
argument or use another map, but I think the approach in the patch makes
things a bit easier to follow.

Fixes PR35074.

Reviewed By: asbirlea

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

3 years ago[mlir] Support dimension permutations in ProgressiveVectorToSCF
Matthias Springer [Fri, 23 Apr 2021 08:22:40 +0000 (17:22 +0900)]
[mlir] Support dimension permutations in ProgressiveVectorToSCF

This commit adds support for dimension permutations in permutation maps of vector transfer ops.

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

3 years ago[lldb][NFC] Delete a checked-in build log in docs/testsuite
Raphael Isemann [Fri, 23 Apr 2021 08:36:43 +0000 (10:36 +0200)]
[lldb][NFC] Delete a checked-in build log in docs/testsuite

3 years ago[MLIR][NFC] Fix warning, trim includes + cleanup in AffineOps.h
Uday Bondhugula [Thu, 22 Apr 2021 06:35:37 +0000 (12:05 +0530)]
[MLIR][NFC] Fix warning, trim includes + cleanup in AffineOps.h

Fix style/clang-tidy warning, trim stale includes and forward
declarations, and cleanup/fix stale comments.

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

3 years ago[mlir] Handle strided 1D vector transfer ops in ProgressiveVectorToSCF
Matthias Springer [Fri, 23 Apr 2021 08:18:26 +0000 (17:18 +0900)]
[mlir] Handle strided 1D vector transfer ops in ProgressiveVectorToSCF

Strided 1D vector transfer ops are 1D transfers operating on a memref dimension different from the last one. Such transfer ops do not accesses contiguous memory blocks (vectors), but access memory in a strided fashion. In the absence of a mask, strided 1D vector transfer ops can also be lowered using matrix.column.major.* LLVM instructions (in a later commit).

Subsequent commits will extend the pass to handle the remaining missing permutation maps (broadcasts, transposes, etc.).

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

3 years ago[Debug-Info] change return type to void for attribute adding functions.
Chen Zheng [Thu, 22 Apr 2021 05:53:41 +0000 (01:53 -0400)]
[Debug-Info] change return type to void for attribute adding functions.

Make following function return void:

    addLabel()
    addSectionLabel()
    addSectionDelta()

This aligns with other attributes adding functions.

Reviewed By: dblaikie

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

3 years ago[GlobalISel] Remove ConstantFoldingMIRBuilder
Jay Foad [Thu, 22 Apr 2021 11:38:02 +0000 (12:38 +0100)]
[GlobalISel] Remove ConstantFoldingMIRBuilder

ConstantFoldingMIRBuilder was an experiment which is not used for
anything. The constant folding functionality is now part of
CSEMIRBuilder.

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

3 years ago[AArch64] Fix for BTI landing pad insertion with PAC-RET+bkey.
Daniel Kiss [Fri, 23 Apr 2021 08:06:15 +0000 (10:06 +0200)]
[AArch64] Fix for BTI landing pad insertion with PAC-RET+bkey.

EMITBKEY is emitted for PAC-RET+bkey, which is a non machine instructions.

PR: 49957

Reviewed By: eugenis

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

3 years ago[cland] Dont emit missing newline warnings when building preamble
Kadir Cetinkaya [Wed, 14 Apr 2021 17:28:14 +0000 (19:28 +0200)]
[cland] Dont emit missing newline warnings when building preamble

When building preamble, clangd truncates file contents. This yielded
errnous warnings in some cases.

This patch fixes the issue by turning off no-newline-at-eof warnings whenever
the file has more contents than the preamble.

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

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

3 years ago[LoopReroll] Fix rerolling loop with extra instructions
KAWASHIMA Takahiro [Thu, 8 Apr 2021 03:33:25 +0000 (12:33 +0900)]
[LoopReroll] Fix rerolling loop with extra instructions

Fixes PR47627

This fix suppresses rerolling a loop which has an unrerollable
instruction.

Sample IR for the explanation below:

```
define void @foo([2 x i32]* nocapture %a) {
entry:
  br label %loop

loop:
  ; base instruction
  %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %loop ]

  ; unrerollable instructions
  %stptrx = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %indvar, i64 0
  store i32 999, i32* %stptrx, align 4

  ; extra simple arithmetic operations, used by root instructions
  %plus20 = add nuw nsw i64 %indvar, 20
  %plus10 = add nuw nsw i64 %indvar, 10

  ; root instruction 0
  %ldptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 0
  %value0 = load i32, i32* %ldptr0, align 4
  %stptr0 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 0
  store i32 %value0, i32* %stptr0, align 4

  ; root instruction 1
  %ldptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus20, i64 1
  %value1 = load i32, i32* %ldptr1, align 4
  %stptr1 = getelementptr inbounds [2 x i32], [2 x i32]* %a, i64 %plus10, i64 1
  store i32 %value1, i32* %stptr1, align 4

  ; loop-increment and latch
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond = icmp eq i64 %indvar.next, 5
  br i1 %exitcond, label %exit, label %loop

exit:
  ret void
}
```

In the loop rerolling pass, `%indvar` and `%indvar.next` are appended
to the `LoopIncs` vector in the `LoopReroll::DAGRootTracker::findRoots`
function.

Before this fix, two instructions with `unrerollable instructions`
comment above are marked as `IL_All` at the end of the
`LoopReroll::DAGRootTracker::collectUsedInstructions` function,
as well as instructions with `extra simple arithmetic operations`
comment and `loop-increment and latch` comment. It is incorrect
because `IL_All` means that the instruction should be executed in all
iterations of the rerolled loop but the `store` instruction should
not.

This fix rejects instructions which may have side effects and don't
belong to def-use chains of any root instructions and reductions.

See https://bugs.llvm.org/show_bug.cgi?id=47627 for more information.

3 years ago[RISCV] Implement the vnot.v builtin.
Hsiangkai Wang [Tue, 20 Apr 2021 03:01:22 +0000 (11:01 +0800)]
[RISCV] Implement the vnot.v builtin.

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

3 years ago[X86][AMX][NFC] Avoid assert for the same immidiate value
Wang, Pengfei [Fri, 23 Apr 2021 03:42:54 +0000 (11:42 +0800)]
[X86][AMX][NFC] Avoid assert for the same immidiate value

The previous condition in the assert was over strict. We ought to allow
the same immidiate value being loaded more than once. The intention for
the assert is to check the same AMX register uses multiple different
immidiate shapes. So this fix supposes to be NFC.

Reviewed By: LuoYuanke

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

3 years ago[X86][AMX] Try to hoist AMX shapes' def
Wang, Pengfei [Thu, 22 Apr 2021 01:10:26 +0000 (09:10 +0800)]
[X86][AMX] Try to hoist AMX shapes' def

We request no intersections between AMX instructions and their shapes'
def when we insert ldtilecfg. However, this is not always ture resulting
from not only users don't follow AMX API model, but also optimizations.

This patch adds a mechanism that tries to hoist AMX shapes' def as well.
It only hoists shapes inside a BB, we can improve it for cases across
BBs in future. Currently, it only hoists shapes of which all sources' def
above the first AMX instruction. We can improve for the case that only
source that moves an immediate value to a register below AMX instruction.

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

3 years ago[X86] Enable compilation of user interrupt handlers.
Wang, Pengfei [Fri, 23 Apr 2021 03:12:04 +0000 (11:12 +0800)]
[X86] Enable compilation of user interrupt handlers.

Add __uintr_frame structure and use UIRET instruction for functions with
x86 interrupt calling convention when UINTR is present.

Reviewed By: LuoYuanke

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

3 years ago[RISCV] Implement the vneg.v builtin.
Hsiangkai Wang [Tue, 20 Apr 2021 02:53:19 +0000 (10:53 +0800)]
[RISCV] Implement the vneg.v builtin.

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

3 years ago[NFC] Suppress cpplint warning in test
Vitaly Buka [Fri, 23 Apr 2021 03:19:54 +0000 (20:19 -0700)]
[NFC] Suppress cpplint warning in test

3 years ago[InlineSpiller] Clean-up isSpillCandBB
Serguei Katkov [Wed, 21 Apr 2021 05:29:25 +0000 (12:29 +0700)]
[InlineSpiller] Clean-up isSpillCandBB

This is mostly NFC except that for end of BB not previous slot is used.
Idx is used to find a def of sibling live interval in that slot.
The def on end of MBB and on previous slot of end MBB should be the same,
so it should be NFC.

Reviewers: reames, qcolombet, MatzeB, wmi, rnk
Reviewed By: rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100922

3 years ago[lld/mac] Implement support for .weak_def_can_be_hidden
Nico Weber [Thu, 22 Apr 2021 15:28:35 +0000 (11:28 -0400)]
[lld/mac] Implement support for .weak_def_can_be_hidden

I first had a more invasive patch for this (D101069), but while trying
to get that polished for review I realized that lld's current symbol
merging semantics mean that only a very small code change is needed.
So this goes with the smaller patch for now.

This has no effect on projects that build with -fvisibility=hidden
(e.g.  chromium), since these see .private_extern symbols instead.

It does have an effect on projects that build with -fvisibility-inlines-hidden
(e.g. llvm) in -O2 builds, where LLVM's GlobalOpt pass will promote most inline
functions from .weak_definition to .weak_def_can_be_hidden.

Before this patch:

    % ls -l out/gn/bin/clang out/gn/lib/libclang.dylib
    -rwxr-xr-x  1 thakis  staff  113059936 Apr 22 11:51 out/gn/bin/clang
    -rwxr-xr-x  1 thakis  staff   86370064 Apr 22 11:51 out/gn/lib/libclang.dylib
    % out/gn/bin/llvm-objdump --macho --weak-bind out/gn/bin/clang | wc -l
        8291
    % out/gn/bin/llvm-objdump --macho --weak-bind out/gn/lib/libclang.dylib | wc -l
        5698

With this patch:

    % ls -l out/gn/bin/clang out/gn/lib/libclang.dylib
    -rwxr-xr-x  1 thakis  staff  111721096 Apr 22 11:55 out/gn/bin/clang
    -rwxr-xr-x  1 thakis  staff   85291208 Apr 22 11:55 out/gn/lib/libclang.dylib
    thakis@MBP llvm-project % out/gn/bin/llvm-objdump --macho --weak-bind out/gn/bin/clang | wc -l
         725
    thakis@MBP llvm-project % out/gn/bin/llvm-objdump --macho --weak-bind out/gn/lib/libclang.dylib | wc -l
         542

Linking clang becomes a tiny bit faster with this patch:

    x 100    0.67263818    0.77847815    0.69430709    0.69877208   0.017715892
    + 100    0.67209601    0.73323393    0.68600798    0.68917346   0.012824377
    Difference at 95.0% confidence
            -0.00959861 +/- 0.00428661
            -1.37364% +/- 0.613449%
            (Student's t, pooled s = 0.0154648)

This only happens if lld with the patch and lld without the patch are both
linked with an lld with the patch or both linked with an lld without the patch
(...or with ld64). I accidentally linked the lld with the patch with an lld
without the patch and the other way round at first. In that setup, no
difference is found. That makese sense, since having fewer weak imports will
make the linked output a bit faster too. So not only does this make linking
binaries such as clang a bit faster (since fewer exports need to be written to
the export trie by lld), the linked output binary binary is also a bit faster
(since dyld needs to process fewer dynamic imports).

This also happens to fix the one `check-clang` failure when using lld as host
linker, but mostly for silly reasons: See crbug.com/1183336, mostly comment 26.
The real bug here is that c-index-test links all of LLVM both statically and
dynamically, which is an ODR violation. Things just happen to work with this
patch.

So after this patch, check-clang, check-lld, check-llvm all pass with lld as
host linker :)

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

3 years ago[lld/mac] slightly improve weak-private-extern.s test
Nico Weber [Thu, 22 Apr 2021 13:58:52 +0000 (09:58 -0400)]
[lld/mac] slightly improve weak-private-extern.s test

- __got is in --bind output, so print that too (makes the test
  a bit stronger)
- WEAK_DEFINES, BINDS_TO_WEAK are in the mach-o header, so
  --private-header is enough, no need for --all-headers
  (makes the test a bit easier to work with when it fails)

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

3 years ago[gn build] (manually) port 0b2bc69ba29
Nico Weber [Fri, 23 Apr 2021 02:40:53 +0000 (22:40 -0400)]
[gn build] (manually) port 0b2bc69ba29

3 years ago[NFC] Fix cpplint warning
Vitaly Buka [Fri, 23 Apr 2021 02:05:20 +0000 (19:05 -0700)]
[NFC] Fix cpplint warning

3 years agoAMDGPU: Restore atomic fp feature on FP atomic instruction definitions
Matt Arsenault [Fri, 9 Apr 2021 22:40:59 +0000 (18:40 -0400)]
AMDGPU: Restore atomic fp feature on FP atomic instruction definitions

9931b1f7a4785b6a17fb87b81a3546d61d0cbca1 switched this to checking for
the two specific subtargets, instead of the dedicated feature. This
broke supporting functions which force added the feature when emitting
targets that do not actually support them. This stil does not work for
the targets that use the gfx6/7 or gfx10 encodings.

3 years ago[IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -mframe-pointer...
Fangrui Song [Fri, 23 Apr 2021 01:07:29 +0000 (18:07 -0700)]
[IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -mframe-pointer={non-leaf,all}

The Linux kernel objtool diagnostic `call without frame pointer save/setup`
arise in multiple instrumentation passes (asan/tsan/gcov). With the mechanism
introduced in D100251, it's trivial to respect the command line
-m[no-]omit-leaf-frame-pointer/-f[no-]omit-frame-pointer, so let's do it.

Fix: https://github.com/ClangBuiltLinux/linux/issues/1236 (tsan)
Fix: https://github.com/ClangBuiltLinux/linux/issues/1238 (asan)

Also document the function attribute "frame-pointer" which is long overdue.

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

3 years ago[libc++][ranges] Add range.cmp: equal_to, not_equal_to, less, etc.
zoecarver [Fri, 23 Apr 2021 00:33:04 +0000 (17:33 -0700)]
[libc++][ranges] Add range.cmp: equal_to, not_equal_to, less, etc.

Adds the six new concept constrained comparisons.

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

3 years agoReapply "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed"
Jon Chesterfield [Fri, 23 Apr 2021 00:06:23 +0000 (01:06 +0100)]
Reapply  "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed"

This reverts commit 24c1ed3b34f7602b955e52cd8a362f4e27eb5f20.

3 years agoCWG2076: Permit implicit conversions within a single level of braces
Richard Smith [Thu, 22 Apr 2021 23:48:34 +0000 (16:48 -0700)]
CWG2076: Permit implicit conversions within a single level of braces
during overload resolution, even when calling a copy constructor.

3 years ago[lldb] Update register state parsing for JSON crashlogs
Jonas Devlieghere [Thu, 22 Apr 2021 23:37:25 +0000 (16:37 -0700)]
[lldb] Update register state parsing for JSON crashlogs

 - The register encoding state in the JSON crashlog format changes.
   Update the parser accordingly.
 - Print the register state when printing the symbolicated thread.

3 years ago[re-land][lld-macho] Fix min version check
Jez Ng [Thu, 22 Apr 2021 23:08:04 +0000 (19:08 -0400)]
[re-land][lld-macho] Fix min version check

We had got it backwards... the minimum version of the target
should be higher than the min version of the object files, presumably
since new platforms are backwards-compatible with older formats.

Fixes PR50078.

The original commit (aa05439c9cde) broke many tests that had inputs too
new for our target platform (10.0). This commit changes the inputs to
target 10.0, which was the simpler thing to do, but we should really
just have our lit.local.cfg default to targeting 10.15... we're not
likely to ever have proper support for the older versions anyway. I will
follow up with a change to that effect.

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

3 years ago[RISCV] [1/2] Add IR intrinsic for Zbp extension
Levy Hsu [Thu, 22 Apr 2021 23:19:15 +0000 (16:19 -0700)]
[RISCV] [1/2] Add IR intrinsic for Zbp extension

RV32/64:
    grev
    grevi
    gorc
    gorci
    shfl
    shfli
    unshfl
    unshfli

RV64 ONLY:
    grevw
    greviw
    gorcw
    gorciw
    shflw
    shfli     (For non-existing shfliw)
    unshfli   (For non-existing unshfliw)

Reviewed By: craig.topper

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

3 years ago[clang][nfc] Split getOrCheckAMDGPUCodeObjectVersion
Jon Chesterfield [Thu, 22 Apr 2021 23:24:41 +0000 (00:24 +0100)]
[clang][nfc] Split getOrCheckAMDGPUCodeObjectVersion

[clang][nfc] Split getOrCheckAMDGPUCodeObjectVersion

Separates detection of deprecated or invalid code object version from
returning the version. Written to avoid any behaviour change.

Precursor to a revision of D98746.

Reviewed By: yaxunl

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

3 years agoscudo: Only static_assert for compressed LSB format with clang.
Peter Collingbourne [Thu, 22 Apr 2021 23:09:23 +0000 (16:09 -0700)]
scudo: Only static_assert for compressed LSB format with clang.

It looks like there's some old version of gcc that doesn't like this
static_assert (I couldn't reproduce the issue with gcc 8, 9 or 10).
Work around the issue by only checking the static_assert under clang,
which should provide sufficient coverage.

Should hopefully fix this buildbot:
https://lab.llvm.org/buildbot/#/builders/112/builds/5356

3 years agoRevert "[lld-macho] Fix min version check"
Jez Ng [Thu, 22 Apr 2021 23:07:18 +0000 (19:07 -0400)]
Revert "[lld-macho] Fix min version check"

This reverts commit aa05439c9cde873ba18ae847ac7c23877178a9ca.