Commit graph

431386 commits

Author SHA1 Message Date
Florian Hahn 3367244b7e [LV] Add another test for incorrect runtime check generation.
Add a variation of @nested_loop_outer_iv_addrec_invariant_in_inner with
the dependence sink and source swapped to extend test coverage.

Also simplifies the test by removing an unneeded reduction.

(cherry picked from commit e117137af0a37ac309d40db57ec7162ef3d22c29)
2022-08-30 08:08:28 +02:00
Florian Hahn afde142bfe [LV] Add test for incorrect runtime check generation #57315.
Test for PR57315 based on a test provided by @kpdev42.

(cherry picked from commit 6e56779e6bc168a3acd14f9bf2c4fd3fd9d86bd1)
2022-08-30 08:08:28 +02:00
Florian Hahn 4bb006d0d3 [LV] Convert runtime diff check test to use opaque pointers.
Modernize the test to make it easier to extend with up-to-date IR.

(cherry picked from commit 3b135ef446d56e8542d55a1b716e9413f50da7aa)
2022-08-30 08:08:28 +02:00
Aaron Puchert 0c5ce1d7fb Fix formatting in release notes
Code needs double backticks, while single backticks produce italics.
Lists need to be fully indented and have blank lines around them.
Links are written "`text <url>`_".

We use links instead of `:manpage:`, because the latter is meant
more for man pages cross-referencing each other.

Reviewed By: aaron.ballman, thieta

Differential Revision: https://reviews.llvm.org/D132791
2022-08-29 19:43:34 +02:00
Shoaib Meenai 05d07e41b3 [lld] Fix typo in 15.x release notes
The flag is -femit-dwarf-unwind, not -femit-compact-unwind.
2022-08-29 16:33:53 +05:00
Amy Kwan 68e77f1595 [ReleaseNotes]: Add PowerPC release notes for LLVM 15 2022-08-28 13:56:39 -05:00
Tobias Hieta 1594ec2a71 [workflow] Run release tasks for me (tru) as well.
Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131493
2022-08-25 21:17:32 +02:00
Tobias Hieta d3ba48998f [release] Use threaded compression with xz
Use xz -T0 to use your threads

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131470
2022-08-25 21:17:11 +02:00
Phoebe Wang 3d3ef9d073 [X86][FP16] Add the missing legal action for EXTRACT_SUBVECTOR
Fixes #57340

Reviewed By: RKSimon

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

(cherry picked from commit 12b203ea7c65071f9fc02d420b28d58dcdc5ad4a)
2022-08-25 12:49:26 +02:00
Martin Storsjö 9c29291dfa [LLD] [COFF] Fix export directives in object files from -includeoptional
When an object file contains an export directive, we normally do some
amount of deferred processing of them at the end of the linking
process. The -includeoptional option was handled after this, and
any object files (defining new exports) weren't handled.

Move the handling of the -includeoptional into the same late loop
which does the fixups for e.g. export directives.

Ideally, this would also be done for object files that are pulled
in by the wrap options, and for mingw autoimports, but those changes
require more modifications, to make them safe for potentially
being executed multiple times.

This fixes https://github.com/llvm/llvm-project/issues/57243.

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

(cherry picked from commit af39e6f6fc905f3c067f022fb44136779d2f9c84)
2022-08-25 12:49:09 +02:00
Tobias Hieta e6f03d1476 [NFC] Fix a misleading comment CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION 2022-08-25 09:57:30 +02:00
H. Vetinari 5768325f06 SONAME introduce option CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION
This reverts commit bc39d7bdd4.

rename CLANG_SONAME to LIBCLANG_SOVERSION

[clang][cmake] introduce option CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION

Differential Revision: https://reviews.llvm.org/D132486
2022-08-25 09:39:40 +02:00
Simon Pilgrim fe3ff3806f [DAG] MatchRotate - bail if we fail to match a shl/srl pair
extractShiftForRotate may fail to return canonicalized shifts due to constant folding or other simplification that can occur in getNode()

