platform/upstream/llvm.git
2 years ago[VecCombine] Fix sort comparator logic in foldShuffleFromReductions
David Green [Fri, 29 Apr 2022 08:30:02 +0000 (09:30 +0100)]
[VecCombine] Fix sort comparator logic in foldShuffleFromReductions

I think this sort comparator was overly complex, and the windows
expensive check bot agreed, failing as it was not giving a strict weak
ordering. Change it to use the comparison of the mask values as unsigned
integers. This should sort the undef elements to the end whilst keeping
X<Y otherwise.

2 years ago[SimplifyCFG] Replace condition value when threading
Nikita Popov [Fri, 29 Apr 2022 07:48:21 +0000 (09:48 +0200)]
[SimplifyCFG] Replace condition value when threading

Replace the condition value with the known constant value on the
threaded edge. This happens implicitly with phi threading because
we replace with the incoming value, but not for non-phi threading.

2 years agoDisable test for Android/Bionic.
Daniel Kiss [Fri, 29 Apr 2022 07:40:55 +0000 (09:40 +0200)]
Disable test for Android/Bionic.

Test depends on pthread_cancel which is not supported on Android.

2 years ago[SimplifyCFG] Thread branches on same condition in more cases (PR54980)
Nikita Popov [Wed, 20 Apr 2022 15:37:13 +0000 (17:37 +0200)]
[SimplifyCFG] Thread branches on same condition in more cases (PR54980)

SimplifyCFG implements basic jump threading, if a branch is
performed on a phi node with constant operands. However,
InstCombine canonicalizes such phis to the condition value of a
previous branch, if possible. SimplifyCFG does support this as
well, but only in the very limited case where the same condition
is used in a direct predecessor -- notably, this does not include
the common diamond pattern (i.e. two consecutive if/elses on the
same condition).

This patch extends the code to look back a limited number of
blocks to find a branch on the same value, rather than only
looking at the direct predecessor.

Fixes https://github.com/llvm/llvm-project/issues/54980.

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

2 years ago[X86] Fix CodeGen Module Flag for -mibt-seal
Joao Moreira [Fri, 29 Apr 2022 06:32:48 +0000 (14:32 +0800)]
[X86] Fix CodeGen Module Flag for -mibt-seal

When assertions are enabled, clang will perform RoundTrip for CompilerInvocation argument generation. ibt-seal flags are currently missing in this argument generation, and because of that, the feature doesn't get enabled for these cases. Performing RoundTrip is the default for assert builds, rendering the feature broken in these scenarios.

This patch fixes this and adds a test to properly verify that modules are  being generated with the flag when -mibt-seal is used.

Please, add any known relevant reviewer which I may have missed.

[1] - https://reviews.llvm.org/D116070

Reviewed By: pengfei, gftg, aaron.ballman, nickdesaulniers

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

2 years ago[SystemZ] Custom lowering of llvm.is_fpclass
Serge Pavlov [Mon, 29 Nov 2021 07:26:02 +0000 (14:26 +0700)]
[SystemZ] Custom lowering of llvm.is_fpclass

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

2 years ago[ELF][test] Improve data-segment-relro.test
Fangrui Song [Fri, 29 Apr 2022 05:29:39 +0000 (22:29 -0700)]
[ELF][test] Improve data-segment-relro.test

2 years ago[RISCV] Add cost model for SK_Broadcast
LiaoChunyu [Fri, 29 Apr 2022 05:18:26 +0000 (13:18 +0800)]
[RISCV] Add cost model for SK_Broadcast

Add cost model for broadcast shuffle in RISCVTTIImpl::getShuffleCost
with scalable vector. The cost model might not the best.

For scalable vector, BasicTTIImpl::getShuffleCost return invalid cost,
so this patch relies on the existing cost model in BasicTTIImpl.

Reviewed By: craig.topper

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

2 years ago[Clang][CodeGen]Fix __builtin_dump_struct missing record type field name
jonasyhwang [Fri, 29 Apr 2022 04:58:53 +0000 (12:58 +0800)]
[Clang][CodeGen]Fix __builtin_dump_struct missing record type field name

Thanks for @rsmith to point this. I'm sorry for introducing this bug.
See @rsmith 's comment in https://reviews.llvm.org/D122248
Eg:(By @rsmith ) https://godbolt.org/z/o7vcbWaEf
I have added a test case
struct:
```
struct U19A {
    int a;
  };
  struct U19B {
    struct U19A a;
  };

  struct U19B a = {
    .a.a = 2022
  };
```
Dump result:
```
struct U19B {
    struct U19A a = {
        int a = 2022
    }
}
```

Reviewed By: erichkeane

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

2 years ago[RISCV] Merge addi into load/store as there is a ADD between them
Hsiangkai Wang [Fri, 22 Apr 2022 01:41:09 +0000 (01:41 +0000)]
[RISCV] Merge addi into load/store as there is a ADD between them

This patch adds peephole optimizations for the following patterns:

(load (add base, (addi src, off1)), off2)
   -> (load (add base, src), off1+off2)
(store val, (add base, (addi src, off1)), off2)
   -> (store val, (add base, src), off1+off2)

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

2 years ago[PowerPC] Support of ppc_fp128 in lowering of llvm.is_fpclass
Serge Pavlov [Tue, 9 Nov 2021 11:20:59 +0000 (18:20 +0700)]
[PowerPC] Support of ppc_fp128 in lowering of llvm.is_fpclass

PowerPC supports `ppc_fp128`, which is not an IEEE floating point
type. The generic lowering of llvm.is_fpclass could not handle it
properly. This change extends the generic lowering code to
support `ppc_fp128`.

The change was tested on emulator using runtime tests from
https://reviews.llvm.org/D112933 and the patch for clang
https://reviews.llvm.org/D112932.

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

2 years ago[asan] Enable detect_stack_use_after_return=1 by default on Linux
Vitaly Buka [Fri, 29 Apr 2022 02:14:52 +0000 (19:14 -0700)]
[asan] Enable detect_stack_use_after_return=1 by default on Linux

By default -fsanitize=address already compiles with this check, why not use it.
For compatibly it can be disabled with env ASAN_OPTIONS=detect_stack_use_after_return=0.

Reviewed By: eugenis, kda, #sanitizers, hans

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

2 years agoReland: [clang] Adding Platform/Architecture Specific Resource Header Installation...
Qiongsi Wu [Fri, 29 Apr 2022 04:02:59 +0000 (00:02 -0400)]
Reland: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

