Jan Svoboda [Tue, 15 Feb 2022 08:17:22 +0000 (09:17 +0100)]
[clang][lex] Remove `PPCallbacks::FileNotFound()`
The purpose of the `FileNotFound` preprocessor callback was to add the ability to recover from failed header lookups. This was to support downstream project.
However, injecting additional search path while performing header search can invalidate currently used iterators/references to `DirectoryLookup` in `Preprocessor` and `HeaderSearch`.
The downstream project ended up maintaining a separate patch to further tweak the functionality. Since we don't have any upstream users nor open source downstream users, I'd like to remove this callback for good to prevent future misuse. I doubt there are any actual downstream users, since the functionality is definitely broken at the moment.
Reviewed By: ahoppen
Differential Revision: https://reviews.llvm.org/D119708
Nikita Popov [Sun, 13 Feb 2022 13:13:16 +0000 (14:13 +0100)]
[Support] Fix build on illumos
D116366 added a call to madvise() in Path.inc. Unfortunately,
Illumos does not declare this function if _XOPEN_SOURCE is defined
(which it is by default) and we need to provide the declaration
manually. This is the same workaround used in sanitizers:
https://github.com/llvm/llvm-project/blob/
ee423d93ead39e94c2970b3cc7ef6e6faa75d10b/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp#L77-L85
Differential Revision: https://reviews.llvm.org/D119695
Nikita Popov [Wed, 9 Feb 2022 13:44:20 +0000 (14:44 +0100)]
[Bitcode] Improve support for opaque-pointer bitcode upgrade
This is step two of supporting autoupgrade of old bitcode to opaque
pointers. Rather than tracking the element type ID of pointers in
particular, track all type IDs that a type contains. This allows us
to recover the element type in more complex situations, e.g. when
we need to determine the pointer element type of a vector element
or function type parameter.
Differential Revision: https://reviews.llvm.org/D119339
Ivan Butygin [Sun, 13 Feb 2022 20:25:19 +0000 (23:25 +0300)]
[mlir][spirv] Add OpenCL fma op and lowering
Also, it seems Khronos has changed html spec format so small adjustment to script was needed.
Base op parsing is also probably broken.
Differential Revision: https://reviews.llvm.org/D119678
serge-sans-paille [Mon, 14 Feb 2022 15:27:04 +0000 (16:27 +0100)]
Cleanup LLVMDWARFDebugInfo
As usual with that header cleanup series, some implicit dependencies now need to
be explicit:
llvm/DebugInfo/DWARF/DWARFContext.h no longer includes:
- "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"
- "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
- "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
- "llvm/DebugInfo/DWARF/DWARFDebugAranges.h"
- "llvm/DebugInfo/DWARF/DWARFDebugFrame.h"
- "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
- "llvm/DebugInfo/DWARF/DWARFDebugMacro.h"
- "llvm/DebugInfo/DWARF/DWARFGdbIndex.h"
- "llvm/DebugInfo/DWARF/DWARFSection.h"
- "llvm/DebugInfo/DWARF/DWARFTypeUnit.h"
- "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
Plus llvm/Support/Errc.h not included by a bunch of llvm/DebugInfo/DWARF/DWARF*.h files
Preprocessed lines to build llvm on my setup:
after:
1065629059
before:
1066621848
Which is a great diff!
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D119723
Bill Wendling [Tue, 15 Feb 2022 08:06:01 +0000 (00:06 -0800)]
Insert a blurb about the -fzero-call-used-regs feature
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D119592
Pavel Labath [Tue, 15 Feb 2022 07:41:44 +0000 (08:41 +0100)]
[lldb] Fix thread syncrhonization TestThreadBacktraceRepeat
lldb reports (and lldbutil.continue_to_breakpoint returns) a stop reason
even for suspended threads. Fix the test to expect that.
This was making the test flaky, as most of the time, the two threads
stop simultaneously, and the synchronization code is not executed.
Valentin Clement [Tue, 15 Feb 2022 07:24:48 +0000 (08:24 +0100)]
[flang] Enable complex type in function lowering
This patch enables complex type in lowering.
It is tested on function return types.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D119698
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D119700
Co-authored-by: Jean Perier <jperier@nvidia.com>
Valentin Clement [Tue, 15 Feb 2022 07:23:00 +0000 (08:23 +0100)]
[flang] Enable scalar real type in lowering
This patch enables scalar real type in lowering.
It is tested on function return types.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D119698
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D119699
Co-authored-by: Jean Perier <jperier@nvidia.com>
Shraiysh Vaishay [Tue, 15 Feb 2022 05:56:49 +0000 (11:26 +0530)]
[flang][mlir][NFC] Remove deprecated parser/printer/verifier utilities
These have been replaced by `hasCustomAssemblyFormat` and `hasVerifier`
fields and aren't needed anymore.
Ops deriving from `fir_IntegralSwitchTerminatorOp` and `region_Op` are
not handled in this patch for ease of review.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D119776
Siva Chandra Reddy [Tue, 25 Jan 2022 19:50:00 +0000 (19:50 +0000)]
[libc] Add a platform independent buffered file IO data structure.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D119458
Jonas Devlieghere [Tue, 15 Feb 2022 05:21:07 +0000 (21:21 -0800)]
[lldb] Determine the main binary in JSON crashlogs
The symbolicator assumes that the first image in the image list is the
main image. That isn't always the case. For JSON crashlogs we can use
the procName to move the main image to the front of the list.
rdar://
83907760
Serguei Katkov [Tue, 15 Feb 2022 05:21:33 +0000 (12:21 +0700)]
[Safepoint Verifier] Add a missed comment to previous commit.
Serguei Katkov [Mon, 14 Feb 2022 12:22:47 +0000 (19:22 +0700)]
[Safepoint Verifier] gc.relocate does not change the constant property.
Add traverse through gc.relocate in determining whether base is
isExclusivelyDerivedFromNull OR ExclusivelyNull.
Reviewers: reames, anna
Reviewed By: reames, anna
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D119712
Min-Yih Hsu [Tue, 14 Dec 2021 12:59:22 +0000 (20:59 +0800)]
[TableGen] Add a new `encoder` directive into VarLenCodeEmitterGen
The new encoder directive can be used to specify custom encoder for a
single operand or slice. This is different from the EncoderMethod field
within an Operand, which affects every operands in the target.
In addition, this patch also changes the function signature of the
encoder method -- a new argument, InsertPost, is added to both the
default one (i.e. getMachineValue) and the custom one. This argument
provides the bit position where the operand will eventually be inserted.
Differential Revision: https://reviews.llvm.org/D119100
Brad Smith [Tue, 15 Feb 2022 04:29:13 +0000 (23:29 -0500)]
[Driver][NetBSD] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119655
Brad Smith [Tue, 15 Feb 2022 04:24:26 +0000 (23:24 -0500)]
[Driver][DragonFly] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D119656
Yonghong Song [Sun, 13 Feb 2022 00:56:17 +0000 (16:56 -0800)]
[BPF] Fix a bug in BTF_KIND_TYPE_TAG generation
Kumar Kartikeya Dwivedi reported a bug ([1]) where BTF_KIND_TYPE_TAG types
are not generated.
Currently, BPF backend only generates BTF types which are used by
the program, e.g., global variables, functions and some builtin functions.
For example, suppose we have
struct task_struct {
...
struct task_group *sched_task_group;
struct mm_struct *mm;
...
pid_t pid;
pid_t tgid;
...
}
If BPF program intends to access task_struct->pid and task_struct->tgid,
there really no need to generate BTF types for struct task_group
and mm_struct.
In BPF backend, during BTF generation, when generating BTF for struct
task_struct, if types for task_group and mm_struct have not been generated
yet, a Fixup structure will be created, which will be reexamined later
to instantiate into either a full type or a forward type.
In current implementation, if we have something like
struct foo {
struct bar __tag1 *f;
};
and when generating types for struct foo, struct bar type
has not been generated, the __tag1 will be lost during later
Fixup instantiation. This patch fixed this issue by properly
handling btf_type_tag's during Fixup instantiation stage.
[1] https://lore.kernel.org/bpf/
20220210232411.pmhzj7v5uptqby7r@apollo.legion/
Differential Revision: https://reviews.llvm.org/D119799
Snehasish Kumar [Mon, 14 Feb 2022 19:52:38 +0000 (11:52 -0800)]
Reland "[memprof] Introduce a wrapper around MemInfoBlock."
This reverts commit
e6999040f5758f89a64b6232119b775b7bd1c85b.
Update test to fix signed int comparison warning, fix whitespace in
compiler-rt MIBEntryDef.inc file.
Differential Revision: https://reviews.llvm.org/D117256
Hongtao Yu [Mon, 14 Feb 2022 17:33:54 +0000 (09:33 -0800)]
[CSSPGO] Do not merge a context that is already duplicated into the base profile.
Do not merge a context that is already duplicated into the base profile.
Also fixing a typo caused by previous refactoring.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D119735
Jun Zhang [Fri, 11 Feb 2022 08:40:26 +0000 (16:40 +0800)]
[Clang][Sema] Add a missing regression test about Wliteral-range
This patch adds a missing test, covering the different kinds of floating-point
literals, like hexadecimal floats, and testing extreme cases & normal cases.
Differential Revision: https://reviews.llvm.org/D119528
Jim Ingham [Tue, 15 Feb 2022 00:57:20 +0000 (16:57 -0800)]
This test seems to pass on Linux, remove the x-fail.
One of the tests in this test setup was copied from a more complex test, and I didn't know
if the setup or the subsequent parts of the test were the ones that fail on Linux. Looks
like it was the latter, so let's mark this succeeding.
Mike Rice [Mon, 14 Feb 2022 19:36:12 +0000 (11:36 -0800)]
[OpenMP]Fix parsing of OpenMP directive nested in a metadirective
Differential Revision: https://reviews.llvm.org/D119761
Jonas Devlieghere [Mon, 14 Feb 2022 22:25:27 +0000 (14:25 -0800)]
[dsymutil] Add the ability to run the DWARF verifier on the input
Currently you can run the DWARF verifier on the linked dsymutil output.
This patch extends this functionality and makes it possible to
run the DWARF verifier on the input as well.
A new option --verify-dwarf allows you to specify input, output, all and
none. The existing --verify flag remains unchanged and acts and alias
for --verify-dwarf=output.
Input verification issues do not result in a non-zero exit code because
dsymutil is capable of taking invalid DWARF as input and producing valid
DWARF as output.
Differential revision: https://reviews.llvm.org/D89216
Snehasish Kumar [Mon, 14 Feb 2022 19:52:34 +0000 (11:52 -0800)]
Reland "[memprof] Refactor out the MemInfoBlock into a macro based def."
This reverts commit
857ec0d01f8021ff0d9540fcbf6ff24e29868ba4.
Fixes -DLLVM_ENABLE_MODULES=On build by adding the new textual
header to the modulemap file.
Reviewed in https://reviews.llvm.org/D117722
Volodymyr Sapsai [Tue, 1 Feb 2022 23:03:59 +0000 (15:03 -0800)]
[modules] Add a flag for TagDecl if it was a definition demoted to a declaration.
For redeclaration chains we maintain an invariant of having only a
single definition in the chain. In a single translation unit we make
sure not to create duplicates. But modules are separate translation
units and they can contain definitions for the same symbol
independently. When we load such modules together, we need to demote
duplicate definitions to keep the AST invariants.
Some AST clients are interested in distinguishing
declaration-that-was-demoted-from-definition and
declaration-that-was-never-a-definition. For that purpose introducing
`IsThisDeclarationADemotedDefinition`. No functional change intended.
rdar://
84677782
Differential Revision: https://reviews.llvm.org/D118855
Peter Klausler [Tue, 8 Feb 2022 19:56:22 +0000 (11:56 -0800)]
[flang] Accept structure constructor value for polymorphic component
Semantic analysis was emitting a bogus error message when a structure
constructor contains a monomorphic value for a (limited) polymorphic
component of a derived type. The type compatibility test was too
strict; this patch relaxes it a little to allow values that could
be assigned or passed to a variable or dummy argument with that type.
Also add some quotes to an error message that was sometimes confusing
without them, and remove a repeated space character from another.
Differential Revision: https://reviews.llvm.org/D119744
Jim Ingham [Mon, 14 Feb 2022 23:49:37 +0000 (15:49 -0800)]
Fix an incorrect assumption in "thread until": code with debug info is not always in a function.
Some dyld cross library stubs can have line information but no function. Make sure you
check that you have a valid Function object before asking it questions.
Differential Revision: https://reviews.llvm.org/D119297
Jim Ingham [Fri, 4 Feb 2022 23:16:31 +0000 (15:16 -0800)]
Add a repeat command option for "thread backtrace --count N".
This way if you have a long stack, you can issue "thread backtrace --count 10"
and then subsequent <Return>-s will page you through the stack.
This took a little more effort than just adding the repeat command, since
the GetRepeatCommand API was returning a "const char *". That meant the command
had to keep the repeat string alive, which is inconvenient. The original
API returned either a nullptr, or a const char *, so I changed the private API to
return an llvm::Optional<std::string>. Most of the patch is propagating that change.
Also, there was a little thinko in fetching the repeat command. We don't
fetch repeat commands for commands that aren't being added to history, which
is in general reasonable. And we don't add repeat commands to the history -
also reasonable. But we do want the repeat command to be able to generate
the NEXT repeat command. So I adjusted the logic in HandleCommand to work
that way.
Differential Revision: https://reviews.llvm.org/D119046
Nikolas Klauser [Mon, 14 Feb 2022 17:52:28 +0000 (18:52 +0100)]
[libc++] Guard warning pragmas
This makes the GCC output even cleaner!
Reviewed By: ldionne, #libc
Spies: mstorsjo, Quuxplusone, Mordante, libcxx-commits
Differential Revision: https://reviews.llvm.org/D119295
Nikolas Klauser [Fri, 11 Feb 2022 00:01:17 +0000 (01:01 +0100)]
[libc++] Replace _VSTD with std in __ranges/
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D119497
Bixia Zheng [Fri, 11 Feb 2022 23:05:06 +0000 (15:05 -0800)]
[mlir][sparse][taco] Support true dense tensors and all dense sparse tensors.
The only method to create a true dense tensor (i.e un-annotated) in MLIR-PyTACO
is through the from_array method. However, the annotated all dense tensors are
also implemented as true dense tensor currently. The PR fixes the
implementation to support annotated all dense sparse tensors.
Extend the tensor init method to support the construction of a tensor without
any sparsity annotation.
Change the tensor to_file method to only support writing unpacked sparse
tensors to file through the MLIR sparse tensor dialect.
Add unit tests for true dense tensors and all dense sparse tensors.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D119500
Peter Klausler [Tue, 8 Feb 2022 18:07:55 +0000 (10:07 -0800)]
[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
Florian Mayer [Sat, 12 Feb 2022 01:41:56 +0000 (17:41 -0800)]
[HWASAN] use common alignAndPadAlloca
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D119614
Louis Dionne [Mon, 14 Feb 2022 23:25:57 +0000 (18:25 -0500)]
[libc++][NFC] Fix typo in comment
Martin Storsjö [Thu, 10 Feb 2022 11:08:24 +0000 (13:08 +0200)]
[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
Stefan Pintilie [Mon, 14 Feb 2022 21:38:54 +0000 (15:38 -0600)]
[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
Florian Mayer [Sat, 12 Feb 2022 01:38:19 +0000 (17:38 -0800)]
[NFC] [MTE] Move alignAndPadAlloca to MemoryTaggingSupport.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D119610
Peter Klausler [Mon, 7 Feb 2022 23:34:54 +0000 (15:34 -0800)]
[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
Dmitry Vassiliev [Mon, 14 Feb 2022 22:30:13 +0000 (01:30 +0300)]
[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
Dmitry Vassiliev [Mon, 14 Feb 2022 22:23:11 +0000 (01:23 +0300)]
[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
Sam Clegg [Fri, 11 Feb 2022 23:53:28 +0000 (15:53 -0800)]
[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
Nick Desaulniers [Mon, 14 Feb 2022 21:47:00 +0000 (13:47 -0800)]
[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
Nikolas Klauser [Thu, 10 Feb 2022 22:28:11 +0000 (23:28 +0100)]
[libc++] Prepare string.nonmembers for constexpr
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D119487
LLVM GN Syncbot [Mon, 14 Feb 2022 21:39:38 +0000 (21:39 +0000)]
[gn build] Port
5d1c1a243c4d
Marek Kurdej [Mon, 7 Feb 2022 21:04:31 +0000 (16:04 -0500)]
[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
Fangrui Song [Mon, 14 Feb 2022 21:23:22 +0000 (13:23 -0800)]
Revert D119669 "[NVPTX] Prefix "$L__" for branch label names"
This reverts commit
cccef321096c20825fe8738045c1d91d3b9fd57d.
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
```
Alex Lorenz [Mon, 14 Feb 2022 21:21:39 +0000 (13:21 -0800)]
[clang][test] Add -fuse-ld= to test cases added in
d238acd1131ec2670acf5cf47b89069ca6c2e86c to resolve test failure with CLANG_DEFAULT_LINKER=lld
Louis Dionne [Tue, 8 Feb 2022 18:06:44 +0000 (13:06 -0500)]
[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
Dmitry Vassiliev [Mon, 14 Feb 2022 20:51:36 +0000 (23:51 +0300)]
[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
Jay Foad [Fri, 11 Feb 2022 10:39:46 +0000 (10:39 +0000)]
[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
Joe Nash [Mon, 14 Feb 2022 18:34:11 +0000 (13:34 -0500)]
[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
Louis Dionne [Thu, 10 Feb 2022 19:03:05 +0000 (14:03 -0500)]
[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
Joseph Huber [Mon, 14 Feb 2022 19:01:04 +0000 (14:01 -0500)]
[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
Valentin Clement [Mon, 14 Feb 2022 20:31:46 +0000 (21:31 +0100)]
[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>
Alex Lorenz [Mon, 14 Feb 2022 20:24:43 +0000 (12:24 -0800)]
[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
Martin Storsjö [Tue, 25 Jan 2022 09:24:45 +0000 (11:24 +0200)]
[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
Martin Storsjö [Thu, 20 Jan 2022 12:47:05 +0000 (14:47 +0200)]
[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
Jonas Devlieghere [Mon, 14 Feb 2022 20:12:54 +0000 (12:12 -0800)]
[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
Jonas Devlieghere [Mon, 14 Feb 2022 20:14:36 +0000 (12:14 -0800)]
[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
Arthur O'Dwyer [Mon, 14 Feb 2022 20:12:10 +0000 (15:12 -0500)]
[libc++] [test] Uncomment std::ranges::min_element in niebloid.compile.pass.cpp.
This should have been part of
3b470d1ce.
Martin Storsjö [Sat, 12 Feb 2022 20:00:46 +0000 (22:00 +0200)]
[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
Jonathan Peyton [Mon, 31 Jan 2022 16:04:49 +0000 (10:04 -0600)]
[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.
Joe Nash [Mon, 14 Feb 2022 16:29:58 +0000 (11:29 -0500)]
[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
LLVM GN Syncbot [Mon, 14 Feb 2022 19:57:49 +0000 (19:57 +0000)]
[gn build] Port
85355a560a33
LLVM GN Syncbot [Mon, 14 Feb 2022 19:57:48 +0000 (19:57 +0000)]
[gn build] Port
2a8f9a5e95de
Raman Tenneti [Mon, 14 Feb 2022 19:53:59 +0000 (11:53 -0800)]
[libc] [Obvious] Fix.
Disable getenv_test.
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D119758
Nikolas Klauser [Mon, 14 Feb 2022 17:26:02 +0000 (18:26 +0100)]
[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
Raman Tenneti [Mon, 14 Feb 2022 19:43:47 +0000 (11:43 -0800)]
[libc] [Obvious] Fix.
Removed getenv from entrypoints.
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D119753
Sanjay Patel [Mon, 14 Feb 2022 18:28:31 +0000 (13:28 -0500)]
[InstCombine] add tests for min/max intrinsics with constant ops; NFC
Snehasish Kumar [Mon, 14 Feb 2022 19:42:00 +0000 (11:42 -0800)]
Revert "[memprof] Refactor out the MemInfoBlock into a macro based def."
This reverts commit
9def83c6d02944b2931efd50cd2491953a772aab. [4/4]
Snehasish Kumar [Mon, 14 Feb 2022 19:41:37 +0000 (11:41 -0800)]
Revert "[memprof] Introduce a wrapper around MemInfoBlock."
This reverts commit
9b67165285c5e752fce3b554769f5a22e7b38da8. [3/4]
Snehasish Kumar [Mon, 14 Feb 2022 19:41:03 +0000 (11:41 -0800)]
Revert "[InstrProf] Make the IndexedInstrProf header backwards compatible."
This reverts commit
14cc41a0206a85d350767f8aff6e02bd4e7dd5d6. [2/4]
Snehasish Kumar [Mon, 14 Feb 2022 19:40:22 +0000 (11:40 -0800)]
Revert "Reland "[memprof] Extend the index prof format to include memory profiles.""
This reverts commit
de54e4ab78ef09b60f870e8df6f8a87e56d6bd94 [1/4]
Louis Dionne [Mon, 14 Feb 2022 19:28:23 +0000 (14:28 -0500)]
[libc++][NFC] Remove redundant comment about availability of std::format
Ahmed Bougacha [Wed, 9 Feb 2022 03:04:47 +0000 (19:04 -0800)]
[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
LLVM GN Syncbot [Mon, 14 Feb 2022 19:21:47 +0000 (19:21 +0000)]
[gn build] Port
de54e4ab78ef
Louis Dionne [Mon, 14 Feb 2022 19:16:50 +0000 (14:16 -0500)]
[libc++][NFC] Remove trailing whitespace
Jason Molenda [Mon, 14 Feb 2022 19:09:34 +0000 (11:09 -0800)]
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
Shraiysh Vaishay [Mon, 14 Feb 2022 18:33:06 +0000 (00:03 +0530)]
[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
Aaron Ballman [Mon, 14 Feb 2022 19:02:27 +0000 (14:02 -0500)]
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
5029dce492b3cf3ac191eda0b5bf268c3acac2e0.
Fangrui Song [Mon, 14 Feb 2022 19:03:26 +0000 (11:03 -0800)]
[lldb] Fix use-after-move in SymbolFile/NativePDB
Fangrui Song [Mon, 14 Feb 2022 18:54:37 +0000 (10:54 -0800)]
[BitcodeReader] Fix use-after-move
Snehasish Kumar [Mon, 14 Feb 2022 18:32:58 +0000 (10:32 -0800)]
Reland "[memprof] Extend the index prof format to include memory profiles."
This reverts commit
0f73fb18ca333e38cdb9ffa701a8db026c56041d.
Use llvm/Profile/MIBEntryDef.inc instead of relative path.
Generated the raw profile data with `-mllvm
-enable-name-compression=false` so that builbots where the reader is
built without zlib do not fail.
Also updated the test build instructions.
Andy Yankovsky [Mon, 14 Feb 2022 18:48:51 +0000 (18:48 +0000)]
[lldb] Enable test for `getelementptr` const args for Windows
The test actually passes fine on Windows, since it doesn't use any
static members.
Follow-up to https://reviews.llvm.org/D113498
Peter Klausler [Mon, 7 Feb 2022 16:44:50 +0000 (08:44 -0800)]
[flang] Allow DATA initialization of derived types w/ allocatable components
While one cannot of course statically initialize an allocatable component
of an instance of a derived type, its mere presence should not prevent
DATA initialization of the other nonallocatable components. Semantics
was treating the existence of an allocatable component as a case of
"default initialization", which it is, but not one that should run
afoul of C877. Add another Boolean argument to IsInitialized() to allow
for a more nuanced test.
Differential Revision: https://reviews.llvm.org/D119449
Fangrui Song [Mon, 14 Feb 2022 18:38:22 +0000 (10:38 -0800)]
[llvm-profdata] Fix use-after-move
Maksim Panchenko [Mon, 14 Feb 2022 18:37:20 +0000 (10:37 -0800)]
[BOLT] Make order of jump table successors deterministic
When a jump table is recovered in postProcessIndirectBranches(),
successors for the containing basic block are added in random order.
Make the order deterministic.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D119672
Kai Nacke [Mon, 14 Feb 2022 18:02:28 +0000 (13:02 -0500)]
[SystemZ/z/OS] Add XPLINK dynamic stack allocation
With XPLINK, dynamic stack allocations requires calling
a runtime function, which allocates the stack memory,
moves the register save area, and returns the new
stack pointer.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D119732
alex-t [Fri, 11 Feb 2022 21:08:32 +0000 (00:08 +0300)]
[AMDGPU] Divergence-driven abs instruction selection
This change enables "abs" SDNodes selection by the node divergence.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D119581
Maksim Panchenko [Mon, 14 Feb 2022 18:31:43 +0000 (10:31 -0800)]
[BOLT] Skip warning message if no functions were ignored
Reviewed By: yota9, Amir
Differential Revision: https://reviews.llvm.org/D119673
LLVM GN Syncbot [Mon, 14 Feb 2022 18:25:45 +0000 (18:25 +0000)]
[gn build] Port
0f73fb18ca33
Snehasish Kumar [Mon, 14 Feb 2022 18:23:23 +0000 (10:23 -0800)]
Revert "[memprof] Extend the index prof format to include memory profiles."
This reverts commit
43c2348c5b926df6bdbc5b70efaa35ecdefe12d5.
Buildbots are failing with an error on reading memprof testdata.
"Inputs/basic.profraw: profile uses zlib
compression but the profile reader was built without zlib support"
https://lab.llvm.org/buildbot/#/builders/16/builds/24490
Alex Brachet [Mon, 14 Feb 2022 18:13:00 +0000 (18:13 +0000)]
[libc] Create cpp::IntegerSequence analogous to std::integer_sequence
Reviewed By: sivachandra, lntue
Differential Revision: https://reviews.llvm.org/D119511
Raman Tenneti [Mon, 14 Feb 2022 01:57:28 +0000 (17:57 -0800)]
Introduce getenv to LLVM libc
Add support for getenv as defined by the Open Group's "System Interface &
Header" in https://pubs.opengroup.org/onlinepubs/7908799/xsh/getenv.html
getenv requires a standard way of accessing the environment,
so a pointer to the environment is added to the startup in crt1.
Consquently, this function is not usable on top of other libcs.
Added starts_with method to StringView. getenv function uses it.
Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Reviewed By: sivachandra, rtenneti
Differential Revision: https://reviews.llvm.org/D119403
Peter Klausler [Fri, 11 Feb 2022 18:37:55 +0000 (10:37 -0800)]
[flang] Allow for deferred-length character in EstablishDescriptor
When the runtime is initializing an instance of a derived type,
don't crash if an allocatable character component has deferred length.
Differential Revision: https://reviews.llvm.org/D119731
Andy Yankovsky [Mon, 14 Feb 2022 17:27:31 +0000 (17:27 +0000)]
[lldb] Add a positive test for `getelementptr` constant args
The IR interpreter supports const operands to the `GetElementPtr` IR
instruction, so it should be able to evaluate expression without JIT.
Follow up to https://reviews.llvm.org/D113498
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D119734
LLVM GN Syncbot [Mon, 14 Feb 2022 17:55:08 +0000 (17:55 +0000)]
[gn build] Port
43c2348c5b92
Snehasish Kumar [Sat, 12 Feb 2022 00:28:33 +0000 (16:28 -0800)]
[memprof] Extend the index prof format to include memory profiles.
This patch adds support for optional memory profile information to be
included with and indexed profile. The indexed profile header adds a new
field which points to the offset of the memory profile section (if
present) in the indexed profile. For users who do not utilize this
feature the only overhead is a 64-bit offset in the header.
The memory profile section contains (1) profile metadata describing the
information recorded for each entry (2) an on-disk hashtable containing
the profile records indexed via llvm::md5(function_name). We chose to
introduce a separate hash table instead of the existing one since the
indexing for the instrumented fdo hash table is based on a CFG hash
which itself is perturbed by memprof instrumentation.
Differential Revision: https://reviews.llvm.org/D118653
Snehasish Kumar [Thu, 27 Jan 2022 03:35:17 +0000 (19:35 -0800)]
[InstrProf] Make the IndexedInstrProf header backwards compatible.
While the contents of the profile are backwards compatible the header
itself is not. For example, when adding new fields to the header results
in significant issues. This change adds allows for portable
instantiation of the header across indexed format versions.
Differential Revision: https://reviews.llvm.org/D118390