David Green [Fri, 5 Aug 2022 06:48:42 +0000 (07:48 +0100)]
[AArch64][GlobalISel] Recognise some CCMPri
This is a simple addition to emitConditionalComparison, to match CCMP
with immediates using getIConstantVRegValWithLookThrough, letting it
select the CCMPri variants of the instructions.
Differential Revision: https://reviews.llvm.org/D131073
Xiang Li [Fri, 5 Aug 2022 06:05:46 +0000 (23:05 -0700)]
[NFC][HLSL] Fix build error caused missing typo update.
setHLSLFnuctionAttributes to setHLSLFunctionAttributes.
Differential Revision: https://reviews.llvm.org/D131240
Xiang Li [Fri, 5 Aug 2022 06:05:46 +0000 (23:05 -0700)]
[NFC][HLSL] Fix typo in CGHLSLRuntime.
Change setHLSLFnuctionAttributes to setHLSLFunctionAttributes.
Differential Revision: https://reviews.llvm.org/D131238
Austin Kerbow [Fri, 5 Aug 2022 05:51:39 +0000 (22:51 -0700)]
[AMDGPU] Pre-commit tests for D130797
Timm Bäder [Thu, 4 Aug 2022 10:53:06 +0000 (12:53 +0200)]
[clang] Consider array filler in MaybeElementDependentArrayfiller()
Any InitListExpr may have an array filler and since we may be evaluating
the array filler as well, we need to take into account that the array
filler expression might make the InitListExpr element dependent.
Fixes https://github.com/llvm/llvm-project/issues/56016
Differential Revision: https://reviews.llvm.org/D131155
Timm Bäder [Wed, 3 Aug 2022 15:05:07 +0000 (17:05 +0200)]
[clang][sema] Fix collectConjunctionTerms()
Consider:
A == 5 && A != 5
IfA is 5, the old collectConjunctionTerms() would call itself again for
the LHS (which it ignores), then the RHS (which it also ignores) and
then just return without ever adding anything to the Terms array.
Differential Revision: https://reviews.llvm.org/D131070
Xiang Li [Mon, 2 May 2022 07:04:00 +0000 (00:04 -0700)]
[HLSL] clang codeGen for HLSLShaderAttr.
Translate HLSLShaderAttr to IR level.
1. Skip mangle for hlsl entry functions.
2. Add function attribute for hlsl entry functions.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D124752
Shilei Tian [Fri, 5 Aug 2022 03:54:07 +0000 (23:54 -0400)]
[NFC] Fix wrong header in `LibC.cpp`
Paul Kirth [Fri, 5 Aug 2022 01:39:01 +0000 (01:39 +0000)]
[llvm][ir] Add missing license to ProfDataUtils
We failed to add these in D128860 or D128858
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D131226
Florian Mayer [Thu, 4 Aug 2022 22:02:52 +0000 (15:02 -0700)]
[libunwind] undef NDEBUG for assert.h in tests.
This makes sure the assertions also get verified in optimized builds.
This matches what is already done in bad_unwind_info.pass.cpp.
Reviewed By: #libunwind, MaskRay
Differential Revision: https://reviews.llvm.org/D131210
Jeff Bailey [Fri, 5 Aug 2022 02:44:02 +0000 (02:44 +0000)]
[libc] Trivial implementation of std::optional
This class has only the minimum functionality in it to provide what the
TZ variable parsing needs. In particular, the standard makes guarantees
about how trivial the destructors are, throws an expception if it's used
incorrectly, etc. There are also missing features.
Tested:
Trivial testsuite added, and use in development.
Reviewed By: gchatelet
Differential Revision: https://reviews.llvm.org/D129920
jacquesguan [Wed, 3 Aug 2022 06:58:05 +0000 (14:58 +0800)]
[mlir][Math] Add constant folder for Atan2Op.
This patch adds constant folder for Atan2Op which only supports single and double precision floating-point.
Differential Revision: https://reviews.llvm.org/D131050
Phoebe Wang [Fri, 5 Aug 2022 01:58:34 +0000 (09:58 +0800)]
Reland "[X86][MC] Always emit `rep` prefix for `bsf`"
`BMI` new instruction `tzcnt` has better performance than `bsf` on new
processors. Its encoding has a mandatory prefix '0xf3' compared to
`bsf`. If we force emit `rep` prefix for `bsf`, we will gain better
performance when the same code run on new processors.
GCC has already done this way: https://c.godbolt.org/z/6xere6fs1
Fixes #34191
Reviewed By: craig.topper, skan
Differential Revision: https://reviews.llvm.org/D130956
Tue Ly [Thu, 4 Aug 2022 20:04:14 +0000 (16:04 -0400)]
[libc] Add subtraction for UInt<N> class.
Add subtraction operators (-, -=) for UInt<N> class.
Reviewed By: michaelrj, orex
Differential Revision: https://reviews.llvm.org/D131196
Walter Erquinigo [Thu, 4 Aug 2022 23:24:37 +0000 (16:24 -0700)]
[trace][intel pt] Support a new kernel section in LLDB’s trace bundle schema
Add a new "kernel" section with following schema.
```
"kernel": {
"loadAddress"?: decimal | hex string | string decimal
# This is optional. If it's not specified, use default address 0xffffffff81000000.
"file": string
# path to the kernel image
}
```
Here's more details of the diff:
- If "kernel" section exist, it means current tracing mode is //KernelMode//.
- If tracing mode is //KernelMode//, the "processes" section must be empty and the "kernel" and "cpus" section must be provided. This is tested with `TestTraceLoad`.
- "kernel" section is parsed and turned into a new process with a single module which is the kernel image. The kernel process has N fake threads, one for each cpu.
Reviewed By: wallace
Differential Revision: https://reviews.llvm.org/D130805
Ellis Hoag [Fri, 29 Jul 2022 21:49:44 +0000 (14:49 -0700)]
[InstrProf][attempt 2] Add new format for -fprofile-list=
In D130807 we added the `skipprofile` attribute. This commit
changes the format so we can either `forbid` or `skip` profiling
functions by adding the `noprofile` or `skipprofile` attributes,
respectively. The behavior of the original format remains
unchanged.
Also, add the `skipprofile` attribute when using
`-fprofile-function-groups`.
This was originally landed as https://reviews.llvm.org/D130808 but was
reverted due to a Windows test failure.
Differential Revision: https://reviews.llvm.org/D131195
Richard Smith [Fri, 5 Aug 2022 00:07:43 +0000 (17:07 -0700)]
Fix parsing of comma fold-expressions as the operand of a C-style cast.
Xiang Li [Sat, 23 Apr 2022 05:56:15 +0000 (22:56 -0700)]
[HLSL] Support -E option for HLSL.
-E option will set entry function for hlsl.
The format is -E entry_name.
To avoid conflict with existing option with name 'E', add an extra prefix '--'.
A new field HLSLEntry is added to TargetOption.
To share code with HLSLShaderAttr, entry function will be add HLSLShaderAttr attribute too.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D124751
Arthur Eubanks [Thu, 4 Aug 2022 23:32:34 +0000 (16:32 -0700)]
[test][llvm-reduce] Use opaque pointers in tests
Siva Chandra Reddy [Wed, 27 Jul 2022 21:24:07 +0000 (21:24 +0000)]
[libc][NFC] Add a few compiler warning flags.
A bunch of cleanup to supress the new warnings is also done.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D130723
Kevin Gleason [Thu, 4 Aug 2022 23:22:50 +0000 (23:22 +0000)]
[MLIR] Fix arith.cmpi assembly syntax in the doc to match the implementation (NFC)
Kevin Gleason [Thu, 4 Aug 2022 23:15:07 +0000 (23:15 +0000)]
[MLIR] Fix arith.cmpf assembly syntax in the doc to match the implementation (NFC)
Matt Arsenault [Thu, 4 Aug 2022 02:44:51 +0000 (22:44 -0400)]
AMDGPU/clang: Remove dead code
The order has to be a constant and should be enforced by the builtin
definition. The fallthrough behavior would have been broken anyway.
There's still an existing issue/assert if you try to use garbage for the
ordering. The IRGen should be broken, but we also hit another assert
before that.
Fixes issue 56832
Leonard Chan [Thu, 4 Aug 2022 22:56:32 +0000 (22:56 +0000)]
Revert "[clang][Darwin] Always set the default C++ Standard Library to libc++"
This reverts commit
c5ccb78ade8136134e0ca9dde64de97f913f0f8c.
We're seeing darwin-stdlib.cpp fail on our linux, mac, and windows
builders:
https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/
b8806821020552676065/overview
Alex Langford [Thu, 4 Aug 2022 18:53:28 +0000 (11:53 -0700)]
Re-submit "[lldb] Filter DIEs based on qualified name where possible"
This reverts commit
967df65a3610f98a3bc0ec0f2303641d7bad176c.
This fixes test/Shell/SymbolFile/NativePDB/find-functions.cpp. When
looking up functions with the PDB plugins, if we are looking for a
full function name, we should use `GetName` to populate the `name`
field instead of `GetLookupName` since `GetName` has the more
complete information.
Fangrui Song [Thu, 4 Aug 2022 22:16:51 +0000 (15:16 -0700)]
[TTI] Change new getVectorInstrCost overload to use const reference after D131114
A const reference is preferred over a non-null const pointer.
`Type *` is kept as is to match the other overload.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D131197
Corentin Jabot [Thu, 4 Aug 2022 21:02:17 +0000 (23:02 +0200)]
[Clang] Fix capture of values initialized by bitfields
This fixes a regression introduced in 127bf44
Differential Revision: https://reviews.llvm.org/D131202
Ben Langmuir [Thu, 4 Aug 2022 21:20:44 +0000 (14:20 -0700)]
[orc-rt] Fix swift protocol metadata registration
The __swif5_proto and __swift5_protos sections had their meaning
inverted. Fix, and rename the arrays so it is more obvious which is
which.
Differential Revision: https://reviews.llvm.org/D131206
Sanjay Patel [Thu, 4 Aug 2022 21:41:19 +0000 (17:41 -0400)]
[ValueTracking] improve readability in isImpliedCond helper functions; NFC
This matches the caller code naming scheme and avoids the
potentially confusing transition from left/right to A/B.
Craig Topper [Thu, 4 Aug 2022 21:29:14 +0000 (14:29 -0700)]
[RISCV] Relax another one use restriction in performSRACombine.
When folding (sra (add (shl X, 32), C1), 32 - C) -> (shl (sext_inreg (add X, C1), i32), C)
it's possible that the add is used by multiple sras. We should
allow the combine if all the SRAs will eventually be updated.
After transforming all of the sras, the shls will share a single
(sext_inreg (add X, C1), i32).
This pattern occurs if an sra with 32 is used as index in multiple
GEPs with different scales. The shl from the GEPs will be combined
with the sra before we get a chance to match the sra pattern.
Sanjay Patel [Thu, 4 Aug 2022 20:23:09 +0000 (16:23 -0400)]
[ValueTracking] reduce code in isImpliedCondICmps; NFC
This copies the implementation of the subsequent match with constants.
Louis Dionne [Thu, 4 Aug 2022 20:48:10 +0000 (16:48 -0400)]
[compiler-rt] Don't build builtins beyond macOS 10.7
It's not supported anyways, and now Clang complains about it since
we didn't support -stdlib=libc++ back then.
Aart Bik [Thu, 4 Aug 2022 18:49:00 +0000 (11:49 -0700)]
[mlir][sparse] fix bug in complex zero detection
We were checking real-part twice, not real/imag-part.
The new test only passes after the bug fix.
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D131190
Arthur Eubanks [Wed, 3 Aug 2022 03:23:03 +0000 (20:23 -0700)]
[InstrProf] Set prof global variables to internal linkage if adding a comdat
COFF has a verifier check that private global variables don't have a comdat of the same name.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D131043
Mingming Liu [Wed, 3 Aug 2022 21:20:30 +0000 (14:20 -0700)]
[AArch64][TTI][NFC] Overload method 'getVectorInstrCost' to provide vector instruction itself, as a context information for cost estimation.
1) Overloaded (instruction-based) method is a wrapper around the current (opcode-based) method.
2) This patch also changes a few callsites (VectorCombine.cpp,
SLPVectorizer.cpp, CodeGenPrepare.cpp) to call the overloaded method.
3) This is a split of D128302.
Differential Revision: https://reviews.llvm.org/D131114
Mats Petersson [Fri, 29 Apr 2022 14:24:37 +0000 (15:24 +0100)]
Prepare for inlining of SUM intrinsic
Find calls to FortranASum{Real8,Integer4}, check for dim and mask
arguments being absent - then produce an inlineable simple
version of the sum function.
(No longer a prototype, please review for push to llvm/main - not sure how to make Phabricator update the review with actual commit message)
Reviewed By: peixin, awarzynski
Differential Revision: https://reviews.llvm.org/D125407
David Green [Thu, 4 Aug 2022 19:52:26 +0000 (20:52 +0100)]
[AArch64] Add some extra GlobalISel CCMP tests coverage. NFC
Johannes Doerfert [Thu, 4 Aug 2022 18:13:40 +0000 (13:13 -0500)]
[Attributor][FIX] Deal with implicit `undef` in AAPotentialConstantValues.
In contrast to AAPotentialValues, the constant values version can
contain implicit `undef` in the set. We had an assertion that could
misfire before. Handle it properly now.
Krzysztof Drewniak [Wed, 6 Jul 2022 20:37:30 +0000 (20:37 +0000)]
[mlir][AMDGPU] Explicitly truncate memory addresses in buffer ops
As a percaution, truncate memory addresses passed to kernels to 48 bits,
since bits 48-63 of the buffer descriptor are used for the stride field
and, on gfx10, to control swizzling.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D131016
Nico Weber [Thu, 4 Aug 2022 19:33:26 +0000 (15:33 -0400)]
[gn build] port
976f37050dbd more
Follow-up to commit
51d84737b5a.
Marc Auberer [Thu, 4 Aug 2022 19:14:12 +0000 (19:14 +0000)]
[Docs] Fix missing docs strings for CallingConv.h
Replaces
```
//
```
with
```
///
```
for some code lines to make it visible in the auto-generated documentation.
Reviewed By: dblaikie, MaskRay
Differential Revision: https://reviews.llvm.org/D131152
Tue Ly [Wed, 3 Aug 2022 19:42:05 +0000 (15:42 -0400)]
[libc] Prevent overflow from intermediate results when adding UInt<N> values.
Prevent overflow from intermediate results when adding UInt<N> values.
Reviewed By: orex
Differential Revision: https://reviews.llvm.org/D131095
Sanjay Patel [Sun, 31 Jul 2022 21:42:58 +0000 (17:42 -0400)]
[InstSimplify] add tests for or-of-icmps; NFC
Alex Langford [Thu, 4 Aug 2022 18:51:47 +0000 (11:51 -0700)]
Revert "[lldb] Filter DIEs based on qualified name where possible"
This reverts commit
befa77e59a7760d8c4fdd177b234e4a59500f61c.
Looks like this broke a SymbolFileNativePDB test. I'll investigate and
resubmit with a fix soon.
Shilei Tian [Thu, 4 Aug 2022 18:48:07 +0000 (14:48 -0400)]
[OpenMP] Fix the test case issue that printf cannot be used in target region for AMDGPU
Mehdi Amini [Thu, 4 Aug 2022 18:47:28 +0000 (18:47 +0000)]
Revert "[mlir][test] Fix IR/AttributeTest.cpp compilation on Solaris"
This reverts commit
07aaa35f74d845a20d48e644671dce150ebf7748.
This breaks the Windows bot, and while the fix addressed the
`char`/`int8_t` case, it does not make sense for other cases like
`float`.
Fangrui Song [Thu, 4 Aug 2022 18:47:52 +0000 (11:47 -0700)]
[ELF] Parallelize input section initialization
This implements the last step of
https://discourse.llvm.org/t/parallel-input-file-parsing/60164 for the ELF port.
For an ELF object file, we previously did: parse, (parallel) initializeLocalSymbols, (parallel) postParseObjectFile.
Now we do: parse, (parallel) initSectionsAndLocalSyms, (parallel) postParseObjectFile.
initSectionsAndLocalSyms does most of input section initialization.
The sequential `parse` does SHT_ARM_ATTRIBUTES/SHT_RISCV_ATTRIBUTES/SHT_GROUP initialization for now.
Performance linking some programs with --threads=8 (glibc 2.33 malloc and mimalloc):
* clang: 1.05x as fast with glibc malloc, 1.03x as fast with mimalloc
* chrome: 1.04x as fast with glibc malloc, 1.03x as fast with mimalloc
* internal search program: 1.08x as fast with glibc malloc, 1.05x as fast with mimalloc
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D130810
Shilei Tian [Thu, 4 Aug 2022 18:37:47 +0000 (14:37 -0400)]
[OpenMP][DeviceRTL] Implement libc function `memcmp`
We will add some simple implementation of libc functions starting from
this patch, and the first one is `memcmp`, which is reported in #56929. Note that
`malloc` and `free` are not included in this patch because of the use of
`declare variant`. In the near future we will implement the two functions w/o
using any vendor provided function.
This fixes #56929.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D131182
LLVM GN Syncbot [Thu, 4 Aug 2022 18:26:38 +0000 (18:26 +0000)]
[gn build] Port
4038c859e58c
Craig Topper [Thu, 4 Aug 2022 18:16:27 +0000 (11:16 -0700)]
[RISCV] Relax a one use restriction performSRACombine
When folding (sra (add (shl X, 32), C1), 32 - C) -> (shl (sext_inreg (add X, C1), C)
ignore the use count on the (shl X, 32).
The sext_inreg after the transform is free. So we're only making
2 new instructions, the add and the shl. So we only need to be
concerned with replacing the original sra+add. The original shl
can have other uses. This helps if there are multiple different
constants being added to the same shl.
Alex Langford [Tue, 12 Jul 2022 15:51:30 +0000 (08:51 -0700)]
[lldb] Filter DIEs based on qualified name where possible
Context:
When setting a breakpoint by name, we invoke Module::FindFunctions to
find the function(s) in question. However, we use a Module::LookupInfo
to first process the user-provided name and figure out exactly what
we're looking for. When we actually perform the function lookup, we
search for the basename. After performing the search, we then filter out
the results using Module::LookupInfo::Prune. For example, given
a::b::foo we would first search for all instances of foo and then filter
out the results to just names that have a::b::foo in them. As one can
imagine, this involves a lot of debug info processing that we do not
necessarily need to be doing. Instead of doing one large post-processing
step after finding each instance of `foo`, we can filter them as we go
to save time.
Some numbers:
Debugging LLDB and placing a breakpoint on
llvm::itanium_demangle::StringView::begin without this change takes
approximately 70 seconds and resolves 31,920 DIEs. With this change,
placing the breakpoint takes around 30 seconds and resolves 8 DIEs.
Differential Revision: https://reviews.llvm.org/D129682
Arjun P [Thu, 4 Aug 2022 17:59:35 +0000 (18:59 +0100)]
[MLIR][Presburger] SlowMPInt::gcd: fix crash when sizes differ
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D131186
Arjun P [Thu, 4 Aug 2022 17:42:51 +0000 (18:42 +0100)]
[MLIR][Presburger] fourier-motzkin: check if all LCMs are 1 using a bool instead of by multiplying them
This can easily overflow and it is possible for these unsigned overflows to result in incorrect results.
For example, the two LCMs could be 641 and 6700417, which multiply to 2^32 + 1, which overflows to 1.
Unsigned overflows already occur in the existing tests.
Also, when switching to arbitrary-precision arithmetic, this results in a many
large integer multiplications resulting in a significant slowdown.
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D131184
Fangrui Song [Thu, 4 Aug 2022 18:09:40 +0000 (11:09 -0700)]
[ELF] Add makeThreadLocal/makeThreadLocalN and remove InputFile::localSymStorage
makeThreadLocal/makeThreadLocalN are moved from D130810 ([ELF] Parallelize input
section initialization) here to make D130810 more focused on the refactor:
* COFF has some needs for multiple linker contexts. D108850 partially removed
global states from lldCommon but left the global variable `lctx`.
* To the best of my knowledge, all multiple-linker-context feature requests to
ELF are more from user convenience, with no very strong argument.
* In practice, ELF port is very difficult to remove global states without
introducing significant performance regression/hurting code readability.
* Per-thread allocators from D122922/D123879 are too expensive and will not
really benefit ELF.
This patch adds a simple thread_local based makeThreadLocal to
lld/Common/Memory.h. It will enable further optimization in ELF.
Louis Dionne [Thu, 4 Aug 2022 18:06:31 +0000 (14:06 -0400)]
[libc++] Clarify comment in CI pipeline definition
This partially reverts commit
7d855bb8e133. The comments were actually
not outdated, they were simply unclear.
Louis Dionne [Thu, 4 Aug 2022 18:03:16 +0000 (14:03 -0400)]
[libc++][NFC] Remove outdated comment in CI pipeline definition
Konstantin Varlamov [Thu, 4 Aug 2022 17:57:58 +0000 (10:57 -0700)]
[libc++] Fix a hard error in `contiguous_iterator<NoOperatorArrowIter>`.
Evaluating `contiguous_iterator` on an iterator that satisfies all the
constraints except the `to_address` constraint and doesn't have
`operator->` defined results in a hard error. This is because
instantiating `to_address` ends up instantiating templates
dependent on the given type which might lead to a hard error even
in a SFINAE context.
Differential Revision: https://reviews.llvm.org/D130835
Nikolas Klauser [Thu, 4 Aug 2022 17:54:13 +0000 (10:54 -0700)]
[libc++][ranges] Implement `ranges::is_permutation`
Co-authored-by: Konstantin Varlamov <varconst@apple.com>
Differential Revision: https://reviews.llvm.org/D127194
Zakk Chen [Thu, 4 Aug 2022 17:34:05 +0000 (17:34 +0000)]
[RISCV][Clang] Support policy function for all vector segment load.
We will switch all UndefValue to PoisonValue in follow up patches.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D126750
Sam Estep [Thu, 4 Aug 2022 17:45:30 +0000 (17:45 +0000)]
[clang][dataflow] Analyze method bodies
This patch adds the ability to context-sensitively analyze method bodies, by moving `ThisPointeeLoc` from `DataflowAnalysisContext` to `Environment`, and adding code in `pushCall` to set it.
Reviewed By: ymandel, sgatev, xazax.hun
Differential Revision: https://reviews.llvm.org/D131170
lorenzo chelini [Tue, 19 Jul 2022 14:13:22 +0000 (16:13 +0200)]
[MLIR] TilingInterface: Avoid map when tile divides iteration domain
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D131080
Petr Hosek [Thu, 21 Jul 2022 08:12:08 +0000 (08:12 +0000)]
[clang-doc] Default to Standalone executor and improve documentation
This should provide a more intuitive usage consistent with other tools.
Differential Revision: https://reviews.llvm.org/D130226
Sam Estep [Thu, 4 Aug 2022 17:42:01 +0000 (17:42 +0000)]
[clang][dataflow] Handle return statements
This patch adds a `ReturnLoc` field to the `Environment`, serving a similar to the `ThisPointeeLoc` field in the `DataflowAnalysisContext`. It then uses that (along with a new `VisitReturnStmt` method in `TransferVisitor`) to handle non-`void`-returning functions in context-sensitive analysis.
Reviewed By: ymandel, sgatev
Differential Revision: https://reviews.llvm.org/D130600
David Green [Thu, 4 Aug 2022 17:35:27 +0000 (18:35 +0100)]
[AArch64] Always allow the __bf16 type
We would like to make the ACLE NEON and SVE intrinsics more useable by
gating them on the target, not by ifdef preprocessor macros. In order to
do this the types they use need to be available. This patches makes
__bf16 always available under AArch64 not just when the bf16
architecture feature is present. This bringing it in-line with GCC. In
subsequent patches the NEON bfloat16x8_t and SVE svbfloat16_t types
(along with bfloat16_t used in arm_sve.h) will be made unconditional
too.
The operations valid on the types are still very limited. They can be
used as a storage type, but the intrinsics used for convertions are
still behind an ifdef guard in arm_neon.h/arm_bf16.h.
Differential Revision: https://reviews.llvm.org/D130973
Fangrui Song [Thu, 4 Aug 2022 17:26:31 +0000 (10:26 -0700)]
[Sema] -Wformat: support C23 format specifier %b %B
Close #56885: WG14 N2630 added %b to fprintf/fscanf and recommended %B for
fprintf. This patch teaches -Wformat %b for the printf/scanf family of functions
and %B for the printf family of functions.
glibc 2.35 and latest Android bionic added %b/%B printf support. From
https://www.openwall.com/lists/libc-coord/2022/07/ no scanf support is available
yet.
Like GCC, we don't test library support.
GCC 12 -Wformat -pedantic emits a warning:
> warning: ISO C17 does not support the ‘%b’ gnu_printf format [-Wformat=]
The behavior is not ported.
Note: `freebsd_kernel_printf` uses %b differently.
Reviewed By: aaron.ballman, dim, enh
Differential Revision: https://reviews.llvm.org/D131057
Daniel Thornburgh [Tue, 19 Jul 2022 21:20:12 +0000 (14:20 -0700)]
[Symbolizer] Implement data symbolizer markup element.
This connects the Symbolizer to the markup filter and enables the first
working end-to-end flow using the filter.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D130187
Mark de Wever [Tue, 19 Jul 2022 05:56:23 +0000 (07:56 +0200)]
[libc++] Uses operator<=> in string_view
Implements:
- LWG3432 Missing requirement for comparison_category
Implements part of:
- P1614R2 The Mothership has Landed
Reviewed By: #libc, ldionne, jloser, philnik
Differential Revision: https://reviews.llvm.org/D130295
Eric Li [Thu, 4 Aug 2022 15:57:22 +0000 (11:57 -0400)]
[clang][dataflow][NFC] Resize vector directly with ctor
Differential Revision: https://reviews.llvm.org/D131177
Eric Li [Thu, 4 Aug 2022 15:56:10 +0000 (11:56 -0400)]
[clang][dataflow][NFC] Convert mutable vector references to ArrayRef
`transferBlock` and `computeBlockInputState` only read the
`BlockStates` vector for the predecessor block(s), and do not need to
mutate any of the contents. Only `runTypeErasedDataflowAnalysis`
writes into the `vector`, so simply down to an `ArrayRef`.
Nico Weber [Thu, 4 Aug 2022 17:04:59 +0000 (13:04 -0400)]
Revert "[InstrProf] Add new format for -fprofile-list="
This reverts commit
b692312ca432d9a379f67a8d83177a6f1722baaa.
Breaks tests on Windows, see https://reviews.llvm.org/D130808#3699952
Rainer Orth [Thu, 4 Aug 2022 16:56:05 +0000 (18:56 +0200)]
[mlir][test] Fix IR/AttributeTest.cpp compilation on Solaris
The `IR/AttributeTest.cpp` test fails to compile on Solaris:
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:223:36: error: no matching function for call to 'allocate'
AttrT::get(type, "resource", UnmanagedAsmResourceBlob::allocate(data));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:237:3: note: in instantiation of function template specialization 'checkNativeAccess<mlir::detail::DenseResourceElementsAttrBase<int8_t>, char>' requested here
checkNativeAccess<AttrT, T>(builder.getContext(), llvm::makeArrayRef(data),
^
/vol/llvm/src/llvm-project/local/mlir/unittests/IR/AttributeTest.cpp:258:3: note: in instantiation of function template specialization 'checkNativeIntAccess<mlir::detail::DenseResourceElementsAttrBase<int8_t>, char>' requested here
checkNativeIntAccess<DenseI8ResourceElementsAttr, int8_t>(builder, 8);
^
/vol/llvm/src/llvm-project/local/mlir/include/mlir/IR/AsmState.h:221:3: note: candidate template ignored: requirement '!std::is_same<char, char>::value' was not satisfied [with T = char]
allocate(ArrayRef<T> data, bool dataIsMutable = false) {
^
/vol/llvm/src/llvm-project/local/mlir/include/mlir/IR/AsmState.h:214:26: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
static AsmResourceBlob allocate(ArrayRef<char> data, size_t align,
^
I suspect this happens because `char` is `signed` by default on Solaris.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D131148
Aart Bik [Wed, 3 Aug 2022 22:15:42 +0000 (15:15 -0700)]
[mlir][sparse] replace zero yield generic op with copy in allocation
This prepares patterns that sometimes are generated by the front-end
and would prohibit fusion of SDDMM flavored kernels.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D131126
John Regehr [Thu, 4 Aug 2022 16:21:20 +0000 (10:21 -0600)]
earlier I fixed a bug where the BB removal pass sometimes created
invalid IR. the fix was incomplete, this one is better and is believed
to be complete
Differential Revision: https://reviews.llvm.org/D131132
Jim Ingham [Thu, 4 Aug 2022 16:14:45 +0000 (09:14 -0700)]
Remove the check for eStateConnected in remote testing sessions.
This check is clearly incorrect, there's no way you should have an
eStateConnected event left on the queue if you've already launched
and hit a breakpoint in the program. This check fails running remotely
on Darwin systems and on one remote Linux platform. And if we do
find this failing somewhere, we should fix the bogus eStateConnected,
not the test.
Dawid Jurczak [Thu, 4 Aug 2022 14:47:54 +0000 (16:47 +0200)]
[NFC] Define NumBuiltinElts utility just once at the beginning of SmallVectorTest file
Extracted from: https://reviews.llvm.org/D130268
Differential Revision: https://reviews.llvm.org/D131173
Frederik Gossen [Wed, 3 Aug 2022 22:23:55 +0000 (18:23 -0400)]
[MLIR] Make the implementations for getMixedOffsets/Sizes/Strides independent of OffsetSizeAndStrideOpInterface
The functions are effectively independent of the interface already, however, they take it as an argument for no reason.
The current state complicates reuse outside of MLIR.
Differential Revision: https://reviews.llvm.org/D131120
Igor Zhukov [Thu, 4 Aug 2022 15:50:51 +0000 (22:50 +0700)]
[libc++][NFC] Remove rebase artifact
I found it in this commit: https://github.com/llvm/llvm-project/commit/
a203acb9dd7227323d6161431225189d49917744
Reviewed By: Mordante
Differential Revision: https://reviews.llvm.org/D131163
Ellis Hoag [Fri, 29 Jul 2022 21:49:44 +0000 (14:49 -0700)]
[InstrProf] Add new format for -fprofile-list=
In D130807 we added the `skipprofile` attribute. This commit
changes the format so we can either `forbid` or `skip` profiling
functions by adding the `noprofile` or `skipprofile` attributes,
respectively. The behavior of the original format remains
unchanged.
Also, add the `skipprofile` attribute when using
`-fprofile-function-groups`.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D130808
Chelsea Cassanova [Tue, 26 Jul 2022 19:51:58 +0000 (15:51 -0400)]
Reland "[lldb/Fuzzer] Add fuzzer for expression evaluator"
This reverts commit
d959324e1efec12c3924c17b7d90db0b37eb84c3.
The target_include_directories in the clang-fuzzer CMake files
are set to PRIVATE instead of PUBLIC to prevent the clang buildbots
from breaking when symlinking clang into llvm.
The expression evaluator fuzzer itself has been modified to prevent a
bug that occurs when running it without a target.
Ellis Hoag [Fri, 29 Jul 2022 23:23:46 +0000 (16:23 -0700)]
[InstrProf] Add the skipprofile attribute
As discussed in [0], this diff adds the `skipprofile` attribute to
prevent the function from being profiled while allowing profiled
functions to be inlined into it. The `noprofile` attribute remains
unchanged.
The `noprofile` attribute is used for functions where it is
dangerous to add instrumentation to while the `skipprofile` attribute is
used to reduce code size or performance overhead.
[0] https://discourse.llvm.org/t/why-does-the-noprofile-attribute-restrict-inlining/64108
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D130807
Eugene Zhulenev [Thu, 4 Aug 2022 15:41:01 +0000 (08:41 -0700)]
[mlir:LLVM] Do not lookup symbol twice in the addressof verifier
`SymbolTable::lookupSymbolIn` is an expensive operation and we do not want to do it twice
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D131145
Mark de Wever [Thu, 4 Aug 2022 15:40:38 +0000 (17:40 +0200)]
[libc++][doc] Updates format status page.
Adds the details for P2286 and its status.
Eric Li [Wed, 3 Aug 2022 19:33:58 +0000 (15:33 -0400)]
[clang][dataflow][NFC] Fix outdated comment on getStableStorageLocation
Follow-up to D129097.
It is no longer a requirement that the `QualType` passed to to
`DataflowAnalysisContext::getStableStorageLocation()` is not null. A
null type pass as an argument is only applicable as the pointee type
of a `std::nullptr_t` pointer.
Differential Revision: https://reviews.llvm.org/D131109
LLVM GN Syncbot [Thu, 4 Aug 2022 14:49:27 +0000 (14:49 +0000)]
[gn build] Port
2138c906458e
Nikolas Klauser [Wed, 3 Aug 2022 17:35:34 +0000 (19:35 +0200)]
[libc++] Install clang-tools in the CI container
This is required for using clang-query in the CI
Reviewed By: Mordante, #libc
Spies: libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D130845
Joshua Cranmer [Thu, 4 Aug 2022 14:41:11 +0000 (10:41 -0400)]
[IR] Move support for dxil::TypedPointerType to LLVM core IR.
This allows the construct to be shared between different backends. However, it
still remains illegal to use TypedPointerType in LLVM IR--the type is intended
to remain an auxiliary type, not a real LLVM type. So no support is provided for
LLVM-C, nor bitcode, nor LLVM assembly (besides the bare minimum needed to make
Type->dump() work properly).
Reviewed By: beanz, nikic, aeubanks
Differential Revision: https://reviews.llvm.org/D130592
Tres Popp [Tue, 2 Aug 2022 08:18:52 +0000 (10:18 +0200)]
[mlir] Only conditionally lower CF branching ops to LLVM
Previously cf.br cf.cond_br and cf.switch always lowered to their LLVM
equivalents. These ops are all ops that take in some values of given
types and jump to other blocks with argument lists of the same types. If
the types are not the same, a verification failure will later occur. This led
to confusions, as everything works when func->llvm and cf->llvm lowering
both occur because func->llvm updates the blocks and argument lists
while cf->llvm updates the branching ops. Without func->llvm though,
there will potentially be a type mismatch.
This change now only lowers the CF ops if they will later pass
verification. This is possible because the parent op and its blocks will
be updated before the contained branching ops, so they can test their
new operand types against the types of the blocks they jump to.
Another plan was to have func->llvm only update the entry block
signature and to allow cf->llvm to update all other blocks, but this had
2 problems:
1. This would create a FuncOp lowering in cf->llvm lowering which is
awkward
2. This new pattern would only be applied if the containing FuncOp is
marked invalid. This is infeasible with the shared LLVM type
conversion/target infrastructure.
See previous discussions at
https://discourse.llvm.org/t/lowering-cf-to-llvm/63863 and
https://github.com/llvm/llvm-project/issues/55301
Differential Revision: https://reviews.llvm.org/D130971
Jeff Niu [Mon, 1 Aug 2022 20:21:33 +0000 (16:21 -0400)]
[mlir] Add I1 support to DenseArrayAttr
This patch adds a DenseI1ArrayAttr to support arrays of i1. Importantly,
the implementation is as a simple `ArrayRef<bool>` instead of using bit
compression, which was problematic in DenseElementsAttr.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D130957
Lorenzo Albano [Wed, 3 Aug 2022 16:08:45 +0000 (18:08 +0200)]
[VP] Add widening for VP_STRIDED_LOAD and VP_STRIDED_STORE
Reviewed By: frasercrmck, craig.topper
Differential Revision: https://reviews.llvm.org/D121114
Michal Paszkowski [Thu, 4 Aug 2022 13:20:06 +0000 (15:20 +0200)]
[Docs] Added my office hours
YingChi Long [Thu, 4 Aug 2022 13:15:45 +0000 (21:15 +0800)]
[clang] change `auto` to `Expr` in last commit [NFC]
YingChi Long [Wed, 3 Aug 2022 02:07:31 +0000 (10:07 +0800)]
[clang] format string checking for conpile-time evaluated str literal
This patch enhances clang's ability to check compile-time determinable
string literals as format strings, and can give FixIt hints at literals
(unlike gcc). Issue https://github.com/llvm/llvm-project/issues/55805
mentiond two compile-time string cases. And this patch partially fixes
one.
```
constexpr const char* foo() {
return "%s %d";
}
int main() {
printf(foo(), "abc", "def");
return 0;
}
```
This patch enables clang check format string for this:
```
<source>:4:24: warning: format specifies type 'int' but the argument has type 'const char *' [-Wformat]
printf(foo(), "abc", "def");
~~~~~ ^~~~~
<source>:2:42: note: format string is defined here
constexpr const char *foo() { return "%s %d"; }
^~
%s
1 warning generated.
```
Reviewed By: aaron.ballman
Signed-off-by: YingChi Long <me@inclyc.cn>
Differential Revision: https://reviews.llvm.org/D130906
Pavel Labath [Thu, 4 Aug 2022 11:55:35 +0000 (13:55 +0200)]
[lldb] Fix arm breakages from D130985
The kernel was rejecting sizeof(struct GPR) as it was not a multiple of
8. Add a padding field to fix that.
One also wonders whether "cpsr" is right register name for aarch64.
Kadir Cetinkaya [Thu, 4 Aug 2022 09:50:16 +0000 (11:50 +0200)]
Revert "[clang] Pass FoundDecl to DeclRefExpr creator for operator overloads"
This reverts commit
4e94f6653150511de434fa7e29b684ae7f0e52b6.
See https://reviews.llvm.org/D129973#3698969 for reasoning.
LLVM GN Syncbot [Thu, 4 Aug 2022 09:46:03 +0000 (09:46 +0000)]
[gn build] Port
a203acb9dd72
Nikolas Klauser [Wed, 3 Aug 2022 23:30:50 +0000 (16:30 -0700)]
[libc++][ranges] Implement `ranges::clamp`
Differential Revision: https://reviews.llvm.org/D126193
Matt Jacobson [Mon, 1 Aug 2022 05:59:41 +0000 (01:59 -0400)]
[ObjC] type method metadata `_imp`, messenger routine at callsite with program address space
On targets with non-default program address space (e.g., Harvard
architectures), clang crashes when emitting Objective-C method metadata,
because the address of the method IMP cannot be bitcast to i8*. It similarly
crashes at messenger callsite with a failed bitcast.
Define the _imp field instead as i8 addrspace(1)* (or whatever the target's
program address space is). And in getMessageSendInfo(), create signatureType by
specifying the program address space.
Add a regression test using the AVR target. Test failed previously and passes
now. Checked codegen of the test for x86_64-apple-darwin19.6.0 and saw no
difference, as expected.
Reviewed By: rjmccall, dylanmckay
Differential Revision: https://reviews.llvm.org/D112113
Alexander Belyaev [Thu, 4 Aug 2022 09:18:04 +0000 (11:18 +0200)]
[mlir] Extract offsets-sizes-strides computation from `makeTiledShape(s)`.
This change separates computation of the actual parameters of the subset and
the materialization of subview/extract_slice. That way the users can still use
Linalg tiling logic even if they use different operations to materialize the
subsets.
Differential Revision: https://reviews.llvm.org/D131053
Nikita Popov [Wed, 3 Aug 2022 13:28:49 +0000 (15:28 +0200)]
[MLIR] Fix checks for native arch
Using if (TARGET ${LLVM_NATIVE_ARCH}) only works if MLIR is built
together with LLVM, but not for standalone builds of MLIR. The
correct way to check this is
if (${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD), as the
LLVM build system exports LLVM_TARGETS_TO_BUILD.
To avoid repeating the same check many times, add a
MLIR_ENABLE_EXECUTION_ENGINE variable.
Differential Revision: https://reviews.llvm.org/D131071
David Spickett [Thu, 28 Jul 2022 14:09:50 +0000 (14:09 +0000)]
[llvm-reduce] Split operands-skip.ll into serial and parallel parts
This fixes a test failure when building with LLVM_ENABLE_THREADS=OFF.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D130707