The goal of this patch is to improve distribution build's flexibility to include only applicable header files.

Currently, the clang-resource-headers target contains nearly all the files in clang/lib/Headers. Most of these files are platform specific (e.g. immintrin.h is x86 specific). A distribution build will have to either include all the headers for all the platforms, or not include any headers. For example, if a distribution build for powerpc includes the clang-resource-headers target, it will include all the x86 specific headers, even-though the x86 specific headers cannot be used.

This patch breaks up the clang-resource-headers list to a core list and platform specific lists. With the patch, a distribution build can now include the ppc-resource-headers to include the headers applicable to the powerpc platform.

Specifically, one can now have

cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;ppc-resource-headers" ... ../llvm
ninja install-distribution then installs the powerpc headers.

Similarly, one can do

cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;x86-resource-headers" ... ../llvm
to include headers applicable to the x86 platform in a distribution installation.

To implement this behaviour, the patch does two things

It breaks up the long files header file list to a core list and platform specific lists.
It adds numerous platform specific installation targets.

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

2 years ago[CMake] Ensure correct extension for llvm-lit is used on Windows when LLVM_INSTALL_UT...
Douglas Gliner [Fri, 29 Apr 2022 03:41:47 +0000 (20:41 -0700)]
[CMake] Ensure correct extension for llvm-lit is used on Windows when LLVM_INSTALL_UTILS is enabled.

D77110 initially added support for setting LLVM_CONFIG_DEFAULT_EXTERNAL_LIT
to llvm-lit in the install directory if LLVM_INSTALL_UTILS is on.

D79144 ensured that, on Windows, llvm-lit.py is correctly set for
LLVM_CONFIG_DEFAULT_EXTERNAL_LIT within the context of the build area,
however, it did not account for the install area which is the latter set
directive for this same variable.

This patch ensures that LLVM_CONFIG_DEFAULT_EXTERNAL_LIT under the install
area uses llvm-lit.py under Windows since llvm-lit without the extension
is not created.

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

2 years ago[NFC] Prevent shadowing a variable declared in `if`
Ken Matsui [Thu, 28 Apr 2022 19:45:55 +0000 (15:45 -0400)]
[NFC] Prevent shadowing a variable declared in `if`

Prevents confusion over which `S` is referenced in the final `else`
branch if such use is added.

Reviewed By: hubert.reinterpretcast

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

2 years ago[msan][libcxx] Enable -fsanitize-memory-param-retval
Vitaly Buka [Tue, 19 Apr 2022 03:37:28 +0000 (20:37 -0700)]
[msan][libcxx] Enable -fsanitize-memory-param-retval

We are considering to make -fsanitize-memory-param-retval enabled by default so probably this patch is unnneded.

Reviewed By: #libc, EricWF

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

2 years agoFrontend: Delete output streams before closing CompilerInstance outputs
Duncan P. N. Exon Smith [Thu, 28 Apr 2022 06:43:35 +0000 (23:43 -0700)]
Frontend: Delete output streams before closing CompilerInstance outputs

Delete the output streams coming from
CompilerInstance::createOutputFile() and friends once writes are
finished. Concretely, replacing `OS->flush()` with `OS.reset()` in:

- `ExtractAPIAction::EndSourceFileAction()`
- `PrecompiledPreambleAction::setEmittedPreamblePCH()`
- `cc1_main()'s support for `-ftime-trace`

This fixes theoretical bugs related to proxy streams, which may have
cleanups to run in their destructor. For example, a proxy that
CompilerInstance sometimes uses is `buffer_ostream`, which wraps a
`raw_ostream` lacking pwrite support and adds it. `flush()` does not
promise that output is complete; `buffer_ostream` needs to wait until
the destructor to forward anything so that it can service later calls to
`pwrite()`. If the destructor isn't called then the proxied stream
hasn't received any content.

This also protects against some logic bugs, triggering a null
dereference on a later attempt to write to the stream.

No tests, since in practice these particular code paths never use
use `buffer_ostream`; you need to be writing a binary file to a
pipe (such as stdout) to hit it, but `-extract-api` writes a text file
and the other two use computed filenames that will never (in practice)
be a pipe. This is effectively NFC, for now.

But I have some other patches in the works that add guard rails,
crashing if the stream hasn't been destructed by the time the
CompilerInstance is told to keep the output file, since in most cases
this is a problem.

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

2 years ago[analyzer] Add path note tags to standard library function summaries.
Artem Dergachev [Wed, 23 Mar 2022 04:45:24 +0000 (21:45 -0700)]
[analyzer] Add path note tags to standard library function summaries.

The patch is straightforward except the tiny fix in BugReporterVisitors.cpp
that suppresses a default note for "Assuming pointer value is null" when
a note tag from the checker is present. This is probably the right thing to do
but also definitely not a complete solution to the problem of different sources
of path notes being unaware of each other, which is a large and annoying issue
that we have to deal with. Note tags really help there because they're nicely
introspectable. The problem is demonstrated by the newly added getenv() test.

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

2 years ago[CUDA][HIP] Fix mangling number for local struct
Yaxun (Sam) Liu [Wed, 30 Mar 2022 14:33:03 +0000 (10:33 -0400)]
[CUDA][HIP] Fix mangling number for local struct

MSVC and Itanium mangling use different mangling numbers
for function-scope structs, which causes inconsistent
mangled kernel names in device and host compilations.

This patch uses Itanium mangling number for structs
in for mangling device side names in CUDA/HIP host
compilation on Windows to fix this issue.

A state is added to ASTContext to indicate whether the
current name mangling is for device side names in host
compilation. Device and host mangling number
are encoded/decoded as upper and lower half of 32 bit
unsigned integer to fit into the original mangling number
field for AST. Diagnostic will be emitted if a manglining
number exceeds limit.

Reviewed by: Artem Belevich, Reid Kleckner

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

Fixes: SWDEV-328515

2 years ago[NFC][SCEV] Refactor `createNodeForSelectViaUMinSeq()` out of `createNodeForSelectOrP...
Roman Lebedev [Thu, 28 Apr 2022 20:17:57 +0000 (23:17 +0300)]
[NFC][SCEV] Refactor `createNodeForSelectViaUMinSeq()` out of `createNodeForSelectOrPHIViaUMinSeq()`

2 years ago[NFC][SCEV] Tests with modellable pointer `select`s
Roman Lebedev [Thu, 28 Apr 2022 19:35:37 +0000 (22:35 +0300)]
[NFC][SCEV] Tests with modellable pointer `select`s