Fixes Issue #57283

(cherry picked from commit e624f8a3bb88075493dec521408993ea0ef7bde0)
2022-08-25 09:07:51 +02:00
Petr Hosek 3a481d4491 [runtimes] Use a response file for runtimes test suites
We don't know which test suites are going to be included by runtimes
builds so we cannot include those before running the sub-build, but
that's not possible during the LLVM build configuration. We instead use
a response file that's populated by the runtimes build as a level of
indirection.

This addresses the issue described in:
https://discourse.llvm.org/t/cmake-regeneration-is-broken/62788

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

(cherry picked from commit 992e10a3fce41255e4b11782f51d0f4b26dca14d)
2022-08-25 09:04:03 +02:00
Petr Hosek 427e1ea3e7 [lit] Support reading arguments from a file
This allows reading arguments from file using the response file syntax.
We would like to use this in the LLVM build to pass test suites from
subbuilds.

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

(cherry picked from commit b52820edec6f3d95edef7859a56ef30878b08382)
2022-08-25 09:04:03 +02:00
Louis Dionne 0cc033e333 [runtimes] Handle interface targets in runtimes distribution components
As reported in [1], cxx-headers is not a valid distribution target
because it is an interface target in CMake. This breaks the most
basic MultiDistributionExample of the runtimes build.

This patch handles interface targets by getting rid of the assumption
that all distribution components have a target associated to them. It
is valid for a distribution component to only have a `install-FOO`
target.

In the case where only `cxx-headers` is provided as a distribution
component, `ninja toolchain-distribution` will not build anything
after this patch, since there is effectively nothing to build for
the `cxx-headers` target. However, running `ninja install-toolchain-distribution`
will build everything, as expected.

[1]: https://discord.com/channels/636084430946959380/636732894974312448/1010013287464828968

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

(cherry picked from commit 5905e699342fd476d7eb9e35db5d84248a7e9156)
2022-08-25 09:03:53 +02:00
Louis Dionne d761fe6ef1 [libc++] Add a missing assertion in std::span's constructor
Also, add missing tests for assertions in span constructors. Now I
believe that all of std::span's API should be hardened, and all the
assertions should have a corresponding test.

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

(cherry picked from commit 8c6319e30a357fb9b25db09b6f5fc9cf3e7c4aab)
2022-08-25 09:03:53 +02:00
Tobias Hieta 12f27d8bef Revert "GCC ABI Compatibility: Preserve alignment of non-pod members in packed structs"
This reverts commit 277123376c.

See issue: https://github.com/llvm/llvm-project/issues/57346
2022-08-25 09:00:25 +02:00
Nemanja Ivanovic 4e4252f9b6 [GTest] Change detection of libpthread
We currently use CMake's find_library function to detect whether
libpthread exists on the system to determine if pthread should
be added on the link step. However, there are configurations in
which CMake's path checking fails to find the library even though
the toolchain has it.

One such case is with Clang 14.0.0 on PowerPC. Due to a recent
change, the build puts libc++ and related libraries in a
subdirectory that appears to depend on the default target triple.
CMake then uses that subdirectory to determine the architecture
and adds that name to its search paths. However, the triple for
the system GNU toolchain is different so CMake fails to find it.
Namely, Clang 14.0.0's default target triple and the subdirectory
name is powerpc64le-unknown-linux-gnu whereas the system GNU
toolchain has powerpc64le-linux-gnu. Clang's driver has no trouble
finding either the GNU includes/libraries or Clang's own. But
CMake seems to get this wrong.

The net result of this is that we can't do a shared libraries
build of ToT with Clang 14.0.0.

