William Huang [Tue, 7 Jun 2022 18:48:24 +0000 (18:48 +0000)]
[ValueTracking] Add support to deduce a PHI node being a power of 2 if each incoming value is a power of 2.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D124889
Reid Kleckner [Fri, 3 Jun 2022 17:27:02 +0000 (10:27 -0700)]
[config] Remove vestigial LLVM_VERSION_INFO
This has been superseded by the llvm/Support/VCSRevision.h header. So
far as I can tell, nothing in the CMake build sets LLVM_VERSION_INFO. It
was always undefined, and the ifdefs using it were dead. However, CMake
is very flexible, so it's possible that I missed some ways to set this
variable. One could, for example, probably pass -DLLVM_VERSION_INFO=x on
the command line and get that through to configure_file, or set the
variable in an obscure way (`set(${proj}_VERSION_INFO "x")`). I'm
reasonably confident that isn't happening, but I'd like a second
opinion.
Update the Bazel and gn builds accordingly.
Differential Revision: https://reviews.llvm.org/D126977
Reid Kleckner [Fri, 3 Jun 2022 23:21:42 +0000 (16:21 -0700)]
[config] Remove RETSIGTYPE from config.h.cmake, NFC
This doesn't need to be configurable. It was hardcoded to void in all
LLVM build systems.
Erich Keane [Tue, 7 Jun 2022 18:29:03 +0000 (11:29 -0700)]
[CodeGen] Fix an issue when the 'extern C' replacement names broke
Originally broken by me in D122608, this is a regression where we
attempt to replace an extern-C thing with 'itself'. The problem is that
we end up deleting it, causing the value to fail when it gets put into
llvm.used.
Philip Reames [Tue, 7 Jun 2022 14:43:00 +0000 (07:43 -0700)]
[PointerUnionTest] Fix an incorrectly written test
The test being change appears to have been intended to exercise PointerUnion, but what it actually did was cast<> a double to a double*. This only worked because cast<> was missing the required assertion. Adding the assertion reveals a template error where isa<const double*>(double) fails to compile.
Kaining Zhong [Tue, 7 Jun 2022 17:39:46 +0000 (19:39 +0200)]
[clang-diff] Fix assertion error when dealing with wide strings
Directly using StringLiteral::getString for wide string is not
currently supported; therefore in ASTDiff, getStmtValue will fail when
asserting that the StringLiteral has a width of 1. This patch also
covers cases for UTF16 and UTF32 encoding, along with corresponding
test cases.
Fixes https://github.com/llvm/llvm-project/issues/55771.
Reviewed By: johannes
Differential Revision: https://reviews.llvm.org/D126651
Jay Foad [Tue, 7 Jun 2022 09:41:50 +0000 (10:41 +0100)]
[CodeEmitter] Fix encoding wide instructions on big-endian hosts
For instructions wider than 64 bits the InstBits table is initialized in
64-bit chunks from APInt::getRawData, but it was being read with
LoadIntFromMemory which is byte-based.
Fix this by reading the table with the APInt constructor that takes an
ArrayRef to the raw data instead.
This is currently NFC for in-tree targets but fixes AMDGPU failures on
big-endian hosts that were caused by D126483 until it was reverted.
Differential Revision: https://reviews.llvm.org/D127195
David Green [Tue, 7 Jun 2022 17:57:59 +0000 (18:57 +0100)]
[AArch64] Remove isDef32
isDef32 would attempt to make a guess at which SelectionDag nodes were
32bit sources, and use the nature of 32bit AArch64 instructions
implicitly zeroing the upper register half to not emit zext that were
expected to already be zero. This was a bit fragile though, needing to
guess at the correct opcodes that do not become 32bit defs later in
ISel.
This patch removed isDef32, relying on the AArch64MIPeephole optimizer
to remove redundant SUBREG_TO_REG nodes. A part of
SelectArithExtendedRegister was left with the same logic as a heuristic
to prevent some regressions from it picking less optimal sequences.
The AArch64MIPeepholeOpt pass also needs to be taught that a COPY from a
FPR will become a FMOVSWr, which it lowers immediately to make sure that
remains true through register allocation.
Fixes #55833
Differential Revision: https://reviews.llvm.org/D127154
Vince Bridgers [Mon, 6 Jun 2022 12:23:08 +0000 (08:23 -0400)]
[analyzer] Fix null pointer deref in CastValueChecker
A crash was seen in CastValueChecker due to a null pointer dereference.
The fix uses QualType::getAsString to avoid the null dereference
when a CXXRecordDecl cannot be obtained. A small reproducer is added,
and cast value notes LITs are updated for the new debug messages.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D127105
Sanjay Patel [Tue, 7 Jun 2022 16:42:12 +0000 (12:42 -0400)]
[InstCombine] reduce right-shift-of-left-shifted constant via demanded bits
If we don't demand high bits (zeros) and it is valid to pre-shift a constant:
(C2 << X) >> C1 --> (C2 >> C1) << X
https://alive2.llvm.org/ce/z/P3dWDW
There are a variety of related patterns, but I haven't found a single solution
that gets all of the motivating examples - so pulling this piece out of
D126617 along with more tests.
We should also handle the case where we shift-right followed by shift-left,
but I'll make that a follow-on patch assuming this one is ok. It seems likely
that we would want to add this to the SDAG version of the code too to keep it
on par with IR.
Differential Revision: https://reviews.llvm.org/D127122
Sanjay Patel [Tue, 7 Jun 2022 12:54:38 +0000 (08:54 -0400)]
[InstCombine] add vector tests for shift-shift; NFC
D127122
Groverkss [Tue, 7 Jun 2022 17:19:34 +0000 (22:49 +0530)]
[MLIR][Presburger] Fix subtract processing extra inequalities
This patch fixes a bug in PresburgeRelation::subtract that made it process the
inequality at index 0, multiple times. This was caused by allocating memory
instead of reserving memory in llvm::SmallVector.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D127228
Alan Zhao [Thu, 2 Jun 2022 23:42:37 +0000 (19:42 -0400)]
[llvm-ml] Remove all file extension restrictions
After D126425 was submitted, hans@ observed that MSVC's ml.exe doesn't
care about the file's extension at all. Now, we check if the file exists
to determine whether an input filename is a valid assembly file.
To keep things consistent with clang-cl and lld-link, llvm-ml will treat
everything that's not a flag as a filename.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D126931
Mark de Wever [Tue, 31 May 2022 16:58:54 +0000 (18:58 +0200)]
[libc++] Removes _LIBCPP_AVAILABILITY_TO_CHARS.
After moving the std::to_chars base 10 implementation from the dylib to
the header the integral overloads of std::to_chars are available on all
platforms.
Remove the _LIBCPP_AVAILABILITY_TO_CHARS availability macro and update
the tests.
Depends on D125704
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D125745
Philip Reames [Tue, 7 Jun 2022 16:54:23 +0000 (09:54 -0700)]
Add initial coverage for invalid instruction costs in LoopRotate
Once extended with a case which requires duplication, will serve as test for crash being fixed in D127131.
Mark de Wever [Mon, 30 May 2022 16:34:15 +0000 (18:34 +0200)]
[libc++][CI] Updates Docker image.
- Updates the image to use Ubuntu Jammy.
- Installs GCC-12 as preparation to migrate to that GCC version.
Reviewed By: ldionne, #libc, jloser
Differential Revision: https://reviews.llvm.org/D126666
Mark de Wever [Thu, 2 Jun 2022 06:16:40 +0000 (08:16 +0200)]
[libc++] Don't use static constexpr in headers.
This was noticed in the review of D125704. In that commit only the new
table has been adapted. This adapts the existing tables.
Note since libc++'s charconv is backported to C++11 it's not possible to
use inline constexpr variables. The were introduced in C++17.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D126887
David Penry [Tue, 29 Mar 2022 17:13:55 +0000 (10:13 -0700)]
[NFC] Fix spelling/newlines in comments/debug messages
Just a few spelling mistakes and missing newlines
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D127162
Benjamin Kramer [Tue, 7 Jun 2022 16:17:40 +0000 (18:17 +0200)]
[format] Fix an uninitialized variable
parseBlock may decide to leave it unchanged. Found by msan.
Joseph Huber [Tue, 31 May 2022 14:08:25 +0000 (10:08 -0400)]
[Libomptarget] Do not use retaining attributes for the static library
When we build the libomptarget device runtime library targeting bitcode,
we need special care to make sure that certain functions are not
optimized out. This is because we manually internalize and optimize
these definitions, ignoring their standard linkage semantics. When we
build with the static library, we can maintain these semantics and we do
not need these to be kept-alive. Furthermore, if they are kept-alive it
prevents them from being removed during LTO. This prevents us from
completely internalizing `IsSPMDMode` and removing several other
functions. This patch removes these for the static library target by
using a macro definition to enable them.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D126701
Simon Pilgrim [Tue, 7 Jun 2022 15:42:15 +0000 (16:42 +0100)]
[DAG] combineShuffleOfSplatVal - fold shuffle(splat,undef) -> splat, iff the splat contains no UNDEF elements
As noticed on D127115 - we were missing this fold, instead just having the shuffle(shuffle(x,undef,splatmask),undef) fold. We should be able to merge these into one using SelectionDAG::isSplatValue, but we'll need to match the shuffle's undef handling first.
This also exposed an issue in SelectionDAG::isSplatValue which was incorrectly propagating the undef mask across a bitcast (it was trying to just bail with a APInt::isSubsetOf if it found any undefs but that was actually the wrong way around so didn't fire for partial undef cases).
Muhammad Omair Javaid [Tue, 7 Jun 2022 15:30:24 +0000 (19:30 +0400)]
[LLDB] Remove decorator from XPASSes AArch64/Windows
This patch remove XFAIL decorator from tests which as passing on AArch64
Windows. This is tested on surface pro x using tot llvm and clang 14.0.3
as compiler with visual studio 2019 x86_arm64 environment.
Muhammad Omair Javaid [Tue, 7 Jun 2022 13:47:50 +0000 (17:47 +0400)]
[LLDB] Fix TestBase.generateSource for AArch64/Windows
This patch adds a minor fix in lldbtest.py TestBase.generateSource
function. Generated Python source with directory paths was not being
escaped properly. This fix makes sure we treat dir path as raw string.
Craig Topper [Tue, 7 Jun 2022 15:21:20 +0000 (08:21 -0700)]
[LoopFlatten] Fix crash if the inner loop trip count comes from a sext instruction.
If we look through a truncate in matchLinearIVUser, it's possible
we find a sext/zext instruction that didn't come from widening.
This will fail the MatchedItCount->getType() == InnerInductionPHI->getType()
assertion.
Fix this by checking that we did not look through a truncate already.
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D127149
Craig Topper [Tue, 7 Jun 2022 15:20:59 +0000 (08:20 -0700)]
[LoopFlatten] Replace unchecked dyn_cast with cast.
Spotted while reading through the code.
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D127146
Craig Topper [Tue, 7 Jun 2022 15:07:49 +0000 (08:07 -0700)]
[RISCV] Scalarize gather/scatter on RV64 with Zve32* extension.
i64 indices aren't supported on Zve32*. Scalarize gathers to prevent
generating illegal instructions.
Since InstCombine will aggressively canonicalize GEP indices to
pointer size, we're pretty much always going to have an i64 index.
Trying to predict when SelectionDAG will find a smaller index from
the TTI hook used by the ScalarizeMaskedMemIntrinPass seems fragile.
To optimize this we probably need an IR pass to rewrite it earlier.
Test RUN lines have also been added to make sure the strided load/store
optimization still works.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D127179
Alexey Bataev [Tue, 7 Jun 2022 15:02:14 +0000 (08:02 -0700)]
[SLP]Add a test for geps with non-const indeces in scatter vectorize
nodes, NFC.
LLVM GN Syncbot [Tue, 7 Jun 2022 14:38:58 +0000 (14:38 +0000)]
[gn build] Port
47c8ec811f78
David Truby [Mon, 6 Jun 2022 11:15:38 +0000 (12:15 +0100)]
[clang][AArch64][SVE] Improve diagnostics for SVE operators
This patch corrects some diagnostics for the SVE sizeless vector
operators, including correctly diagnosing when the vectors are
different sizes.
Differential Revision: https://reviews.llvm.org/D126377
Benjamin Kramer [Tue, 7 Jun 2022 14:29:06 +0000 (16:29 +0200)]
[DX][ObjYAML] Zero out unused fields that get written to the output file
Found by msan
Matt Arsenault [Mon, 6 Jun 2022 13:17:55 +0000 (09:17 -0400)]
llvm-reduce: Add -abort-on-invalid-reduction to MIR tests
Ideally reductions would never produce invalid IR, and we shouldn't
regress on cases that already avoid doing so.
Matt Arsenault [Mon, 6 Jun 2022 13:21:02 +0000 (09:21 -0400)]
llvm-reduce: Don't set generic instruction operands to undef
The intention is that these should never have undef operands. It turns
out the restriction the verifier enforces is too lax. The verifier
enforces that registers without a register class cannot be undef, but
it's valid to use a register with a register class and type. The
verifier needs to change to be based on the opcode.
Matt Arsenault [Fri, 22 Apr 2022 15:44:37 +0000 (11:44 -0400)]
llvm-reduce: Add pass to remove register uses
Try to delete implicit uses, and add undef flags to explicit ones.
Jay Foad [Mon, 6 Jun 2022 14:51:18 +0000 (15:51 +0100)]
[AMDGPU] Add support for the .reloc directive
Differential Revision: https://reviews.llvm.org/D127117
Matt Arsenault [Sat, 16 Apr 2022 02:35:53 +0000 (22:35 -0400)]
llvm-reduce: Add cloning of target MachineFunctionInfo
MIR support is totally unusable for AMDGPU without this, since the set
of reserved registers is set from fields here.
Add a clone method to MachineFunctionInfo. This is a subtle variant of
the copy constructor that is required if there are any MIR constructs
that use pointers. Specifically, at minimum fields that reference
MachineBasicBlocks or the MachineFunction need to be adjusted to the
values in the new function.
Matt Arsenault [Mon, 18 Apr 2022 15:01:19 +0000 (11:01 -0400)]
AMDGPU: Make PSV instances static members
Louis Dionne [Tue, 7 Jun 2022 14:01:01 +0000 (10:01 -0400)]
[libc++] Forgot to bump the CI timeout everywhere
Louis Dionne [Tue, 7 Jun 2022 14:00:25 +0000 (10:00 -0400)]
[libc++] Bump timeout to avoid spurious failures on AIX
Matt Arsenault [Sat, 4 Jun 2022 22:31:18 +0000 (18:31 -0400)]
llvm-reduce: Fix crashes on unreachable blocks for MIR instructions
Matt Arsenault [Wed, 13 Apr 2022 21:26:42 +0000 (17:26 -0400)]
llvm-reduce: Don't assert on functions which don't track liveness
Use the query that doesn't assert if TracksLiveness isn't set, which
needs to always be available. We also need to start printing liveins
regardless of TracksLiveness.
Matt Arsenault [Mon, 6 Jun 2022 22:27:11 +0000 (18:27 -0400)]
AMDGPU: Fix not checking liveness in test
Guillaume Chatelet [Fri, 3 Jun 2022 16:37:45 +0000 (16:37 +0000)]
[Alignment][NFC] Remove usage of MemSDNode::getAlignment
I can't remove the function just yet as it is used in the generated .inc files.
I would also like to provide a way to compare alignment with TypeSize since it came up a few times.
Differential Revision: https://reviews.llvm.org/D126910
Simon Pilgrim [Tue, 7 Jun 2022 13:27:06 +0000 (14:27 +0100)]
[X86] getFauxShuffleMask - add VSELECT/BLENDV handling
First step towards enabling shuffle combining starting from VSELECT/BLENDV nodes - this should eventually help improve the codegen reported at Issue #54819
Simon Pilgrim [Tue, 7 Jun 2022 13:17:23 +0000 (14:17 +0100)]
[X86] x86-interleaved-access.ll - use nounwind to remove cfi noise from tests
Pengxuan Zheng [Tue, 7 Jun 2022 13:42:22 +0000 (06:42 -0700)]
[clang-cl] Add support for /kernel
MSVC defines _KERNEL_MODE when /kernel is passed.
Also, /kernel disables RTTI and C++ exception handling.
https://docs.microsoft.com/en-us/cpp/build/reference/kernel-create-kernel-mode-binary?view=msvc-170
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D126719
David Green [Tue, 7 Jun 2022 13:36:04 +0000 (14:36 +0100)]
[ARM] Fix MVE getShuffleCost legalized type check
The MVE shuffle costing for VREV instructions was making incorrect
assumptions as to legalized vector types remaining as vectors. Add a
quick check to ensure they are indeed vectors before attempting to get
the number of elements.
David Green [Tue, 7 Jun 2022 12:55:53 +0000 (13:55 +0100)]
[AArch64] Regenerate arm64-shifted-sext.ll and add a test from #55833. NFC
Simon Pilgrim [Tue, 7 Jun 2022 11:38:05 +0000 (12:38 +0100)]
[X86] X86SpeculativeLoadHardening.cpp - pass DebugLoc by const reference not value.
Simon Pilgrim [Tue, 7 Jun 2022 11:36:30 +0000 (12:36 +0100)]
[X86] foldMaskedMergeImpl - pass SDLoc by const reference not value.
Guillaume Chatelet [Tue, 7 Jun 2022 11:20:44 +0000 (11:20 +0000)]
Fix change of variable name in test
J. Ryan Stinnett [Wed, 1 Jun 2022 10:04:46 +0000 (11:04 +0100)]
[DebugInfo][Docs] Improve code formatting in instruction referencing doc
This adds code blocks and inline code formatting to improve the readability of
the instruction referencing doc.
Reviewed By: Orlando
Differential Revision: https://reviews.llvm.org/D126767
Martin Boehme [Tue, 7 Jun 2022 11:03:56 +0000 (13:03 +0200)]
[clang-tidy] Fix syntax error in release notes.
Introduced by
https://github.com/llvm/llvm-project/commit/
1b664460fa4cb507e2af87c48cd269964f3ad747
Sorry for the breakage.
Gabor Marton [Thu, 2 Jun 2022 13:05:45 +0000 (15:05 +0200)]
[analyzer] Remove NotifyAssumeClients
Depends on D126560.
Differential Revision: https://reviews.llvm.org/D126878
Martin Boehme [Tue, 7 Jun 2022 09:00:24 +0000 (11:00 +0200)]
[clang-tidy] `bugprone-use-after-move`: Don't warn on self-moves.
Reviewed By: sammccall, njames93
Differential Revision: https://reviews.llvm.org/D126853
Gabor Marton [Tue, 7 Jun 2022 08:29:54 +0000 (10:29 +0200)]
[analyzer][NFC] Add LLVM_UNLIKELY to assumeDualImpl
Aligned with the measures we had in D124674, this condition seems to be
unlikely.
Nevertheless, I've made some new measurments with stats just for this,
and data confirms this is indeed unlikely.
Differential Revision: https://reviews.llvm.org/D127190
Yuki Okushi [Sun, 5 Jun 2022 03:30:50 +0000 (12:30 +0900)]
[clang] Remove some `U+C2AD`s in `__cpp_multidimensional_subscript`
The `Builder.defineMacro("__cpp_multidimensional_subscript", "202110L");` line has
some `U+C2AD`s that shouldn't necessary here. So removed them.
Differential Revision: https://reviews.llvm.org/D127066
David Sherwood [Tue, 7 Jun 2022 10:00:33 +0000 (11:00 +0100)]
[NFC][InstCombine] Add two more tests to select-binop-foldable-floating-point.ll
Pre-commit some tests as part of https://reviews.llvm.org/D126774
Kiran Chandramohan [Tue, 7 Jun 2022 09:57:38 +0000 (09:57 +0000)]
[Flang] Add flag dependent code to execute the loop-body atleast once
Given the flag `--always-execute-loop-body` the compiler emits code
to execute the body of the loop atleast once.
Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.
Reviewed By: awarzynski, schweitz
Differential Revision: https://reviews.llvm.org/D127128
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Sameeran Joshi <sameeranjayant.joshi@amd.com>
owenca [Fri, 3 Jun 2022 21:19:00 +0000 (14:19 -0700)]
[clang-format][NFC] Clean up the unwrapped line parser
Change the signatures of parseBlock(), parseLevel(), and
parseStructuralElement() to support combining else and if when
removing braces. See #55663.
Differential Revision: https://reviews.llvm.org/D127005
Simon Pilgrim [Tue, 7 Jun 2022 09:50:21 +0000 (10:50 +0100)]
[X86] LowerGC_TRANSITION - remove redundant SDLoc().
Kiran Chandramohan [Tue, 7 Jun 2022 09:44:20 +0000 (09:44 +0000)]
[Flang,MLIR,OpenMP] Fix a few tests that were not converting to LLVM
A few OpenMP tests were retaining the FIR operands even after running
the LLVM conversion pass. To fix these tests the legality checkes for
OpenMP conversion are made stricter to include operands and results.
The Flush, Single and Sections operations are added to conversions or
legality checks. The RegionLessOpConversion is appropriately renamed
to clarify that it works only for operations with Variable operands.
The operands of the flush operation are changed to match those of
Variable Operands.
Fix for an OpenMP issue mentioned in
https://github.com/llvm/llvm-project/issues/55210.
Reviewed By: shraiysh, peixin, awarzynski
Differential Revision: https://reviews.llvm.org/D127092
Alex Zinenko [Tue, 7 Jun 2022 09:51:24 +0000 (11:51 +0200)]
[mlir] fix documentation format in SCF
Four leading spaces are interpreted as a code block in markdown. Unless
used consistently in ODS op description, they cannot be stripped away by
the tablegen backend, which results in malformed markdown being
generated.
Guillaume Chatelet [Tue, 7 Jun 2022 09:49:36 +0000 (09:49 +0000)]
Cleanup sema checking for buitlin_memcpy_inline
David Sherwood [Wed, 1 Jun 2022 13:01:37 +0000 (14:01 +0100)]
[LoopVectorize] Add FastMathFlags to the select used for reductions with tail-folding
Based on reviewer comments on https://reviews.llvm.org/D126692 I've
added FastMathFlags to the select instruction used when tail-folding
with reductions. These flags can then be used by InstCombine to
decide upon the most optimal floating point identity value for
fadd/fsub. Doing so unlocks further optimisations, such as folding
selects into masked loads.
Differential Revision: https://reviews.llvm.org/D126778
Alexander Batashev [Tue, 7 Jun 2022 09:13:59 +0000 (12:13 +0300)]
[mlir][spirv] Correctly deduce PhysicalStorageBuffer64 addressing model
According to the SPIR-V specification[1], PhysicalStorageBuffer storage
class can only be used iff addressing model is PhysicalStorageBuffer64.
[1]: https://www.khronos.org/registry/SPIR-V/specs/unified1/SPIRV.html#_addressing_model
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D127067
Jay Foad [Wed, 6 Oct 2021 11:14:55 +0000 (12:14 +0100)]
[APInt] Remove truncOrSelf, zextOrSelf and sextOrSelf
Differential Revision: https://reviews.llvm.org/D125559
Haojian Wu [Tue, 7 Jun 2022 08:51:45 +0000 (10:51 +0200)]
[pseudo]Pull out the operator< test, NFC
Fix the review comment in https://reviews.llvm.org/D125479.
Haojian Wu [Tue, 7 Jun 2022 08:44:30 +0000 (10:44 +0200)]
[pseudo] Fix the incorrect parameters-and-qualifiers rule.
The parenthese body should be parameter-declaration-clause, rather
than parameter-declaration-list.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D125479
Muhammad Omair Javaid [Tue, 7 Jun 2022 08:09:13 +0000 (12:09 +0400)]
[LLDB] Avoid using -fno-builtin for building API tests
This patch removes use of -fno-builtin flag for building LLDB API
tests.
LLDB API tests are built using Makefile.rules where we were using
-fno-builtin flag to avoid gcc intrinsic optimization conflicting
with Android runtime in past.
Now that we no longer use gcc for building testsuite and compiling
LLDB API tests on AArch64/Windows require clang to optimize certain
calls like _setjmp to setjmpex as former is not implemented by
AArch64 windows runtime.
Haojian Wu [Fri, 3 Jun 2022 20:01:36 +0000 (22:01 +0200)]
[pseudo] Fix the type-parameter rule.
The IDENTIFIER should be optional.
Differential Revision: https://reviews.llvm.org/D126998
Haojian Wu [Fri, 3 Jun 2022 19:47:11 +0000 (21:47 +0200)]
[pseudo] Handle the language predefined identifier __func__
The clang lexer lexes it as a dedicated token kind (rather than
identifier), we extend the grammar to handle it.
Differential Revision: https://reviews.llvm.org/D126996
lorenzo chelini [Thu, 2 Jun 2022 13:56:01 +0000 (15:56 +0200)]
[MLIR][LLVMIR] Add round intrinsic
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D126879
Haojian Wu [Fri, 3 Jun 2022 19:13:26 +0000 (21:13 +0200)]
[pseudo] Fix noptr-abstract-declarator rule.
The const-expression in the [] can be empty.
Differential Revision: https://reviews.llvm.org/D126992
Nikita Popov [Mon, 30 May 2022 13:05:04 +0000 (15:05 +0200)]
[SCCP] Don't mark ranges from branch conditions as potentially undef
Now that transforms introducing branch on poison have been removed,
we can stop marking ranges that have been derived from branch
conditions as containing undef. The existing comment explains why
this is legal. I've checked that alive2 is happy with SCCP tests
after this change.
Differential Revision: https://reviews.llvm.org/D126647
Haojian Wu [Fri, 3 Jun 2022 19:02:25 +0000 (21:02 +0200)]
[pseudo] Fix the member-specification grammar rule.
The grammar rule is not right, doesn't match the standard one.
Differential Revision: https://reviews.llvm.org/D126991
Andrzej Warzynski [Tue, 7 Jun 2022 08:09:26 +0000 (08:09 +0000)]
[flang][docs] Remove the out-dated note on Windows support
Building Flang on Windows *is supported*. It's been tested there for
quite a while now:
* https://lab.llvm.org/buildbot/#/builders/172
Submitting this without a review as the current note in the readme file
is clearly incorrect.
Nikita Popov [Fri, 3 Jun 2022 09:11:03 +0000 (11:11 +0200)]
[DAGCombiner] Remove overzealous assertion when folding assert+trunc+assert (PR55846)
These assert that there are no "useless" assertzext/assertsext nodes
(that assert a wider width than a following trunc), but I don't think
there is anything preventing such nodes from reaching this code.
I don't think the assertion is relevant for correctness of this
transform either -- if such an assert is present, then the other
one will always be to a smaller width, and we'll pick that one.
The assertion dates back to D37017.
Fixes https://github.com/llvm/llvm-project/issues/55846.
Differential Revision: https://reviews.llvm.org/D126952
lewuathe [Tue, 7 Jun 2022 07:37:20 +0000 (09:37 +0200)]
[mlir][complex] Add complex.conj op
Add complex.conj op to calculate the complex conjugate which is widely used for the mathematical operation on the complex space.
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D127181
Fangrui Song [Tue, 7 Jun 2022 07:31:02 +0000 (00:31 -0700)]
[MC] De-capitalize MCStreamer functions
Follow-up to
c031378ce01b8485ba0ef486654bc9393c4ac024 .
The class is mostly consistent now.
Peixin-Qiao [Tue, 7 Jun 2022 07:08:17 +0000 (15:08 +0800)]
[flang][OpenMP] Support lowering parse-tree to MLIR for threadprivate directive
This supports lowering parse-tree to MLIR for threadprivate directive
following the OpenMP 5.1 [2.21.2] standard. Take the following as an
example:
```
program m
integer, save :: i
!$omp threadprivate(i)
call sub(i)
!$omp parallel
call sub(i)
!$omp end parallel
end
```
```
func.func @_QQmain() {
%0 = fir.address_of(@_QFEi) : !fir.ref<i32>
%1 = omp.threadprivate %0 : !fir.ref<i32> -> !fir.ref<i32>
fir.call @_QPsub(%1) : (!fir.ref<i32>) -> ()
omp.parallel {
%2 = omp.threadprivate %0 : !fir.ref<i32> -> !fir.ref<i32>
fir.call @_QPsub(%2) : (!fir.ref<i32>) -> ()
omp.terminator
}
return
}
```
A threadprivate operation (omp.threadprivate) is created for all
references to a threadprivate variable. The runtime will appropriately
return a threadprivate var (%1 as above) or its copy (%2 as above)
depending on whether it is outside or inside a parallel region. For
threadprivate access outside the parallel region, the threadprivate
operation is created in instantiateVar. Inside the parallel region, it
is created in createBodyOfOp.
One new utility function collectSymbolSet is created for collecting
all the variables with a property within a evaluation, which may be one
Fortran, or OpenMP, or OpenACC construct.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D124226
Peixin-Qiao [Tue, 7 Jun 2022 06:58:44 +0000 (14:58 +0800)]
[flang] Fix XArrayCoorOp conversion for index type slices
The previous XArrayCoorOp conversion forgot to change getting the
operands from OpAdaptor for upper bound and step of slice. This leads to
the fail of incompatible of types of codegen when slices are index type.
Reviewed By: kiranchandramohan, schweitz
Differential Revision: https://reviews.llvm.org/D125967
Peixin-Qiao [Tue, 7 Jun 2022 06:55:31 +0000 (14:55 +0800)]
[flang] Fix semantic checks for C919
The previous semantic analysis does not consider when the last part-ref
is scalar or complex part. Refactor the previous code and bring all the
checks into one place. The check starts from the designator by
extracting the dataref wrapped including the substring and complex part
and recursively check the base objects.
Co-authored-by: Peter Klausler <pklausler@nvidia.com>
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D126595
Jeff Bailey [Tue, 7 Jun 2022 06:52:02 +0000 (06:52 +0000)]
Replace Goals and Why section with Introduction
Rewrite the introduction of the page to state clearly the goals of
LLVM's libc project.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D127174
lorenzo chelini [Sat, 4 Jun 2022 16:30:03 +0000 (18:30 +0200)]
[MLIR][SCF] Fix top-level comment (NFC)
Gabor Marton [Fri, 27 May 2022 18:44:43 +0000 (20:44 +0200)]
[analyzer] Track assume call stack to detect fixpoint
Assume functions might recurse (see `reAssume` or `tryRearrange`).
During the recursion, the State might not change anymore, that means we
reached a fixpoint. In this patch, we avoid infinite recursion of assume
calls by checking already visited States on the stack of assume function
calls. This patch renders the previous "workaround" solution (D47155)
unnecessary. Note that this is not an NFC patch. If we were to limit the
maximum stack depth of the assume calls to 1 then would it be equivalent
with the previous solution in D47155.
Additionally, in D113753, we simplify the symbols right at the beginning
of evalBinOpNN. So, a call to `simplifySVal` in `getKnownValue` (added
in D51252) is no longer needed.
Fixes https://github.com/llvm/llvm-project/issues/55851
Differential Revision: https://reviews.llvm.org/D126560
luxufan [Mon, 6 Jun 2022 13:35:33 +0000 (21:35 +0800)]
[MC][ARM] Reuse symbol value in constant pool
Fix https://github.com/llvm/llvm-project/issues/55816
Before this patch, MCConstantExpr were reused, but MCSymbolExpr were
not. To reuse symbol value, this patch added a DenseMap to record the
symbol value.
Differential Revision: https://reviews.llvm.org/D127113
River Riddle [Tue, 7 Jun 2022 03:19:59 +0000 (20:19 -0700)]
[vscode-mlir] Bump to version 0.9
Since version 0.8 we've added:
* Switched PDLL and TableGen to use incremental doc updates
* Added support to PDLL for inlay hints
River Riddle [Wed, 18 May 2022 00:56:17 +0000 (17:56 -0700)]
[mlir:PDLL] Add support for inlay hints
These allow for displaying additional inline information,
such as the types of variables, names operands/results,
constraint/rewrite arguments, etc. This requires a bump in the
vscode extension to a newer version, as inlay hints are a new LSP feature.
Differential Revision: https://reviews.llvm.org/D126033
River Riddle [Tue, 17 May 2022 22:16:24 +0000 (15:16 -0700)]
[mlir:LSP] Switch document sync mode to Incremental
This is much more efficient over the full mode, as it only requires sending
smalls chunks of files. It also works around a weird command ordering
issue (full document updates are being sent after other commands like
code completion) in newer versions of vscode.
Differential Revision: https://reviews.llvm.org/D126032
Enna1 [Tue, 7 Jun 2022 03:15:12 +0000 (11:15 +0800)]
[ASan] Skip any instruction inserted by another instrumentation.
Currently, we only check !nosanitize metadata for instruction passed to function `getInterestingMemoryOperands()` or instruction which is a cannot return callable instruction.
This patch add this check to any instruction.
E.g. ASan shouldn't instrument the instruction inserted by UBSan/pointer-overflow.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D126269
Evgeny Shulgin [Tue, 7 Jun 2022 02:51:59 +0000 (10:51 +0800)]
[clang] Allow consteval functions in default arguments
We should not mark a function as "referenced" if we call it within a
ConstantExpr, because the expression will be folded to a value in LLVM
IR. To prevent emitting consteval function declarations, we should not "jump
over" a ConstantExpr when it is a top-level ParmVarDecl's subexpression.
Fixes https://github.com/llvm/llvm-project/issues/48230
Reviewed By: erichkeane, aaron.ballman, ChuanqiXu
Differenitial Revision: https://reviews.llvm.org/D119646
Arthur Eubanks [Tue, 7 Jun 2022 02:38:50 +0000 (19:38 -0700)]
[NFC] Properly suppress unused argument warning in __isOSVersionAtLeast()
Casting to non-void causes
expression result unused [-Wunused-value]
jacquesguan [Mon, 6 Jun 2022 04:32:35 +0000 (04:32 +0000)]
[NFC] Use predecessors to replace make_range.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D127085
Akira Hatanaka [Tue, 17 May 2022 16:37:29 +0000 (09:37 -0700)]
[gmodules] Skip CXXDeductionGuideDecls when visiting FunctionDecls in
DebugTypeVisitor
This recommits d1346e2. I've added a line to the test case to enable it
only on assert builds.
Differential Revision: https://reviews.llvm.org/D125839
Akira Hatanaka [Tue, 7 Jun 2022 01:48:24 +0000 (18:48 -0700)]
Revert "[gmodules] Skip CXXDeductionGuideDecls when visiting FunctionDecls in"
This reverts commit
d1346e2ee2741919a8cc1b1ffe400001e76a6d06.
The commit broke a few bots.
River Riddle [Tue, 7 Jun 2022 01:29:20 +0000 (18:29 -0700)]
[mlir] Add documentation for TableGen LSP features and setup
This commit beefs up the documentation for MLIR language servers by
adding proper documentations/examples/etc for the provided TableGen
language server capabilities. Given that this documentation is also used
for the vscode extension, this commit also updates the user facing vscode
extension documentation.
Note that the images referenced in the new documentation are hosted on
the website, and will be commited to mlir-www shortly after this commit
lands.
Thomas Lively [Tue, 7 Jun 2022 00:56:39 +0000 (17:56 -0700)]
[WebAssembly][NFC] RelaxedBinary tablegen multiclass for relaxed SIMD
Refactor the tablegen definitions for relaxed SIMD min/max instructions to use a
shared RelaxedBinary multiclass modeled on the existing SIMDBinary multiclass. A
future commit will add further instruction definitions that use RelaxedBinary.
Also rename the SIMD_RELAXED_CONVERT multiclass to RelaxedConvert to better fit
existing naming conventions.
Reviewed By: aheejin
Differential Revision: https://reviews.llvm.org/D127157
Chris Bieneman [Tue, 7 Jun 2022 00:38:15 +0000 (19:38 -0500)]
[NFC] Fix spelling error M->L
Clearly I cannot spell...
Chris Bieneman [Tue, 7 Jun 2022 00:25:25 +0000 (19:25 -0500)]
Fix big endian build bots
Another case of reading a value from a struct that has been byte
swapped to write out. This should address the failure on the ppcbe bot.
Pengxuan Zheng [Sat, 4 Jun 2022 19:22:38 +0000 (12:22 -0700)]
[Object][Archive] Support a new archive member /<ECSYMBOLS>/
Some libraries (e.g., arm64rt.lib) from the Windows WDK (version 10.0.22000.0)
contain an undocumented special member '/<ECSYMBOLS>/'. This causes llvm-lib to
fail with the following error:
"truncated or malformed archive (long name offset characters after the '/' are
not all decimal numbers: '<ECSYMBOLS>/' for archive member header at offset 162)"
The '/<ECSYMBOLS>/' member does not seem to be documented anywhere, but might be
related to the ARM64EC ABI Microsoft announced last year.
https://blogs.windows.com/windowsdeveloper/2021/06/28/announcing-arm64ec-building-native-and-interoperable-apps-for-windows-11-on-arm/
Reviewed By: thieta, thakis
Differential Revision: https://reviews.llvm.org/D127135