2 years agoRevert "[DebugInfo][InstrRef] Describe value sizes when spilt to stack"
Zequan Wu [Thu, 28 Apr 2022 23:17:12 +0000 (16:17 -0700)]
Revert "[DebugInfo][InstrRef] Describe value sizes when spilt to stack"

This reverts commit a15b66e76d1ecff625a4bbb4a46ff83a43138f49.

This causes linker to crash at assertion: `Assertion failed: !Expr->isComplex(), file C:\b\s\w\ir\cache\builder\src\third_party\llvm\llvm\lib\CodeGen\LiveDebugValues\InstrRefBasedImpl.cpp, line 907`.

2 years ago[llvm-profgen] Decouple artificial branch from LBR parser and fix external address...
wlei [Sun, 24 Apr 2022 19:07:54 +0000 (12:07 -0700)]
[llvm-profgen] Decouple artificial branch from LBR parser and fix external address related issues

This patch is fixing two issues for both CS and non-CS.
1) For external-call-internal, the head samples of the the internal function should be recorded.
2) avoid ignoring LBR after meeting the interrupt branch for CS profile

LBR parser is shared between CS and non-CS, we found it's error-prone while dealing with artificial branch inside LBR parser. Since artificial branch is mainly used for CS profile unwinding, this patch tries to simplify LBR parser by decoupling artificial branch code from it, the concept of artificial branch is removed and split into two transitional branches(internal-to-external, external-to-internal). Then we leave all the processing of external branch to unwinder.

Specifically for unwinder, remembering that we introduce external frame in https://reviews.llvm.org/D115550. We can just take external address as a regular address and reuse current unwind function(unwindCall, unwindReturn). For a normal case, the external frame will match an external LBR, and it will be filtered out by `unwindLinear` without losing any context.

The data also shows that the interrupt or standalone LBR pattern(unpaired case) does exist, we choose to handle it by clearing the call stack and keeping unwinding. Here we leverage checking in `unwindLinear`, because a standalone LBR, no matter its type, since it doesn’t have other part to pair, it will eventually cause a wrong linear range, like [external, internal], [internal, external]. Then set the state to invalid there.

Reviewed By: hoy, wenlei

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

2 years ago[lldb] Remove ConnectionFileDescriptorTest.Connectv(4|6)
Jonas Devlieghere [Thu, 28 Apr 2022 22:40:17 +0000 (15:40 -0700)]
[lldb] Remove ConnectionFileDescriptorTest.Connectv(4|6)

These tests are timing out on the bots.

2 years ago[Tooling/DependencyScanning] Make skipping excluded PP ranges during dependency scann...
Argyrios Kyrtzidis [Wed, 27 Apr 2022 21:31:54 +0000 (14:31 -0700)]
[Tooling/DependencyScanning] Make skipping excluded PP ranges during dependency scanning the default

This is to improve maintenance a bit and remove need to maintain the additional option and related code-paths.

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

2 years ago[NFC] remove const from FunctionPropertiesAnalysis::run, keep on Result
Mircea Trofin [Thu, 28 Apr 2022 22:10:21 +0000 (15:10 -0700)]
[NFC] remove const from FunctionPropertiesAnalysis::run, keep on Result

The goal in 75881d8b023e was just modifying what `Result` is, didn't
need to also modify ::run.

2 years ago[lldb] Fix crash when launching in terminal
Jonas Devlieghere [Thu, 28 Apr 2022 19:48:14 +0000 (12:48 -0700)]
[lldb] Fix crash when launching in terminal

This patch fixes a crash when using process launch -t to launch the
inferior from a TTY. The issue is that on Darwin, Host.mm is calling
ConnectionFileDescriptor::Connect without a socket_id_callback_type. The
overload passes nullptr as the function ref, which gets called
unconditionally as the socket_id_callback.

One potential way to fix this is to change all the lambdas to include a
null check, but instead I went with an empty lambda.

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

2 years ago[MC][AArch64] Enable '+v8a' when nothing specified for MCSubtargetInfo
CHIANG, YU-HSUN (Tommy Chiang, oToToT) [Fri, 22 Apr 2022 01:54:15 +0000 (09:54 +0800)]
[MC][AArch64] Enable '+v8a' when nothing specified for MCSubtargetInfo

Since D110065, the 'R' profile support is added to LLVM. It turns the
`generic` cpu into the intersection of v8-a and v8-r. However, this
makes some backward compatibility problems. The original patch makes
the clang driver implicitly pass -march=armv8-a when only the triple
is specified. Since it only applies to clang, other tools like
llvm-objdump still faces the backward compatibility problem.

This patch applies the same idea to MC related tools by enabling '+v8a'
feature when nothing is specified (both CPU and FS are empty) for
MCSubtargetInfo creation.

This patch should fix PR53956.

Reviewed by: labrinea

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

2 years ago[BOLT] Fix r_aarch64_prelxx test
Alexey Moksyakov [Thu, 28 Apr 2022 20:34:03 +0000 (23:34 +0300)]
[BOLT] Fix r_aarch64_prelxx test

The relocation value is calculated using the formula S + A - P,
the verification of the value is performed by inversely calculating the location address

Reviewed By: Amir

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

2 years ago[bazel] Port 92a836da0759
Benjamin Kramer [Thu, 28 Apr 2022 20:51:27 +0000 (22:51 +0200)]
[bazel] Port 92a836da0759

2 years ago[lit][unit] set the default result start and pid
Yuanfang Chen [Thu, 28 Apr 2022 20:37:07 +0000 (13:37 -0700)]
[lit][unit] set the default result start and pid

In case of interrupting, there were None. Fixes PR55176.

2 years agoRevert "[CodeGen][ARM] Enable Swing Module Scheduling for ARM"
David Penry [Thu, 28 Apr 2022 20:23:22 +0000 (13:23 -0700)]
Revert "[CodeGen][ARM] Enable Swing Module Scheduling for ARM"

This reverts commit 28d09bbbc3d09c912b54a4d5edb32cab7de32a6f
while I investigate a buildbot failure.

2 years ago[X86] Don't fold AND(SRL(X,Y),1) -> SETCC(BT(X,Y)) on BMI2 targets
Simon Pilgrim [Thu, 28 Apr 2022 20:28:16 +0000 (21:28 +0100)]
[X86] Don't fold AND(SRL(X,Y),1) -> SETCC(BT(X,Y)) on BMI2 targets

With BMI2 we have SHRX which is a lot quicker than regular x86 shifts.

Fixes #55138

