Commit graph

415012 commits

Author SHA1 Message Date
Peter Klausler 882d5f14ad [flang] Ensure a characterized ENTRY in a PURE subprogram is also marked PURE
ENTRY point symbols aren't marked PURE in the symbol table, but must
instead inherit the attribute from their containing subprograms.
There's a predicate in semantics that does this, but it wasn't being
used in the context of actual procedure argument characterization.

Differential Revision: https://reviews.llvm.org/D119564
2022-02-14 15:34:45 -08:00
Florian Mayer 8de457eafc [HWASAN] use common alignAndPadAlloca
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119614
2022-02-14 15:28:32 -08:00
Louis Dionne ae68ce5ca8 [libc++][NFC] Fix typo in comment 2022-02-14 18:26:10 -05:00
Martin Storsjö 7420cf1b15 [libcxx] [ci] Enable LIBCXX_ENABLE_WERROR where possible
Only opt out from it in the few configs (GCC based) where there still
are build warnings.

Differential Revision: https://reviews.llvm.org/D119573
2022-02-15 01:17:12 +02:00
Stefan Pintilie a601db30c6 [PowerPC] Remove the LDMX instruction.
The LDMX instruction was to be potentially added in P9 but it was never added
in either ISA 3.0 or ISA 3.1. This patch removes that instruction as it is
currently still an invalid instruction.

Reviewed By: lei

Differential Revision: https://reviews.llvm.org/D118074
2022-02-14 17:03:48 -06:00
Florian Mayer 205308de6b [NFC] [MTE] Move alignAndPadAlloca to MemoryTaggingSupport.
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D119610
2022-02-14 14:54:04 -08:00
Peter Klausler 3632e9f852 [flang] Accept NULL(mold=x) as constant component value in constant structure constructor
The predicate IsInitialDataTarget() was failing to return a correct true
result in the case of a reference to the intrinsic function NULL() with a
MOLD= argument.  Fix, and improve tests for "NULL()" elsewhere in semantics,
checking for an attribute set by intrinsics.cpp rather than the actual name.

Differential Revision: https://reviews.llvm.org/D119452
2022-02-14 14:46:53 -08:00
Dmitry Vassiliev 885140171a [NVPTX] Fix NVPTXReplaceImageHandles for multiple uses of a texref
The texsurf_handle is removed by NVPTXReplaceImageHandles.cpp. There are more than one uses of the texsurf_handle, one of them is a regular function call, and one of them is a texture intrinsic.
The current hacky logic in NVPTXReplaceImageHandles.cpp for CUDA cannot handle such a mixed use. This patch fixes this issue.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D119635
2022-02-15 01:30:13 +03:00
Dmitry Vassiliev 6645bfa8f5 [NVPTX] Fix bug with int_nvvm_rotate_b64 when operand immediate
Need to subract from 64, not 32.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D119639
2022-02-15 01:23:11 +03:00
Sam Clegg 37f422f4ac [WebAssembly] Use GeneralDynamic TLS for exception handling builtins.
These global TLS symbols are shared across all shared libraries and
therefor should not be assumed to be local to the current module.

Also add new error in the linker when TLS relocations are used against
undefined symbols.  TLS relocations are offsets into the current modules
tls data segment, and don't make sense for undefined symbols which are
modeled as global imports.

Fixes: https://github.com/emscripten-core/emscripten/issues/13398

Differential Revision: https://reviews.llvm.org/D119630
2022-02-14 14:08:32 -08:00
Nick Desaulniers 9dcb006165 [funcattrs] check reachability to improve noreturn
There was a fixme in the code pertaining to attributing functions as
noreturn.  By using reachability, if none of the blocks that are
reachable from the entry return, then the function is noreturn.

Previously, the code only checked if any blocks returned. If they're
unreachable, then they don't matter.

This improves codegen for the Linux kernel.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1563

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D119571
2022-02-14 14:01:59 -08:00
Nikolas Klauser 30046a31b8 [libc++] Prepare string.nonmembers for constexpr
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D119487
2022-02-14 22:53:41 +01:00
LLVM GN Syncbot 9e8a72babc [gn build] Port 5d1c1a243c 2022-02-14 21:39:38 +00:00
Marek Kurdej 5d1c1a243c [libc++] [C++2b] [P0943] Add stdatomic.h header.
* https://wg21.link/P0943
* https://eel.is/c++draft/stdatomic.h.syn