This patch proposes using HAVE_LIBPTHREAD which CMake seems to
determine by compiling a test file with -lpthread (or perhaps
-pthread, I can't really get CMake to tell me how it is figuring
this out). If that variable tells CMake that the build compiler
accepts the pthread option, it seems reasonable to depend on
that variable to determine if we should add it to the link step
when building the llvm_gtest library.

(cherry picked from commit 8537a99b2c1d08e9e586b3fb9e36728075ec4a03)
2022-08-23 19:10:12 +02:00
Joseph Huber bcb8d21fc3 [CUDA] Fix output name being replaced in device-only mode
When performing device only compilation, there was an issue where
`cubin` outputs were being renamed to `cubin` despite the user's name.
This is required in a normal compilation flow as the Nvidia tools only
understand specific filenames instead of checking magic bytes for some
unknown reason. We do not want to perform this transformation when the
user is performing device only compilation.

Reviewed By: tra

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

(cherry picked from commit 3b52341116b794e53dec2fd07e568884e5a0b8bb)
2022-08-23 19:10:03 +02:00
Kadir Cetinkaya 99b6254657 [clangd] Support for standard type hierarchy
This is mostly a mechanical change to adapt standard type hierarchy
support proposed in LSP 3.17 on top of clangd's existing extension support.

This does mainly two things:
- Incorporate symbolids for all the parents inside resolution parameters, so
  that they can be retrieved from index later on. This is a new code path, as
  extension always resolved them eagerly.
- Propogate parent information when resolving children, so that at least one
  branch of parents is always preserved. This is to address a shortcoming in the
  extension.

This doesn't drop support for the extension, but it's deprecated from now on and
will be deleted in upcoming releases. Currently we use the same struct
internally but don't serialize extra fields.

Fixes https://github.com/clangd/clangd/issues/826.

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

(cherry picked from commit 83411bf06f34ae06731008eeabfc53553c1a1f86)
2022-08-23 19:09:56 +02:00
Alexander Shaposhnikov 077736456f [InstCombine] Refactor foldICmpMulConstant
This is a follow-up to 2ebfda2417
(replace "if" with "else if" since the cases nuw/nsw
were meant to be handled separately).

Test plan:
1/ ninja check-llvm check-clang check-lld
2/ Bootstrapped LLVM/Clang pass tests

(cherry picked from commit d982f1e0c69f3447c4520ae4c010520f62ed1174)
2022-08-23 19:09:48 +02:00
Jonas Hahnfeld 69c35fa29a [RISCV] Re-enable JIT support
Commit 8922adf646 recently made JITTargetMachineBuilder honor the
hasJIT property of the target. LLVM supports just-in-time compilation
on RISC-V, so set the flag.

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

(cherry picked from commit 940733d6a0a92245912361bf116514172a15f4f8)
2022-08-23 19:09:38 +02:00
Tobias Hieta b11009ffe7
[NFC] Minor documentation fix for the release branch 2022-08-22 16:32:55 +02:00
David Truby 006b649321 [clang][docs] Release notes for C/C++ SVE Operators 2022-08-22 13:53:56 +01:00
Rainer Orth b6889f0f1b [Sparc] Don't use SunStyleELFSectionSwitchSyntax
As discussed in D85414 <https://reviews.llvm.org/D85414>, two tests
currently `FAIL` on Sparc since that backend uses the Sun assembler syntax
for the `.section` directive, controlled by
`SunStyleELFSectionSwitchSyntax`.

Instead of adapting the affected tests, this patch changes that default.
The internal assembler still accepts both forms as input, only the output
syntax is affected.

Current support for the Sun syntax is cursory at best: the built-in
assembler cannot even assemble some of the directives emitted by GCC, and
the set supported by the Solaris assembler is even larger: SPARC Assembly
Language Reference Manual, 3.4 Pseudo-Op Attributes
<https://docs.oracle.com/cd/E37838_01/html/E61063/gmabi.html#scrolltoc>.

A few Sparc test cases need to be adjusted. At the same time, the patch
fixes the failures from D85414 <https://reviews.llvm.org/D85414>.