2 years ago[RISCV] Add riscv32 RUN lines to bittest.ll. NFC
Craig Topper [Thu, 28 Apr 2022 19:47:58 +0000 (12:47 -0700)]
[RISCV] Add riscv32 RUN lines to bittest.ll. NFC

Add extra check-prefixes to merge common results.

2 years ago[CodeGen][ARM] Enable Swing Module Scheduling for ARM
David Penry [Tue, 29 Mar 2022 17:13:55 +0000 (10:13 -0700)]
[CodeGen][ARM] Enable Swing Module Scheduling for ARM

This patch permits Swing Modulo Scheduling for ARM targets
turns it on by default for the Cortex-M7.  The t2Bcc
instruction is recognized as a loop-ending branch.

MachinePipeliner is extended by adding support for
"unpipelineable" instructions.  These instructions are
those which contribute to the loop exit test; in the SMS
papers they are removed before creating the dependence graph
and then inserted into the final schedule of the kernel and
prologues. Support for these instructions was not previously
necessary because current targets supporting SMS have only
supported it for hardware loop branches, which have no
loop-exit-contributing instructions in the loop body.

The current structure of the MachinePipeliner makes it difficult
to remove/exclude these instructions from the dependence graph.
Therefore, this patch leaves them in the graph, but adds a
"normalization" method which moves them in the schedule to
stage 0, which causes them to appear properly in kernel and
prologues.

It was also necessary to be more careful about boundary nodes
when iterating across successors in the dependence graph because
the loop exit branch is now a non-artificial successor to
instructions in the graph. In additional, schedules with physical
use/def pairs in the same cycle should be treated as creating an
invalid schedule because the scheduling logic doesn't respect
physical register dependence once scheduled to the same cycle.

Reviewed By: dmgreen

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

2 years ago[mlir:PDLL] Fix the import of native constraints from ODS
River Riddle [Tue, 26 Apr 2022 20:29:45 +0000 (13:29 -0700)]
[mlir:PDLL] Fix the import of native constraints from ODS

We weren't properly returning the result of the constraint,
which leads to errors when actually trying to use the generated
C++.

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

2 years ago[mlir:PDLL] Fix error handling of eof within a string literal
River Riddle [Tue, 26 Apr 2022 20:27:03 +0000 (13:27 -0700)]
[mlir:PDLL] Fix error handling of eof within a string literal

We currently aren't handling this properly, and in the case
of a string block just crash. This commit adds proper error handling
and detection for eof.

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

2 years ago[mlir:LSP] Improve conversion between SourceMgr and LSP locations
River Riddle [Tue, 26 Apr 2022 20:05:23 +0000 (13:05 -0700)]
[mlir:LSP] Improve conversion between SourceMgr and LSP locations

SourceMgr generally uses 1-based locations, whereas the LSP is zero based.
This commit corrects this conversion and also enhances the conversion from SMLoc
to SMRange to support string tokens.

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

2 years ago[mlir:PDL] Rework errors for pdl.operations with non-inferrable results
River Riddle [Tue, 26 Apr 2022 19:18:27 +0000 (12:18 -0700)]
[mlir:PDL] Rework errors for pdl.operations with non-inferrable results

We currently emit an error during verification if a pdl.operation with non-inferrable
results is used within a rewrite. This allows for catching some errors during compile
time, but is slightly broken. For one, the verification at the PDL level assumes that
all dialects have been loaded, which is true at run time, but may not be true when
the PDL is generated (such as via PDLL). This commit fixes this by not emitting the
error if the operation isn't registered, i.e. it uses the `mightHave` variant of trait/interface
methods.

