Kazu Hirata [Thu, 13 Jan 2022 06:12:01 +0000 (22:12 -0800)]
[clang] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
Kazu Hirata [Thu, 13 Jan 2022 06:11:59 +0000 (22:11 -0800)]
[Sema] Fix a bugprone argument comment (NFC)
Identified with bugprone-argument-comment.
Kazu Hirata [Thu, 13 Jan 2022 06:11:57 +0000 (22:11 -0800)]
[CSKY] Ensure a newline at the end of a file (NFC)
Igor Kudrin [Thu, 13 Jan 2022 04:38:26 +0000 (11:38 +0700)]
[ELF] Use tombstone values for discarded symbols in relocatable output
This extends D81784. Sections can be discarded when linking a
relocatable output. Before the patch, LLD did not update the content
of debug sections and only replaced the corresponding relocations with
R_*_NONE, which could break the debug information.
Differential Revision: https://reviews.llvm.org/D116946
Arthur O'Dwyer [Tue, 11 Jan 2022 16:27:53 +0000 (11:27 -0500)]
[libc++] [ranges] Implement ranges::cdata.
Differential Revision: https://reviews.llvm.org/D117044
James Y Knight [Thu, 13 Jan 2022 02:59:49 +0000 (02:59 +0000)]
Revert "[Inline] Attempt to delete any discardable if unused functions"
Somehow this ends up causing an infinite loop in the inliner.
This reverts commit
d5be48c66d3e5e8be21805c3a33dc67a20e258be.
Amir Ayupov [Thu, 13 Jan 2022 03:06:03 +0000 (19:06 -0800)]
[BOLT] Update repo location in Dockerfile
Lian Wang [Thu, 13 Jan 2022 02:53:00 +0000 (02:53 +0000)]
[RISCV] Add bfp and bfpw intrinsic in zbf extension
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D116994
Philip Reames [Thu, 13 Jan 2022 01:32:05 +0000 (17:32 -0800)]
[Attributor] Simplify how we handle required alignment during heap-to-stack [NFC]
The existing code duplicated the same concern in two places, and (weirdly) changed the inference of the allocation size based on whether we could meet the alignment requirement. Instead, just directly check the allocation requirement.
Peter Klausler [Wed, 29 Dec 2021 20:51:39 +0000 (12:51 -0800)]
[flang] RESHAPE(PAD=) can be arbitrary array rank
The "pad=" argument in the intrinsic function table entry for RESHAPE
has a Rank::Array constraint, and that would be fine if not for RESHAPE
already having an earlier argument that's Rank::Array. It's the only
intrinsic that has multiple Rank::Array arguments. The checking for
the Rank::Array constraint was enforcing that multiple occurrences
of it have the same rank in a call, and that's not appropriate.
Differential Revision: https://reviews.llvm.org/D117149
Shoaib Meenai [Thu, 13 Jan 2022 01:28:25 +0000 (17:28 -0800)]
[bolt] Fix relative links in README
The README is in the `bolt` subdirectory now, so relative links need to
be adjusted accordingly.
Kevin Athey [Wed, 12 Jan 2022 21:29:55 +0000 (13:29 -0800)]
[NFC] Minimize noundef analysis when disabled
Minor adjustment in order of noundef analysis to be a bit more optimal (when disabled).
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D117078
Lang Hames [Wed, 12 Jan 2022 21:09:05 +0000 (08:09 +1100)]
[JITLink] Fix assert condition broken in
118e953b18ff0.
The condition was accidentally changed from A != InvalidAddr to A != 0, this
commit changes it back.
Philip Reames [Thu, 13 Jan 2022 00:43:02 +0000 (16:43 -0800)]
[Attributor] Generalize calloc handling in heap-to-stack for any init value [NFC]
Rewrite the calloc specific handling in heap-to-stack to allow arbitrary init values. The basic problem being solved is that if an allocation is initilized to anything other than zero, this must be explicitly done for the formed alloca as well.
This covers the calloc case today, but once a couple of earlier guards are removed in this code, downstream allocators with other init values could also be handled.
Inspired by discussion on D116971
Philip Reames [Thu, 13 Jan 2022 00:16:36 +0000 (16:16 -0800)]
[Attributor] Reuse object size evaluation code [NFC]
Philip Reames [Thu, 13 Jan 2022 00:04:18 +0000 (16:04 -0800)]
[Attributor] Use getAllocAlignment where possible [NFC]
Inspired by D116971.
Matt Arsenault [Mon, 13 Dec 2021 21:26:02 +0000 (16:26 -0500)]
AMDGPU: Fix assert on function argument as loop condition
Stanislav Mekhanoshin [Tue, 11 Jan 2022 22:03:58 +0000 (14:03 -0800)]
[AMDGPU] Fixed physreg asm constraint parsing
We are always failing parsing of the physreg constraint because
we do not drop trailing brace, thus getAsInteger() returns a
non-empty string and we delegate reparsing to the TargetLowering.
In addition it did not parse register tuples.
Fixed which has allowed to remove w/a in two places we call it.
Differential Revision: https://reviews.llvm.org/D117055
Emily Shi [Tue, 11 Jan 2022 03:28:08 +0000 (19:28 -0800)]
[compiler-rt][darwin] check for strcmp to test interceptors instead of pthread_create
If `pthread_create` is not available on a platform, we won't be able to check if interceptors work. Use `strcmp` instead.
Reviewed By: yln
Differential Revision: https://reviews.llvm.org/D116989
LLVM GN Syncbot [Thu, 13 Jan 2022 00:08:45 +0000 (00:08 +0000)]
[gn build] Port
b9bc3c107c6c
Andrew Litteken [Thu, 6 Jan 2022 21:34:44 +0000 (15:34 -0600)]
[CostModel] Use cost of target trunc type when only it is the only use of a non-register sized load
The code size cost model for most targets uses the legalization cost for the type of the pointer of a load. If this load is followed directly by a trunc instruction, and is the only use of the result of the load, only one instruction is generated in the target assembly language. This adds a check for this case, and uses the target type of the trunc instruction if so.
This did not show any changes in CTMark code size benchmarks.
Reviewers: paquette, samparker, dmgreen
Differential Revision: https://reviews.llvm.org/D109388
Peter Klausler [Wed, 29 Dec 2021 20:14:25 +0000 (12:14 -0800)]
[flang] Fix handling of space between # and name in preprocessor stringification
When preprocessing "# ARG" in function-like macro expansion,
the preprocessor needs to pop the previously-pushed '#' token
from the end of the resulting token sequence after detecting the
argument name. The code to do this was just wrong in a couple of
ways.
Differential Revision: https://reviews.llvm.org/D117148
Konstantin Varlamov [Thu, 13 Jan 2022 00:00:44 +0000 (16:00 -0800)]
[libc++][ranges] Implement `construct_at` and `destroy{,_at}`.
Differential Revision: https://reviews.llvm.org/D116078
Matt Arsenault [Wed, 12 Jan 2022 20:31:51 +0000 (15:31 -0500)]
GlobalISel: Always enable GISelKnownBits for InstructionSelect
This wasn't running at -O0, and causing crashes for AMDGPU. AMDGPU
needs this to match the addressing modes of stack access instructions,
which is even more important at -O0 than with optimizations.
It currently costs nothing to run ahead of time, so just always enable
it.
Matt Arsenault [Wed, 1 Dec 2021 02:26:08 +0000 (21:26 -0500)]
RegScavenger: Remove used regs from scavenge candidates
In a future change, AMDGPU will have 2 emergency scavenging indexes in
some situations. The secondary scavenging index ends up being used
recursively when the scavenger calls eliminateFrameIndex for the
emergency spill slot. Without this, it would end up seeing the same
register which was just scavenged in the parent call as free, inserts
a second emergency spill to the same location and returns the same
register when 2 unique free registers are required.
We need to only do this if the register is used. SystemZ uses 2
scavenging slots, but calls the scavenger twice in sequence and not
recursively. In this case the previously scavenged register can be
re-clobbered, but is still tracked in the scavenger until it sees the
deferred restore instruction.
Matt Arsenault [Wed, 12 Jan 2022 20:01:27 +0000 (15:01 -0500)]
AMDGPU/GlobalISel: Fix assertions on legalize queries with huge align
For some reason we pass around the alignment in bits as uint64_t. Two
places were truncating it to unsigned, and losing bits in extreme
cases.
Matt Arsenault [Sun, 9 Jan 2022 22:42:09 +0000 (17:42 -0500)]
AMDGPU: Add base test for future optimization patch
Matt Arsenault [Tue, 4 Jan 2022 22:53:52 +0000 (17:53 -0500)]
IR: Make getRetAlign check callee function attributes
The attribute queries semi-consistently check the attribute set, and
then fallback to checking the callee's attributes.
Matt Arsenault [Tue, 4 Jan 2022 21:33:20 +0000 (16:33 -0500)]
GlobalISel: Add G_ASSERT_ALIGN hint instruction
Insert it for call return values only for now, which is the only case
the DAG handles also.
Arthur O'Dwyer [Tue, 11 Jan 2022 19:58:32 +0000 (14:58 -0500)]
[libc++] [ranges] Finish ADL-proofing ranges::data.
This should have been part of D116239.
Arthur O'Dwyer [Tue, 11 Jan 2022 16:05:41 +0000 (11:05 -0500)]
[libc++] [ranges] Fix a missing auto(x) cast in ranges::data.
Also remove some bogus `std::forward`s. My impression is that these
forwards were actually harmless, because `ranges::begin(FWD(t))` is
always identical to `ranges::begin(t)` (except when it's ill-formed,
and that can't happen in this case). However, they're also superfluous
and don't reflect the wording in the standard, so let's eliminate them.
Differential Revision: https://reviews.llvm.org/D117043
Amara Emerson [Wed, 12 Jan 2022 22:54:11 +0000 (14:54 -0800)]
[AArch64][GlobalISel] Re-generate checks for a test.
River Riddle [Mon, 3 Jan 2022 07:12:03 +0000 (23:12 -0800)]
[mlir] Add a parsePassPipeline overload that returns a new pass manager
This overload parses a pipeline string that contains the anchor operation type, and returns an OpPassManager
corresponding to the provided pipeline. This is useful for various situations, such as dynamic pass pipelines
which are not anchored within a parent pass pipeline.
fixes #52813
Differential Revision: https://reviews.llvm.org/D116525
Michael Jones [Wed, 12 Jan 2022 22:33:03 +0000 (14:33 -0800)]
[libc] fix strtold_test formatting on ARM
I missed a variable when reformatting the tests. This fixes that.
Differential Revision: https://reviews.llvm.org/D117161
Daniel McIntosh [Wed, 8 Dec 2021 18:22:52 +0000 (13:22 -0500)]
[libcxxabi] Added convenience classes to cxa_guard
This is the 5th of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.
Depends on D115368
Reviewed By: ldionne, #libc_abi
Differential Revision: https://reviews.llvm.org/D115369
Daniel McIntosh [Wed, 8 Dec 2021 18:16:21 +0000 (13:16 -0500)]
[libcxxabi] Re-organized inheritance structure to remove CRTP in cxa_guard
Currently, the `InitByte...` classes inherit from `GuardObject` so they can
access the `base_address`, `init_byte_address` and `thread_id_address`. Then,
since `GuardObject` needs to call `acquire`/`release`/`abort_init_byte`, it uses
the curiously recurring template pattern (CRTP). This is rather messy.
Instead, we'll have `GuardObject` contain an instance of `InitByte`, and pass it
the addresses it needs in the constructor. `GuardObject` doesn't need the
addresses anyways, so it makes more sense for `InitByte` to keep them instead of
`GuardObject`. Then, `GuardObject` can call `acquire`/`release`/`abort` as one
of `InitByte`'s member functions.
Organizing things this way not only gets rid of the use of the CRTP, but also
improves separation of concerns a bit since the `InitByte` classes are no longer
indirectly responsible for things because of their inheritance from
`GuardObject`. This means we no longer have strange things like calling
`InitByteFutex.cxa_guard_acquire`, instead we call
`GuardObject<InitByteFutex>.cxa_guard_acquire`.
This is the 4th of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.
Depends on D115367
Reviewed By: ldionne, #libc_abi
Differential Revision: https://reviews.llvm.org/D115368
Daniel McIntosh [Wed, 8 Dec 2021 17:53:03 +0000 (12:53 -0500)]
[libcxxabi] Pulled guard byte code out of GuardObject
Right now, GuardObject is in charge of both reading and writing to the guard
byte, and co-ordinating with the InitByte... classes. In order to improve
separation of concerns, create a separate class responsible for managing the
guard byte and use that inside GuardObject.
This is the 3rd of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.
Depends on D110088
Reviewed By: ldionne, #libc_abi
Differential Revision: https://reviews.llvm.org/D115367
Daniel McIntosh [Mon, 16 Aug 2021 18:07:55 +0000 (14:07 -0400)]
[libcxxabi] Make InitByteGlobalMutex check GetThreadID instead of PlatformThreadID
By relying on PlatformSupportsThreadID, InitByteGlobalMutex disregards
the GetThreadID template argument, rendering it useless.
This is the 2nd of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.
Depends on D109539
Reviewed By: ldionne, #libc_abi
Differential Revision: https://reviews.llvm.org/D110088
Daniel McIntosh [Wed, 11 Aug 2021 14:47:48 +0000 (10:47 -0400)]
[NFC][libcxxabi] Rename GlobalLock to GlobalMutex
This will make the naming more consistent with what it's called in the
rest of the file.
This is the 1st of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.
Reviewed By: ldionne, #libc_abi
Differential Revision: https://reviews.llvm.org/D109539
Michael Jones [Wed, 12 Jan 2022 21:44:10 +0000 (13:44 -0800)]
[libc] add working ARM entrypoints
Some functions were added to x86_64 that were untested on Aarch64. Now
that I've had an opportunity to test them, they all work on Aarch64 with
the minor formatting change included.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D117146
natashaknk [Wed, 12 Jan 2022 22:10:27 +0000 (14:10 -0800)]
[tosa][mlir] Support dynamic batch dimension for ops where the batch dim is explicit
Dynamic batch for rescale, gather, max_pool, avg_pool, conv2D and depthwise_conv2D. Split helper functions into a separate header file.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D117031
River Riddle [Mon, 10 Jan 2022 18:55:57 +0000 (10:55 -0800)]
[mlir] Refactor ShapedType into an interface
ShapedType was created in a time before interfaces, and is one of the earliest
type base classes in the ecosystem. This commit refactors ShapedType into
an interface, which is what it would have been if interfaces had existed at that
time. The API of ShapedType and it's derived classes are essentially untouched
by this refactor, with the exception being the API surrounding kDynamicIndex
(which requires a sole home).
For now, the API of ShapedType and its name have been kept as consistent to
the current state of the world as possible (to help with potential migration churn,
among other reasons). Moving forward though, we should look into potentially
restructuring its API and possible its name as well (it should really have "Interface"
at the end like other interfaces at the very least).
One other potentially interesting note is that I've attached the ShapedType::Trait
to TensorType/BaseMemRefType to act as mixins for the ShapedType API. This
is kind of weird, but allows for sharing the same API (i.e. preventing API loss from
the transition from base class -> Interface). This inheritance doesn't affect any
of the derived classes, it is just for API mixin.
Differential Revision: https://reviews.llvm.org/D116962
River Riddle [Sat, 8 Jan 2022 01:41:06 +0000 (17:41 -0800)]
[mlir][Interfaces] Add a extraSharedClassDeclaration field
This field allows for defining a code block that is placed in both the interface
and trait declarations. This is very useful when defining a set of utilities to
expose on both the Interface class and the derived attribute/operation/type.
In non-static methods, `$_attr`/`$_op`/`$_type` (depending on the type of
interface) may be used to refer to an instance of the IR entity. In the interface
declaration, this is an instance of the interface class. In the trait declaration,
this is an instance of the concrete entity class (e.g. `IntegerAttr`, `FuncOp`, etc.).
Differential Revision: https://reviews.llvm.org/D116961
Rob Suderman [Wed, 12 Jan 2022 19:28:34 +0000 (11:28 -0800)]
[mlir][tosa] Expand tosa.apply_scale lowering for vectors
Apply scale may encounter scalar, tensor, or vector operations. Expand the
lowering so that it can lower arbitrary of container types.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D117080
Tomas Matheson [Mon, 13 Dec 2021 14:57:09 +0000 (14:57 +0000)]
clang support for Armv8.8/9.3 HBC
This introduces clang command line support for new Armv8.8-A and
Armv9.3-A Hinted Conditional Branches feature, previously introduced
into LLVM in https://reviews.llvm.org/D116156.
Patch by Tomas Matheson and Son Tuan Vu.
Differential Revision: https://reviews.llvm.org/D116939
River Riddle [Tue, 4 Jan 2022 21:19:23 +0000 (13:19 -0800)]
[mlir] Remove populateFuncOpTypeConversionPattern
This method simply forwards to populateFunctionLikeTypeConversionPattern,
which is more general. This also helps to remove special treatment of FuncOp from
DialectConversion.
Differential Revision: https://reviews.llvm.org/D116624
CJ Johnson [Tue, 30 Nov 2021 23:17:24 +0000 (18:17 -0500)]
Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr
Updates the check and tests to not diagnose the null case for string_view (but retains it for string). This prevents the check from giving duplicate warnings that are caught by bugprone-stringview-nullptr ([[ https://reviews.llvm.org/D113148 | D113148 ]]).
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D114823
Luís Ferreira [Wed, 12 Jan 2022 21:37:41 +0000 (21:37 +0000)]
[Demangle] Pass Ret parameter from decodeNumber by reference
Since Ret parameter is never meant to be nullptr, let's pass it by reference instead of a raw pointer.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D117046
Luís Ferreira [Wed, 12 Jan 2022 21:37:40 +0000 (21:37 +0000)]
[Demangle] Add support for D types back referencing
This patch adds support for type back referencing, allowing demangling of
compressed mangled symbols with repetitive types.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D111419
Luís Ferreira [Wed, 12 Jan 2022 21:37:37 +0000 (21:37 +0000)]
[Demangle] Add support for D symbols back referencing
This patch adds support for identifier back referencing allowing compressed
mangled names by avoiding repetitiveness.
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D111417
Luís Ferreira [Wed, 12 Jan 2022 21:37:34 +0000 (21:37 +0000)]
[Demangle] Add minimal support for D simple basic types
This patch implements simple demangling of two basic types to add minimal type functionality. This will be later used in function type parsing. After that being implemented we can add the rest of the types and test the result of the type name.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D111416
CJ Johnson [Sun, 5 Dec 2021 19:11:02 +0000 (14:11 -0500)]
Add support for return values in bugprone-stringview-nullptr
bugprone-stringview-nullptr was not initially written with tests for return statements. After landing the check, the thought crossed my mind to add such tests. After writing them, I realized they needed additional handling in the matchers.
Differential Revision: https://reviews.llvm.org/D115121
Stanislav Gatev [Wed, 12 Jan 2022 16:28:59 +0000 (16:28 +0000)]
[clang][dataflow] Add transfer functions for initializers
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D117123
James Y Knight [Wed, 12 Jan 2022 18:14:56 +0000 (18:14 +0000)]
Omit "clang" from CHECK lines.
This avoids spurious failures in some environemnts.
Similar change to
eafc64ed6325eba962096d4a947d7e45e909bfde.
Konstantin Varlamov [Wed, 12 Jan 2022 21:09:28 +0000 (13:09 -0800)]
Revert "[libc++] Temporarily disable the in_out_result test on Fuchsia."
This reverts commit
9e634b35ff51d0eb2b38013111491e88bdbae388.
Fangrui Song [Wed, 12 Jan 2022 21:04:32 +0000 (13:04 -0800)]
[ELF] Change gnuHashTab/hashTab to unique_ptr. NFC
and remove associated make<XXX> calls.
My x86-64 `lld` is ~5KiB smaller.
Mehdi Amini [Wed, 12 Jan 2022 20:55:03 +0000 (20:55 +0000)]
Add llc to the list of build dependencies to test MLIR (Fix buildbot)
Richard [Thu, 30 Dec 2021 18:37:04 +0000 (11:37 -0700)]
[clang-tidy] Improve modernize-redundant-void-arg to recognize macro uses
Sometimes a macro invocation will look like an argument list
declaration. Improve the check to detect this situation and not
try to modify the macro invocation.
Thanks to Nathan James for the fix.
- Ignore implicit typedefs (e.g. compiler builtins)
- Improve lexing state machine to locate void argument tokens
- Add additional return_t() macro tests
- clang-format control in the test case file
- remove braces around single statements per LLVM style guide
Fixes #43791
Differential Revision: https://reviews.llvm.org/D116425
Fangrui Song [Wed, 12 Jan 2022 20:47:07 +0000 (12:47 -0800)]
[ELF] Refactor how .gnu.hash and .hash are discarded
Switch to the D114180 approach which is simpler and allows gnuHashTab/hashTab to
switch to unique_ptr.
Fangrui Song [Wed, 12 Jan 2022 20:43:49 +0000 (12:43 -0800)]
[ELF][test] Improve discard-gnu-hash.s to check DT_HASH and DT_GNU_HASH
Walter Erquinigo [Wed, 12 Jan 2022 20:36:23 +0000 (12:36 -0800)]
[CODE OWNERS] Add wallace as code owner
Mehdi Amini [Wed, 12 Jan 2022 20:33:26 +0000 (20:33 +0000)]
Add split-file to the MLIR test dependencies (Fix bot)
Kazu Hirata [Wed, 12 Jan 2022 20:31:43 +0000 (12:31 -0800)]
[mlir] Fix a warning
This patch fixes:
mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp:161:52: error:
'static_assert' with no message is a C++17 extension
[-Werror,-Wc++17-extensions]
Mehdi Amini [Tue, 11 Jan 2022 20:21:37 +0000 (20:21 +0000)]
Apply clang-tidy fixes for bugprone-macro-parentheses in Interop.h (NFC)
Mehdi Amini [Wed, 12 Jan 2022 18:56:21 +0000 (18:56 +0000)]
Add an example of integration test invoking MLIR source with Memref from C
Reviewed By: ftynse, nicolasvasilache, bondhugula
Differential Revision: https://reviews.llvm.org/D117072
Craig Topper [Wed, 12 Jan 2022 20:13:03 +0000 (12:13 -0800)]
[RISCV] Remove stale references to experimental-b. NFC
Differential Revision: https://reviews.llvm.org/D117136
Sanjay Patel [Wed, 12 Jan 2022 19:58:24 +0000 (14:58 -0500)]
[InstSimplify] use knownbits to fold more udiv/urem
We could use knownbits on both operands for even more folds (and there are
already tests in place for that), but this is enough to recover the example
from:
https://github.com/llvm/llvm-project/issues/51934
(the tests are derived from the code in that example)
I am assuming no noticeable compile-time impact from this because udiv/urem
are rare opcodes.
Differential Revision: https://reviews.llvm.org/D116616
River Riddle [Wed, 12 Jan 2022 19:20:18 +0000 (11:20 -0800)]
[mlir] Finish removing Identifier from the C++ API
There have been a few API pieces remaining to allow for a smooth transition for
downstream users, but these have been up for a few months now. After this only
the C API will have reference to "Identifier", but those will be reworked in a followup.
The main updates are:
* Identifier -> StringAttr
* StringAttr::get requires the context as the first parameter
- i.e. `Identifier::get("...", ctx)` -> `StringAttr::get(ctx, "...")`
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D116626
Christian Sigg [Tue, 11 Jan 2022 17:00:44 +0000 (18:00 +0100)]
Remove NaN constant from arith.minf, arith.maxf expansion
If any of the operands is NaN, return the operand instead of a new constant.
When the rhs operand is a constant, the second arith.cmpf+select ops will be folded away.
https://reviews.llvm.org/D117010 marks the two ops commutative, which will place the constant on the rhs.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D117011
Fangrui Song [Wed, 12 Jan 2022 19:55:22 +0000 (11:55 -0800)]
[ELF] Support discarding .relr.dyn
db08df0570b6dfaf00d7b1b8555c1d2d4effb224 does not work because part.relrDyn is
a unique_ptr and `reset` destroys the object which may still be referenced.
This commit uses the D114180 approach. Also improve the test to check that there
is no R_X86_64_RELATIVE.
Christian Sigg [Wed, 12 Jan 2022 11:48:38 +0000 (12:48 +0100)]
Fold arith.cmpf when at least one operand is known to be NaN.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D117101
Thomas Raoux [Fri, 7 Jan 2022 02:43:04 +0000 (18:43 -0800)]
[mlir][vector] Add folding for extract + extract/insert_strided
Differential Revision: https://reviews.llvm.org/D116785
Sanjay Patel [Tue, 11 Jan 2022 23:29:30 +0000 (18:29 -0500)]
[InstCombine] add tests for binop with phi operands; NFC
Fangrui Song [Wed, 12 Jan 2022 19:43:56 +0000 (11:43 -0800)]
[ELF][test] Temporarily remove .relr.dyn test which is not working
Nico Weber [Wed, 12 Jan 2022 19:40:09 +0000 (14:40 -0500)]
Revert "[JITLink][AArch64] Add support for splitting eh-frames on AArch64."
This reverts commit
253ce92844f72e3a6d0e423473f2765c2c5afd6a.
Breaks tests on Windows, see
https://github.com/llvm/llvm-project/issues/52921#issuecomment-
1011118896
Alex Bradbury [Wed, 12 Jan 2022 19:30:01 +0000 (19:30 +0000)]
[RISCV] Update recently ratified Zb{a,b,c,s} extensions to no longer be experimental
Agreed policy is that RISC-V extensions that have not yet been ratified
should be marked as experimental, and enabling them requires the use of
the -menable-experimental-extensions flag when using clang alongside the
version number. These extensions have now been ratified, so this is no
longer necessary, and the target feature names can be renamed to no
longer be prefixed with "experimental-".
Differential Revision: https://reviews.llvm.org/D117131
Fangrui Song [Wed, 12 Jan 2022 19:33:23 +0000 (11:33 -0800)]
[llvm-ar] Enforce one-dash form for long options
binutils ar does not support one-dash long options (they conflict with
operation code and modifier flags).
```
% ar -help
ar: invalid option -- 'e'
...
% ar -version
ar: invalid option -- 'e'
...
% ar x --plugin=xx x.a # ok
% ar x -plugin=xx x.a
ar: two different operation options specified
% ar -plugin=/usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so x x.a
ar: x: No such file or directory
```
Drop one-dash long options to simplify code and match the usual practice for
command line utilities.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D116977
Fangrui Song [Wed, 12 Jan 2022 19:32:30 +0000 (11:32 -0800)]
[llvm-ar][test] Test that --plugin is ignored
Matt Arsenault [Wed, 12 Jan 2022 18:12:03 +0000 (13:12 -0500)]
AMDGPU/GlobalISel: Regenerate mir test checks
Matt Arsenault [Tue, 11 Jan 2022 19:15:48 +0000 (14:15 -0500)]
AMDGPU/GlobalISel: Do not use terminator copy before waterfall loops
Stop using the _term variants of the mov to save the initial exec
value before the waterfall loop. This cannot be glued to the bottom of
the block because we may need to spill the result register. Just use a
regular mov, like the loops produced on the DAG path. Fixes some
verification errors with regalloc fast.
Matt Arsenault [Tue, 11 Jan 2022 16:03:10 +0000 (11:03 -0500)]
GlobalISel: Fix insert point in localizer
This was inserting the new G_CONSTANT after the use, and the later
block scan would run off the end. Fix calling SkipPHIsAndLabels for no
apparent reason.
Fangrui Song [Wed, 12 Jan 2022 18:40:33 +0000 (10:40 -0800)]
[ELF] -Map --why-extract=: print despite errors
Fix https://github.com/llvm/llvm-project/issues/53073
In case of a relocation error, GNU ld's link map includes
the archive member extraction information but not output sections.
Our -Map and --why-extract= are currently no-op in case of an error.
This change makes the two options work.
Reviewed By: ikudrin, peter.smith
Differential Revision: https://reviews.llvm.org/D116838
Fangrui Song [Wed, 12 Jan 2022 18:38:59 +0000 (10:38 -0800)]
[ELF] Support discarding .relr.dyn
to prepare for D116838, otherwise for linkerscript/discard-section-err.s,
there will be a null pointer dereference in `part.relrDyn->getParent()->size`
in `finalizeSynthetic(part.relrDyn.get())`.
Erich Keane [Wed, 12 Jan 2022 18:17:54 +0000 (10:17 -0800)]
Add an assert in cpudispatch emit to try to track down an error.
I'm attempting to debug an issue that I can only get to happen on
godbolt, where the cpu-dispatch resolver for an out of line member
function is generated with the wrong name, causing a link failure.
Arthur O'Dwyer [Tue, 11 Jan 2022 04:37:01 +0000 (23:37 -0500)]
[libc++] [ranges] SFINAE away ranges::cbegin(const T&&) for non-borrowed T.
Fixes #52952.
Differential Revision: https://reviews.llvm.org/D116991
Chia-hung Duan [Wed, 12 Jan 2022 18:11:30 +0000 (18:11 +0000)]
[mlir] Update BUILD rule for MathDialect.
1773dddadf5de5ad0477394ac2f308eff38c9978 adds the dependency to
ArithmeticDialect.
Reviewed By: rdzhabarov, ftynse
Differential Revision: https://reviews.llvm.org/D117127
Arthur Eubanks [Wed, 12 Jan 2022 17:55:16 +0000 (09:55 -0800)]
[ModuleInliner] Properly delete dead functions
Followup to D116964 where we only did this in the CGSCC inliner.
Fixes leaks reported in D116964.
Egor Zhdan [Tue, 4 Jan 2022 18:14:18 +0000 (18:14 +0000)]
[Clang][Sema] Use VersionMap from SDKSettings for remapping tvOS and watchOS availability
This makes the mapping between iOS & tvOS/watchOS versions more accurate. For example, iOS 9.3 now gets correctly mapped into tvOS 9.2 and not tvOS 9.3.
Before this change, the incorrect mapping could cause excessive or missing warnings for code that specifies availability for iOS, but not for tvOS/watchOS.
rdar://
81491680
Differential Revision: https://reviews.llvm.org/D116822
Craig Topper [Wed, 12 Jan 2022 17:13:07 +0000 (09:13 -0800)]
[RISCV] Add RISCVProcFamilyEnum and add SiFive7.
Use it to remove explicit string compares from unrolling preferences.
I'm of two minds on this. Ideally, we would define things in terms
of architectural or microarchitectural features, but it's hard to
do that with things like unrolling preferences without just ending up
with FeatureSiFive7UnrollingPreferences.
Having a proc enum is consistent with ARM and AArch64. X86 only has
a few and is trying to move away from it.
Reviewed By: asb, mcberg2021
Differential Revision: https://reviews.llvm.org/D117060
Mircea Trofin [Wed, 12 Jan 2022 17:32:06 +0000 (09:32 -0800)]
[NFC][MLGO] The regalloc reward is float, not int64_t
zhijian [Wed, 12 Jan 2022 17:27:03 +0000 (12:27 -0500)]
[AIX] demangle xcoff label symbol for llvm-nm
Summary:
modified the demangle for the xcoff label symbol.
Reviewers: James Henderson
Differential Revision: https://reviews.llvm.org/D113106
Amir Ayupov [Wed, 12 Jan 2022 17:23:30 +0000 (09:23 -0800)]
[BOLT][TEST] Move exceptions-instrumentation.test to X86
The aarch64 instrumentation is currently unsupported so the test is failing.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D117102
Markus Böck [Thu, 6 Jan 2022 10:26:03 +0000 (11:26 +0100)]
[clang][#51931] Enable `-Wdeclaration-after-statement` for all C versions
-Wdeclaration-after-statement currently only outputs an diagnostic if the user is compiling in C versions older than C99, even if the warning was explicitly requested by the user.
This patch makes the warning also available in later C versions. If the C version is C99 or later it is simply a normal warning that is disabled by default (as it is valid C99) and has to be enabled by users. In older versions it remains an extension warning, and therefore affected by -pedantic.
The above behaviour also matches GCCs behaviour.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51931
Differential Revision: https://reviews.llvm.org/D114787
William S. Moses [Wed, 12 Jan 2022 05:26:41 +0000 (00:26 -0500)]
[MLIR][Math] Enable constant folding of ops
Enable constant folding of ops within the math dialect, and introduce constant folders for ceil and log2
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D117085
Stella Stamenova [Wed, 12 Jan 2022 16:55:48 +0000 (08:55 -0800)]
[lldb] Disable one more watchpoint test on Windows
This should be the last remaining flaky watchpoint test on Windows
Mircea Trofin [Wed, 12 Jan 2022 16:50:57 +0000 (08:50 -0800)]
[NFC][MLGO] Prep a few files before the main ML Regalloc adviser
To avoid trivial changes.
Stella Stamenova [Wed, 12 Jan 2022 16:53:19 +0000 (08:53 -0800)]
Revert "[LLDB][NativePDB] Add support for inlined functions"
This reverts commit
945aa520ef07a3edb655f3f38e4c3023658dd623.
This commit broke the windows lldb bot.
Petar Avramovic [Wed, 12 Jan 2022 16:43:18 +0000 (17:43 +0100)]
GlobalIsel: Fix fma combine when one of the operands comes from unmerge
Fma combine assumes that MRI.getVRegDef(Reg)->getOperand(0).getReg() = Reg
which is not true when Reg is defined by instruction with multiple defs
e.g. G_UNMERGE_VALUES.
Fix is to keep register and the instruction that defines register in
DefinitionAndSourceRegister and use when needed.
Differential Revision: https://reviews.llvm.org/D117032
Petar Avramovic [Wed, 12 Jan 2022 16:38:24 +0000 (17:38 +0100)]
GlobalIsel: Precommit fma combine tests with one operand from unmerge
Arthur Eubanks [Fri, 7 Jan 2022 17:47:55 +0000 (09:47 -0800)]
[Inline] Attempt to delete any discardable if unused functions
Previously we limited ourselves to only internal/private functions. We
can also delete linkonce_odr functions.
Minor compile time wins:
https://llvm-compile-time-tracker.com/compare.php?from=
d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=
bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=instructions
Major memory wins on tramp3d:
https://llvm-compile-time-tracker.com/compare.php?from=
d51e3474e060cb0e90dc2e2487f778b0d3e6a8de&to=
bccffe3f8d5dd4dda884c9ac1f93e51772519cad&stat=max-rss
Reviewed By: nikic, mtrofin
Differential Revision: https://reviews.llvm.org/D115545