Nikita Popov [Tue, 4 Apr 2023 10:16:50 +0000 (12:16 +0200)]
[WebAssembly] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 4 Apr 2023 10:13:26 +0000 (12:13 +0200)]
[WinEH] Convert test to opaque pointers (NFC)
Nikita Popov [Tue, 4 Apr 2023 10:04:40 +0000 (12:04 +0200)]
[PowerPC] Convert tests to opaque pointers (NFC)
Serguei Katkov [Tue, 4 Apr 2023 09:49:59 +0000 (16:49 +0700)]
[InstCombine] Pre-land tests for maximum(a,b) +* minimum(a,b) => a +* b
Nikita Popov [Tue, 4 Apr 2023 10:03:33 +0000 (12:03 +0200)]
[PowerPC] Name instructions in tests (NFC)
Nikita Popov [Tue, 4 Apr 2023 09:34:02 +0000 (11:34 +0200)]
[Hexagon] Convert some tests to opaque pointers (NFC)
John McIver [Tue, 4 Apr 2023 09:47:42 +0000 (10:47 +0100)]
[InstCombine][NFC] Update generated variable names in signed-truncation-check.ll
Update signed-truncation-check.ll using latest version of update_test_checks.py.
Differential Revision: https://reviews.llvm.org/D143030
Simon Pilgrim [Tue, 4 Apr 2023 09:45:43 +0000 (10:45 +0100)]
[X86] LowerVectorAllEqual - remove repeated VT.getScalarSizeInBits() call. NFC.
Nicolas Vasilache [Mon, 3 Apr 2023 15:17:24 +0000 (08:17 -0700)]
[mlir][Linalg] NFC - Refactor hoist padding transform and separate packing creation functionality in a separate transform
This revision is in prevision for upcoming improvements.
Differential Revision: https://reviews.llvm.org/D147458
Alex Zinenko [Thu, 30 Mar 2023 12:31:48 +0000 (12:31 +0000)]
[mlir] add readonly/consume annotations to transform named sequences
Use the argument attribute mechanism for function-like operations to
annotate the arguments of named transform sequences as consuming or only
reading the handles passed as arguments. This makes it possible to
correctly specify handle invalidation for external named sequences by
requiring their declarations to always provide such annotations.
Additionally, these annotations remove the need to analyze the body of
a named sequence to understand its effects on the arguments. Make them
required for named sequences that are called from the same file, in
addition to external sequences.
Provide a convenience pass that infers annotations by analyzing bodies
of named sequences provided they are not called from the same file.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D147223
Nikita Popov [Tue, 4 Apr 2023 09:25:13 +0000 (11:25 +0200)]
[ARM] Regenerate test checks (NFC)
Nikita Popov [Tue, 4 Apr 2023 09:15:38 +0000 (11:15 +0200)]
[ARM] Convert some tests to opaque pointers (NFC)
Nikita Popov [Tue, 4 Apr 2023 09:15:22 +0000 (11:15 +0200)]
[ARM] Regenerate test checks (NFC)
Nikita Popov [Tue, 4 Apr 2023 09:10:24 +0000 (11:10 +0200)]
[ARM] Name instructions in test (NFC)
Timm Bäder [Thu, 16 Feb 2023 08:01:52 +0000 (09:01 +0100)]
[clang][Interp][NFC] Remove Integral.h include from PrimType.h
Timm Bäder [Sun, 12 Mar 2023 07:32:07 +0000 (08:32 +0100)]
[clang][Interp] Ignore more non-VarDecl declarations
They are harmless and handled by other means, but we used to return
false from visitDeclStmt.
Differential Revision: https://reviews.llvm.org/D145861
Max Kazantsev [Tue, 4 Apr 2023 08:08:36 +0000 (15:08 +0700)]
[Test] Commit test for PR61923
We see increased number of assembly instructions after patch
24780e13e5be1501e34330148137a10fa9965166 for this test. See details
at https://github.com/llvm/llvm-project/issues/61923.
Jie Fu [Tue, 4 Apr 2023 08:17:25 +0000 (16:17 +0800)]
[clang][dataflow] Fix -Wdeprecated-declarations after D147302 (NFC)
Replace:
1. createAtomicBoolValue() --> create<AtomicBoolValue>()
2. createTopBoolValue() --> create<TopBoolValue>()
/Users/jiefu/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:386:19: error: 'createAtomicBoolValue' is deprecated: use create<AtomicBoolValue> instead [-Werror,-Wdeprecated-declarations]
return DACtx->createAtomicBoolValue();
^~~~~~~~~~~~~~~~~~~~~
create<AtomicBoolValue>
/Users/jiefu/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:215:3: note: 'createAtomicBoolValue' has been explicitly marked deprecated here
LLVM_DEPRECATED("use create<AtomicBoolValue> instead",
^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
^
In file included from /Users/jiefu/llvm-project/clang/lib/Analysis/FlowSensitive/Transfer.cpp:14:
In file included from /Users/jiefu/llvm-project/clang/include/clang/Analysis/FlowSensitive/Transfer.h:19:
/Users/jiefu/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:391:19: error: 'createTopBoolValue' is deprecated: use create<TopBoolValue> instead [-Werror,-Wdeprecated-declarations]
return DACtx->createTopBoolValue();
^~~~~~~~~~~~~~~~~~
create<TopBoolValue>
/Users/jiefu/llvm-project/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:227:3: note: 'createTopBoolValue' has been explicitly marked deprecated here
LLVM_DEPRECATED("use create<TopBoolValue> instead", "create<TopBoolValue>")
^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/Compiler.h:143:50: note: expanded from macro 'LLVM_DEPRECATED'
^
2 errors generated.
Nikita Popov [Wed, 22 Mar 2023 10:53:01 +0000 (11:53 +0100)]
[SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating
After D141386, violation of nonnull, range and align metadata
results in poison rather than immediate undefined behavior,
which means that these are now safe to retain when speculating.
We only need to remove UB-implying metadata like noundef.
This is done by adding a dropUBImplyingAttrsAndMetadata() helper,
which lists the metadata which is known safe to retain on speculation.
Differential Revision: https://reviews.llvm.org/D146629
Phoebe Wang [Tue, 4 Apr 2023 07:51:09 +0000 (15:51 +0800)]
[X86] Disable masked UNPCKLPD/UNPCKHPD -> SHUFPS transformation
UNPCKLPD/UNPCKHPD is a 64-bit element operation. The masked version
doesn't match SHUFPS in lanes.
This reverts part of D144763.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D147507
AMS21 [Tue, 4 Apr 2023 06:39:15 +0000 (06:39 +0000)]
[clang-tidy] Small refactor for ExceptionAnalyzer
- Use llvm::DenseMap<> with pre-allocation instead of std::map<> for FunctionCache
- Avoid double lookup for FunctionCache
- Use try_emplace instead of insert
- Simplify definition of State enum
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D147376
AMS21 [Tue, 4 Apr 2023 06:38:40 +0000 (06:38 +0000)]
[clang-tidy] Allow bugprone-unchecked-optional-access to handle calls to `std::forward`
The check now understands that calling `std::forward`
will not modify the underlying optional value.
This fixes llvm#59705
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D147383
AMS21 [Tue, 4 Apr 2023 06:35:08 +0000 (06:35 +0000)]
[clang-tidy] Fix readability-static-accessed-through-instance check for anonymous structs
Previously we would provide a fixit which looked like
this `unnamed struct at ...::f()` but which is obviously
not valid C/C++.
Since there is no real nice way to accesses a static function
from an anonymous struct anyways we simply ignore all
anonymous structs.
Fixes llvm#61736
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D147411
Martin Braenne [Mon, 3 Apr 2023 14:45:13 +0000 (14:45 +0000)]
[clang][dataflow] Add `create<T>()` methods to `Environment` and `DataflowAnalysisContext`.
These methods provide a less verbose way of allocating `StorageLocation`s and
`Value`s than the existing `takeOwnership(make_unique(...))` pattern.
In addition, because allocation of `StorageLocation`s and `Value`s now happens
within the `DataflowAnalysisContext`, the `create<T>()` open up the possibility
of using `BumpPtrAllocator` to allocate these objects if it turns out this
helps performance.
Reviewed By: ymandel, xazax.hun, gribozavr2
Differential Revision: https://reviews.llvm.org/D147302
LLVM GN Syncbot [Tue, 4 Apr 2023 06:25:30 +0000 (06:25 +0000)]
[gn build] Port
39fc67b8af70
Shengchen Kan [Tue, 4 Apr 2023 05:00:14 +0000 (13:00 +0800)]
[X86][NFC] Compress CD8_Scale from 7 bits to 3 bits
Post: https://discourse.llvm.org/t/save-some-bits-in-tsflags-for-x86/69025
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D147500
Pavel Kosov [Tue, 4 Apr 2023 06:17:50 +0000 (09:17 +0300)]
[llvm-exegesis] Factor out DisassemblerHelper from the Analysis class
As part of preparing the reports, the Analysis class needs to print
machine instructions in a disassembled form. For this purpose, the class
has four fields (namely Context_, AsmInfo_, InstPrinter_ and Disasm_).
All the constructor of the Analysis class does is conditionally
initializing these four fields.
This commit factors out the logic for decoding machine code and printing
it in an assembler form into a separate DisassemblerHelper class.
~~
Huawei RRI, OS Lab
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D147156
Craig Topper [Tue, 4 Apr 2023 06:14:02 +0000 (23:14 -0700)]
[IR] Replace calls to ConstantFP::getNullValue with ConstantFP::getZero. NFC
There is no getNullValue in ConstantFP. Due to inheritance, we're calling
Constant::getNullValue which handles any type including FP.
Since we already know we want an FP constant we can use ConstantFP::getZero
which might be faster and is a more readable name for an FP zero.
Vitaly Buka [Tue, 4 Apr 2023 03:42:16 +0000 (20:42 -0700)]
Revert "asan_memory_profile: Fix for deadlock in memory profiler code."
Deadlocks with internal symbolizer.
https://lab.llvm.org/buildbot/#/builders/37/builds/21181
This reverts commit
129394ff50ed28a0b85d742c8ae315758bb22582.
LLVM GN Syncbot [Tue, 4 Apr 2023 05:30:21 +0000 (05:30 +0000)]
[gn build] Port
50b2a113db19
serge-sans-paille [Wed, 2 Nov 2022 07:52:29 +0000 (08:52 +0100)]
Move "auto-init" instructions to the dominator of their users
As a result of -ftrivial-auto-var-init, clang generates instructions to
set alloca'd memory to a given pattern, right after the allocation site.
In some cases, this (somehow costly) operation could be delayed, leading
to conditional execution in some cases.
This is not an uncommon situation: it happens ~500 times on the cPython
code base, and much more on the LLVM codebase. The benefit greatly
varies on the execution path, but it should not regress on performance.
This is a recommit of
cca01008cc31a891d0ec70aff2201b25d05d8f1b with
MemorySSA update fixes.
Differential Revision: https://reviews.llvm.org/D137707
Craig Topper [Tue, 4 Apr 2023 05:13:36 +0000 (22:13 -0700)]
[X86] Remove stale comment. NFC
David Blaikie [Fri, 18 Nov 2022 00:26:40 +0000 (00:26 +0000)]
PR58819: Correct linkage and mangling of lambdas in inline static member initializers
https://llvm.org/pr58819 - clang is giving an externally visible lambda in a static data member internal linkage and the wrong linkage name.
Looks like we should be classifying this case the same as a non-static data member, so far as I can tell from the ABI docs and template examples (seems like the non-template inline-defined case should be the same).
This is a change in ABI, but not sure it qualifies as an ABI break as far as Apple and Sony are concerned - do you folks want this change? (it should fix the example in the bug where a static member in such a lambda ends up bifurcated, and I don't /think/ it'll break existing code since the symbol was previously internal anyway)
Looks like GCC has got this mangling slightly wrong (so we'd still end up with GCC+Clang bifurcation of the local static in the lambda, function address inequality, etc) in that they miss the variable name in the mangling in the non-template case. GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107741
Differential Revision: https://reviews.llvm.org/D138247
Amara Emerson [Mon, 3 Apr 2023 23:12:58 +0000 (16:12 -0700)]
[AArch64][GlobalISel] Move the localizer to run before the legalizer, and always localize globals.
Our strategy for localizing globals in the entry block breaks down when we have
large functions with high register pressure, using lots of globals. When this
happens, our heuristics say that globals with many uses should not be localized,
leading us to cause excessive spills and stack usage. These situations are also
exacerbated by LTO which tends to generate large functions.
For now, moving to a strategy that's simpler and more akin to SelectionDAG
fixes these issues and makes our codegen more similar. This has an overall
neutral effect on size on CTMark, while showing slight improvements with -Os -flto
on benchmarks. For low level firmware software though we see big improvements.
The reason this is neutral, and not an improvement, is because we give up the
gains from CSE'ing globals in cases where we low register pressure. I think
this can be addressed in future with some better heuristics.
Differential Revision: https://reviews.llvm.org/D147484
Enna1 [Tue, 4 Apr 2023 03:24:46 +0000 (11:24 +0800)]
[hwasan] Record allocation thread id in HeapAllocationRecord
Extend HeapAllocationRecord to record allocation thread id, print thread id in memory allocation stack trace.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D147215
Vitaly Buka [Tue, 4 Apr 2023 03:01:24 +0000 (20:01 -0700)]
[lsan] Fix Asan/Hwasan testing conditions
Vitaly Buka [Tue, 4 Apr 2023 03:00:38 +0000 (20:00 -0700)]
[sanitizer] Add new symbolizer symbol
Alexander Shaposhnikov [Tue, 4 Apr 2023 02:22:08 +0000 (02:22 +0000)]
[Clang][Sema] Fix comparison of constraint expressions
This diff switches the approach to comparison of constraint expressions
to the new one based on template args substitution.
It continues the effort to fix our handling of out-of-line definitions
of constrained templates.
The associated GitHub issue: https://github.com/llvm/llvm-project/issues/61414
Test plan:
1/ ninja check-all
2/ bootstrapped Clang passes tests
Differential revision: https://reviews.llvm.org/D146178
Shengchen Kan [Mon, 3 Apr 2023 14:15:47 +0000 (22:15 +0800)]
[X86][NFC] Combine HasVEX_W with hasREX_W to save 1 bit of TSFlags
Post: https://discourse.llvm.org/t/save-some-bits-in-tsflags-for-x86/69025
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D147443
LLVM GN Syncbot [Tue, 4 Apr 2023 01:55:14 +0000 (01:55 +0000)]
[gn build] Port
038b7e6b761c
Xiang1 Zhang [Fri, 31 Mar 2023 08:56:06 +0000 (16:56 +0800)]
[X86] Support AMX Complex instructions
Reviewed By: Wang Pengfei
Differential Revision: https://reviews.llvm.org/D147420
Chia-hung Duan [Tue, 4 Apr 2023 00:58:40 +0000 (00:58 +0000)]
[scudo] Temporarily disable the build of Timer.
The placeholder was %llu while merged but it may cause problem on some
platforms that enable -Wformat. It was incorrect changed to %lu which
cause the test failure because string_utils doesn't support %lu. Will
bring this back after we fix the placeholder.
Differential Revision: https://reviews.llvm.org/D147490
Nemanja Ivanovic [Tue, 4 Apr 2023 00:59:30 +0000 (19:59 -0500)]
[SmallVector] Fix unit test to eliminate failure with -Werror
Commit
475dd6f626ee2679578ed570e9fb78f7e957a36d added
a unit test that compares SmallVector::size() (a size_t
value) against 42 (an int value). That causes failures with
-Werror. This patch just adds the cast to silence the warning.
Thurston Dang [Tue, 4 Apr 2023 00:42:37 +0000 (00:42 +0000)]
Update __sanitizer_get_allocated_begin to return const void*
D147005 introduced __sanitizer_get_allocated_begin, with a return
value of void*. This involved a few naughty casts that dropped the
const. This patch adds back the const qualifier.
Differential Revision: https://reviews.llvm.org/D147489
Zequan Wu [Mon, 3 Apr 2023 17:01:14 +0000 (13:01 -0400)]
[NFC] Update CodeGen/*/nomerge.ll tests with utils/update_llc_test_checks.py.
Precommit this patch for better diff view on D146749.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D147454
Jie Fu [Mon, 3 Apr 2023 23:48:33 +0000 (07:48 +0800)]
[compiler-rt] Fix -Wformat in timing.h (NFC)
/home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:181:41: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
Str.append("%14llu.%llu(ns) %-11s", Integral, Fraction, " ");
~~~~~~ ^~~~~~~~
%14lu
/home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:181:51: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
Str.append("%14llu.%llu(ns) %-11s", Integral, Fraction, " ");
~~~~ ^~~~~~~~
%lu
/home/jiefu/llvm-project/compiler-rt/lib/scudo/standalone/timing.h:185:54: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat]
Str.append("%s (%llu)\n", Timers[HandleId].Name, Occurrence);
~~~~ ^~~~~~~~~~
%lu
3 errors generated.
Stefan Pintilie [Mon, 3 Apr 2023 23:45:27 +0000 (19:45 -0400)]
[PowerPC][NFC] Forgot to add requires asserts to ppc-TOC-stats.ll
When I sumbitted the original patch I forgot to add that:
GodeGen/PowerPC/ppc-TOC-stats.ll
requires asserts.
Added that now.
Jie Fu [Mon, 3 Apr 2023 23:40:34 +0000 (07:40 +0800)]
[compiler-rt] Fix -Wcast-qual after D147005 (NFC)
/home/jiefu/llvm-project/compiler-rt/lib/lsan/lsan_allocator.cpp:161:18: error: cast from 'const void *' to 'void *' drops const qualifier [-Werror,-Wcast-qual]
return (void *)beg;
^
1 error generated.
wren romano [Mon, 3 Apr 2023 19:55:59 +0000 (12:55 -0700)]
[mlir][sparse] Using SparseTensorType in SparsePackOpConverter
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D147465
Philip Reames [Mon, 3 Apr 2023 22:48:44 +0000 (15:48 -0700)]
[RISCV] Add cost and lowering tests for "transpose" shuffle kinds
These just hit the generic two argument shuffle lowering right now, but that's not how their costed.
Chia-hung Duan [Fri, 24 Mar 2023 22:54:41 +0000 (22:54 +0000)]
Reland "[scudo] Add a Timer class to assist performance measurement"
This reverts commit
2e9bcadb7c8acaa8f6ec7d807e5666246923e468.
Differential Revision: https://reviews.llvm.org/D146772
Craig Topper [Mon, 3 Apr 2023 22:15:48 +0000 (15:15 -0700)]
[SelectionDAG] Use MemVT for FoldingSetNodeID in SelectionDAG::getLoadVP.
Return types and operands are put in the ID by AddNodeIDNode. I'm
pretty sure this was supposed to be the memory VT.
Diego Caballero [Mon, 3 Apr 2023 21:36:13 +0000 (21:36 +0000)]
[mlir][Vector] Enable masking for ops with index semantics
Masking was already supported for linalg.index and n-D extract but
disabled while waiting for some n-D extract vectorization patches to
land. This patch is just enabling masking for them and adding a couple
of tests.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D147359
Diego Caballero [Mon, 3 Apr 2023 21:34:38 +0000 (21:34 +0000)]
[mlir][Vector][NFC] Small vector masking clean-up
We stored static (int) and dynamic (Value) iteration space dims separately
and then merged them by creating constant ops for the static ones. This
merge happened multiple times during vectorization. This PR changes that
to perform the merge once and store in the state instead of the dynamic
values in isolation.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D147351
Joseph Huber [Mon, 3 Apr 2023 21:53:41 +0000 (16:53 -0500)]
[Clang] Fix failing test on windows and add TODO for gpu headers
Summary:
This test failed because of the path separators on Windows. Also this
was a good excuse to add an extra TODO that @tra wanted.
Thurston Dang [Mon, 3 Apr 2023 21:14:40 +0000 (21:14 +0000)]
Add __sanitizer_get_allocated_begin API and implementations
This function will return the start of the allocation, if given a pointer that lies within an allocation. Otherwise, it returns NULL.
It will be useful for detecting dynamic TLS allocations in glibc >=2.25, which
uses malloc (see https://github.com/google/sanitizers/issues/1409#issuecomment-
1214244142).
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D147005
Craig Topper [Mon, 3 Apr 2023 21:02:26 +0000 (14:02 -0700)]
[SelectionDAG] Move variable declaration to its first assignment. NFC
We declared this variable and assigned it to true, but then overwrote
it before its first use.
Craig Topper [Mon, 3 Apr 2023 20:59:55 +0000 (13:59 -0700)]
[SelectionDAGBuilder] Use SmallVectorImpl& for function arguments. NFC
Make the reference const since we aren't modifying the vectors.
Philip Reames [Mon, 3 Apr 2023 20:53:22 +0000 (13:53 -0700)]
[RISCV][docs] Document which revision of the specification we implement
This is intended to document the decision made in recent discussion, and ratified at the last risc-v sync up call two weeks ago.
The wording here turned out to be a bit tricky. I ended up using the word "revision" as the specification internally defines several versioning schemes, and RVI assigns particular meaning to the words "specification version" that I really didn't want to get into. If anyone has suggestions on how to improve this, please don't hesitate to chime in.
Differential Revision: https://reviews.llvm.org/D147183
Jason Molenda [Mon, 3 Apr 2023 20:49:51 +0000 (13:49 -0700)]
Using global variable in xnu kernel, set # of addressable bits
The kernel has a global variable with the TCR_EL1.T1SZ value,
from which was can calculate the number of addressable bits.
Find that symbol in DynamicLoaderDarwinKernel and set the bits
to that value for this Process.
Differential Revision: https://reviews.llvm.org/D147462
rdar://
107445318
walter erquinigo [Mon, 3 Apr 2023 16:32:53 +0000 (11:32 -0500)]
[LLDB] Ensure LLDB symbols are exported in LLDB_EXPORT_ALL_SYMBOLS is provided.
If we want to export all lldb symbols (i.e LLDB_EXPORT_ALL_SYMBOLS=ON), we need to use default visibility for all LLDB libraries even if a global CMAKE_CXX_VISIBILITY_PRESET=hidden is present. In fact, there are cases in which a global llvm configuration wants CMAKE_CXX_VISIBILITY_PRESET as hidden but simultaneously LLDB_EXPORT_ALL_SYMBOLS=ON is also needed to be able to develop out-of-tree lldb plugins.
Differential Revision: https://reviews.llvm.org/D147453
Rafael A. Herrera Guaitero [Mon, 3 Apr 2023 20:29:16 +0000 (20:29 +0000)]
[OpenMP][5.1] Fix parallel masked is ignored #59939
Code generation support for 'parallel masked' directive.
The `EmitOMPParallelMaskedDirective` was implemented.
In addition, the appropiate device functions were added.
Fix #59939.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D143527
Craig Topper [Mon, 3 Apr 2023 20:22:36 +0000 (13:22 -0700)]
[SmallVector] Add an explicit SmallVector(size_t Size) constructor.
Previously we used the SmallVector(size_t Size, const T& Value) constructor
with a default constructed Value. That will copy construct every element
in the vector, but not all types can be copy constructed.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D147426
Alex Langford [Mon, 3 Apr 2023 20:08:52 +0000 (13:08 -0700)]
[lldb][NFC] Remove outdated TODO message
This should have been removed in
a52054cfa29d
Aaron Ballman [Mon, 3 Apr 2023 19:31:20 +0000 (15:31 -0400)]
Update Clang 16 statuses
Updates the C status tracking page for the recent release.
Aaron Ballman [Mon, 3 Apr 2023 19:19:15 +0000 (15:19 -0400)]
[C2x] Implement support for empty brace initialization (WG14 N2900 and WG14 N3011)
This implements support for allowing {} to consistently zero initialize
objects. We already supported most of this work as a GNU extension, but
the C2x feature goes beyond what the GNU extension allowed.
The changes in this patch are:
* Removed the -Wgnu-empty-initializer warning group. The extension is
now a C2x extension warning instead. Note that use of
`-Wno-gnu-empty-initializer seems` to be quite low in the wild
(https://sourcegraph.com/search?q=context%3Aglobal+-file%3A.*test.*+%22-Wno-gnu-empty-initializer%22&patternType=standard&sm=1&groupBy=repo
which currently only gives 8 hits total), so this is not expected to
be an overly disruptive change. But I'm adding the clang vendors
review group just in case this expectation is wrong.
* Reworded the diagnostic wording to be about a C2x extension, added a
pre-C2x compat warning.
* Allow {} to zero initialize a VLA
This functionality is exposed as an extension in all older C modes
(same as the GNU extension was), but does *not* allow the extension for
VLA initialization in C++ due to concern about handling non-trivially
constructible types.
Differential Revision: https://reviews.llvm.org/D147349
rkayaith [Tue, 28 Mar 2023 23:00:40 +0000 (19:00 -0400)]
[mlir] Improve FieldParser list container detection
The current detection logic will fail for containers with an overloaded
`push_back` member. This causes issues with types like `std::vector` and
`SmallVector<SomeNonTriviallyCopyableT>`, which have both
`push_back(const T&)` and `push_back(T&&)`.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D147101
Graham Markall [Mon, 3 Apr 2023 18:15:36 +0000 (11:15 -0700)]
[RuntimeDyld] RuntimeDyldELF: Clear GOTOffsetMap when resetting GOT section.
When the GOT section ID is reset, the GOTOffsetMap must also be cleared,
otherwise spurious matches can be located when handling GOT relocations
in subsequently-linked objects.
Fixes Issue #61402 - see https://github.com/llvm/llvm-project/issues/61402.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D146938
Stefan Pintilie [Fri, 31 Mar 2023 18:42:58 +0000 (14:42 -0400)]
[PowerPC] Add statistics to show the number of entries in the TOC.
On Power PC some data is stored in the TOC. This pass adds statistics
to show how many entries are emitted to the TOC and what types of
entries those are.
Reviewed By: amyk
Differential Revision: https://reviews.llvm.org/D146325
Job Noorman [Mon, 3 Apr 2023 18:18:19 +0000 (20:18 +0200)]
[JITLink][ELF] Only make sections with SHF_WRITE writable
All non-executable sections used to be mapped as RW- causing read-only
sections such as .rodata to be writable.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D147442
Caslyn Tonelli [Mon, 3 Apr 2023 18:04:48 +0000 (11:04 -0700)]
[libc] Add strchrnul implementation
Introduce strchrnul implementation and unit tests.
Submitting on behalf of Caslyn@
Differential Revision: https://reviews.llvm.org/D147346
Mehdi Amini [Mon, 3 Apr 2023 18:05:37 +0000 (11:05 -0700)]
Revert "[mlir] Introduce IRDL dialect"
This reverts commit
31229d48bbfd394b64179d9be94f74ab70c84630.
The build is broken with shared library mode.
Philip Reames [Mon, 3 Apr 2023 18:03:14 +0000 (11:03 -0700)]
[LV] Remmove unused default argument to isLegalGatherOrScatter [nfc]
Joseph Huber [Mon, 27 Mar 2023 15:01:12 +0000 (10:01 -0500)]
[Clang] Implicitly include LLVM libc headers for the GPU
There is currently work to support basic `libc` functionality on the
GPU. Some basic information about the projects can be found at
https://libc.llvm.org/gpu_mode.html. Typically, including the system
headers on the GPU will result in an error. For this reason the LLVM
`libc` project will generate its own headers that can be used with the
GPU.
The problem is that these headers will use the same name as the system headers.
For that reason, D146970 places it in the `llvm-libc` subfolder. In order to
still pick these files up, this patch adds changes in clang to default to
searching this directory when targeting the GPU. This lets offloading languages
such as OpenMP use the system `string.h` when compiling for the host and then
the LLVM libc `string.h` when targeting the GPU.
Depends on D146970
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D146973
Mahesh Ravishankar [Mon, 3 Apr 2023 17:31:36 +0000 (17:31 +0000)]
[mlir][MemRef] Add pattern to resolve strided metadata of `memref.get_global` operation.
This changes adds patterns to resolve the base pointer, offset, sizes
and strides of the result of a `memref.get_global` operation. Since
the operation can only result in static shaped memrefs, current
resolution kicks in only for non-zero offsets, and identity strides.
Also
- Add a separate `populateResolveExtractStridedMetadata` method that
adds just the pattern to resolve `<memref op>` ->
`memref.extract_strided_metadata` operations.
- Refactor the `SubviewFolder` pattern to allow resolving
`memref.subview` -> `memref.extract_strided_metadata`.
This allows using these patterns for cases where there are already
existing `memref.extract_strided_metadata` operations.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D147393
Mathieu Fehr [Mon, 3 Apr 2023 16:42:53 +0000 (09:42 -0700)]
[mlir] Introduce IRDL dialect
This patch introduces the IRDL dialect, which allow users to represent
dynamic dialect definitions as an MLIR program.
The IRDL dialect defines operations, attributes, and types, using
attribute constraints. For example:
```
module {
irdl.dialect @cmath {
irdl.type @complex {
%0 = irdl.is f32
%1 = irdl.is f64
%2 = irdl.any_of(%0, %1)
irdl.parameters(%2)
}
irdl.operation @norm {
%0 = irdl.any
%1 = irdl.parametric @complex<%0>
irdl.operands(%1)
irdl.results(%0)
}
}
```
This program will define a new `cmath.complex` type, which expects a single
parameter, which is either an `f32` or an `f64`. It also defines an
`cmath.norm` operation, which expects a single `cmath.complex` type as operand,
and returns a value of the underlying type. Note that like PDL (which IRDL is
heavily inspired from), both uses of `%0` are expected to be of the same attribute.
IRDL handles attributes and types with the same operations, and does this by always
wrapping types in a `TypeAttr`. This is to simplify the language.
Depends on D144690
Reviewed By: rriddle, mehdi_amini
Differential Revision: https://reviews.llvm.org/D144692
Logan Gnanapragasam [Mon, 3 Apr 2023 16:37:56 +0000 (16:37 +0000)]
[clang-tidy] ignore NRVO const variables in performance-no-automatic-move.
In the following code:
```cc
struct Obj {
Obj();
Obj(const Obj &);
Obj(Obj &&);
virtual ~Obj();
};
Obj ConstNrvo() {
const Obj obj;
return obj;
}
```
performance-no-automatic-move warns about the constness of `obj`. However, NRVO
is applied to `obj`, so the `const` should have no effect on performance.
This change modifies the matcher to exclude NRVO variables.
#clang-tidy
Reviewed By: courbet, PiotrZSL
Differential Revision: https://reviews.llvm.org/D147419
Noah Goldstein [Mon, 3 Apr 2023 16:59:32 +0000 (11:59 -0500)]
Revert "[X86] Simplify some `pternlog` intrinsics"
This reverts commit
cacc0033b12b2e6400eedd6e449644e87ec3099b.
Joseph Huber [Mon, 3 Apr 2023 16:54:48 +0000 (11:54 -0500)]
[libc] Free the GPU memory allocated in the device loaders
Summary:
This part was ignored and we just hoped that shutting down the runtime
freed these correctly. But it's best to be specific and free the memory
we've allocated.
Simon Pilgrim [Mon, 3 Apr 2023 16:17:52 +0000 (17:17 +0100)]
[X86] combineMOVMSK - merge movmsk(icmp_eq(and(x,c1),c1)) and movmsk(icmp_eq(and(x,c1),0)) folds
Use the same value tracking implementation for both, removing hardcoded PCMPEQ(AND(X,C),C) pattern so to handle bitcasted logic/constants.
Simon Pilgrim [Mon, 3 Apr 2023 16:12:11 +0000 (17:12 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.
Peter Klausler [Thu, 30 Mar 2023 20:34:32 +0000 (13:34 -0700)]
[flang] Don't allow CALL RANDOM_NUMBER(assumed-size-array)
The extents, if any, of the HARVEST= actual argument must be known
at execution time for the call to be implemented.
Differential Revision: https://reviews.llvm.org/D147391
Noah Goldstein [Mon, 3 Apr 2023 04:40:38 +0000 (23:40 -0500)]
[X86] Simplify some `pternlog` intrinsics
Currently `pternlog` intrinsics stay as a function call and are unable
to merge with other bin-ops / constant-fold.
This commit adds support for reducing all `pternlog` intrinsics to
their base logic-ops so that they can be further reduced in other
passes.
Since the x86 backend doesn't do a great job creating `vpternlog`
instructions from stray logic ops, the current logic only simplifies
in the cases were we obviously will be able to do as good or
better. As the x86 backend improves, more cases can be simplified.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D145220
Noah Goldstein [Fri, 3 Mar 2023 04:12:35 +0000 (22:12 -0600)]
[X86] Add tests for simplifying pternlog intrinsics; NFC
Differential Revision: https://reviews.llvm.org/D145219
Noah Goldstein [Mon, 3 Apr 2023 04:40:08 +0000 (23:40 -0500)]
[InstSimplify] Extend simplifications for `(icmp ({z|s}ext X), C)` where `C` is vector
Previous logic only applied for `ConstantInt` which misses all vector
cases. New code works for splat/non-splat vectors as well. No change
to the underlying simplifications.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D147275
Noah Goldstein [Thu, 30 Mar 2023 21:16:46 +0000 (16:16 -0500)]
[InstSimplify] Add tests for simplifying `(icmp ({z|s}ext X), C)` where `C` is vector; NFC
Differential Revision: https://reviews.llvm.org/D147274
Peter Klausler [Thu, 30 Mar 2023 19:43:47 +0000 (12:43 -0700)]
[flang] NORM2(DIM=) argument can't be dynamically optional
The intrinsic function table entry for NORM2 treats its DIM=
argument as if it can be dynamically optional; this is wrong,
and it should be treated in the same way as DIM= is for other
transformational intrinsic functions like SUM.
Differential Revision: https://reviews.llvm.org/D147390
Peter Klausler [Wed, 29 Mar 2023 15:56:31 +0000 (08:56 -0700)]
[flang] Resolve USE vs IMPORT conflicts
When the same name is pulled into a scope more than once via
USE and IMPORT, emit an error if its resolutions are ambiguous,
or (as an extension like some other compilers) emit a portability
warning when the names all resolve to the same symbol.
Differential Revision: https://reviews.llvm.org/D147388
Jon Chesterfield [Mon, 3 Apr 2023 12:44:11 +0000 (13:44 +0100)]
[amdgpu][nfc] Refactor prior to D144233 to remove noise from diff
Cyndy Ishida [Mon, 3 Apr 2023 14:29:25 +0000 (07:29 -0700)]
[llvm][TextAPI] Ignore deployment version in target comparator
Timm Bäder [Mon, 3 Apr 2023 15:11:31 +0000 (17:11 +0200)]
[clang][Interp] Add missing static_assert message
This broke builders, e.g:
https://lab.llvm.org/buildbot/#builders/139/builds/38457
Joseph Huber [Mon, 3 Apr 2023 15:08:32 +0000 (10:08 -0500)]
[libc] Improve copying system vectors to the GPU
Summary:
This implementation was buggy and inefficient. Fine-grained memory can
only be allocated on a page-level granularity. Which means that each
allocated string used about 4096 bytes. This is wasteful in general, and
also allowed for buggy behaviour. The previous copying of the
environment vector only worked because the large buffer size meant that
we would typically have a null byte after the allocated memory. However
this would break if the vector was larger than a page. This patch
allocates everything into a single buffer. It makes it easier to free,
use, and it more correct.
Timm Bäder [Fri, 17 Feb 2023 15:56:47 +0000 (16:56 +0100)]
[clang][Interp] Ignore StaticAssertDecls
They have already been handled before, but we can't just return false
when we encounter one.
Differential Revision: https://reviews.llvm.org/D144272
Alexey Bataev [Mon, 3 Apr 2023 13:50:07 +0000 (06:50 -0700)]
[SLP]Reorder counters for same values, if the root node is reordered.
The counters for the repeated scalars are ordered in the natural order,
but the original scalars might be reordered during SLP graph reordering
and this order can be dropped. Need to use the scalars after the
reordering, not the original ones, to emit correct code for same value
counters.
Timm Bäder [Sun, 5 Feb 2023 07:39:40 +0000 (08:39 +0100)]
[clang][Interp][NFC] Refactor VisitDeclRefExpr
Make it clearer that we only need to check for variables and parameters
if we don't have the easy case. Also only do the IsReference check if
necessary.
Nikita Popov [Mon, 3 Apr 2023 14:32:59 +0000 (16:32 +0200)]
[Clang] Update test checks (NFC)
These were affected by
9b5ff4436e446e9df97ee37b3bcf9ba029c7d9aa.
Kadir Cetinkaya [Mon, 3 Apr 2023 14:26:06 +0000 (16:26 +0200)]
[include-cleaner] Treat member operator calls as implicit
26ff268b80c589fd9f71c1c214af77cd972642ca treated member operator calls
as explicit, while trying to treat them the same way as regular member
expressions, which should've been implicit.
Alexey Bataev [Mon, 3 Apr 2023 14:15:14 +0000 (07:15 -0700)]
[SLP][NFC]Add a test for reordered scalars with not reordered reuse coefficient.
Simon Pilgrim [Mon, 3 Apr 2023 14:07:11 +0000 (15:07 +0100)]
[X86] combineMOVMSK - fold movmsk(icmp_eq(and(x,c1),c1)) -> movmsk(shl(x,c2)) iff pow2splat(c1)
We already have a similar fold for movmsk(icmp_eq(and(x,c1),0)) which we can probably merge this with, but it will involve generalizing a lot of the knownbits code
Simon Pilgrim [Mon, 3 Apr 2023 13:30:32 +0000 (14:30 +0100)]
[X86] MatchVectorAllZeroTest - handle icmp_eq(bitcast(vXi1 trunc(Y)),0) style reduction patterns
If we've truncated from a wider vector, then perform the all vector comparison on that with a suitable mask
There's a minor pre-SSE41 regression due to a missing movmsk(icmp_eq(and(x,c1pow2),c1pow2)) -> movmsk(shl(x,c2)) fold that will be addressed in a followup commit