Secondly, we currently don't verify when a pdl.operation has no explicit results, but the
operation being created is known to expect at least one. This commit adds a heuristic
error to detect these cases when possible and fail. We can't always capture when the user
made an error, but we can capture the most common case where the user expected an
operation to infer its result types (when it actually isn't possible).

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

2 years ago[mlir:PDL] Fix a syntax ambiguity in pdl.attribute
River Riddle [Tue, 26 Apr 2022 18:21:18 +0000 (11:21 -0700)]
[mlir:PDL] Fix a syntax ambiguity in pdl.attribute

pdl.attribute currently has a syntax ambiguity that leads to the incorrect parsing
of pdl.attribute operations with locations that don't also have a constant value. For example:

```
pdl.attribute loc("foo")
```

The above IR is treated as being a pdl.attribute with a constant value containing the location,
`loc("foo")`, which is incorrect. This commit changes the syntax to use `= <constant-value>` to
clearly distinguish when the constant value is present, as opposed to just trying to parse an attribute.

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

2 years ago[mlir] Attach InferTypeOpInterface on SameOperandsAndResultType operations when possible
River Riddle [Tue, 26 Apr 2022 18:12:45 +0000 (11:12 -0700)]
[mlir] Attach InferTypeOpInterface on SameOperandsAndResultType operations when possible

This allows for inferring the result types of operations in certain situations by using the type of
an operand. This commit allowed for automatically supporting type inference for many more
operations with no additional effort, e.g. nearly all Arithmetic operations now support
result type inferrence with no additional changes.

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

2 years ago[mlir:ODS] Support using attributes in AllTypesMatch to automatically add InferTypeOp...
River Riddle [Tue, 26 Apr 2022 18:00:35 +0000 (11:00 -0700)]
[mlir:ODS] Support using attributes in AllTypesMatch to automatically add InferTypeOpInterface

This allows for using attribute types in result type inference for use with
InferTypeOpInterface. This was a TODO before, but it isn't much
additional work to properly support this. After this commit,
arith::ConstantOp can now have its InferTypeOpInterface implementation automatically
generated.

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

2 years ago[flang][runtime] Support B/O/Z editing of CHARACTER
Peter Klausler [Wed, 27 Apr 2022 19:45:07 +0000 (12:45 -0700)]
[flang][runtime] Support B/O/Z editing of CHARACTER

This is a common extension, though semantics differ across
compilers.  I've chosen to interpret the CHARACTER data
as if it were an arbitrary-precision integer value and
format or read it as such.  This matches Intel's compilers
and nvfortran.  (GNU Fortran can't handle lengths > 1 and XLF
seems to get the enddianness wrong.)

This patch generalizes the previous implementations of
B/O/Z input and output so that they'll work for arbitrary data
in memory, and then uses them for all B/O/Z input/output,
including (now) CHARACTER.

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

2 years ago[NFC] const-ed the return type of FunctionPropertiesAnalysis
Mircea Trofin [Thu, 28 Apr 2022 18:18:28 +0000 (11:18 -0700)]
[NFC] const-ed the return type of FunctionPropertiesAnalysis

The result is a data bag, this makes sure it's signaled to a user that
the data can't be mutated when, for example, doing something like:

auto &R = FAM.getResult<FunctionPropertiesAnalysis>(F)
...
R.Uses++

2 years ago[X86] setcc.ll - add "NOTBM" check-prefix for expected common code
Simon Pilgrim [Thu, 28 Apr 2022 19:12:38 +0000 (20:12 +0100)]
[X86] setcc.ll - add "NOTBM" check-prefix for expected common code

2 years agoRevert "[VPlan] Remove uneeded needsVectorIV check."
Florian Hahn [Thu, 28 Apr 2022 19:16:21 +0000 (20:16 +0100)]
Revert "[VPlan] Remove uneeded needsVectorIV check."

This reverts commit 43842b887e0a7b918bb2d6c9f672025b2c621f8a while I
investigate a buildbot failure.

It also reverts the follow-up commit
2883de05145fc5b4afb99b91f69ebb835af36af5.

2 years ago[OpAsmParser] Simplify logic for requiredOperandCount in parseOperandList.
Chris Lattner [Thu, 28 Apr 2022 18:37:17 +0000 (11:37 -0700)]
[OpAsmParser] Simplify logic for requiredOperandCount in parseOperandList.

I would ideally like to eliminate 'requiredOperandCount' as a bit of
verification that should be in the client side, but it is much more
widely used than I expected.  Just tidy some pieces up around it given
we can't drop it immediately.

NFC.

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

2 years ago[randstruct] Randomize all elements of a record
Bill Wendling [Thu, 28 Apr 2022 19:00:47 +0000 (12:00 -0700)]
[randstruct] Randomize all elements of a record

A record may have more than just FieldDecls in it. If so, then we're
likely to drop them if we only randomize the FieldDecls.

We need to be careful about anonymous structs/unions. Their fields are
made available in the RecordDecl as IndirectFieldDecls, which are listed
after the anonymous struct/union. The ordering doesn't appear to be
super important, however we place them unrandomized at the end of the
RecordDecl just in case. There's also the possiblity of
StaticAssertDecls. We also want those at the end.

All other non-FieldDecls we place at the top, just in case we get
something like:

    struct foo {
      enum e { BORK };
      enum e a;
    };

Link: https://github.com/KSPP/linux/issues/185
Reviewed By: aaron.ballman

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

2 years ago[libc] Support 32-bit ARM platform tests
Dominic Chen [Thu, 21 Apr 2022 22:08:04 +0000 (15:08 -0700)]
[libc] Support 32-bit ARM platform tests

Set LONG_DOUBLE_IS_DOUBLE, add ifdefs for 128-bit integer types

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

2 years ago[LLVM] Add exported visibility style for XCOFF
David Tenty [Tue, 5 Apr 2022 21:27:00 +0000 (17:27 -0400)]
[LLVM] Add exported visibility style for XCOFF

For the AIX linker, under default options, global or weak symbols which
have no visibility bits set to zero (i.e. no visibility, similar to ELF
default) are only exported if specified on an export list provided to
the linker. So AIX has an additional visibility style called
"exported" which indicates to the linker that the symbol should
be explicitly globally exported.

This change maps "dllexport" in the LLVM IR to correspond to XCOFF
exported as we feel this best models the intended semantic (discussion
on the discourse RFC thread: https://discourse.llvm.org/t/rfc-adding-exported-visibility-style-to-the-ir-to-model-xcoff-exported-visibility/61853)
and allows us to enable writing this visibility for the AIX target
in the assembly path.

Reviewed By: DiggerLin

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

2 years ago[VectorCombine] Try to reduce shuffle cost for commutative reduction operands
David Green [Thu, 28 Apr 2022 18:46:12 +0000 (19:46 +0100)]
[VectorCombine] Try to reduce shuffle cost for commutative reduction operands

Given a shuffle feeding a commutative reduction, the lane ordering of
the shuffle will not alter the result. This is also true if there are a
number of operations between the reduction and the shuffle, providing
they only operate lane-wise. This patch searches for cases like that in
Vector Combine, allowing us to check the cost of the shuffle vs an
in-order identity shuffle and replace the order if possible. This only
handles a single shuffle at the moment to keep things simple, and is
able to ignore splats that produce results where every result is the
same.

This is a more powerful version of a combine that already happens in
instrcombine, capable of optimizing more cases by looking through more
instructions and being able to cost the shuffle.

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

2 years ago[mlir] Add basic tree-sitter grammar file
Jacques Pienaar [Thu, 28 Apr 2022 18:42:46 +0000 (11:42 -0700)]
[mlir] Add basic tree-sitter grammar file

tree-sitter grammar file that tries to closely matches LangRef (it could use
some tweaking and cleanup, but kept fairly basic). Also updated LangRef in
places where found some issues while doing the nearly direct transcription.

This only adds a grammar file, not all the other parts (npm etc) that
accompanies it. Those I'll propose for separate repo like we do for vscode
extension.

Reviewed By: rriddle

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

2 years agoInstCombine: Add no-one-use tests and create thwart complexity-based canonicalization...
Biplob Mishra [Thu, 28 Apr 2022 18:24:28 +0000 (19:24 +0100)]
InstCombine: Add no-one-use tests and create thwart complexity-based canonicalization for the or-and combine tests

2 years ago[AsmParser] Rework logic around "region argument parsing"
Chris Lattner [Tue, 26 Apr 2022 19:03:03 +0000 (12:03 -0700)]
[AsmParser] Rework logic around "region argument parsing"

The asm parser had a notional distinction between parsing an
operand (like "%foo" or "%4#3") and parsing a region argument
(which isn't supposed to allow a result number like #3).

Unfortunately the implementation has two problems:

1) It didn't actually check for the result number and reject
   it.  parseRegionArgument and parseOperand were identical.
2) It had a lot of machinery built up around it that paralleled
   operand parsing.  This also was functionally identical, but
   also had some subtle differences (e.g. the parseOptional
   stuff had a different result type).

I thought about just removing all of this, but decided that the
missing error checking was important, so I reimplemented it with
a `allowResultNumber` flag on parseOperand.  This keeps the
codepaths unified and adds the missing error checks.

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

2 years ago[clang][dataflow] Perform structural comparison of indirection values in `join`.
Yitzhak Mandelbaum [Wed, 27 Apr 2022 17:21:59 +0000 (17:21 +0000)]
[clang][dataflow] Perform structural comparison of indirection values in `join`.

This patch changes `Environment::join`, in the case that two values at the same
location are not (pointer) equal, to structurally compare indirection values
(pointers and references) for equivalence (that is, equivalent pointees) before
resorting to merging.

This change makes join consistent with equivalence, which also performs
structural comparison. It also fixes a bug where the values are `ReferenceValue`
but the merge creates a non-reference value. This case arises when the
`ReferenceValue`s were created to represent an lvalue, so the "reference-ness"
is not reflected in the type. In this case, the pointees will always be
equivalent, because lvalues at the same code location point to the location of a
fixed declaration, whose location is itself stable across blocks.

We were unable to reproduce a unit test for this latter bug, but have verified
the fix in the context of a larger piece of code that triggers the bug.

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

2 years ago[OPENMP]PR53344: Emit code for final update of the inscan reduction vars in workshari...
Alexey Bataev [Mon, 7 Mar 2022 21:11:12 +0000 (13:11 -0800)]
[OPENMP]PR53344: Emit code for final update of the inscan reduction vars in worksharing loops.

Need to emit final update of the inscan reduction variables. For
worksharing loops, the reduction values are stored in the temp array,
need to copy the last element to the original var at the end of the
construct.

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

2 years ago[PS5] Default to omit leaf frame pointer
Paul Robinson [Thu, 28 Apr 2022 17:34:57 +0000 (10:34 -0700)]
[PS5] Default to omit leaf frame pointer

2 years ago[llvm-ml] Improve indirect call parsing
Alan Zhao [Thu, 28 Apr 2022 17:01:10 +0000 (13:01 -0400)]
[llvm-ml] Improve indirect call parsing

In MASM, if a QWORD symbol is passed to a jmp or call instruction in
64-bit mode or a DWORD or WORD symbol is passed in 32-bit mode, then
MSVC's assembler recognizes that as an indirect call. Additionally, if
the operand is qualified as a ptr, then that should also be an indirect
call.

Furthermore, in 64-bit mode, such operands are implicitly rip-relative
(in fact, MSVC's assembler ml64.exe does not allow explicitly specifying
rip as a base register.)

To keep this patch managable, this patch does not include:
* error messages for wrong operand types (e.g. passing a QWORD in 32-bit
  mode)
* resolving indirect calls if the symbol is declared after it's first
  use (llvm-ml currently only runs a single pass).
* imlementing the extern keyword (required to resolve
  https://crbug.com/762167.)

This patch is likely missing a bunch of edge cases, so please do point
them out in the review.

Reviewed By: epastor, hans, MaskRay

Committed By: epastor (on behalf of ayzhao)

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

2 years ago[InstCombine][X86] simplifyDemandedVectorEltsIntrinsic - handle avx2 per-element...
Simon Pilgrim [Thu, 28 Apr 2022 16:49:11 +0000 (17:49 +0100)]
[InstCombine][X86] simplifyDemandedVectorEltsIntrinsic - handle avx2 per-element vector shifts

2 years ago[COST]Improve cost model for shuffles in SLP.
Alexey Bataev [Wed, 14 Apr 2021 14:49:32 +0000 (07:49 -0700)]
[COST]Improve cost model for shuffles in SLP.

Introduced masks where they are not added and improved target dependent
cost models to avoid returning of the incorrect cost results after
adding masks.

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

2 years ago[PS5] Defaults for -fdeclspec, -ffunction/data-sections
Paul Robinson [Thu, 28 Apr 2022 16:58:47 +0000 (09:58 -0700)]
[PS5] Defaults for -fdeclspec, -ffunction/data-sections

2 years ago[RISCV] Use default promotion for (i32 (shl 1, X)) on RV64 when Zbs is enabled.
Craig Topper [Thu, 28 Apr 2022 16:21:13 +0000 (09:21 -0700)]
[RISCV] Use default promotion for (i32 (shl 1, X)) on RV64 when Zbs is enabled.

This improves opportunities to use bset/bclr/binv. Unfortunately,
there are no W versions of these instrcutions so this isn't always
a clear win. If we use SLLW we get free sign extend and shift masking,
but need to put a 1 in a register and can't remove an or/xor. If
we use bset/bclr/binv we remove the immediate materializationg and
logic op, but might need a mask on the shift amount and sext.w.

Reviewed By: luismarques

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

2 years agoFix "not all control paths return a value" diagnostic; NFC
Aaron Ballman [Thu, 28 Apr 2022 16:57:07 +0000 (12:57 -0400)]
Fix "not all control paths return a value" diagnostic; NFC

2 years ago[ArgPromotion] Move ArgPart and OffsetAndArgPart to anonymous namespace
Pavel Samolysov [Thu, 28 Apr 2022 16:51:39 +0000 (09:51 -0700)]
[ArgPromotion] Move ArgPart and OffsetAndArgPart to anonymous namespace

The structure ArgPart and alias OffsetAndArgPart have been moved
into the anonymous namespace. NFC.

Reviewed By: aeubanks

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

2 years ago[ArgPromotion] Change the condition to check the promotion limit
Pavel Samolysov [Thu, 28 Apr 2022 16:37:35 +0000 (09:37 -0700)]
[ArgPromotion] Change the condition to check the promotion limit

The condition should be 'ArgParts.size() > MaxElements', so that if we
have exactly 3 elements in the 'ArgParts' vector, the promotion should
be allowed because the 'MaxElement' threshold is not exceeded yet.

The default value for 'MaxElement' has been decreased to 2 in order
to avoid an actual change in argument promoting behavior. However,
this changes byval argument transformation behavior by allowing
adding not more than 2 arguments to the function instead of 3 allowed
before.

Reviewed By: aeubanks

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

2 years ago[SelectionDAG] Use correct boolean representation in FoldConstantArithmetic
Bjorn Pettersson [Thu, 28 Apr 2022 16:31:05 +0000 (18:31 +0200)]
[SelectionDAG] Use correct boolean representation in FoldConstantArithmetic

The description of SETCC says
  /// SetCC operator - This evaluates to a true value iff the condition is
  /// true.  If the result value type is not i1 then the high bits conform
  /// to getBooleanContents.

Without this patch, we sign extended the i1 to the used larger type
regardless of getBooleanContents. This resulted in miscompiles, as
shown in the attached testcase that ended up returning -1 instead of
1 when using -mattr=+v.

Fixes https://github.com/llvm/llvm-project/issues/55168

Reviewed By: craig.topper

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

2 years ago[libunwind][AArch64] Fix _Unwind_ForcedUnwind via sigreturn.
Daniel Kiss [Thu, 28 Apr 2022 08:01:22 +0000 (10:01 +0200)]
[libunwind][AArch64] Fix _Unwind_ForcedUnwind via sigreturn.

When the sigreturn trampoline is found the unw_proc_info_t.end_ip need to be set to
indicate a stack frame is found.

Reviewed By: cjdb, #libunwind, MaskRay

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

2 years ago[InstCombine][X86] Add exhaustive simplify demanded vector elts tests for avx2 per...
Simon Pilgrim [Thu, 28 Apr 2022 16:14:39 +0000 (17:14 +0100)]
[InstCombine][X86] Add exhaustive simplify demanded vector elts tests for avx2 per-element vector shifts

2 years ago[bazel] Port 84fe39a45b73
Benjamin Kramer [Thu, 28 Apr 2022 16:29:43 +0000 (18:29 +0200)]
[bazel] Port 84fe39a45b73

2 years ago[flang][runtime] Correct emission & reading of unterminated final records
Peter Klausler [Tue, 26 Apr 2022 23:09:42 +0000 (16:09 -0700)]
[flang][runtime] Correct emission & reading of unterminated final records

When the last operation on a foramtted sequential or stream file (prior
to an implied or explicit ENDFILE) is a non-advancing WRITE, ensure
that any partial record data is emitted to the file without a line
terminator.  Further, when that last record is read with a non-advancing
READ, ensure that it won't raise an end-of-record condition after its
data, but instead will signal an end-of-file.

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

2 years ago[X86] getTargetVShiftByConstNode - use SelectionDAG::FoldConstantArithmetic to perfor...
Simon Pilgrim [Thu, 28 Apr 2022 16:08:20 +0000 (17:08 +0100)]
[X86] getTargetVShiftByConstNode - use SelectionDAG::FoldConstantArithmetic to perform constant folding. NFCI.

Remove some unnecessary code duplication.

2 years ago[COST][NFC]Add a test for non-power-2 shuffles, NFC.
Alexey Bataev [Thu, 28 Apr 2022 15:49:52 +0000 (08:49 -0700)]
[COST][NFC]Add a test for non-power-2 shuffles, NFC.

2 years ago[mlir] Don't iterate mutable user list
Vitaly Buka [Wed, 27 Apr 2022 23:16:39 +0000 (16:16 -0700)]
[mlir] Don't iterate mutable user list

executeOp.operandsMutable().append(asyncTokens) in
addAsyncDependencyAfter can resize and invalidate iterators.

Fixes reports like https://reviews.llvm.org/P8286

Reviewed By: herhut

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

2 years ago[mlir][msan] Don't access destroyed node
Vitaly Buka [Wed, 27 Apr 2022 23:07:21 +0000 (16:07 -0700)]
[mlir][msan] Don't access destroyed node

2 years ago[mlir][emitc] Add a cast op
Marius Brehler [Mon, 11 Apr 2022 14:14:51 +0000 (14:14 +0000)]
[mlir][emitc] Add a cast op

This adds a cast operation that allows to perform an explicit type
conversion. The cast op is emitted as a C-style cast. It can be applied
to integer, float, index and EmitC types.

Reviewed By: jpienaar

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

2 years ago[mlir][msan][test] Disable jit tests
Vitaly Buka [Wed, 27 Apr 2022 23:04:47 +0000 (16:04 -0700)]
[mlir][msan][test] Disable jit tests

I am going to enable MLIR test on msan bot
https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux-bootstrap-msan

Reviewed By: ftynse

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

2 years ago[llvm] Ignore .rej files in .gitignore
Jonas Devlieghere [Thu, 28 Apr 2022 15:43:12 +0000 (08:43 -0700)]
[llvm] Ignore .rej files in .gitignore

Ignore reject files (.rej) files generated by patch. I can't imagine a
reason they should ever be checked in. I considered ignoring patch files
as well but decided to err on the side of caution because we might not
want them to be easily deleted by something like git clean.

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

2 years ago[HLSL] Adjust access specifier behavior
Chris Bieneman [Thu, 28 Apr 2022 15:13:20 +0000 (10:13 -0500)]
[HLSL] Adjust access specifier behavior

HLSL doesn't support access specifiers. This change has two components:

1) Make default access for classes public
2) Diagnose the use of access specifiers as a clang HLSL extension

