Commit Graph

478270 Commits

Author SHA1 Message Date
Mehdi Amini
c8f09c19b9 Apply clang-tidy fixes for llvm-qualified-auto in LowerToLLVM.cpp (NFC) 2023-10-21 17:31:37 -07:00
Tom Yang
74ca07295f [lldb] improve dwo path in missing dwo error when relative (#69783)
When the debug info refers to a dwo with relative `DW_AT_comp_dir` and
`DW_AT_dwo_name`, we only print the `DW_AT_comp_dir` in our error
message if we can't find it. This often isn't very helpful, especially
when the `DW_AT_comp_dir` is ".":
```
(lldb) fr v
error: unable to locate .dwo debug file "." for skeleton DIE 0x000000000000003c
```

I'm updating the error message to include both `DW_AT_comp_dir` (if it
exists) and `DW_AT_dwo_name` when the `DW_AT_dwo_name` is relative. The
behavior when `DW_AT_dwo_name` is absolute should be the same.
2023-10-21 16:59:44 -07:00
Aiden Grossman
6250afe37f [Github] Fetch an additional commit for docs CI on PRs
There still seem to be issues with the files changed step taking a
significant amount of time on PRs. This seems to be occurring on PRs
with one commit and not on PRs with more than one commit which is why I
didn't catch this nuance before. Either way, fetching an additional
commit seems to fix the issue. Requires a little bit of hackiness due to
the fact that you can't do math in the github actions variables.

Will be monitoring this over the next little bit to see if this actually
fixes the problem.