Tested on `sparcv9-sun-solaris2.11`.

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

(cherry picked from commit d9993484ee40abaab6d9e96872d3a29044202aea)
2022-08-22 11:35:56 +02:00
Martin Sebor 87c92cd2fc [InstCombine] Correct strtol folding with nonnull endptr
Reflect in the pointer's offset the length of the leading part
of the consumed string preceding the first converted digit.

Reviewed By: efriedma

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

(cherry picked from commit bcef4d238d113c61127575bf5dd0328f97bda9e9)
2022-08-22 11:35:48 +02:00
Rainer Orth b630bafb3c [mlir][test] Require JIT support in JIT tests
A number of mlir tests `FAIL` on Solaris/sparcv9 with `Target has no JIT
support`.  This patch fixes that by mimicing `clang/test/lit.cfg.py` which
implements a `host-supports-jit` keyword for this.  The gtest-based unit
tests don't support `REQUIRES:`, so lack of support needs to be hardcoded
there.

Tested on `amd64-pc-solaris2.11` (`check-mlir` results unchanged) and
`sparcv9-sun-solaris2.11` (only one unrelated failure left).

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

(cherry picked from commit ca98e0dd6cf59907f07201c4282dcafeeea11a91)
2022-08-22 11:35:40 +02:00
Alex Bradbury 43fb0d7193 [clang][RISCV] Fix incorrect ABI lowering for inherited structs under hard-float ABIs
The hard float ABIs have a rule that if a flattened struct contains
either a single fp value, or an int+fp, or fp+fp then it may be passed
in a pair of registers (if sufficient GPRs+FPRs are available).
detectFPCCEligibleStruct and the helper it calls,
detectFPCCEligibleStructHelper examine the type of the argument/return
value to determine if it complies with the requirements for this ABI
rule.

As reported in bug #57084, this logic produces incorrect results for C++
structs that inherit from other structs. This is because only the fields
of the struct were examined, but enumerating RD->fields misses any
fields in inherited C++ structs. This patch corrects that issue by
adding appropriate logic to enumerate any included base structs.

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

(cherry picked from commit bc538320809fb52af12ec0366118c82201af4f40)
2022-08-22 11:35:31 +02:00
Alex Bradbury 89be541e31 [clang][RISCV][test] Add test that shows incorrect ABI lowering
As reported in <https://github.com/llvm/llvm-project/issues/57084>,
under hard float ABIs there are issues with lowering structs that
inherit from other structs.

See <https://reviews.llvm.org/D131677> for a fix.

(cherry picked from commit d17de5479c6234f9e37fb4deca9e537bf8d3932e)
2022-08-22 11:35:31 +02:00
Sanjay Patel 2950a43867 [SDAG] avoid generating libcall to function with same name
This is a potentially better alternative to D131452 that also
should avoid the infinite loop bug from:
issue #56403

This is again a minimal fix to reduce merging pain for the
release. But if this makes sense, then we might want to guard
all of the RTLIB generation (and other libcalls?) with a
similar name check.

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

(cherry picked from commit 7f72a0f5bb3743428021df920d9a7c50f74f61ae)
2022-08-22 11:35:21 +02:00
Sanjay Patel e2613c5ea6 [AArch64] add test for recursive libcall lowering; NFC
Issue #56403

(cherry picked from commit 8eddd1ec6066fe958313a2b1cc4907b5ee7dfbee)
2022-08-22 11:35:21 +02:00
Tom Stellard 05c85020a5 workflows/llvm-project-tests: Workaround an issue with lldb builds on Windows
For some reason cmake started selecting a 32-bit version of python on
Windows instead of the 64-bit version when building windows.  Explicitly
setting the default python to 3.10 fixes this problem.

Reviewed By: thieta

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