As long as the default behavior for access specifiers matches HLSL,
allowing them to be used doesn't cause sourece incompatability with
valid code. As such enabling them as a clang extension seems like a
reasonable approach.

Fixes #55124

Reviewed By: aaron.ballman

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

2 years ago[Driver] Add f16 support to -mrecip parsing.
Craig Topper [Thu, 28 Apr 2022 15:21:02 +0000 (08:21 -0700)]
[Driver] Add f16 support to -mrecip parsing.

This is a followup to D120158 which added an 'h' suffix to the
backend handling.

Reviewed By: spatel

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

2 years ago[RISCV] Fix alias printing for vmnot.m
Craig Topper [Thu, 28 Apr 2022 15:20:42 +0000 (08:20 -0700)]
[RISCV] Fix alias printing for vmnot.m

By clearing the HasDummyMask flag from mask register binary operations
and mask load/store.

HasDummyMask was causing an extra operand to get appended when
converting from MachineInstr to MCInst. This extra operand doesn't
appear in the assembly string so was mostly ignored, but it prevented
the alias instruction printing from working correctly.

Reviewed By: arcbbb

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

2 years ago[VPlan] Fix comment formatting from 43842b887e.
Florian Hahn [Thu, 28 Apr 2022 15:31:48 +0000 (16:31 +0100)]
[VPlan] Fix comment formatting from 43842b887e.