Differential Revision: https://reviews.llvm.org/D97044
2022-02-14 16:39:22 -05:00
Fangrui Song a00ae86ab2 Revert D119669 "[NVPTX] Prefix "$L__" for branch label names"
This reverts commit cccef32109.

Broke clang-cuda-t4

```
/buildbot/cuda-t4-0/work/clang-cuda-t4/clang/bin/clang++  -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time -UNDEBUG --cuda-path=/buildbot/cuda-t4-0/work/clang-cuda-t4/external/cuda/cuda-11.0 -I/buildbot/cuda-t4-0/work/clang-cuda-t4/external/cuda/cuda-11.0/include --cuda-gpu-arch=sm_75 -std=c++20 -stdlib=libstdc++ --gcc-toolchain=/buildbot/cuda-t4-0/work/clang-cuda-t4/external/cuda/gcc-8 -DSTDLIB_VERSION=2014 -MD -MT External/CUDA/CMakeFiles/complex-cuda-11.0-c++20-libstdc++-8.dir/complex.cu.o -MF External/CUDA/CMakeFiles/complex-cuda-11.0-c++20-libstdc++-8.dir/complex.cu.o.d -o External/CUDA/CMakeFiles/complex-cuda-11.0-c++20-libstdc++-8.dir/complex.cu.o -c /buildbot/cuda-t4-0/work/clang-cuda-t4/llvm-test-suite/External/CUDA/complex.cu
ptxas /tmp/complex-cfa050/complex-sm_75.s, line 250; fatal   : Parsing error near '$L__BB6_2': syntax error
ptxas fatal   : Ptx assembly aborted due to errors
```
2022-02-14 13:23:22 -08:00
Alex Lorenz 688622ff60 [clang][test] Add -fuse-ld= to test cases added in d238acd113 to resolve test failure with CLANG_DEFAULT_LINKER=lld 2022-02-14 13:21:39 -08:00
Louis Dionne f34f7dfe3a [release] Use a supported way of building libc++ when building the documentation
Instead of using the deprecated LLVM_ENABLE_PROJECTS build, use the
default runtimes build. This is just as fast, but it's supported.

Differential Revision: https://reviews.llvm.org/D119275
2022-02-14 16:01:11 -05:00
Dmitry Vassiliev cccef32109 [NVPTX] Prefix "$L__" for branch label names
A global variable may have the same name as a label, and ptxas does not accept it.
Prefix labels with $L__ to fix this.

Reviewed By: MaskRay, tra

Differential Revision: https://reviews.llvm.org/D119669
2022-02-14 23:51:36 +03:00
Jay Foad cb199e0fca [MC] Define and use MCRegisterInfo::regsOverlap
Separate MCRegisterInfo::regsOverlap out from
TargetRegisterInfo::regsOverlap. This is useful in the AMDGPU AsmParser
where we only have access to MCRegisterInfo.

Differential Revision: https://reviews.llvm.org/D119533
2022-02-14 20:46:02 +00:00
Joe Nash c87c61c52c [AMDGPU] Fix AGPR offset for waitcnt
An enum value stores the offset between AGPR ranges and VGPR
ranges in the internal storage of SIInsertWaitcnts. It said 226 when
it should say 256, causing some portion of the ranges to overlap. That
in turn causes 'aliasing' between the registers, potentially inserting
waitcnts that are not required.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D119749
2022-02-14 15:16:21 -05:00
Louis Dionne 8c06061372 [libc++abi] Add a from-scratch testing config for Apple backdeployment
We added one for libc++ recently, and this patch adds one for libc++abi.
Also, as a fly-by fix, include older libunwind dylibs in the testing of
libc++ and libc++abi, which fixes some issues related to running
back-deployment tests on newer systems.

Differential Revision: https://reviews.llvm.org/D119466
2022-02-14 15:36:50 -05:00
Joseph Huber 48e3dcecc4 [Libomptarget][NFC] Remove constexpr to hide warnings
Currently whenever we compile the device runtime we get the following
'Mapping.cpp:32:32: warning: inline function '_OMP::impl::getGridValue'
is not defined [-Wundefined-inline]' warning. This can be silenced by
removing the constexpr attribute for this function. Doing this doesn't
change the generated bitcode at all but prevents the screen from getting
filled with warnings whenver we build the runtime.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119747
2022-02-14 15:34:18 -05:00
Valentin Clement ad40cc14a8
[flang] Lower basic function with scalar integer/logical return value
This patch allows the lowring of simple empty function with a
scalar integer or logical return value.
The code in ConvertType.cpp is cleaned up as well. This file was landed
together with the initial flang push and lowering was still a prototype
at that time. Some more cleaning will come with follow up patches.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-02-14 21:32:24 +01:00
Alex Lorenz d238acd113 [clang][driver] add clang driver support for emitting macho files with two build version load commands
This patch extends clang driver to pass the right flags to the clang frontend, and ld64,
so that they can emit macho files with two build version load commands. It adds a new
0darwin-target-variant option which complements -target and also can be used to specify different
target variants when multi-arch compilations are invoked with multiple -arch commands.

