Commit Graph

478847 Commits

Author SHA1 Message Date
Med Ismail Bennani
ec456ba9ca [lldb] Add OperatingSystem base class to the lldb python module
This patch introduces an `OperatingSystem` base implementation in the
`lldb` python module to make it easier for lldb users to write their own
implementation.

The `OperatingSystem` base implementation is derived itself from the
`ScriptedThread` base implementation since they share some common grounds.

To achieve that, this patch makes changes to the `ScriptedThread`
initializer since it gets called by the `OperatingSystem` initializer.

I also took the opportunity to document the `OperatingSystem` base
class and methods.

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-10-26 15:12:22 -07:00
Med Ismail Bennani
7a1e878358 [lldb] Introduce OperatingSystem{,Python}Interface and make use it
This patch aims to consolidate the OperatingSystem scripting affordance
by introducing a stable interface that conforms to the
Scripted{,Python}Interface.

This unify the way we call into python methods from lldb while
also improving its capabilities by allowing us to pass lldb_private
objects are arguments.

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

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-10-26 15:12:22 -07:00
Peiming Liu
d808d922b4 [mlir][sparse] introduce sparse_tensor.reinterpret_map operation. (#70378) 2023-10-26 15:04:09 -07:00
Chi Chun Chen
391181062f Revert "[OpenMP] Patch for Support to loop bind clause : Checking Parent Region"
This reverts commit 85f6b2fac9.
2023-10-26 16:57:36 -05:00
Mingming Liu
a1e9777b76 [NFC] In InstrProf, generalize helper functions to take 'GlobalObject'. They currently take 'Functions' as function parameters or have 'Func' in the name. (#70287)
- For instance, `collectPGOFuncNameStrings` is reused a lot in https://github.com/llvm/llvm-project/pull/66825 to get the compressed vtable names; and in some added callsites it's just confusing to see 'func' since context clearly shows it's not. This function currently just takes a list of strings as input so name it to `collectGlobalObjectNameStrings`
- Do the rename in a standalone patch since the method is used in non-llvm codebase. It's easier to rollback this NFC in case rename in that codebase takes longer.
2023-10-26 14:48:36 -07:00
Johannes Doerfert
c2a1249a82 [OpenMP][NFC] Add min/max threads/teams count into the KernelEnvironment (#70257)
The runtime needs to know about the acceptable launch bounds, especially
if the compiler (middle- or backend) assumed those bounds. While this
patch does not yet inform the runtime, it stores the bounds in a place
that can/will be accessed and is associated with the kernel.
2023-10-26 14:46:55 -07:00
Alex Richardson
a002606404 Add another missing REQUIRES: line
This test depends on the datalayout.
2023-10-26 14:46:20 -07:00
Kiran Chandramohan
140e5d52e7 [Flang][OpenMP] Port copyin and commonblock privatisation tests to HLFIR flow
These are copies of tests in flang/test/Lower/OpenMP/FIR
copyin.f90 is autogenerated.
2023-10-26 21:45:19 +00:00
Johannes Doerfert
0ba57c8bba [OpenMP] Pass min/max thread and team count to the OMPIRBuilder (#70247)
We now provide the information about the min/max thread and team count
from to the OMPIRBuilder, no matter what the source was. That means we
unify `thread_limit`, `num_teams`, `num_threads` handling with the
target specific attriutes (`__launch_bounds__` and
`amdgpu_flat_work_group_size`). This is in preparation to pass the
values to the runtime, and to allow the middle-end (OpenMP-opt) to
tighten the values if it seems appropriate. There is no "real" change
after this commit.
2023-10-26 14:45:07 -07:00
Johannes Doerfert
57cebc709d [OpenMP][NFC] Fix test (remove wrong autogen header) 2023-10-26 14:38:24 -07:00
Johannes Doerfert
ab34d71087 [OpenMP][NFC] Remove untested code emitting no-op call 2023-10-26 14:38:24 -07:00
Johannes Doerfert
289a0f255d [OpenMP] Remove SPMD specific handling during globalization
Globalization and SPMD are different things that used to be conflated.
Some leftover crossover interactions remain, trying to remove them now.
2023-10-26 14:38:23 -07:00
Johannes Doerfert
331085b469 [OpenMP][NFC] Clang format some tests 2023-10-26 14:38:23 -07:00
Johannes Doerfert
0012b956f9 [OpenMP][FIX] Move workaround code to avoid races
The workaround code ensure we always call __kmpc_kernel_parallel, but it
did so in a racy manner as the initialization might not have been
completed yet. To avoid introducing a sync, we move the workaround into
the deinit function for now.
2023-10-26 14:38:23 -07:00
Alex Richardson
1f5a9d1d07 Fix opt/invalid-target.ll on Windows bots
On Windows the warning/error messages print opt.exe instead of opt, so
just drop this part of the check.
2023-10-26 14:32:12 -07:00
Alex Richardson
1e029cf53b Add missing REQUIRES lines to unbreak buildbots
Since e39f6c1844 these tests require
a valid target in order to compute the data layout.
2023-10-26 14:28:40 -07:00
Fangrui Song
7e42545524 [Driver] Reject unsupported -mcmodel= (#70262)
-mcmodel= is supported for a few architectures. Reject the option for
other architectures.

* -mcmodel= is unsupported on x86-32.
* -mcmodel=large is unsupported for PIC on AArch64.
* -mcmodel= is unsupported for aarch64_32 triples.
* https://reviews.llvm.org/D67066 (for RISC-V) made
-mcmodel=medany/-mcmodel=medlow aliases for all architectures. Restrict
this to RISC-V.
* llvm/lib/Target/Sparc has some small/medium/large support, but the
values listed on https://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
had been supported before https://reviews.llvm.org/D67066. Consider
-mcmodel= unsupported for Sparc.
* https://reviews.llvm.org/D106371 translated -mcmodel=medium to
-mcmodel=large on AIX, even for 32-bit systems. Retain this behavior but
reject -mcmodel= for other PPC32 systems.

In general the accept/reject behavior is more similar to GCC.

err_drv_invalid_argument_to_option is less clear than
err_drv_unsupported_option_argument. As the supported values are
different for
different architectures, add a
err_drv_unsupported_option_argument_for_target
for better clarity.
2023-10-26 14:15:36 -07:00
ZhangYin
cf0f6a1460 [libc++] <experimental/simd> Add assignment operator of simd reference (#70020) 2023-10-26 23:09:55 +02:00
serge-sans-paille
a8a6b66a26 [clang] Document -Wglobal-constructors behavior (#68084)
It's a drop in the ocean considering the lack of documentation of our
diagnostics, but it's a start.

Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
2023-10-26 21:09:31 +00:00
Piotr Zegar
543f9e7810 [clang-tidy] Improve bugprone-unused-return-value check (#66573)
Improve diagnostic message to be more straight forward, fix handling of 
casting to non-void and add new option AllowCastToVoid to control
casting
to void behavior.

Closes #66570
2023-10-26 22:58:20 +02:00
Amara Emerson
c9e8b73694 [AArch64][GlobalISel] Add support for extending indexed loads. (#70373) 2023-10-26 13:38:09 -07:00
Owen Pan
e3ecdf7d3b [clang-format][NFC] Remove some extraneous newlines at end of test cases 2023-10-26 13:37:23 -07:00
David Green
3fe8fd712b [AArch64] Fix st2 check for nearby store with debug info.
It needs to be skipping over debug instructions, whilst not counting them in
the MaxLookupDist.
2023-10-26 21:37:04 +01:00
David Pagan
52315f9b75 [clang][OpenMP] Fix target data if/logical expression assert fail (#70268)
Fixed assertion failure

  Basic Block in function 'main' does not have terminator!
  label %land.end

caused by premature setting of CodeGenIP upon entry to
emitTargetDataCalls, where subsequent evaluation of logical expression
created new basic blocks, leaving CodeGenIP pointing to the wrong basic
block. CodeGenIP is now set near the end of the function, just prior to
generating a comparison of the logical expression result (from the if
clause) which uses CodeGenIP to insert new IR.
2023-10-26 13:19:37 -07:00
Andrzej Warzyński
f24c443e82 [mlir][SVE] Add an e2e test for vector.contract (#69845)
Adds an end-to-end test for `vector.contract` that targets SVE (i.e.
scalable vectors). Note that this requires lifting the restriction on
`vector.outerproduct` (to which `vector.contract` is lowered to) that
would deem the following as invalid by the Op verifier (*):

```
vector.outerproduct %27, %28, %26 {kind = #vector.kind<add>} : vector<3xf32>, vector<[2]xf32>
```

This is indeed valid as the end-to-end test demonstrates (at least when
compiling for SVE).
2023-10-26 20:57:49 +01:00
Mehdi Amini
b13e9efcef Update llvm/docs/MyFirstTypoFix.rst for post-Phabricator / Pull-requests world (#70310) 2023-10-26 12:53:44 -07:00
Aart Bik
b1bb23991a [mlir][sparse] merger cleanup (#70371)
Implemented some TODOs and removed unlikely ones.
Comment cleanup
2023-10-26 12:46:23 -07:00
Tai Ly
cfc922fc5a [Tosa] Add tosa-to-linalg-pipeline for testing (#69997)
Add tosa-to-linalg-pipeline that calls the function
addTosaToLinalgPasses, so it gets tested in core

also added tests in tosa-to-linalg-pipeline.mlir

Signed-off-by: Tai Ly <tai.ly@arm.com>
2023-10-26 12:41:37 -07:00
Adrian Prantl
92b4e05494 Fix typo in swift section name 2023-10-26 12:25:47 -07:00
Craig Topper
56183cf608 [RISCV] Disable lax vector conversions between RVVBuiltin types and RVVFixedLengthDataVector.
This seems to be causing issues with using overloaded RVV intrinsics
that take scalar operands. If the scalar type passed in doesn't exactly
match the element type.

I blindly copied this feature from SVE. Since no one has asked for it
I'd prefer to remove it to make overloaded intrinsics work as expected.

By removing the lax conversions, types declared with __attribute__((riscv_rvv_vector_bits(__riscv_v_fixed_vlen)))
can only ever be used like their underlying RVV builtin type. No lax conversions
to other element sizes with the same LMUL.

Fixes #64404.
2023-10-26 12:20:01 -07:00
Alex Richardson
e39f6c1844 [opt] Infer DataLayout from triple if not specified
There are many tests that specify a target triple/CPU flags but no
DataLayout which can lead to IR being generated that has unusual
behaviour. This commit attempts to use the default DataLayout based
on the relevant flags if there is no explicit override on the command
line or in the IR file.

One thing that is not currently possible to differentiate from a missing
datalayout `target datalayout = ""` in the IR file since the current
APIs don't allow detecting this case. If it is considered useful to
support this case (instead of passing "-data-layout=" on the command
line), I can change IR parsers to track whether they have seen such a
directive and change the callback type.

Differential Revision: https://reviews.llvm.org/D141060
2023-10-26 12:07:37 -07:00
Alex Richardson
696eb3a55a Remove unnecessary newline from error message
I was writing a test that included this error and noticed the spurios
newline that made writing the test more awkward.
2023-10-26 12:07:37 -07:00
Piotr Zegar
c02b2ab8ab [clang-tidy] Add StrictMode to cppcoreguidelines-pro-type-static-cast-downcast (#69529)
Add StrictMode option that controls behavior whatever
warnings are emitted for casts on non-polymorphic types.

Fixes: #69414
2023-10-26 21:06:19 +02:00
Brad Smith
15254eb740 [Driver] Clean up unused architecture related bits for *BSD's (#69809)
- FreeBSD removed big-endian arm with 12.0.
- OpenBSD never had big-endian arm support. I added it just in case, but it has
  never been used.
- Remove sparcel bits. It was sprinkled in a few places but it will never be a
  thing.
- Remove 32-bit sparc bits for FreeBSD. FreeBSD has never had 32-bit sparc
  support.
- Remove sparc64 IAS test as support was enabled across the board awhile ago.
2023-10-26 14:44:12 -04:00
Benjamin Kramer
f7de498403 [AArch64][GlobalISel] Fold variable into assert
Avoids unused variable warnings in release builds. NFCI.
2023-10-26 20:39:11 +02:00
Rainer Orth
183158b4bc [Driver] Fix -r handling on Solaris (#70322)
As discussed in [[Driver] Link Flang runtime on Solaris](https://github.com/llvm/llvm-project/pull/65644), `clang -r`
incorrectly passes both `-Bdynamic` and `-e _start` to `ld` which lets the linker choke.

This patch fixes this, omitting `-Bdynamic` completely which is the linker default.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
2023-10-26 20:37:31 +02:00
Amara Emerson
a66051c68a [InstCombine] Add oneuse checks to shr + cmp constant folds.
This change has virtually no code size regressions on the llvm test suite (+ SPECs)
while having these improvements (measured with -Os on Darwin arm64):

External/S.../CFP2006/450.soplex/450.soplex    214024.00      213920.00     -0.0%
External/S...7speed/641.leela_s/641.leela_s     93412.00       93348.00     -0.1%
External/S...17rate/541.leela_r/541.leela_r     93412.00       93348.00     -0.1%
MultiSourc.../Applications/JM/lencod/lencod    426044.00      425748.00     -0.1%
MultiSourc...rks/mediabench/gsm/toast/toast     20436.00       20416.00     -0.1%
MultiSourc...ench/telecomm-gsm/telecomm-gsm     20436.00       20416.00     -0.1%
MultiSourc...Prolangs-C/assembler/assembler     16172.00       16156.00     -0.1%
MultiSourc...nch/mpeg2/mpeg2dec/mpeg2decode     35332.00       35256.00     -0.2%
SingleSour...Adobe-C++/stepanov_abstraction      6904.00        6888.00     -0.2%
External/SPEC/CINT2000/254.gap/254.gap         366060.00      365132.00     -0.3%
MultiSourc...-ProxyApps-C++/PENNANT/PENNANT     79688.00       79484.00     -0.3%
External/S...NT2006/464.h264ref/464.h264ref    352044.00      351132.00     -0.3%
SingleSour...arks/Adobe-C++/functionobjects     15524.00       15480.00     -0.3%
SingleSour...arks/Adobe-C++/stepanov_vector     10728.00       10696.00     -0.3%
SingleSour...ks/Misc-C++/stepanov_container     16900.00       16848.00     -0.3%
MultiSource/Applications/oggenc/oggenc         124184.00      123780.00     -0.3%
SingleSour...tout-C++/Shootout-C++-wordfreq      7060.00        7036.00     -0.3%
MultiSourc...ity-rijndael/security-rijndael      8976.00        8936.00     -0.4%
MultiSource/Benchmarks/McCat/18-imp/imp          9816.00        9772.00     -0.4%
SingleSour...chmarks/Misc-C++/stepanov_v1p2      1772.00        1764.00     -0.5%
MultiSourc...iabench/g721/g721encode/encode      5492.00        5464.00     -0.5%
MultiSourc...rks/McCat/03-testtrie/testtrie      1364.00        1344.00     -1.5%
SingleSour.../execute/GCC-C-execute-pr42833       400.00         364.00     -9.0%

Doing so also prevents a regression described in https://reviews.llvm.org/D143624

Differential Revision: https://reviews.llvm.org/D149918
2023-10-26 11:36:10 -07:00
Jessica Clarke
f9ead46931 [AST] Only dump desugared type when visibly different (#65214)
These are an artifact of how types are structured but serve little
purpose, merely showing that the type is sugared in some way. For
example, ElaboratedType's existence means struct S gets printed as
'struct S':'struct S' in the AST, which is unnecessary visual clutter.
Note that skipping the second print when the types have the same string
matches what we do for diagnostics, where the aka will be skipped.
2023-10-26 19:28:28 +01:00
Jinsong Ji
cf07904ee4 [Github] Fix libc docs build (#70363)
https://github.com/llvm/llvm-project/pull/69824 added libc build, but
missed the folder in ninja command, is causing failures.

ninja: fatal: chdir to 'docs-libc-html' - No such file or directory
ninja: Entering directory `docs-libc-html'
2023-10-26 14:26:47 -04:00
Aart Bik
ff94061a9f [mlir][sparse] remove reshape dot test (#70359)
This no longer tests a required feature.
2023-10-26 11:14:44 -07:00
Ralf Jung
fceb7193ea clarify NaN propagation in fptrunc (#68554)
Follow-up to #66579: while
implementing those semantics in Miri I realized there's a special case
to be considered in truncating float casts.
2023-10-26 14:09:38 -04:00
Youngsuk Kim
645b7795d4 [mlir] Remove no-op ptr-to-ptr bitcasts (NFC)
Opaque pointer cleanup effort. NFC.
2023-10-26 13:01:23 -05:00
Craig Topper
d307dc5b51 [RISCV][GISel] Allow G_AND/G_OR/G_XOR to have s32 types on RV64.
Even though we don't have W instructions for them. This treats them
the same as other binary operators.
2023-10-26 11:00:43 -07:00
LLVM GN Syncbot
02fcae844c [gn build] Port 88d00a6897 2023-10-26 17:54:25 +00:00
Aart Bik
0cbaff815c [mlir][sparse] cleanup conversion test (#70356)
Various TODOs had been added that actually removed the actual test.
This puts the CHECK test backs and removes the TODOs that have no
immediate plans.
2023-10-26 10:48:29 -07:00
Alpha Abdoulaye
88d00a6897 Reland [dsymutil] Add support for mergeable libraries (#70256)
Reland https://reviews.llvm.org/D158124
Fixed `-fpermissive` error reported by gcc only.
2023-10-26 10:45:08 -07:00
Nishant Patel
7fa19e6f4b [MLIR] Add SyclRuntimeWrapper (#69648) 2023-10-26 19:41:09 +02:00
Amara Emerson
93659947d2 [AArch64][GlobalISel] Add support for pre-indexed loads/stores. (#70185)
The pre-index matcher just needs some small heuristics to make sure it
doesn't cause regressions. Apart from that it's a simple change, since
the only difference is an immediate operand of '1' vs '0' in the
instruction.
2023-10-26 10:29:12 -07:00
Matt Harding
bf92eba697 Fix comment in wasm unreachable test (#70340)
Some textual editing errors got through this pull request that was
merged a few weeks ago: https://github.com/llvm/llvm-project/pull/65876

This patch clears up the unintentional duplicated line, and white-space
at the end of the lines.
2023-10-26 10:23:32 -07:00
Louis Dionne
59750027b9 [libc++][NFC] Remove unused typedefs in filesystem::path helpers (#70331)
I came across those typedefs while working on another change, and I
noticed they were just never used.
2023-10-26 13:10:44 -04:00