(cherry picked from commit 99020b3c73c1e22fa388be8fd0c44391d40b3a38)
2022-08-20 00:15:54 -07:00
Tom Stellard 0bc3cbb984 workflows/version-check: Fix check for release candidates
Reviewed By: thieta

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

(cherry picked from commit 5b108dfc159a461c10bba1fd1f05308bf57dcd25)
2022-08-19 22:12:59 -07:00
Haojian Wu 0334c1ac1b [clangd] Fix an inlay-hint crash on a broken designator.
Differential Revision: https://reviews.llvm.org/D131696

(cherry picked from commit 06b97b4985ad0415f6cde4baad2bc7d73b456244)
2022-08-18 08:29:04 +02:00
Rainer Orth 67ea7a1b11 [flang] Add Solaris/x86 support to Optimizer/CodeGen/Target.cpp
When testing LLVM 15.0.0 rc1 on Solaris, I found that 50+ flang tests
`FAIL`ed with

  error:
/vol/llvm/src/llvm-project/local/flang/lib/Optimizer/CodeGen/Target.cpp:310:
not yet implemented: target not implemented

This patch fixes that for Solaris/x86, where the fix is trivial (just
handling it like the other x86 OSes).

Tested on `amd64-pc-solaris2.11`; only a single failure remains now.

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

(cherry picked from commit bcb2740f415b0f825402f656dda3271414121a0e)
2022-08-18 08:28:57 +02:00
Fangrui Song af3707c3b8 [MC] Avoid C++17 structured bindings
release/15.x uses C++14 and structured bindings trigger warnings in Clang/GCC
and errors in MSVC.
2022-08-17 10:38:38 -07:00
Michał Górny 64260feaa7 [llvm] [cmake] Move LLVM_INSTALL_PACKAGE_DIR top-level to fix llvm-config
Move the `LLVM_INSTALL_PACKAGE_DIR` declaration from llvm/cmake/modules
directory to the top-level llvm/CMakeLists.txt, in order to fix
the regression in `llvm-config --cmakedir` output for installed LLVM.
Since the tools directory is processed by CMake prior to
llvm/cmake/modules, the llvm-config executable ended up using
the variable prior to it being defined and incorrectly used an empty
path, resulting in e.g.:

    $ llvm-config --cmakedir
    /usr/lib/llvm/16/

With this patch, the path is defined (and therefore the default value
is being set) prior to adding the tools subdirectory and llvm-config
starts working correctly:

    $ llvm-config --cmakedir
    /usr/lib/llvm/16/lib64/cmake/llvm

This fixes a regression introduced by D130539.  Thanks to Petr Polezhaev
for reporting the problem @ https://bugs.gentoo.org/865165

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

(cherry picked from commit d230055234863aafe63489f9ab95e52d2c1883f2)
2022-08-17 10:56:24 +02:00
Maciej Gabka b4a285bcb5 [clang][SVE] Undefine preprocessor macro defined in
arm_sve.h defines and uses __ai macro which needs to be undefined (as it is
already in arm_neon.h).

Reviewed By: paulwalker-arm

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

(cherry picked from commit 48e1250a91d244741c8677fed248ace1fcd7c41c)
2022-08-17 10:56:17 +02:00
David Green 02b82b844d [DAG] Ensure more Legal BUILD_VECTOR elements types in shuffle->And combine
This is a followup to D131350, which caused another problem for i64
types being split into i32 on i32 targets. This patch tries to make sure
that either Illegal types are OK, or that the element types of a
buildvector are legal and bigger than or equal to the size of the
original elements.

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

(cherry picked from commit dfc95bab078297b1564c1ac757b1ac093d125b2d)
2022-08-17 10:56:08 +02:00
Diana Picus 8abe263f1e [flang] Install runtime libs with the toolchain
Make sure that FortranDecimal, FortranRuntime and Fortran_main are
installed/packaged even when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.
They are used by flang to link executables, so they should be provided
even with minimal installs.

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