Differential Revision: https://reviews.llvm.org/D118862
2022-02-14 12:27:14 -08:00
Martin Storsjö e98f6fa1c7 [libcxx] [test] Fix the get_weekday test on glibc
This test feeds in the expected utf8 form of weekdays in various
languages, trying to match what libc++ has gathered internally
from `strftime()`. On glibc, the ru_RU.UTF-8 representation of the
tested weekday is spelled with upper case, while the existing
test reference is lower case.

Differential Revision: https://reviews.llvm.org/D118237
2022-02-14 22:21:16 +02:00
Martin Storsjö e5f362828a [libcxx] [test] Simplify the handling of platform specific NAN formatting in put_long_double
Also opt in to testing the hexadecimal float formatting for glibc; glibc
does matches the current test references there.

Differential Revision: https://reviews.llvm.org/D118238
2022-02-14 22:21:15 +02:00
Jonas Devlieghere 343662a028 [crashlog] Change heuristic to stripping the meta data from crashlogs
Instead trying to pro-actively determine if the first line in a
crashlog contains meta data, change the heuristic to do the following:

 1. To trying to parse the whole file. If that fails, then:
 2. Strip the first line and try parsing the remainder of the file. If
    that fails, then:
 3. Fall back to the textual crashlog parser.

rdar://88580543

Differential revision: https://reviews.llvm.org/D119755
2022-02-14 12:18:12 -08:00
Jonas Devlieghere d52866e1a8 [lldb] Stop forwarding LLDB_DEFAULT_PYTHON_VERSION in crashlog
Support for Python 2 was removed in Xcode 13.

Differential revision: https://reviews.llvm.org/D119756
2022-02-14 12:18:12 -08:00
Arthur O'Dwyer 6c4052166c [libc++] [test] Uncomment std::ranges::min_element in niebloid.compile.pass.cpp.
This should have been part of 3b470d1ce.
2022-02-14 15:12:10 -05:00
Martin Storsjö 7b89360d3a [libcxx] Fix setup of MSVC specific intrinsics in Ryu code
This fixes warnings about implicitly declared `_umul128` and
`__shiftright128` when building for x86_64 with clang-cl.

Use `_MSC_VER` instead of `_LIBCPP_COMPILER_MSVC` for enabling MSVC
specific code; `_MSC_VER` is defined both in clang-cl and MSVC,
while `_LIBCPP_COMPILER_MSVC` only is defined if building with the
actual MSVC compiler.

Include `ryu.h` at the head of `d2s_intrinsics.h`, as it uses
the `_LIBCPP_64_BIT` define, which is defined in `ryu.h`.

Now the Ryu files build without warnings with clang-cl for i386,
x86_64, arm and aarch64.

Differential Revision: https://reviews.llvm.org/D119647
2022-02-14 22:11:22 +02:00
Jonathan Peyton 1234011b80 [OpenMP][libomp] Introduce oneAPI compiler support
Introduce KMP_COMPILER_ICX macro to represent compilation with oneAPI
compiler.

Fixup flag detection and compiler ID detection in CMake. Older CMake's
detect IntelLLVM as Clang.

Fix compiler warnings.

Fixup many of the tests to have non-empty parallel regions as they are
elided by oneAPI compiler.
2022-02-14 14:10:33 -06:00
Joe Nash aabf6e65fd [AMDGPU] Pre-commit test for wait between agpr & vgpr
Due to a typo of 256 to 226, the SIInsertWaitcnt pass thinks
several registers are aliased from a waitcnt PoV including vgpr226
and agpr0, vgpr227 and agpr1...

This is a test of the behavior.
NFC.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D119750
2022-02-14 14:45:14 -05:00
LLVM GN Syncbot 4aaa8e4e00 [gn build] Port 85355a560a 2022-02-14 19:57:49 +00:00
LLVM GN Syncbot f849a3adce [gn build] Port 2a8f9a5e95 2022-02-14 19:57:48 +00:00
Raman Tenneti 31eccf99ec [libc] [Obvious] Fix.
Disable getenv_test.