CI stuff is annoying sometimes.
2023-10-21 16:45:20 -07:00
Jacques Pienaar
196a09f477 [mlir][doc] Add basic doc for extraTraitClassDeclaration.
Fixes #61247.
2023-10-21 16:34:56 -07:00
Jacques Pienaar
01ea528145 [mlir][doc] Include ml_program passes in passes doc 2023-10-21 16:04:14 -07:00
Aiden Grossman
5ce45e9d8e [Github] Add lldb docs step to Github docs action (#69832)
This patch adds a step to build the lldb docs when they change to the
Github docs action, enabling easy triage of warnings/docs build failures
during the PR process.
2023-10-21 15:42:29 -07:00
Aiden Grossman
40a5044af8 [Github] Add clang-tools-extra docs to CI (#69827)
This patch adds the clang-tools-extra docs to the Github CI job that
builds docs, enabling the ability to easily ensure the docs build
properly without warnings in PRs and at the tip of tree.
2023-10-21 15:32:51 -07:00
Johannes Doerfert
87dac9f168 [OpenMP] Rewrite test to check the correct (CPU) result
The test initially showed we do no crash but compute the wrong GPU
result, now we show the CPU result is correct and disable GPU testing.
2023-10-21 14:55:15 -07:00
Johannes Doerfert
d3921e4670 [OpenMP] Basic BumpAllocator for (AMD)GPUs (#69806)
The patch contains a basic BumpAllocator for (AMD)GPUs to allow us to
run more tests. The allocator implements `malloc`, both internally and
externally, while we continue to default to the NVIDIA `malloc` when we
target NVIDIA GPUs. Once we have smarter or customizable allocators we
should consider this choice, for now, this allocator is better than
none. It traps if it is out of memory, making it easy to debug. Heap
size is configured via `LIBOMPTARGET_HEAP_SIZE` and defaults to 512MB.
It allows to track allocation statistics via
`LIBOMPTARGET_DEVICE_RTL_DEBUG=8` (together with
`-fopenmp-target-debug=8`). Two tests were added, and one was enabled.

This is the next step towards fixing
 https://github.com/llvm/llvm-project/issues/66708
2023-10-21 14:49:30 -07:00
Johannes Doerfert
d571af7f62 [OpenMP][FIX] Ensure thread states do not crash on the GPU
The nested parallelism causes thread states which still do not properly
work but at least don't crash anymore.
2023-10-21 14:43:09 -07:00
Florian Hahn
ca01f2af78 [LV] Enforce order of reductions with intermediate stores in VPlan (NFC)
Reductions with intermediate stores currently need to be fixed in order
of their intermediate stores. Instead of doing this at fixup time after
code has been generated, sort the reductions in adjustRecipesForReductions.

This makes the order explicit in VPlan and will enable removing
fixReductions with modeling computing the final reduction result in
VPlan, followed by also modeling the intermediate stores explicitly.
2023-10-21 21:26:52 +01:00
Martin Storsjö
241c290ad7 Reland [LLD] [COFF] Don't try to detect MSVC installations in mingw mode
In mingw mode, all linker paths are passed explicitly to the linker
by the compiler driver. Don't try to implicitly add linker paths
from the LIB environment variable or by detecting an MSVC
installation directory.

If the /winsysroot command line parameter is explicitly passed to
lld-link while /lldmingw is specified, it could be considered reasonable
to actually include those paths. However, modifying the code to
handle only the /winsysroot case but not the other ones, when the
mingw mode has been enabled, seems like much more code complexity
for a mostly hypothetical case.

Add a test for this when case when using LIB. (The code paths for
trying to detect an MSVC installation aren't really regression tested.)

Also fix an issue in the existing test for "Check that when /winsysroot
is specified, %LIB% is ignored.", where the LIB variable pointed
to a nonexistent directory, so the test would pass even if /winsysroot
wouldn't be specified.

Reland this after https://github.com/llvm/llvm-project/pull/68077 and
https://github.com/llvm/llvm-project/pull/69781 - the compiler-rt test
that used -lldmingw in MSVC environments has been updated to use a more
specific option.

Differential Revision: https://reviews.llvm.org/D144084
2023-10-21 22:36:11 +03:00
Johannes Doerfert
ba87fba806 [Attributor] Ignore different kernels for kernel lifetime objects
If a potential interfering access is in a different kernel and the
underlying object has kernel lifetime we can straight out ignore the
interfering access.
TODO: This should be made much stronger via "reaching kernels", which we
already track in AAKernelInfo.
2023-10-21 12:31:06 -07:00
Johannes Doerfert
bb96093ca6 [Attributor][NFC] Precommit test 2023-10-21 12:31:06 -07:00
Jason Molenda
ed0bb9476c [lldb] Update qRegisterInfo docs to recommend target.xml (#69853)
Before target.xml, lldb had its own method for querying the remote stub
of the registers it supports, qRegisterInfo. The gdb standard method of
using a target.xml file to describe the available registers has become
commonplace, and the lldb method for doing this is no longer needed.

Stubs should describe their registers to lldb, but it should be with the
target.xml file.
2023-10-21 11:58:29 -07:00
Craig Topper
44d4f975e4 [RISCV] Replace RISCV -> RISC-V in comments. NFC
I did this once previously, but more uses have crept in.
2023-10-21 10:52:24 -07:00
Ben Shi
f9906508bc [analyzer][NFC] Substitute operator() with lambda in StreamChecker 2023-10-21 16:29:14 +02:00
Chris B
7d7e4d20b0 [Windows] Add git-clang-format wrapper bat file (#69228)
This allows git-clang-format to be used on a Windows terminal without
manually needing to find the path and invoke the python interpreter. We
have a similar script for `scan-build`.

Fixes #69643
2023-10-21 08:14:29 -05:00
Brad Smith
c2f02e3bd6 Clang: Define macro _MIPS_SPFPSET
GCC defines this macro for how many single-precision floating point registers
can be used.

If the -mno-odd-spreg option is given, it will be 16; if either -mno-odd-spreg
nor -modd-spreg are given, we set it to 16 for FPXX.

Reviewed By: theraven

Differential Revision: https://reviews.llvm.org/D157896
2023-10-21 07:08:54 -04:00
Piotr Zegar
9322216021 [clang-tidy][DOC] Fix 'table cell spanning'
Change current tables to avoid cell spanning.
2023-10-21 10:30:06 +00:00
Aiden Grossman
764c7ae949 [Github] Remove CMake options from docs CI resetting defaults
The SPHINX_OUTPUT_HTML and SPHINX_OUTPUT_MAN CMake flags are by default
set to ON/True in ./llvm/cmake/modules/FindSphinx.cmake, so we don't
need to set them true again within the CMake invocation.
2023-10-21 02:11:15 -07:00
Brad Smith
09b02f5d56 [Driver][NetBSD][NFC] Some cleaning up 2023-10-21 04:45:41 -04:00
Carl Ritson
386f390391 [MachineBasicBlock] Fix SlotIndexUpdater for insertion order (#69424)
Follow up fix for #68786 to address that MachineFunction handleInsertion
is actually called before a new instruction has been inserted into the
block. Hence new instructions must be recorded and SlotIndex updates
performed after the delegate call.
2023-10-21 16:31:19 +09:00
Kazu Hirata
af447dde5e [Serialization] Use llvm::is_contained (NFC) 2023-10-20 23:45:20 -07:00
Kazu Hirata
7552b4d9ee [polly] Use llvm::erase_value (NFC) 2023-10-20 23:45:18 -07:00
Kazu Hirata
dc554bd06f [flang] Use llvm::any_of (NFC) 2023-10-20 23:45:16 -07:00
Kazu Hirata
e5ef5b9e32 [DebugInfo] Use llvm::erase_value (NFC) 2023-10-20 23:45:15 -07:00
Martin Storsjö
8822eaae0f [compiler-rt] Switch LLD specific tests to a more precise option (#69781)
Prefer the new flag -lld-allow-duplicate-weak (which was added recently
in a67ae8c0fd), over the old -lldmingw.

The -lldmingw option enables a number of different behaviours, while
this test only is interested in one aspect of them.

This should allow making -lldmingw more strict with not enabling MSVC
specific behaviours like inferring lib directories automatically from
the environment, as being pursued in https://reviews.llvm.org/D144084.
2023-10-21 09:42:49 +03:00
Will Hawkins
4aae5387a8 [llvm][CMake] Respect LIBCXX_HARDENING_MODE on command-line (#68541)
When the user specifies `LIBCXX_HARDENING_MODE` on the command line in a
bootstrapping build, it should override the setting implied by
`LLVM_ENABLE_ASSERTIONS`.
2023-10-20 23:13:33 -07:00
Kazu Hirata
d36ddaa665 [compiler-rt] Fix a warning
This patch fixes:

  compiler-rt/lib/builtins/int_to_fp_impl.inc:22:18: error: expression
  is not an integer constant expression; folding it to a constant is a
  GNU extension [-Werror,-Wgnu-folding-constant]

by using enum for constants.
2023-10-20 23:03:55 -07:00
Matt Harding
a3937c46d0 Fix typos in Debug.h (#68761)
There were a couple of typos of "If" -> "In" in Debug.h
2023-10-21 11:14:13 +05:30
Brad Smith
a157a82b1e [mlir] Avoid including <alloca.h> on DragonFly 2023-10-21 01:19:34 -04:00
Aiden Fox Ivey
7df9b0c5b3 Fix typos and formatting in GettingStarted.md (#68537)
Not too much to change here. Just found some issues with the flang
GettingStarted.md file and wanted to sort it out.
2023-10-21 10:48:33 +05:30
Arseny
826c93f96e [AST] Use explicit type erasure in TypeSourceInfo constructor (#68435)
When this file is included in a project compiled with GCC 13 `-Werror`,
compilation fails with the following diagnostic:
<pre>
/usr/lib/llvm-17.0/include/clang/AST/TypeLoc.h: In constructor
'clang::TypeSourceInfo::TypeSourceInfo(clang::QualType, size_t)':
/usr/lib/llvm-17.0/include/clang/AST/TypeLoc.h:245:9: error: 'void*
memset(void*, int, size_t)' clearing an object of non-trivial type
'class clang::TypeSourceInfo'; use assignment instead
[-Werror=class-memaccess]
  245 |   memset(this + 1, 0, DataSize);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

</pre>
To avoid this, we add an explicit type cast. The cast to `void*` makes
sense, since other member functions of `TypeSourceInfo` also treat the
buffer `(this + 1)` of length `DataSize` as opaque memory, and was
likely left out by mistake.

Fixes: 4498663f3d ("[AST] Initialized data after TypeSourceInfo")

I also suggest to apply this to release/17.x if possible.
2023-10-21 10:40:58 +05:30
Artur Pilipenko
cb5612c99b Add IR name to -print-pass-numbers output
Print the name of the module/function/loop the pass
ran on.
2023-10-20 20:19:23 -07:00
max
d342843c2b [MLIR][python bindings][fix] invalidate ops after PassManager run 2023-10-20 22:15:58 -05:00
long.chen
c000bd4e40 Revert "[mlir] Silence a few -Wunused-but-set-parameter warnings" (#68667)
A cmake patch append compile options `-Wno-unused-but-set-parameter` is
merged.

This reverts commit 82ae83a848.
2023-10-21 11:15:04 +08:00
Johannes Doerfert
1cea309b7e [OpenMP][NFC] Move DebugKind to make it reusable from the host 2023-10-20 19:28:09 -07:00
Johannes Doerfert
499fb1b8d8 [Attributor][FIX] Interposable constants cannot be propagated 2023-10-20 19:28:09 -07:00
Johannes Doerfert
0a0c23b9ce [OpenMPOpt][FIX] Properly track changes to NestedParallelism
If we update the state, or indicate a pessimistic fixpoint, we need to
consider NestedParallelism too.

Fixes part of https://github.com/llvm/llvm-project/issues/66708

That said, the reproducer still needs malloc which we don't support on
AMD GPU. Will be added later.
2023-10-20 19:28:09 -07:00
Dave Lee
3b5d59ab55 [lldb][test] Turn ObjC string literals to C-style literals (NFC) (#69793)
The underlying timezone classes are being reimplemented in Swift, and these 
strings will be Swift strings, without the ObjC `@` prefix. Leaving off the `@` 
makes these tests usable both before and after the reimplmentation of 
Foundation in Swift.
2023-10-20 19:24:53 -07:00
Aiden Grossman
9b381c6a06 [Github] Fetch number of commits in PR for docs action (#69763)
This patches changes the docs action to run a fetch with a depth of the
number of commits in the PR (1 if we're just running against a push
event) which significantly increases the speed of the changed files
event. The changed files event goes from taking ~30m to ~3s without any
noticeable increase in fetch time.
2023-10-20 18:48:40 -07:00
Qizhi Hu
14bc11a651 [clang][dataflow]Use cast_or_null instead of cast to prevent crash (#68510)
`getStorageLocation` may return `nullptr` and this will produce crash
when use `cast`, use `dyn_cast_or_null` instead. I test it locally using
[FTXUI](https://github.com/ArthurSonzogni/FTXUI) and it may be the cause
of issue [issue](https://github.com/llvm/llvm-project/issues/68412), but
I am not sure.

Co-authored-by: huqizhi <huqizhi@836744285@qq.com>
2023-10-21 09:39:30 +08:00
Maksim Levental
bdc3e6cb45 [MLIR][python bindings] invalidate ops after PassManager run (#69746)
Fixes https://github.com/llvm/llvm-project/issues/69730 (also see
https://reviews.llvm.org/D155543).

There are  two things outstanding (why I didn't land before):

1. add some C API tests for `mlirOperationWalk`;
2. potentially refactor how the invalidation in `run` works; the first
version of the code looked like this:
    ```cpp
    if (invalidateOps) {
      auto *context = op.getOperation().getContext().get();
      MlirOperationWalkCallback invalidatingCallback =
          [](MlirOperation op, void *userData) {
            PyMlirContext *context =
                static_cast<PyMlirContext *>(userData);
            context->setOperationInvalid(op);
          };
      auto numRegions =
          mlirOperationGetNumRegions(op.getOperation().get());
      for (int i = 0; i < numRegions; ++i) {
        MlirRegion region =
            mlirOperationGetRegion(op.getOperation().get(), i);
        for (MlirBlock block = mlirRegionGetFirstBlock(region);
             !mlirBlockIsNull(block);
             block = mlirBlockGetNextInRegion(block))
          for (MlirOperation childOp =
                   mlirBlockGetFirstOperation(block);
               !mlirOperationIsNull(childOp);
               childOp = mlirOperationGetNextInBlock(childOp))
            mlirOperationWalk(childOp, invalidatingCallback, context,
                              MlirWalkPostOrder);
      }
    }
    ```
This is verbose and ugly but it has the important benefit of not
executing `mlirOperationEqual(rootOp->get(), op)` for every op
underneath the root op.

Supposing there's no desire for the slightly more efficient but highly
convoluted approach, I can land this "posthaste".
But, since we have eyes on this now, any suggestions or approaches (or
needs/concerns) are welcome.
2023-10-20 20:28:32 -05:00
zhongyunde 00443407
7e3d1103e6 [InstCombine] optimize powi(X,Y)/X with Ofast (#67236)
Try to transform the powi(X, Y) / X into powi(X, Y-1) with Ofast.
For this case, when the Y is 3, then powi(X, 2) is replaced by X * X in
the further step.

Fixes https://github.com/llvm/llvm-project/pull/67216
Reviewed By: dtcxzyw, nikic, jcranmer-intel
2023-10-21 08:56:14 +08:00
zhongyunde 00443407
6cbcbecf53 [InstCombine] Precommit tests for PR67216 2023-10-21 08:54:33 +08:00
Diogo Teles Sant'Anna
7c0a589af9 [CI] Set minimal permission on libcxx-check-generated-file workflow (#69737)
Relates to #69736

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
2023-10-20 17:42:22 -07:00
Peiming Liu
e9fa1fdec9 [mlir][sparse] support CSR/BSR conversion (#69800) 2023-10-20 17:24:34 -07:00
Andy Kaylor
4e0c6d3057 Fix build warning caused by mixed signed/unsigned compare (#69797) 2023-10-20 16:42:41 -07:00
Craig Topper
972709a74a [RISCV][GISel] Minor refactoring of RISCVCallReturnHandler and RISCVIncomingValueHandler to match other targets (#69757)
Forward assignValueToReg to the base class to make the copy. Add
markPhysRegUsed to contain the differences between call handling and
argument handling. Introduce RISCVFormalArgHandler.

This structure matches how AArch64, AMDGPU, and X86 are structured.

I've also added `MIRBuilder.getMRI()->addLiveIn(PhysReg);` to match the
other targets.
2023-10-20 16:34:37 -07:00