Louis Dionne [Mon, 27 Jun 2022 13:15:28 +0000 (09:15 -0400)]
[libc++] Remove dummy command in Dockerfile
It turns out that the Docker images on CI instances are not updated
based on what's in this file, but instead when a new image is pushed
to ldionne/libcxx-builder on DockerHub. So this is effectively useless.
Javier Setoain [Mon, 6 Jun 2022 10:55:04 +0000 (11:55 +0100)]
[mlir][llvm] Add vector insert/extract intrinsics
These intrinsics will be needed to convert between fixed-length vectors
and scalable vectors.
This operation will be needed for VLS (vector-length specific)
vectorization, when interfacing with vector functions or intrinsics that
take scalable vectors as operands in a context where the length of our
vectors is known or assumed at compile time, but we still want to
generate scalable vector instructions.
Differential Revision: https://reviews.llvm.org/D127100
Koakuma [Mon, 27 Jun 2022 12:52:10 +0000 (14:52 +0200)]
[SPARC] Don't do leaf optimization on procedures with inline assembly
On SPARC, leaf function optimization omits the register window sliding (and the associated register name changes). This might result in miscompilation of procedures containing inline assembly, as some of the register constraints used may interfere with the register usage of optimized functions, so we disable leaf procedure optimization on those procedures to prevent it from happening.
This is a continuation of patch D102342 by @LemonBoy, the original comment is reproduced below:
> Leaf functions allow the compiler to omit the setup and teardown of a frame pointer, therefore avoiding the exchange of the in/out register. According to the SPARC architecture manual every reference to %i0-%i5 should be replaced with %o0-o5, if the target register is already in use a further remapping step to %g1-%g7 is required to free the output register.
>
> Add a simple check to make sure not to stomp on any output register that's already in use.
Reviewed By: dcederman
Differential Revision: https://reviews.llvm.org/D128263
Lucas Prates [Fri, 6 May 2022 09:31:11 +0000 (10:31 +0100)]
[ARM][Thumb] Command-line option to ensure AAPCS compliant Frame Records
Currently the a AAPCS compliant frame record is not always created for
functions when it should. Although a consistent frame record might not
be required in some cases, there are still scenarios where applications
may want to make use of the call hierarchy made available trough it.
In order to enable the use of AAPCS compliant frame records whilst keep
backwards compatibility, this patch introduces a new command-line option
(`-mframe-chain=[none|aapcs|aapcs+leaf]`) for Aarch32 and Thumb backends.
The option allows users to explicitly select when to use it, and is also
useful to ensure the extra overhead introduced by the frame records is
only introduced when necessary, in particular for Thumb targets.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D125094
Valentin Clement [Mon, 27 Jun 2022 13:00:07 +0000 (15:00 +0200)]
[flang][NFC] Add IO lowering tests
These tests were left behind or only partially upstreamed during
the lower code upstreaming.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D128634
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Tim Northover [Mon, 27 Jun 2022 12:59:35 +0000 (13:59 +0100)]
ARM: don't try to load function pointer before long call.
Deciding to load an arbitrary global based on whether the entire module is
being built for long calls is pretty clearly spurious, and in fact the existing
indirect logic is sufficient.
Nikita Popov [Mon, 27 Jun 2022 12:54:03 +0000 (14:54 +0200)]
[IndVars] Add test for PR56242 (NFC)
Matt Arsenault [Wed, 22 Jun 2022 23:04:07 +0000 (19:04 -0400)]
MIR: Fix parse error on empty CustomRegMask
LLVM GN Syncbot [Mon, 27 Jun 2022 12:35:34 +0000 (12:35 +0000)]
[gn build] Port
633d1d0df766
Louis Dionne [Mon, 6 Jun 2022 18:01:38 +0000 (14:01 -0400)]
[libc++] Use bounded iterators in std::span when the debug mode is enabled
Previously, we'd use raw pointers when the debug mode was enabled,
which means we wouldn't get out-of-range checking with std::span's
iterators.
This patch introduces a new class called __bounded_iter which can
be used to wrap iterators and make them carry around bounds-related
information. This allows iterators to assert when they are dereferenced
outside of their bounds.
As a fly-by change, this commit removes the _LIBCPP_ABI_SPAN_POINTER_ITERATORS
knob. Indeed, not using a raw pointer as the iterator type is useful to
avoid users depending on properties of raw pointers in their code.
This is an alternative to D127401.
Differential Revision: https://reviews.llvm.org/D127418
Louis Dionne [Thu, 23 Jun 2022 19:09:52 +0000 (15:09 -0400)]
[libc++] Improve Lit's buildhost=XXXX feature on a few platforms
Differential Revision: https://reviews.llvm.org/D128455
Valentin Clement [Mon, 27 Jun 2022 12:19:23 +0000 (14:19 +0200)]
[flang][NFC] Add array lowering tests
These tests were left behind during the upstreaming of parts lowering.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D128632
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Wei Yi Tee [Mon, 27 Jun 2022 12:14:01 +0000 (14:14 +0200)]
[clang][dataflow] Singleton pointer values for null pointers.
When a `nullptr` is assigned to a pointer variable, it is wrapped in a `ImplicitCastExpr` with cast kind `CK_NullTo(Member)Pointer`. This patch assigns singleton pointer values representing null to these expressions.
For each pointee type, a singleton null `PointerValue` is created and stored in the `NullPointerVals` map of the `DataflowAnalysisContext` class. The pointee type is retrieved from the implicit cast expression, and used to initialise the `PointeeLoc` field of the `PointerValue`. The `PointeeLoc` created is not mapped to any `Value`, reflecting the absence of value indicated by null pointers.
Reviewed By: gribozavr2, sgatev, xazax.hun
Differential Revision: https://reviews.llvm.org/D128056
Nicolas Vasilache [Fri, 24 Jun 2022 09:26:22 +0000 (02:26 -0700)]
[SCF] Add thread_dim_mapping attribute to scf.foreach_thread
An optional thread_dim_mapping index array attribute specifies for each
virtual thread dimension, how it remaps 1-1 to a set of concrete processing
element resources (e.g. a CUDA grid dimension or a level of concrete nested
async parallelism). At this time, the specification is backend-dependent and
is not verified by the op, beyond being an index array attribute.
It is the reponsibility of the lowering to interpret the index array in the
context of the concrete target the op is lowered to, or to ignore it when
the specification is ill-formed or unsupported for a particular target.
Differential Revision: https://reviews.llvm.org/D128633
Matthias Springer [Mon, 27 Jun 2022 11:46:37 +0000 (13:46 +0200)]
[mlir][bufferization][NFC] Add error handling to getBuffer
This is in preparation of adding memory space support.
Differential Revision: https://reviews.llvm.org/D128277
Matthias Springer [Mon, 27 Jun 2022 11:41:18 +0000 (13:41 +0200)]
[mlir][bufferization][NFC] Fix typo in AllocTensorOp builders
Matthias Springer [Mon, 27 Jun 2022 11:25:52 +0000 (13:25 +0200)]
[mlir][SCF][bufferize][NFC] Bufferize scf.for terminator separately
This allows for better type inference during bufferization and is in preparation of supporting memory spaces.
Differential Revision: https://reviews.llvm.org/D128422
Matthias Springer [Mon, 27 Jun 2022 11:17:45 +0000 (13:17 +0200)]
[mlir][SCF][bufferize] Bufferize scf.if/execute_region terminators separately
This allows for better type inference during bufferization and is in preparation of supporting memory spaces.
Differential Revision: https://reviews.llvm.org/D128581
Matthias Springer [Mon, 27 Jun 2022 11:10:00 +0000 (13:10 +0200)]
[mlir][SCF][bufferize][NFC] Bufferize parallel_insert_slice separately
This allows for better type inference during bufferization and is in preparation of supporting memory spaces.
Differential Revision: https://reviews.llvm.org/D128580
Jay Foad [Mon, 27 Jun 2022 11:15:25 +0000 (12:15 +0100)]
[AMDGPU] Regenerate MIR checks. NFC.
Aaron Ballman [Mon, 27 Jun 2022 11:12:36 +0000 (07:12 -0400)]
Fix clang docs build; NFC
This should address the break from:
https://lab.llvm.org/buildbot/#/builders/92/builds/28769
Matthias Springer [Mon, 27 Jun 2022 10:52:59 +0000 (12:52 +0200)]
[mlir][shape][bufferize][NFC] Bufferize block terminators separately
This allows for better type inference during bufferization and is in preparation of supporting memory spaces.
Differential Revision: https://reviews.llvm.org/D128579
Dmitry Preobrazhensky [Mon, 27 Jun 2022 11:01:09 +0000 (14:01 +0300)]
[AMDGPU][GFX9][DOC][NFC] Update assembler syntax description
Summary of changes:
- Updated MUBUF lds syntax (see https://reviews.llvm.org/D124485).
- Updated SMEM syntax (see https://reviews.llvm.org/D127314).
- Enabled src0=literal for v_madak*, v_madmk* (see https://reviews.llvm.org/D111067).
- Removed SYSMSG_OP_HOST_TRAP_ACK message.
- Minor bug fixing and improvements.
Edd Barrett [Mon, 27 Jun 2022 10:53:38 +0000 (11:53 +0100)]
[STACKMAPS] Document+test UINT64_MAX stack size.
When a function does a dynamic stack allocation, the function's stack
size (in the stack map) is reported as UINT64_MAX.
This change tests and documents this property.
Differential Revision: https://reviews.llvm.org/D128525
Bradley Smith [Thu, 16 Jun 2022 14:45:28 +0000 (14:45 +0000)]
[IR] Move vector.insert/vector.extract out of experimental namespace
These intrinsics are now fundemental for SVE code generation and have been
present for a year and a half, hence move them out of the experimental
namespace.
Differential Revision: https://reviews.llvm.org/D127976
Simon Pilgrim [Mon, 27 Jun 2022 10:46:42 +0000 (11:46 +0100)]
[X86] combineConcatVectorOps - IsConcatFree must check extraction index
Identified in the regression reported by @alexfh on rGb5d7beeb9792 - IsConcatFree wasn't ensuring the subvector extraction index matched the position it would be concatenated back into.
Matthias Springer [Mon, 27 Jun 2022 10:42:07 +0000 (12:42 +0200)]
[mlir][bufferization][NFC] Bufferize with PostOrder traversal
This is useful because the result type of an op can sometimes be inferred from its body (e.g., `scf.if`). This will be utilized in subsequent changes.
Also introduces a new `getBufferType` interface method on BufferizableOpInterface. This method is useful for computing a bufferized block argument type with respect to OpOperand types of the parent op.
Differential Revision: https://reviews.llvm.org/D128420
Jolanta Jensen [Mon, 13 Jun 2022 13:37:19 +0000 (14:37 +0100)]
[AArch64] Define __FP_FAST_FMA[F]
Libraries use this flag to decide whether to use the fma builtin.
Author: Paul Walker
Differential Revision: https://reviews.llvm.org/D127655
Matthias Springer [Mon, 27 Jun 2022 10:31:55 +0000 (12:31 +0200)]
[mlir][bufferization] Add `memory_space` op attribute
This attribute is currently supported on AllocTensorOp only. Future changes will add support to other ops. Furthermore, the memory space is not propagated properly in all bufferization patterns and some of the core bufferization infrastructure. This will be addressed in a subsequent change.
Differential Revision: https://reviews.llvm.org/D128274
gbreynoo [Mon, 27 Jun 2022 10:08:36 +0000 (11:08 +0100)]
[llvm-ar] Improve MRI script CREATE command handling
I discovered that when compared to GNU the llvm-ar MRI script parsing of
CREATE could lead to some strange behaviour. This fix improves the error
message in the case when no archive name is given and will not allow the
adding of members until CREATE is called. Along with this change I added
more testing of the CREATE command.
Differential Revision: https://reviews.llvm.org/D128055
Andrzej Warzynski [Mon, 6 Jun 2022 09:44:21 +0000 (09:44 +0000)]
[flang][driver] Add support for `-O{0|1|2|3}`
This patch adds support for most common optimisation compiler flags:
`-O{0|1|2|3}`. This is implemented in both the compiler and frontend
drivers. At this point, these options are only used to configure the
LLVM optimisation pipelines (aka middle-end). LLVM backend or MLIR/FIR
optimisations are not supported yet.
Previously, the middle-end pass manager was only required when
generating LLVM bitcode (i.e. for `flang-new -c -emit-llvm <file>` or
`flang-new -fc1 -emit-llvm-bc <file>`). With this change, it becomes
required for all frontend actions that are represented as
`CodeGenAction` and `CodeGenAction::executeAction` is refactored
accordingly (in the spirit of better code re-use).
Additionally, the `-fdebug-pass-manager` option is enabled to facilitate
testing. This flag can be used to configure the pass manager to print
the middle-end passes that are being run. Similar option exists in Clang
and the semantics in Flang are identical. This option translates to
extra configuration when setting up the pass manager. This is
implemented in `CodeGenAction::runOptimizationPipeline`.
This patch also adds some bolier plate code to manage code-gen options
("code-gen" refers to generating machine code in LLVM in this context).
This was extracted from Clang. In Clang, it simplifies defining code-gen
options and enables option marshalling. In Flang, option marshalling is
not yet supported (we might do at some point), but being able to
auto-generate some code with macros is beneficial. This will become
particularly apparent when we start adding more options (at least in
Clang, the list of code-gen options is rather long).
Differential Revision: https://reviews.llvm.org/D128043
Wei Yi Tee [Mon, 27 Jun 2022 09:18:01 +0000 (11:18 +0200)]
[clang][dataflow] Implement functionality for flow condition variable substitution.
This patch introduces `buildAndSubstituteFlowCondition` - given a flow condition token, this function returns the expression of constraints defining the flow condition, with values substituted where specified.
As an example:
Say we have tokens `FC1`, `FC2`, `FC3`:
```
FlowConditionConstraints: {
FC1: C1,
FC2: C2,
FC3: (FC1 v FC2) ^ C3,
}
```
`buildAndSubstituteFlowCondition(FC3, /*Substitutions:*/{{C1 -> C1'}})`
returns a value corresponding to `(C1' v C2) ^ C3`.
Note:
This function returns the flow condition expressed directly as its constraints, which differs to how we currently represent the flow condition as a token bound to a set of constraints and dependencies. Making the representation consistent may be an option to consider in the future.
Depends On D128357
Reviewed By: gribozavr2, xazax.hun
Differential Revision: https://reviews.llvm.org/D128363
Andrzej Warzynski [Thu, 23 Jun 2022 09:29:12 +0000 (09:29 +0000)]
[flang] Update the release notes
Document changes introduced in https://reviews.llvm.org/D126164.
Differential Revision: https://reviews.llvm.org/D128413
Wei Yi Tee [Mon, 27 Jun 2022 09:12:37 +0000 (11:12 +0200)]
[clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.
`createStorageLocation` in `DataflowEnvironment` is now a trivial wrapper around the logic in `DataflowAnalysisContext`.
Additionally, `getObjectFields` and `getFieldsFromClassHierarchy` (required for the implementation of `createStorageLocation`) are also moved to `DataflowAnalysisContext`.
Reviewed By: gribozavr2, sgatev
Differential Revision: https://reviews.llvm.org/D128359
Siva Chandra Reddy [Fri, 24 Jun 2022 17:45:02 +0000 (17:45 +0000)]
[libc] Add a simple arm32 config.
This will be expanded in future as more functions are brought up on arm32.
Sven van Haastregt [Mon, 27 Jun 2022 08:55:44 +0000 (09:55 +0100)]
[OpenCL] Reduce emitting candidate notes for builtins
When overload resolution fails, clang emits a note diagnostic for each
candidate. For OpenCL builtins this often leads to many repeated note
diagnostics with no new information. Stop emitting such notes.
Update a test that was relying on counting those notes to check how
many builtins are available for certain extension configurations.
Differential Revision: https://reviews.llvm.org/D127961
Nikita Popov [Mon, 27 Jun 2022 08:50:33 +0000 (10:50 +0200)]
[SCEV] Assert that GEP source element type is sized (NFC)
This is checked by the IR verifier, so replace the condition with
an assert.
Jay Foad [Thu, 23 Jun 2022 12:35:02 +0000 (13:35 +0100)]
[AMDGPU] Fix assertion failure on mad with negative immediate addend
Without this, the new test case would fail with:
AMDGPUInstPrinter.cpp:545: void llvm::AMDGPUInstPrinter::printImmediate64(uint64_t, const llvm::MCSubtargetInfo &, llvm::raw_ostream &): Assertion `isUInt<32>(Imm) || Imm == 0x3fc45f306dc9c882' failed.
Differential Revision: https://reviews.llvm.org/D128435
Siva Chandra Reddy [Sat, 25 Jun 2022 08:28:57 +0000 (08:28 +0000)]
[libc][NFC] Make the support thread library an object library.
It was previously a header library. Making it an object library will
allow us to declare thread local variables which can used to setup a
thread's self object.
Matthias Springer [Mon, 27 Jun 2022 08:01:58 +0000 (10:01 +0200)]
[mlir][bufferization][NFC] Change signature of getMemRefType
These functions now accep unsigned attributes for address spaces instead of Attributes.
Differential Revision: https://reviews.llvm.org/D128275
Simon Tatham [Mon, 27 Jun 2022 08:36:20 +0000 (09:36 +0100)]
[libunwind,EHABI,ARM] Fix get/set of RA_AUTH_CODE.
According to EHABI32 §8.5.2, the PAC for the return address of a
function described in an exception table is supposed to be addressed
in the _Unwind_VRS_{Get,Set} API by setting regclass=_UVRSC_PSEUDO and
regno=0. (The space of 'regno' values is independent for each
regclass, and for _UVRSC_PSEUDO, there is only one valid regno so far.)
That is indeed what libunwind's _Unwind_VRS_{Get,Set} functions expect
to receive. But at two call sites, the wrong values are passed in:
regno is being set to UNW_ARM_RA_AUTH_CODE (0x8F) instead of 0, and in
one case, regclass is _UVRSC_CORE instead of _UVRSC_PSEUDO.
As a result, those calls to _Unwind_VRS_{Get,Set} return
_UVRSR_FAILED, which their callers ignore. So if you compile in the
AUTG instruction that actually validates the PAC, it will try to
validate what's effectively an uninitialised register as an
authentication code, and trigger a CPU fault even on correct exception
unwinding.
Reviewed By: danielkiss
Differential Revision: https://reviews.llvm.org/D128522
Florian Hahn [Mon, 27 Jun 2022 08:33:04 +0000 (09:33 +0100)]
[SCEV] Use SCEVUnknown(poison) instead of SCEVUnknown(undef).
Use poison instead of undef for SCEVUnkown of unreachable values.
This should be in line with the movement to replace undef with poison
when possible.
Suggested in D114650.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D128586
Mikhail Goncharov [Mon, 27 Jun 2022 08:18:39 +0000 (10:18 +0200)]
Revert "[lldb] Fix thread step until to not set breakpoint(s) on incorrect line numbers"
This reverts commit
a57b62deef37c7f2ec31bca3bf9173a6206bfb9b.
lldb-aarch64-ubuntu buildbot test fails since https://lab.llvm.org/buildbot/#/builders/96/builds/25128
Nikita Popov [Mon, 27 Jun 2022 08:15:06 +0000 (10:15 +0200)]
[FunctionAttrs] Add missing pass dependency
This pass depends on AAResults. This fixes the ocaml IPO binding
tests.
Nikita Popov [Fri, 24 Jun 2022 15:06:07 +0000 (17:06 +0200)]
[ArgPromotion] Remove legacy PM support
Support for the legacy pass manager in ArgPromotion causes
complications in D125485. As the legacy pass manager for middle-end
optimizations is unsupported, drop ArgPromotion from the legacy
pipeline, rather than introducing additional complexity to deal
with it.
Differential Revision: https://reviews.llvm.org/D128536
Adrian Kuegel [Mon, 27 Jun 2022 07:15:39 +0000 (09:15 +0200)]
[mlir] Fix ClangTidyPerformance finding (NFC)
Chuanqi Xu [Mon, 27 Jun 2022 06:44:10 +0000 (14:44 +0800)]
[NFC] Add parentheses around && within || to avoid warning
Jacques Pienaar [Mon, 27 Jun 2022 03:45:25 +0000 (20:45 -0700)]
[mlir] Flip MemRef dialect to _Both (NFC)
Chuanqi Xu [Mon, 27 Jun 2022 02:38:29 +0000 (10:38 +0800)]
Revert "[Coroutines] Only do symmetric transfer if optimization is on"
This reverts commit
7782e080e80a90f7bb32049beb3787e2118c2251. According
to the discussion of WG21, symmetric transfer is a desired feature.
Kazu Hirata [Mon, 27 Jun 2022 02:54:41 +0000 (19:54 -0700)]
Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
Kazu Hirata [Mon, 27 Jun 2022 02:37:14 +0000 (19:37 -0700)]
[lld] Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
Kazu Hirata [Mon, 27 Jun 2022 02:29:40 +0000 (19:29 -0700)]
[lld] Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
Jacques Pienaar [Mon, 27 Jun 2022 02:12:38 +0000 (19:12 -0700)]
[mlir] Flip more uses to prefixed accessor form (NFC).
Try to keep the final flip small. Need to flip MemRef as there are many
templated cases with it and Tensor.
Kazu Hirata [Mon, 27 Jun 2022 01:51:54 +0000 (18:51 -0700)]
[clang] Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
Kazu Hirata [Mon, 27 Jun 2022 01:31:51 +0000 (18:31 -0700)]
[llvm] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Craig Topper [Mon, 27 Jun 2022 01:19:16 +0000 (18:19 -0700)]
[RISCV] Remove extra semicolon. NFC
Fangrui Song [Mon, 27 Jun 2022 00:26:44 +0000 (17:26 -0700)]
[ELF] Remove deprecated -dc
-dc is deprecated in release/14.x. Remove it for 15.0.
The only usage I know was FreeBSD crungen which was removed by https://reviews.freebsd.org/D34215
glibc just dropped -Wl,-d today. Keep -d for now.
Kazu Hirata [Sun, 26 Jun 2022 23:10:42 +0000 (16:10 -0700)]
[llvm] Use Optional::has_value instead of Optional::hasValue (NFC)
This patch replaces x.hasValue() with x.has_value() where x is not
contextually convertible to bool.
Paul Walker [Sat, 25 Jun 2022 18:04:49 +0000 (19:04 +0100)]
[NFC][SVE] Auto-generate CHECK lines for intrinsic codegen tests.
Uday Bondhugula [Sun, 26 Jun 2022 02:23:31 +0000 (07:53 +0530)]
[MLIR] NFC. Fix doc comment for AliasResult::isNo
Fix doc comment for AliasResult::isNo. NFC.
Differential Revision: https://reviews.llvm.org/D128594
sstwcw [Sun, 26 Jun 2022 22:22:27 +0000 (22:22 +0000)]
[clang-format] Fix uninitialized memory problem
The setLength function checks for the token kind which could be
uninitialized in the previous version.
The problem was introduced in
2e32ff106e.
Reviewed By: MyDeveloperDay, owenpan
Differential Revision: https://reviews.llvm.org/D128607
Craig Topper [Sun, 26 Jun 2022 20:28:57 +0000 (13:28 -0700)]
[RISCV] Evaluate ICE operands to builtins using getIntegerConstantExpr.
Some RISC-V builtins requires ICE operands. We should call
getIntegerConstantExpr instead of EmitScalarExpr to match other
targets.
This was made a little trickier by the vector intrinsics not having
a valid type string, but there are two that have ICE operands so
I specified them manually.
Frederic Cambus [Fri, 24 Jun 2022 08:47:30 +0000 (10:47 +0200)]
[Driver][test] Add libclang_rt.profile{{.*}}.a tests for OpenBSD
This was requested in D109244.
Differential Revision: https://reviews.llvm.org/D128512
owenca [Sat, 25 Jun 2022 05:09:57 +0000 (22:09 -0700)]
[clang-format] Quit analyzing solution space for large state count
Fixes #56043.
Differential Revision: https://reviews.llvm.org/D128574
Greg Steuck [Sun, 26 Jun 2022 19:04:43 +0000 (21:04 +0200)]
[Driver] Use Component in OpenBSD::getCompilerRT to find libraries
Clang uses runtime libraries for some advanced features like
sanitizers. Different systems have different preferences about file
placement. OpenBSD with this change will use this name for ASan:
/usr/lib/clang/15.0.0/lib/libclang_rt.asan.a
Already committed to OpenBSD repository then amended to cover the
case of development tree.
Differential Revision: https://reviews.llvm.org/D109051
Craig Topper [Sun, 26 Jun 2022 18:08:44 +0000 (11:08 -0700)]
[RISCV] Refactor SelectAddrRegImm to not depend on SelectBaseAddr.
SelectBaseAddr was a minor convenience to use since it already'
existed for vector load/store. D128187 is going to remove the other
uses of SelectBaseAddr so it has less reason to exist.
This patch removes the dependency on SelectBaseAddr and adds a new
SelectAddrFrameIndex to share some code with SelectFrameAddrRegImm.
Stella Laurenzo [Sun, 26 Jun 2022 17:39:20 +0000 (10:39 -0700)]
[mlir] Generalize SCF passes to not have to run on FuncOp.
Seems to have been an accident of history and none of these had any reason to be restricted to FuncOp.
Differential Revision: https://reviews.llvm.org/D128614
Nuno Lopes [Sun, 26 Jun 2022 17:50:47 +0000 (18:50 +0100)]
PHINode::removeIncomingValue: use poison as a placeholder instead of undef when the PHI is dead [NFC]
Craig Topper [Sun, 26 Jun 2022 17:45:48 +0000 (10:45 -0700)]
[CodeGenPrepare] Avoid double map lookup. NFCI
Nuno Lopes [Sun, 26 Jun 2022 13:56:35 +0000 (14:56 +0100)]
[LICM] Use poison to replace unreachable values instead of undef [NFC]
Shivam [Sun, 26 Jun 2022 13:52:52 +0000 (19:22 +0530)]
Update LibASTImporter.rst
As my last commit changed the name of ImportError to ASTImportError , this section also needs to be updated so changed it.
Vassil Vassilev [Sun, 26 Jun 2022 13:47:50 +0000 (13:47 +0000)]
[clang] Add missing Interpreter -> ClangDriverOptions dependency
Without this, it is possible that Interpreter.cpp is being built before
clang/Driver/Options.inc is generated.
Observed only infrequently, serial builds and ext4 manifest the problem
much more often than parallel builds and btrfs.
https://reviews.llvm.org/rG06487b010d48c36c7714ee083ed38dff65711812
is a very similar case.
Patch by t184256!
Differential revision: https://reviews.llvm.org/D115827
Tapasweni Pathak [Sun, 26 Jun 2022 09:40:43 +0000 (09:40 +0000)]
Allow interfaces to operate on in-memory buffers with no source location info.
This patch is a part of the upstreaming efforts. Cling has the ability to spawn
child interpreters (mainly for auto completions). The child interpreter import
Decls using the ASTImporter which casuses the assertion here
https://github.com/llvm/llvm-project/blob/
65eb74e94b414fcde6bfa810d1c30c7fcb136b77/clang/include/clang/Basic/SourceLocation.h#L322
The patch is co-developed with V. Vassilev.
Differential revision: https://reviews.llvm.org/D88780
Nuno Lopes [Sun, 26 Jun 2022 13:15:40 +0000 (14:15 +0100)]
[LoopSimplifyCFG] use poison when replacing dead instructions instead of undef [NFC]
Sunho Kim [Sun, 26 Jun 2022 12:57:05 +0000 (21:57 +0900)]
Revert "[clang-repl] Support destructors of global objects."
This reverts commit
9de8b05bfe0de2915d2443d06159396c5f9d389f.
Nikolas Klauser [Sun, 26 Jun 2022 12:55:19 +0000 (14:55 +0200)]
[libc++] Simplify type_traits and use more builtins
Reviewed By: ldionne, #libc
Spies: manojgupta, cjdb, ayzhao, alanphipps, libcxx-commits
Differential Revision: https://reviews.llvm.org/D127226
Stuff
Nuno Lopes [Sun, 26 Jun 2022 12:44:05 +0000 (13:44 +0100)]
[ArgumentPromotion] use poison when replacing dead instructions instead of undef [NFC]
Benjamin Kramer [Sun, 26 Jun 2022 10:54:32 +0000 (12:54 +0200)]
[Support] Work around an issue when building with old versions of libstdc++
llvm/lib/Support/UnicodeNameToCodepoint.cpp:189:12: error: chosen constructor is explicit in copy-initialization
return {N, false, 0};
^~~~~~~~~~~~~
/usr/include/c++/5.4.0/tuple:479:19: note: explicit constructor declared here
constexpr tuple(_UElements&&... __elements)
^
Jun Zhang [Sun, 19 Jun 2022 02:39:03 +0000 (10:39 +0800)]
[clang-repl] Implement code undo.
In interactive C++ it is convenient to roll back to a previous state of the
compiler. For example:
clang-repl> int x = 42;
clang-repl> %undo
clang-repl> float x = 24 // not an error
To support this, the patch extends the functionality used to recover from
errors and adds functionality to recover the low-level execution infrastructure.
The current implementation is based on watermarks. It exploits the fact that
at each incremental input the underlying compiler infrastructure is in a valid
state. We can only go N incremental inputs back to a previous valid state. We do
not need and do not do any further dependency tracking.
This patch was co-developed with V. Vassilev, relies on the past work of Purva
Chaudhari in clang-repl and is inspired by the past work on the same feature
in the Cling interpreter.
Co-authored-by: Purva-Chaudhari <purva.chaudhari02@gmail.com>
Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com>
Signed-off-by: Jun Zhang <jun@junz.org>
Sunho Kim [Sun, 26 Jun 2022 10:02:19 +0000 (19:02 +0900)]
[clang-repl] Support destructors of global objects.
Supports destructors of global objects by properly calling jitdylib deinitialize which calls the global dtors of ir modules.
This supersedes https://reviews.llvm.org/D127945. There was an issue when calling deinitialize on windows but it got fixed by https://reviews.llvm.org/D128037.
Reviewed By: v.g.vassilev
Differential Revision: https://reviews.llvm.org/D128589
Nikita Popov [Sun, 26 Jun 2022 09:37:15 +0000 (11:37 +0200)]
Revert "[LiveInterval] Simplify. NFC"
This reverts commit
e733b80f3cba26bf2df9bd691120f37fc1af21ce.
This caused a major compile-time regression:
https://llvm-compile-time-tracker.com/compare.php?from=
3b7c3a654c9175f41ac871a937cbcae73dfb3c5d&to=
e733b80f3cba26bf2df9bd691120f37fc1af21ce&stat=instructions
About 1% on average, 10% on individual files.
Patryk Wychowaniec [Sun, 26 Jun 2022 09:20:04 +0000 (17:20 +0800)]
[AVR] Fix expanding MOVW for overlapping registers
When expanding a MOVW (16-bit copy) to two MOVs (8-bit copy), the
lower byte always comes first. This is incorrect for corner cases like
'$r24r23 -> $r25r24', in which the higher byte copy should come first.
Current patch fixes that bug as recorded at
https://github.com/rust-lang/rust/issues/98167
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D128588
Fangrui Song [Sun, 26 Jun 2022 05:30:52 +0000 (22:30 -0700)]
[ELF] Improve compound assignment tests
Also use strchr instead of is_contained.
Kazu Hirata [Sun, 26 Jun 2022 05:26:24 +0000 (22:26 -0700)]
[clang] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Fangrui Song [Sun, 26 Jun 2022 05:22:59 +0000 (22:22 -0700)]
[ELF] Support -= *= /= <<= >>= &= |= in symbol assignments
Kazu Hirata [Sun, 26 Jun 2022 04:42:52 +0000 (21:42 -0700)]
[llvm] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Fangrui Song [Sun, 26 Jun 2022 04:16:59 +0000 (21:16 -0700)]
[ELF] Allow ? without adjacent space
GNU ld allows 1 ? 2?3:4 : 5?6 :7
Fangrui Song [Sun, 26 Jun 2022 04:11:32 +0000 (21:11 -0700)]
[ELF][test] Improve expression test
Fangrui Song [Sun, 26 Jun 2022 03:26:47 +0000 (20:26 -0700)]
[ELF] Fix assertion failure when PROVIDE/HIDDEN/PROVIDE_HIDDEN does not have =
Fangrui Song [Sun, 26 Jun 2022 03:25:34 +0000 (20:25 -0700)]
[ELF] Allow an expression to follow = in a symbol assignment
GNU ld doesn't require whitespace before =. Match it.
LLVM GN Syncbot [Sun, 26 Jun 2022 02:21:47 +0000 (02:21 +0000)]
[gn build] Port
9ed2e68c9ae5
sstwcw [Sun, 26 Jun 2022 01:54:02 +0000 (01:54 +0000)]
[clang-format] Handle Verilog preprocessor directives
Verilog uses the backtick instead of the hash. In this revision
backticks are lexed manually and then get labeled as hashes so the logic
for handling C preprocessor stuff don't have to change. Hashes get
labeled as identifiers for Verilog-specific stuff like delays.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D124749
sstwcw [Sun, 26 Jun 2022 01:51:40 +0000 (01:51 +0000)]
[clang-format] Parse Verilog if statements
This patch mainly handles treating `begin` as block openers.
While and for statements will be handled in another patch.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D123450
sstwcw [Sun, 26 Jun 2022 01:25:39 +0000 (01:25 +0000)]
[clang-format] Fix whitespace counting stuff
The current way of counting whitespace would count backticks as
whitespace. For Verilog stuff we need backticks to be handled
correctly. For JavaScript the current way is to compare the entire
token text to see if it's a backtick. However, when the backtick is the
first token following an escaped newline, the escaped newline will be
part of the tok::unknown token. Verilog has macros and escaped newlines
unlike JavaScript. So we can't regard an entire tok::unknown token as
whitespace. Previously, the start of every token would be matched for
newlines. Now, it is all whitespace instead of just newlines.
The column counting problem has already been fixed for JavaScript in
e71b4cbdd140f059667f84464bd0ac0ebc348387 by counting columns elsewhere.
Reviewed By: HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D124748
Joachim Priesner [Fri, 24 Jun 2022 17:01:35 +0000 (11:01 -0600)]
[clang-tidy] cppcoreguidelines-virtual-class-destructor: Fix crash when "virtual" keyword is expanded from a macro
Check llvm::Optional before dereferencing it.
Compute VirtualEndLoc differently to avoid an assertion failure
in clang::SourceManager::getFileIDLoaded:
Assertion `0 && "Invalid SLocOffset or bad function choice"' failed
Fangrui Song [Sat, 25 Jun 2022 20:48:52 +0000 (13:48 -0700)]
[ELF] Fix precedence of ? when there are 2 or more operators on the left hand side
For 1 != 1 <= 1 ? 1 : 2, the current code incorrectly considers that ?
has a higher precedence than != (minPrec).
Also, add a test for right associativity.
Fangrui Song [Sat, 25 Jun 2022 20:47:32 +0000 (13:47 -0700)]
[ELF] Fix precedence of == and != in expressions
In GNU ld, the == and != operators have lower precedence than < > <= >=.
This behavior matches C.
Craig Topper [Sat, 25 Jun 2022 19:19:40 +0000 (12:19 -0700)]
[RISCV] Merge more rv32/rv64 vector intrinsic tests that contain the same content.
Kazu Hirata [Sat, 25 Jun 2022 20:21:34 +0000 (13:21 -0700)]
[flang] Restore Optional::value() (NFC)
This patch restores several calls to Optional::value() in preference
to Optional::operator*.
The Flang C++ Style Guide tells us to use x.value() where no presence
test is obviously protecting a *x reference to the contents.
Differential Revision: https://reviews.llvm.org/D128590
Brad Smith [Sat, 25 Jun 2022 20:16:38 +0000 (16:16 -0400)]
[Driver][Minix] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D128554