Reviewed By: rtenneti

Differential Revision: https://reviews.llvm.org/D119758
2022-02-14 11:56:01 -08:00
Nikolas Klauser 2a8f9a5e95 [libc++] Implement P0627R6 (Function to mark unreachable code)
Reviewed By: ldionne, Quuxplusone, #libc

Spies: arichardson, mstorsjo, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D119152
2022-02-14 20:52:51 +01:00
Raman Tenneti b305de142c [libc] [Obvious] Fix.
Removed getenv from entrypoints.

Reviewed By: rtenneti

Differential Revision: https://reviews.llvm.org/D119753
2022-02-14 11:48:07 -08:00
Sanjay Patel 5e90f38424 [InstCombine] add tests for min/max intrinsics with constant ops; NFC 2022-02-14 14:44:19 -05:00
Snehasish Kumar 857ec0d01f Revert "[memprof] Refactor out the MemInfoBlock into a macro based def."
This reverts commit 9def83c6d0. [4/4]
2022-02-14 11:42:58 -08:00
Snehasish Kumar e6999040f5 Revert "[memprof] Introduce a wrapper around MemInfoBlock."
This reverts commit 9b67165285. [3/4]
2022-02-14 11:42:58 -08:00
Snehasish Kumar 9fd2cb21fb Revert "[InstrProf] Make the IndexedInstrProf header backwards compatible."
This reverts commit 14cc41a020. [2/4]
2022-02-14 11:42:58 -08:00
Snehasish Kumar 85355a560a Revert "Reland "[memprof] Extend the index prof format to include memory profiles.""
This reverts commit de54e4ab78 [1/4]
2022-02-14 11:42:58 -08:00
Louis Dionne 57c3c48e6e [libc++][NFC] Remove redundant comment about availability of std::format 2022-02-14 14:28:26 -05:00
Ahmed Bougacha c703f852c9 [IR] Define "ptrauth" operand bundle.
This introduces a new "ptrauth" operand bundle to be used in
call/invoke. At the IR level, it's semantically equivalent to an
@llvm.ptrauth.auth followed by an indirect call, but it additionally
provides additional hardening, by preventing the intermediate raw
pointer from being exposed.

This mostly adds the IR definition, verifier checks, and support in
a couple of general helper functions. Clang IRGen and backend support
will come separately.

Note that we'll eventually want to support this bundle in indirectbr as
well, for similar reasons.  indirectbr currently doesn't support bundles
at all, and the IR data structures need to be updated to allow that.

Differential Revision: https://reviews.llvm.org/D113685
2022-02-14 11:27:35 -08:00
LLVM GN Syncbot aa15274389 [gn build] Port de54e4ab78 2022-02-14 19:21:47 +00:00
Louis Dionne 608ef3d32a [libc++][NFC] Remove trailing whitespace 2022-02-14 14:17:11 -05:00
Jason Molenda 4a394367c1 Alt mechanism to find the first loadable seg in a Mach-O binary
ObjectFileMachO, for a couple of special binaries at the initial
launch, needs to find segment load addresses before the Target's
SectionLoadList has been initialized. The calculation to find
the first segment, which is at the same address as the mach header,
was not correct if the binary was in the Darwin shared cache.
Update the logic to handle that case.

Differential Revision: https://reviews.llvm.org/D119602
rdar://88802629
2022-02-14 11:12:58 -08:00
Shraiysh Vaishay b85cfe208f [OpenMP][IRBuilder] Change the default constructor for OpenMPIRBuilder::LocationDescription
This patch changes the argument from template-IRBuilder to IRBuilderBase
thus allowing us to write less code while getting the location from a
builder.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D119717
2022-02-15 00:40:34 +05:30
Aaron Ballman a766545402 Update the diagnostic behavior of [[noreturn]] in C2x
Post-commit review feedback suggested dropping the deprecated
diagnostic for the 'noreturn' macro (the diagnostic from the header
file suffices and the macro diagnostic could be confusing) and to only
issue the deprecated diagnostic for [[_Noreturn]] when the attribute
identifier is either directly written or not from a system macro.

Amends the commit made in 5029dce492.
2022-02-14 14:04:32 -05:00
Fangrui Song d0fb3eab74 [lldb] Fix use-after-move in SymbolFile/NativePDB 2022-02-14 11:03:26 -08:00