2 years ago[VPlan] Remove uneeded needsVectorIV check.
Florian Hahn [Thu, 28 Apr 2022 15:27:34 +0000 (16:27 +0100)]
[VPlan] Remove uneeded needsVectorIV check.

Remove one of the last remaining uses of ::needsVectorIV, preparing for
its removal. Now that usesScalars is available and based on the
information explicit in VPlan, there is no need to use the pre-computed
needsVectorIV.

Reviewed By: Ayal

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

2 years ago[mlir][emitc] Replace !emitc.opaque pointers
Marius Brehler [Thu, 28 Apr 2022 15:18:12 +0000 (15:18 +0000)]
[mlir][emitc] Replace !emitc.opaque pointers

Replaces using !emitc.opaque pointers which using !emitc.ptr types.

2 years ago[lldb] Remove patch reject file (.rej)
Jonas Devlieghere [Thu, 28 Apr 2022 15:16:26 +0000 (08:16 -0700)]
[lldb] Remove patch reject file (.rej)

2 years ago[HIP] Add HIP runtime library arguments for linker
Yaxun (Sam) Liu [Wed, 27 Apr 2022 16:23:52 +0000 (12:23 -0400)]
[HIP] Add HIP runtime library arguments for linker

Add -L -l options for linker.

Reviewed by: Artem Belevich

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