(cherry picked from commit 467abac2046d037f8d4cf428e76b77e5b06c187f)
2022-08-16 08:30:20 +02:00
Craig Topper f1f55a9f1e [RISCV] isImpliedByDomCondition returns an Optional<bool> not a bool.
We were incorrectly checking that it returned an implicaton result,
not that the implication result itself was true.
2022-08-16 08:30:13 +02:00
Fangrui Song e4aa1049da [DebugInfo] -fdebug-prefix-map: handle '#line "file"' for asm source
`getContext().setMCLineTableRootFile` (from D62074) sets `RootFile.Name` to
`FirstCppHashFilename`. `RootFile.Name` is not processed by -fdebug-prefix-map
and will go to DW_TAG_compile_unit's DT_AT_name and DW_TAG_label's
DW_AT_decl_file. Remap `RootFile.Name`.

Fix another issue reported by https://github.com/llvm/llvm-project/issues/56609

Reviewed By: #debug-info, dblaikie, raj.khem

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

(cherry picked from commit d797c2ffdb591d10de2964907962aaacb2e360ca)
2022-08-16 08:30:06 +02:00
Fangrui Song 655a1cbd64 [DebugInfo] Don't join DW_AT_comp_dir and directories[0] for DWARF v5 line tables
DWARF v5 6.2.4 The Line Number Program Header says:

> The first entry is the current directory of the compilation. Each additional
> path entry is either a full path name or is relative to the current directory of
> the compilation.

When forming a path, relative DW_AT_comp_dir and directories[0] are not supposed
to be joined together. Fix getFileNameByIndex to special case DWARF v5 DirIdx == 0.

Reviewed By: #debug-info, dblaikie

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

(cherry picked from commit 3329cec2f79185bafd678f310fafadba2a8c76d2)
2022-08-16 08:30:06 +02:00
Fangrui Song e2da724461 [MCDwarf] Respect -fdebug-prefix-map= for generated assembly debug info (DWARF v5)
For generated assembly debug info, MCDwarfLineTableHeader::CompilationDir is an
unmapped path set in MCContext::setGenDwarfRootFile. Remap it.

A relative destination path of -fdebug-prefix-map= exposes a llvm-dwarfdump bug
which joins relative DW_AT_comp_dir and directories[0].

Fix https://github.com/llvm/llvm-project/issues/56609

Reviewed By: dblaikie

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

(cherry picked from commit f62e60fb238146113f84e0efb1a2ebc52f05cc0a)
2022-08-16 08:30:06 +02:00
Fangrui Song e087912321 [BOLT] Use Optional::emplace to avoid move assignment. NFC
(cherry picked from commit 53113515cdaa19a86e4b807808b7b99dc1c91685)
2022-08-16 08:30:06 +02:00
Fangrui Song 095ea503dd [MCDwarf][test] Improve debug-prefix-map.s
(cherry picked from commit d561907f27d721558e4372990ca52a8284b7aafc)
2022-08-16 08:30:06 +02:00
Fangrui Song c4398881f8 [MCDwarf] Use emplace to avoid move assignment. NFC
(cherry picked from commit b0c4cd35df89479ec152c1f79e18d0264dd276cc)
2022-08-16 08:30:06 +02:00
Peter Waller ddb04d7968 [DAGCombine] Check zext legality in zext-extract-extend combine
Discussed in D131503.

Fix to D130782.

(cherry picked from commit 898699831b5490d88b993593e5cb415fb2d1983a)
2022-08-16 08:29:55 +02:00
Martin Storsjö 7af201cba5 [libcxx] [doc] Remove a leftover tentative release note
This release note was added tentatively in
https://reviews.llvm.org/D120982 / ebde6fc23b.
The issue was resolved differently in
https://reviews.llvm.org/D125715 / bedf657d0f,
but that commit forgot to remove the tentative release note.
2022-08-15 14:27:47 +03:00