474134 Commits

Author SHA1 Message Date
Jonas Devlieghere
b82f78670b
[llvm] Add CODE_OF_CONDUCT.md (#65816)
Add a CODE_OF_CONDUCT.md file to the root of the repository. The file
itself references the LLVM Community Code of Conduct. GitHub will
recognize this file and put a link to it to the right of the repository,
similar to the license and security policy, making the CoC easier to
discover.
2023-09-09 10:55:31 -07:00
Tyler Lanphear
52f6f418c7
[GlobalOpt] Handle DL.getAllocaAddrSpace() != 0 (#65847)
Fix crash on RAUW due to locals and globals having different address
spaces. This is the intent of the original code, but it assumes the
alloca address space is 0. This patch fixes the code to check that the
global's address space matches `DL.getAllocaAddrSpace()` instead.

Fixes #65155
2023-09-09 10:12:42 -07:00
Jan Svoboda
98e6deb62c [clang][tools] Use FileEntryRef in include_cleaner::Header 2023-09-09 09:54:13 -07:00
Jan Svoboda
37b08892fc [clang] NFCI: Use FileEntryRef in ModuleMap 2023-09-09 09:12:35 -07:00
Jan Svoboda
c23d65b90f [clang] NFCI: Use FileEntryRef in ModuleMapParser 2023-09-09 09:12:35 -07:00
Jan Svoboda
ef996175a7 [clang] NFCI: Use FileEntryRef in diagnoseFrameworkInclude() 2023-09-09 09:12:35 -07:00
Fabian Mora
119c489cc1 Reland [mlir][test][gpu] Migrate CUDA tests to the TargetAttr compilation workflow (llvm#65768)
The revert happened due to a build bot failure that threw 'CUDA_ERROR_UNSUPPORTED_PTX_VERSION'.
The failure's root cause was a pass using "+ptx76" for compilation and an old CUDA driver
on the bot. This commit relands the patch with "+ptx60".

Original Gh PR: #65768
Original commit message:
    Migrate tests referencing `gpu-to-cubin` to the new compilation workflow
    using `TargetAttrs`. The `test-lower-to-nvvm` pass pipeline was modified
    to use the new compilation workflow to simplify the introduction of
    future tests.

    The `createLowerGpuOpsToNVVMOpsPass` function was removed, as it didn't
    allow for passing all options available in the `ConvertGpuOpsToNVVMOp`
    pass.
2023-09-09 12:45:21 +00:00
Mark de Wever
2374ae4362 [libc++][nfc] Fixes emacs magic marker. 2023-09-09 14:43:12 +02:00
Sergei Barannikov
0917c50118
[Sparc] Replace some CAS instructions with InstAlias (#65588)
According to the manual, cas, casl, casx and casxl are synthetic
instructions. They map to casa and casxa with certain ASI tags.
2023-09-09 15:26:52 +03:00
Fabian Mora
2c596ea951
Revert "[mlir][test][gpu] Migrate CUDA tests to the TargetAttr compilation workflow (#65768) (#65848)
This reverts commit d21b67293be15f8a89378e4785d70cc037866406.
2023-09-09 07:14:19 -04:00
Fabian Mora
d21b67293b
[mlir][test][gpu] Migrate CUDA tests to the TargetAttr compilation workflow (#65768)
Migrate tests referencing `gpu-to-cubin` to the new compilation workflow
using `TargetAttrs`. The `test-lower-to-nvvm` pass pipeline was modified
to use the new compilation workflow to simplify the introduction of
future tests.

The `createLowerGpuOpsToNVVMOpsPass` function was removed, as it didn't
allow for passing all options available in the `ConvertGpuOpsToNVVMOp`
pass.
2023-09-09 07:03:38 -04:00
Job Noorman
649cac3b62 [ELF][RISCV] Implement --emit-relocs with relaxation
Linker relaxation may change relocations (offsets and types). However,
when --emit-relocs is used, relocations are simply copied from the input
section causing a mismatch with the corresponding (relaxed) code
section.

This patch fixes this as follows: for non-relocatable RISC-V binaries,
`InputSection::copyRelocations` reads relocations from the relocated
section's `relocations` array (since this gets updated by the relaxation
code). For all other cases, relocations are read from the input section
directly as before.

In order to reuse as much code as possible, and to keep the diff small,
the original `InputSection::copyRelocations` is changed to accept the
relocations as a range of `Relocation` objects. This means that, in the
general case when reading from the input section, raw relocations need
to be converted to `Relocation`s first, which introduces quite a bit of
boiler plate. It also means there's a slight code size increase due to
the extra instantiations of `copyRelocations` (for both range types).

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D159082
2023-09-09 12:06:39 +02:00
Amy Wang
0aa459fc8a
[MLIR][Tensor] Add Destination style RewritePattern for DimOp. (#65780)
This enables canonicalization to fold away unnecessary tensor.dim ops
which in turn enables folding away of other operations, as can be seen
in conv_tensors_dynamic where affine.min operations were folded away.
2023-09-09 06:01:56 -04:00
Timm Bäder
2744d9b649 [clang][Interp][NFC] Use delegate() vor ParenExprs
Now what we have delegate() we can use it here.
2023-09-09 11:07:56 +02:00
Timm Bäder
211f7ddbe1 [clang][Interp][NFC] Tiny indentation fix 2023-09-09 11:07:55 +02:00
Timm Bäder
38c7230645 [clang][Interp][NFC] Remove unused Boolean::from() overload 2023-09-09 11:07:55 +02:00
Timm Bäder
39db3b097a [clang][Interp][NFC] Remove unused Integral::from() overload 2023-09-09 11:07:55 +02:00
liqin.weng
700042cd88 [RISCV] Remove debug location to spill/reload instructions
Spill/reload instructions are artificially generated by the compiler and
have no relation to the original source code. So the best thing to do is
not attach any debug location to them (instead of just taking the next
debug location we find on following instructions).

Refered to https://reviews.llvm.org/rG3e081703c349dd00b8ef6991c2d15964915dd8f4

Reviewed By: asb, kito-cheng, benshi001

Differential Revision: https://reviews.llvm.org/D129173
2023-09-09 16:39:28 +08:00
Amara Emerson
eaab3245d4
[GlobalISel] Add constant folding support for G_FMA/G_FMAD in the combiner. (#65659) 2023-09-09 16:32:02 +08:00
Job Noorman
1b78742e77
[BOLT][RISCV] Implement R_RISCV_PCREL_LO12_S (#65204)
Relocation used for store instructions.
2023-09-09 08:22:37 +00:00
liqin.weng
1b622fff44 [VP] IR expansion for inttoptr/ptrtoint
Add basic handling for VP ops that can expand to cast intrinsics

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D159478
2023-09-09 15:34:46 +08:00
Kazu Hirata
c7b25faaac [llvm-exegesis] Use range-based for loops (NFC) 2023-09-09 00:27:23 -07:00
Nuno Lopes
8a2d68f6be
[clang][CodeGen] Switch declaration of vtable information to be [0 x ptr] (#65596)
Continuing the discussion in
https://discourse.llvm.org/t/codegen-layout-of-si-class-type-info-doesnt-match-the-actual-size/73274

Before we had this code:
@_ZTVN10__cxxabiv117__class_type_infoE = external global ptr

now we'll produce:
@_ZTVN10__cxxabiv117__class_type_infoE = external global [0 x ptr]

This is because we may not know the exact size of this data, and clang
issues gep inbounds with idx=2. Before, that gep would always result in
poison.
2023-09-09 07:50:35 +01:00
Douglas Yung
0a6f658f97 Fix Dexter test after 37a20cc68f54. Adding the XFAIL line caused the line references to be off.
Should fix https://lab.llvm.org/buildbot/#/builders/216/builds/27001.
2023-09-08 23:34:54 -07:00
Mehdi Amini
4085cb380d
Improve the pull-request subcription notification format by adding the description and files statistics (#65828) 2023-09-08 22:54:53 -07:00
Johannes Doerfert
67635b6e23 [OpenMPOpt][NFC] Precommit test 2023-09-08 22:40:33 -07:00
Dhruv Chawla
e13e808283
[SROA] Limit the number of allowed slices when trying to split allocas
This patch adds a hidden CLI option "--sroa-max-alloca-slices", which is
an integer that controls the maximum number of alloca slices SROA can
consider before bailing out. This is useful because it may not be
profitable to split memcpys into (possibly tens of) thousands of loads/stores.
This also prevents an issue with exponential compile time explosion in passes
like DSE and MemCpyOpt caused by excessive alloca splitting.

Fixes https://github.com/rust-lang/rust/issues/88580.

Differential Revision: https://reviews.llvm.org/D159354
2023-09-09 11:00:47 +05:30
Timm Bäder
f8074942c5 [clang][Interp] Fix SourceLocExpr used in CXXDefaultInitExprs
... when initializing.

Fixes a problem pointed out in https://reviews.llvm.org/D156045/
2023-09-09 07:28:50 +02:00
Tom Stellard
91fdb20915 workflows: Split new-prs into two workflows
We cannot use the default github token for labeling PRs, because this
will not trigger the PR Subscriber job.  However, we weren't allowed to
use a different token via a secret, because secrets aren't allowed
in PR workflows.

The solution is to create two workflows, the first accepts the
pull_request_taget event extracts the PR number and then starts
the second workflow which adds the labels to the PRs.

This separation ensures that nothing malicious in the first workflow is
able to access the secret we use in the second workflow.
2023-09-08 22:09:33 -07:00
Jan Svoboda
358d9dbf4f [clang] NFCI: Use FileEntryRef in checkMSVCHeaderSearch() 2023-09-08 21:28:05 -07:00
Fangrui Song
c6a101d7ed [llvm-readobj][test] Test -s with an invalid section name 2023-09-08 21:17:19 -07:00
Brad Smith
c184f27f55 Fixes for Haiku tests on Win32 2023-09-09 00:13:26 -04:00
Siva Chandra
b0068b5b06
[libc][NFC] Make add_header_library rule support COMPILE_OPTIONS. (#65821)
The options added via COMPILE_OPTIONS will be treated as INTERFACE
options. This will help in setting compile options based on libc config
options in future patches.
2023-09-08 20:34:00 -07:00
Jan Svoboda
0c41681a0c [clang] NFCI: Use FileEntryRef in VerifyDiagnosticConsumer 2023-09-08 20:12:08 -07:00
Shilei Tian
600e0cde3e [NFC][OpenMP] clang-format openmp/libomptarget/src/interface.cpp 2023-09-08 23:01:39 -04:00
Jan Svoboda
523c471250 Reapply "[clang] NFCI: Adopt SourceManager::getFileEntryRefForID()"
This reapplies ddbcc10b9e26b18f6a70e23d0611b9da75ffa52f, except for a tiny part that was reverted separately: 65331da0032ab4253a4bc0ddcb2da67664bd86a9. That will be reapplied later on, since it turned out to be more involved.

This commit is enabled by 5523fefb01c282c4cbcaf6314a9aaf658c6c145f and f0f548a65a215c450d956dbcedb03656449705b9, specifically the part that makes 'clang-tidy/checkers/misc/header-include-cycle.cpp' separator agnostic.
2023-09-08 19:04:01 -07:00
Brad Smith
a3ba9d697b [Driver] Fixes for header / library paths on Haiku
Some fixes for the header / library paths..

- Use concat macro for all paths
- Correct the C++ header paths
- Add library paths

Differential Revision: https://reviews.llvm.org/D159414
2023-09-08 21:34:31 -04:00
Fabian Mora
5db8990cda
[mlir][test][gpu] Migrate ROCM tests to the TargetAttr compilation workflow (#65805)
Migrate tests referencing `gpu-to-hsaco` to the new compilation workflow
using TargetAttrs.
2023-09-08 21:26:43 -04:00
Ellis Hoag
aaa09063a8
[GlobPattern][Docs] End list with "." (#65397)
Apparently we can use "." to end a list and start a new paragraph:
https://www.doxygen.nl/manual/lists.html
2023-09-08 17:37:37 -07:00
Tyler Lanphear
1029fd028c
[NFC][ValueTracking] Simplify check in llvm::isBitwiseValue() (#65817)
Change `!isNonZero()` to `isZero()` for a minor readability improvement.
2023-09-08 17:24:04 -07:00
Vitaly Buka
9dc5d8df16 [sanitizer] Add CMake flag to build with internal symbolizer
This intermediate result in moving internal symbolizer build
from sh script to CMake rules.

The flag is supposed to be used with:
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" -DLLVM_ENABLE_RUNTIMES="libunwind;libcxx;libcxxabi" -Sllvm-project/llvm

After converting sh script into cmake, we may add support for other build modes.

For https://github.com/llvm/llvm-project/issues/30098

Reviewed By: kstoimenov, MaskRay

Differential Revision: https://reviews.llvm.org/D157947
2023-09-08 16:56:57 -07:00
Jan Svoboda
f0f548a65a [clang] Make test separator-agnostic 2023-09-08 16:56:01 -07:00
Jan Svoboda
5523fefb01 [clang][lex] Use preferred path separator in includer-relative lookup
There is a long-standing FIXME in `HeaderSearch.cpp` to use the path separator preferred by the platform instead of forward slash. There was an attempt to fix that (1cf6c28a) which got reverted (cf385dc8). I couldn't find an explanation, but my guess is that some tests assuming forward slash started failing.

This commit fixes tests with that assumption.

This is intended to be NFC, but there are two exceptions to that:
* Some diagnostic messages might now contain backslash instead of forward slash.
* Arguments to the "-remap-file" option that use forward slash might stop kicking in. Separators between potential includer path and header name need to be replaced by backslash in that case.
2023-09-08 16:38:08 -07:00
Mehdi Amini
9818bf2619 Clariy the GitHub PR doc that a "single commit" is only the expected initial state
Review rounds can add more commits, this addresses a post-merge comment.
2023-09-08 16:32:11 -07:00
Shubham Sandeep Rastogi
37a20cc68f XFAIL dexter tests that broke greendragon.
The patch in https://reviews.llvm.org/D151465 broke greendragon, because
it is hardcoding the use of libstdc++ which is not available on darwin.

XFAILing these tests till they can be fixed.
2023-09-08 15:51:10 -07:00
spupyrev
42da84fda9 [BOLT] Always match stale entry blocks
Two (minor) improvements for stale matching:
- always match entry blocks to each other, even if there is a hash mismatch;
- ignore nops in (loose) hash computation.

I record a small improvement in inference quality on my benchmarks. Tests are not affected

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D159488
2023-09-08 15:46:20 -07:00
Tom Stellard
adfd4a2b0e new-prs-labeler: Convert from gitignore syntax to minimatch 2023-09-08 15:40:21 -07:00
Markus Böck
0f052a972e
[mlir] Make StringRefParameter roundtrippable (#65813)
The current printer of `StringRefParameter` simply prints out the
content of the string as is without escaping it any way. This leads to
it generating invalid syntax, causing parser errors when read in again.

This PR fixes that by adding `printString` to `AsmPrinter`, allowing one
to print a string that can be parsed with `parseString`, using the same
escaping syntax as `StringAttr`.
2023-09-09 00:06:38 +02:00
Owen Pan
743659be87
[clang-format] Fix a serious bug in git-clang-format (#65723)
When applying format changes to staged files, git-clang-format
erroneously checks out all files in the index and thus may overwrite
unstaged changes.

Fixes #65643.
2023-09-08 15:05:22 -07:00
Vitaly Buka
0fefa6d01b [NFC][sanitizer] Add a few missed RTSanitizerCommonSymbolizerInternal
Reland edb211cb78317ad73aa4bd2d3df75194b7f23a72 and
5d7b75e2a5846f72f04a6fdb25a0df338f1825a1 without stats broken on OSX.
2023-09-08 15:01:38 -07:00