2 years agoRevert "[COST]Improve cost model for shuffles in SLP."
Alexey Bataev [Thu, 28 Apr 2022 14:49:37 +0000 (07:49 -0700)]
Revert "[COST]Improve cost model for shuffles in SLP."

This reverts commit 29a470e3804ca216d4e76c88a38086eb61c200f9 to fix
a crash reported in https://reviews.llvm.org/D100486#3479989.

2 years ago[NFC][libc++][format] Enable unit tests.
Mark de Wever [Sat, 23 Apr 2022 17:50:31 +0000 (19:50 +0200)]
[NFC][libc++][format] Enable unit tests.

The GCC failures were partly fixed in D124103.

The format functions tests are fixed on GCC but they require a huge
amount of RAM (>10 GB). This fails with parallel testing in the CI. It
can be solved by splitting the test, but GCC-12 will be released shortly
and might fix the memory usage in these tests. Therefore these tests
remain disabled.

Reviewed By: #libc, ldionne

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

2 years ago[X86] getBT - attempt to peek through aext(and(trunc(x),c)) mask/modulo
Simon Pilgrim [Thu, 28 Apr 2022 15:01:33 +0000 (16:01 +0100)]
[X86] getBT - attempt to peek through aext(and(trunc(x),c)) mask/modulo

Ideally we'd fold this with generic DAGCombiner, but that only works for !isTruncateFree cases - we might be able to adapt IsDesirableToPromoteOp to find truncated src ops in the future, but for now just use this peephole.

Noticed in Issue #55138

2 years ago[mlir][emitc] Disallow !emitc.opaque pointers
Marius Brehler [Tue, 19 Apr 2022 09:23:44 +0000 (09:23 +0000)]
[mlir][emitc] Disallow !emitc.opaque pointers

Fordbids to express pointer via the `!emitc.opaque` type. Point the user
to use the `!emitc.ptr` type instead.

Reviewed By: jpienaar

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

2 years ago[PS5] Rename a test to reflect its new purpose
Paul Robinson [Thu, 28 Apr 2022 15:07:36 +0000 (08:07 -0700)]
[PS5] Rename a test to reflect its new purpose

2 years ago[demangler] Fix demangling a template argument which happens to be a null pointer
gbreynoo [Thu, 28 Apr 2022 14:55:26 +0000 (15:55 +0100)]
[demangler] Fix demangling a template argument which happens to be a null pointer

As seen in https://github.com/llvm/llvm-project/issues/51854
llvm-cxxfilt was having trouble demangling the case "_Z1fIDnLDn0EEvv".
We handled the "LDNE" case and "LPi0E" but not "LDn0E". This change adds
that handling.

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

2 years ago[PS5] Set default cpu to znver2, with no tuning
Paul Robinson [Thu, 28 Apr 2022 14:50:20 +0000 (07:50 -0700)]
[PS5] Set default cpu to znver2, with no tuning

2 years ago[test][NewPM] Use -passes=loop-vectorize instead of -loop-vectorize
Bjorn Pettersson [Thu, 28 Apr 2022 14:46:00 +0000 (16:46 +0200)]
[test][NewPM] Use -passes=loop-vectorize instead of -loop-vectorize

Update a bunch of loop-vectorize regression tests to use the new PM
syntax (opt -passes=loop-vectorize) instead of the deprecated legacy
PM syntax (opt -loop-vectorize).

2 years ago[PS5] Disable exceptions by default
Paul Robinson [Thu, 28 Apr 2022 14:16:01 +0000 (07:16 -0700)]
[PS5] Disable exceptions by default

2 years ago[VecCombine] Add tests for removing shuffles from reductions. NFC
David Green [Thu, 28 Apr 2022 14:06:24 +0000 (15:06 +0100)]
[VecCombine] Add tests for removing shuffles from reductions. NFC

2 years ago[InstCombine][X86] Show failure to simplify demanded vector elts for x86 per-element...
Simon Pilgrim [Thu, 28 Apr 2022 14:00:38 +0000 (15:00 +0100)]
[InstCombine][X86] Show failure to simplify demanded vector elts for x86 per-element vector shifts

2 years ago[lldb] Add FixAnyAddress to ABI plugins
David Spickett [Wed, 13 Apr 2022 12:27:46 +0000 (13:27 +0100)]
[lldb] Add FixAnyAddress to ABI plugins

FixAnyAddress is to be used when we don't know or don't care
whether we're fixing a code or data address.

By using FixAnyAddress over the others, you document that no
specific choice was made.

On all existing platforms apart from Arm Thumb, you could use
either FixCodeAddress or FixDataAddress and be fine. Up until
now I've chosen to use FixDataAddress but if I had
chosen to use FixCodeAddress that would have broken Arm Thumb.

Hence FixAnyAddress, to give you the "safest" option when you're
in generic code.

Uses of FixDataAddress in memory region code have been changed
to FixAnyAddress. The functionality is unchanged.

Reviewed By: omjavaid, JDevlieghere

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

2 years ago[ArgPromotion] Rename variables according to the code style. NFC
Pavel Samolysov [Thu, 28 Apr 2022 13:31:00 +0000 (15:31 +0200)]
[ArgPromotion] Rename variables according to the code style. NFC

Some loop counters ('i', 'e') and variables ('type') were named not
in accordance with the code style and clang-tidy issues warnings
about the using of such variables. This patch renames the variables
and fixes some typos in the comments within the source file.

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

2 years ago[AArch64] Add a fp128 shuffle test. NFC
David Green [Thu, 28 Apr 2022 13:28:45 +0000 (14:28 +0100)]
[AArch64] Add a fp128 shuffle test. NFC

These legalize to scalar types, so it's useful to have a test case that
covers them.

2 years ago[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]
Chris Jackson [Thu, 28 Apr 2022 13:10:25 +0000 (14:10 +0100)]
[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]

Reland 3f2b76ec90b5f108272a3072a1345ba55d8ec75b with the test corrected
to require x86-registered-target.

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