478662 Commits

Author SHA1 Message Date
Alexander Yermolovich
da27c25c19
[LLVM[NFC] Refactor to allow debug_names entries to conatain DIE offset (#69399)
This is pre-cursor patch to enabling type units with DWARF5 acceleration
tables.
With this change it allows for entries to contain offsets directly, this
way type
units do not need to be preserved until .debug_names is written out.
2023-10-25 12:39:28 -07:00
Craig Topper
d32e801d74
[RISCV][GISel] Add FP calling convention support (#69138)
This includes support for using GPRs, FPRs, and stack.
2023-10-25 12:30:03 -07:00
Joseph Huber
17b5445996
[Libomptarget] Add a wavefront sync builtin for the AMDGPU implementation (#70228)
Summary:
While this is technically a no-op for AMDGPU hardware, in cases where
the user would see fit to add an explicit wavefront sync on Nvidia
hardware, we should also inform the LLVM optimizer that this control
flow is convergent so we do not reorder blocks.
2023-10-25 14:27:14 -05:00
Joseph Huber
e3d2a7d0a5
[libc] Compile the GPU functions with '-fconvergent-functions' (#70229)
Summary:
This patch simply adds the `-fconvergent-functions` flag to the GPU
compilation. This is in relation to the behaviour of SIMT
architectures under divergence. With the flag, we assume every function
is convergent by default and rely on the compiler's divergence analysis
to transform it if possible.

Fixes: https://github.com/llvm/llvm-project/issues/63853
2023-10-25 14:13:21 -05:00
Petr Hosek
0fc8f0be9b
[CMake] Correctly handle LLVM_ENABLE_RUNTIMES in targets (#69869)
When a target sets LLVM_ENABLE_RUNTIMES, we should only generate proxy
targets for those runtimes rather than using the global list which may
contain runtimes that are not supported by that particular target.
2023-10-25 12:12:27 -07:00
Jessica Clarke
0ab694754e
[clang] Fix trailing whitespace in DiagnosticParseKinds.td
Fixes 567a660a252323f2e82abaf48752dcad26d4779e
2023-10-25 20:03:57 +01:00
Nishant Patel
ced9f4f0e8
[MLIR] Modify lowering of gpu.alloc op to llvm (#69969)
If gpu.alloc has no asyn deependency ( in case if gpu.alloc has
hostShared allocation), create a new stream & synchronize. This PR is
follow up to #66401
2023-10-25 22:00:47 +03:00
Guray Ozen
01ac180c11
[mlir][nvvm] Fix mov.u32 to mov.pred (#70027)
This PR fixes the incorrect `mov` instruction in PTX. We actually move a
predicate here, not u32, so the correct instruction should be
`mov.pred`.
2023-10-25 22:00:09 +03:00
Joseph Huber
006cd37960 [OpenMP][Obvious] Fix incorrect variant selector in test
Summary:
This should be `kind` and not `arch`.
2023-10-25 13:48:30 -05:00
jeffreytan81
d4e6e40337
Improve debug names index fetching global variables performance (#70231)
While using dwarf5 `.debug_names` in internal large targets, we noticed
a performance issue (around 10 seconds delay) while `lldb-vscode` tries
to show `scopes` for a compile unit. Profiling shows the bottleneck is
inside `DebugNamesDWARFIndex::GetGlobalVariables` which linearly search
all index entries belongs to a compile unit.

This patch improves the performance by using the compile units list to
filter first before checking index entries. This significantly improves
the performance (drops from 10 seconds => under 1 second) in the split
dwarf situation because each compile unit has its own named index.

---------

Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2023-10-25 11:46:11 -07:00
Piotr Zegar
20d210285b
[clang-tidy] Ignore deleted functions in cppcoreguidelines-rvalue-reference-param-not-moved (#69514)
Ignore functions and constructors that are maked deleted or defaulted in
cppcoreguidelines-rvalue-reference-param-not-moved check.

Fixes #69412
2023-10-25 20:41:19 +02:00
Matthias Braun
94aaaf4fb4 Update m68k tests to new block placement
e3cf80c5c1fe55efd8216575ccadea0ab087e79c affected block placement of
some tests in the experimental m68k target. This updates them.
2023-10-25 11:33:56 -07:00
Alina Sbirlea
d0584e248d [CodeLayout] Update to resolve Wdangling warning.
Change cc2fbc648d7babbfa612f4f5eda3160212ef6ca7 introduced -Wdangling
warning, use temporaries to resolve.

llvm/lib/Transforms/Utils/CodeLayout.cpp:764:27: error: temporary whose address is used as value of local variable '[minDensity, maxDensity]' will be destroyed at the end of the full-expression [-Werror,-Wdangling]
  764 |               std::minmax(ChainPred->density(), ChainSucc->density());

llvm/lib/Transforms/Utils/CodeLayout.cpp:764:49: error: temporary whose address is used as value of local variable '[minDensity, maxDensity]' will be destroyed at the end of the full-expression [-Werror,-Wdangling]
  764 |               std::minmax(ChainPred->density(), ChainSucc->density());
2023-10-25 11:31:48 -07:00
Craig Topper
4d80e93039
[RISCV] Remove RISCVISD opcodes for LGA, LA_TLS_IE, and LA_TLS_GD. (#70137)
This effectively reverts f912d21e673b0

This was originally done for consistency with RISCVISD::ADD_LO so that
all nodes were emitted as RISCVISD nodes.

I've received feedback a couple times that its not worth it. So I'm
putting it back.
2023-10-25 11:29:20 -07:00
Craig Topper
7fde4ffbd3
[Mips][GISel] Fix a couple issues with passing f64 in 32-bit GPRs. (#69131)
MipsIncomingValueHandler::assignCustomValue should return 1 instead of
2. The return value is the number of additional ArgLocs being consumed.
It's assumed that at least 1 is consumed.

Correct the LocVT used for the spill when there are no registers left.
It should be f64 instead of i32. This allows a workaround to be removed
in the SelectionDAG path.
2023-10-25 11:28:22 -07:00
Nick Renieris
8b32289520
[libclang/python] Add missing concept declaration CursorKind (#69125)
Maps to
[`CXCursor_ConceptDecl`](ee8524087c/clang/include/clang-c/Index.h (L2716)),
added in ee8524087c78a673fcf5486ded69ee597a85e0f1.

Without this I get this error on my codebase which uses C++20 concept
decls:
```
ValueError: Unknown template argument kind 604
```
2023-10-25 14:25:08 -04:00
Mircea Trofin
c362cc2705 [mlgo][regalloc] Fix reference file post e3cf80c 2023-10-25 11:23:15 -07:00
Craig Topper
674b53d1a4 [RISCV][GISel] Add widenScalarToNextPow2 to G_SEXTLOAD/G_ZEXTLOAD legalization.
This fixes i8->i48 on RV64.
2023-10-25 11:20:18 -07:00
ZijunZhaoCCK
7e34ee5291
Update stdckdint.h and make it available in pre-C23 modes. (#69649)
The APIs and the feature test macro are both exposed. This is compatible
with how GCC is exposing the functionality.
2023-10-25 11:04:31 -07:00
Stanislav Mekhanoshin
8715600435
[AMDGPU] Set SchedRW = Write64Bit on V_MOV_B64 (#70135)
This is mostly NFCI as V_MOV_B64_PSEUDO is selected instead and expanded
past RA.
2023-10-25 10:50:53 -07:00
Mark de Wever
0e4264ab1e [lldb][libc++] Adds chrono data formatters.
This adds the data formatters for chrono duration typedefs.

Reviewed By: Michael137

Differential Revision: https://reviews.llvm.org/D159127
2023-10-25 19:36:47 +02:00
Med Ismail Bennani
7b8e686115 [lldb] Fix build failure introduced by f22d82c
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-10-25 10:31:43 -07:00
Joseph Huber
ca3545f0ef
[Libomptarget] Bump up PTX version from +ptx61 to +ptx63 (#70227)
Summary:
This version is required to support the 'activemask' feature which is
used for certain features, such as reductions. This ties the
implementation of the DeviceRTL roughly to the features provided by the
CUDA 9.0 release, which should be sufficienly old as to not cause
problems since this is a minor version jump that corresponds to the
release of `sm_53`.
2023-10-25 13:28:02 -04:00
Craig Topper
8efd6799f0 [RISCV][GISel] Add clampScalar G_ZEXTLOAD/G_SEXTLOAD legalization rules.
This fixes i8->i16 on RV32/RV64 and i8/i16/i32->i64 on RV64.
2023-10-25 10:23:55 -07:00
Shafik Yaghmour
b8e06933a2
[Clang] Ensure zero-init is not overridden when initializing a base class in a constant expression context (#70150)
During constant evaluation when value-initializing a class if the base
class was default-initialized it would undue the previously
zero-initialized class members. This fixes the way we handle default
initialization to avoid initializing over an already initialized member
to an indeterminate value.

Fixes: https://github.com/llvm/llvm-project/issues/69890
2023-10-25 10:18:40 -07:00
Simon Pilgrim
c60bd0e578 [X86] Regenerate select-mmx.ll
Change i686 check-prefix to the more standard X86 instead of I32
2023-10-25 18:10:51 +01:00
Med Ismail Bennani
f22d82cef2
[lldb/Interpreter] Make ScriptedInterface Object creation more generic (#68052)
This patch changes the way plugin objects used with Scripted Interfaces
are created.

Instead of implementing a different SWIG method to create the object for
every scripted interface, this patch makes the creation more generic by
re-using some of the ScriptedPythonInterface templated Dispatch code.

This patch also improves error handling of the object creation by
returning an `llvm::Expected`.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2023-10-25 10:05:54 -07:00
Christudasan Devadasan
7ce613fc77
[AMDGPU] Cleanup hasUnwantedEffectsWhenEXECEmpty function (#70206)
The readlane & writelane instructions don't really depend on the the
EXEC mask and they should return false from here.
2023-10-25 22:10:16 +05:30
Maksim Levental
9d712d2dfb
[MLIR][pass registry] show overlapping pass pipeline name (#70167)
Similar to https://github.com/llvm/llvm-project/pull/70108.
2023-10-25 11:28:50 -05:00
Ramkumar Ramachandra
7dad7ab3c0
Scalarizer: add negative test for lrint, llrint (#70203)
With the recent change 98c90a13 (ISel: introduce vector ISD::LRINT,
ISD::LLRINT; custom RISCV lowering), it is now possible to scalarize
llvm.lrint and llvm.llrint with a trivial change to VectorUtils. In
preparation for this change, and the corresponding test update, add a
negative test for lrint and llrint.
2023-10-25 17:27:12 +01:00
Ramkumar Ramachandra
aa30018e66
SLP/RISCV: add negative test for llrint, increase coverage (#69940)
To follow-up on a06be8a (SLP/RISCV: add negative test for lrint), add a
negative test for llvm.llrint as well, and increase the coverage to
cover vectors of length 2, 4, and 8, and the i32 variant of lrint, in
preparation to get SLPVectorizer to vectorize both lrint and llrint.
This is now possible with the recent change 98c90a1 (ISel: introduce
vector ISD::LRINT, ISD::LLRINT; custom RISCV lowering).
2023-10-25 17:26:39 +01:00
Min-Yih Hsu
e696379c0d
[RISCV][GISel] Falling back to SDISel for scalable vector type values (#70133)
This patch also tests the fallback of unsupported formal arguments.
2023-10-25 09:02:34 -07:00
Arseny Kapoulkine
cd29e19e94
[Sema] -Wzero-as-null-pointer-constant: don't warn for __null (#69126)
The implementation of -Wzero-as-null-pointer-constant was done before
the following fix has been committed to GCC:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=752e7593b0f19af233a0b7e72daab8413662b605;hp=298434c916c14e8adca2cab8a746aee29038c5b3

As a result, clang and gcc diverge on the use of `__null` and,
consequently, on the use of `NULL` on systems like Linux/macOS where
`NULL` is defined as `__null`.

This is a problem for compatibility between gcc and clang, particularly
for code bases that support C++98 or for single-source libraries that
are implemented in C, but compiled as C++ via inclusion into a C++
translation unit. Code like this can not be changed to use `nullptr`, as
it needs to maintain compatibility with C before C23 or C++ before
C++11, but warns on the use of `NULL` in clang.

The warning `Wzero-as-null-pointer-constant` is still useful with this
change, as it allows to change `0` to `NULL`, which fixes
gcc warnings and helps the reader distinguish between pointers and
non-pointers. Users who require a full C++11 modernization pass can
still use clang-tidy for that purpose.
2023-10-25 11:58:28 -04:00
Simon Pilgrim
c9c9bf0f20 [DAG] WidenVectorOperand - add basic handling for *_EXTEND_VECTOR_INREG nodes
Fixes Issue #70208
2023-10-25 16:52:15 +01:00
Juergen Ributzka
2d292ab886
[llvm] Followup fix for "Use XMACROS for MachO platforms" (#70140)
Fix the use of tapi_target in getPlatformFromName.
2023-10-25 08:49:41 -07:00
Joseph Huber
8a181f43da [OpenMP][Obvious] Fix incompatbile function prototype causing failures
Summary:
This function needs `void` as the arguments to be ABI compatbile with
what is actually defined. This is enforced when doing CUDA separable
linking of the runtime.
2023-10-25 10:44:07 -05:00
Joseph Huber
9bdeab1e7b [LinkerWrapper][Obvious] Fix dangling stringref on Xcuda-ptxas options
Summary:
This accidentally was a dangling reference and caused issues when
actually used. Make sure that the memory is saved before the job is
created.
2023-10-25 10:42:34 -05:00
bjacob
8c8336fcad
Add missing linalg.batch_vecmat named op (#70218)
Linalg currently has these named ops:
* `matmul`
* `matvec`
* `vecmat`
* `batch_matmul`
* `batch_matvec`

But it does not have:
* `batch_vecmat`

This PRs adds that for consistency, and I have a short-term need for it
( https://github.com/openxla/iree/issues/15158 ), so not having this
would cause some contortion on my end.
2023-10-25 11:41:24 -04:00
Youngsuk Kim
8e00d59dce [clang] Remove redundant ptr-to-ptr bitcasts (NFC)
Remove redundant bitcasts performed on instances of
`llvm::GlobalVariable`, which are pointers.

Opaque pointer cleanup effort. NFC.
2023-10-25 10:36:52 -05:00
Aart Bik
a12d057be9
[mlir][sparse] update block24 example (#70145)
Removes TODO, shows how to define 8-bit crd (lacking 2-bit for now)
2023-10-25 08:29:31 -07:00
Kiran Chandramohan
bbab5e47c1
[MLIR][OpenMP] Use opaque pointers in OpenMP translation tests 2/2 (#70138)
Second half of the tests switching to opaque pointers. All are the
target related tests.

Removes mlir/test/Target/LLVMIR/openmp-reduction-typed-pointers.mlir,
since this seems to be added to test the typed pointers and probably not
needed anymore.
2023-10-25 16:14:40 +01:00
Nikita Popov
ea99df2e84 [InstCombine] Rename some variables (NFC)
Split NFC rename out from #69882.
2023-10-25 17:08:40 +02:00
David Stenberg
22f1217932 [SelectionDAG] Salvage debug info for non-constant ADDs (2nd try) (#68981)
Teach SelectionDAG::salvageDebugInfo() to salvage debug information for
ADD nodes where the RHS is non-constant.

In the first try, the test case used the MIR output that was produced by
using -stop-before=sparc-isel. Running -start-before=sparc-isel on that
output resulted in the following verifier error with EXPENSIVE_CHECKS:

  "Function has NoVRegs property but there are VReg operands".

In this re-attempt the test case has been rewritten to a .ll test by
extracting the IR from the original MIR file. The test still starts
before sparc-isel.

Co-authored-by: Mikael Holmen <mikael.holmen@ericsson.com>
2023-10-25 17:01:19 +02:00
spupyrev
cc2fbc648d
[CodeLayout] Faster basic block reordering, ext-tsp (#68617)
Aggressive inlining might produce huge functions with >10K of basic 
blocks. Since BFI treats _all_ blocks and jumps as "hot" having 
non-negative (but perhaps small) weight, the current implementation can
be slow, taking minutes to produce an layout. This change introduces a
few modifications that significantly (up to 50x on some instances) 
speeds up the computation. Some notable changes:
- reduced the maximum chain size to 512 (from the prior 4096);
- introduced MaxMergeDensityRatio param to avoid merging chains with
very different densities;
- dropped a couple of params that seem unnecessary.

Looking at some "offline" metrics (e.g., the number of created 
fall-throughs), there shouldn't be problems; in fact, I do see some
metrics go up. But it might be hard/impossible to measure perf 
difference for such small changes. I did test the performance clang-14 
binary and do not record a perf or i-cache-related differences.

My 5 benchmarks, with ext-tsp runtime (the lower the better) and 
"tsp-score" (the higher the better).
**Before**:

- benchmark 1:
  num functions: 13,047
  reordering running time is 2.4 seconds
  score: 125503458 (128.3102%)
- benchmark 2:
  num functions: 16,438
  reordering running time is 3.4 seconds
  score: 12613997277 (129.7495%)
- benchmark 3:
  num functions: 12,359
  reordering running time is 1.9 seconds
  score: 1315881613 (105.8991%)
- benchmark 4:
  num functions: 96,588
  reordering running time is 7.3 seconds
  score: 89513906284 (100.3413%)
- benchmark 5:
  num functions: 1
  reordering running time is 372 seconds
  score: 21292505965077 (99.9979%)
- benchmark 6:
  num functions:  71,155
  reordering running time is 314 seconds
  score: 29795381626270671437824 (102.7519%)

**After**:
- benchmark 1:
  reordering running time is 2.2 seconds
  score: 125510418 (128.3130%)

- benchmark 2:
  reordering running time is 2.6 seconds
  score: 12614502162 (129.7525%)

- benchmark 3:
  reordering running time is 1.6 seconds
  score: 1315938168 (105.9024%)

- benchmark 4:
  reordering running time is 4.9 seconds
  score: 89518095837 (100.3454%)

- benchmark 5:
  reordering running time is 4.8 seconds
  score: 21292295939119 (99.9971%)

- benchmark 6:
  reordering running time is 104 seconds
  score: 29796710925310302879744 (102.7565%)
2023-10-25 07:52:26 -07:00
Benjamin Kramer
28a8f1b901 [bazel] Add missing dependency 2023-10-25 16:43:23 +02:00
Benjamin Kramer
08e765372e [bazel] Port 078ae8cd64b44f2ead538c45cf7fb4c4b63fdcaa 2023-10-25 16:39:50 +02:00
Joseph Huber
84d8ace51a [OpenMP][Obvious] Fix function prototype when used in C mode
Summary:
The `llvm_omp_target_dynamic_shared_alloc` prototype in `omp.h`
accidentally left the void argument unspecified. This created unintended
code when called from the C language, causing some `nvlink` failures in
certain scenarios.
2023-10-25 09:35:23 -05:00
Razvan Lupusoru
62ae549f57
[flang][openacc] Add implicit copy for reduction in combined construct (#70148)
After PR#69417, lowering for combined constructs was updated to adhere
to OpenACC 3.3, section 2.11: `A private or reduction clause on a
combined construct is treated as if it appeared on the loop construct.`

However, the second part of that paragraph notes `In addition, a
reduction clause on a combined construct implies a copy clause`. Since
the acc dialect decomposes combined constructs, it is important to
distinguish between the case where an explicit data clause is required
(as noted in section 2.6.2) and the case where an implicit data action
must be generated by compiler.
2023-10-25 07:27:57 -07:00
Congcong Cai
53705ddcb7
[clang]improve diagnosing redefined defaulted constructor with different exception specs (#69688) 2023-10-25 22:22:13 +08:00
Vladislav Dzhidzhoev
2dea7bd8a0 [AArch64][GlobalISel] Legalize NEON smin,smax,umin,umax,fmin,fmax intrinsics
Replace these intrinsics with the corresponding GISel operators during
legalization stage to reuse available selection patterns.
2023-10-25 16:02:44 +02:00