Jason Molenda [Fri, 22 Oct 2021 20:23:06 +0000 (13:23 -0700)]
Fix locals naming in DNBArchMachARM64::GetGPRState for 32-bit builds
The local variables names used for logging when built on armv7k
weren't unique, resulting in build error.
rdar://
84274006
Matt Arsenault [Thu, 9 Sep 2021 23:57:12 +0000 (19:57 -0400)]
AMDGPU: Use attributor to propagate amdgpu-flat-work-group-size
This can merge the acceptable ranges based on the call graph, rather
than the simple application of the attribute. Remove the handling from
the old pass.
Matt Arsenault [Sat, 11 Sep 2021 02:18:54 +0000 (22:18 -0400)]
AMDGPU: Don't consider whether amdgpu-flat-work-group-size was set
It should be semantically identical if it was set to the same value as
the default. Also improve the documentation.
Craig Topper [Fri, 22 Oct 2021 19:48:17 +0000 (12:48 -0700)]
[X86] Fix bad formatting. NFC
Louis Dionne [Fri, 22 Oct 2021 20:15:45 +0000 (16:15 -0400)]
[libc++][NFC] Remove duplicate Python imports
Duncan P. N. Exon Smith [Thu, 21 Oct 2021 22:57:15 +0000 (15:57 -0700)]
Support: Use Expected<T>::moveInto() in a few places
These are some usage examples for `Expected<T>::moveInto()`.
Differential Revision: https://reviews.llvm.org/D112280
peter klausler [Mon, 18 Oct 2021 17:44:39 +0000 (10:44 -0700)]
[flang] Extension to distinguish specific procedures
Allocatable dummy arguments can be used to distinguish
two specific procedures in a generic interface when
it is the case that exactly one of them is polymorphic
or exactly one of them is unlimited polymorphic. The
standard requires that an actual argument corresponding
to an (unlimited) polymorphic allocatable dummy argument
must also be an (unlimited) polymorphic allocatable, so an
actual argument that's acceptable to one procedure must
necessarily be a bad match for the other.
Differential Revision: https://reviews.llvm.org/D112237
Matt Arsenault [Fri, 22 Oct 2021 17:47:33 +0000 (13:47 -0400)]
AMDGPU: Regenerate MIR test checks
Recently this started using -NEXT checks, so regenerate these to avoid
extra test churn in a future change.
Matt Arsenault [Mon, 16 Aug 2021 14:19:52 +0000 (10:19 -0400)]
AMDGPU: Fix hardcoded registers in tests
Nicolas Vasilache [Fri, 22 Oct 2021 19:11:32 +0000 (19:11 +0000)]
[mlir][Linalg] NFC - Drop Optional in favor of FailureOr
Differential revision: https://reviews.llvm.org/D112332
Jay Foad [Fri, 22 Oct 2021 10:19:29 +0000 (11:19 +0100)]
[AMDGPU] Run SIShrinkInstructions before post-RA scheduling
Run post-RA SIShrinkInstructions just before post-RA scheduling, instead
of afterwards. After the fixes in D112305 and D112317 this seems to make
no difference, but it paves the way for scheduler tweaks that are
sensitive to the e32 vs e64 encoding of VALU instructions.
Differential Revision: https://reviews.llvm.org/D112341
Med Ismail Bennani [Fri, 22 Oct 2021 19:18:11 +0000 (19:18 +0000)]
[lldb/Formatters] Remove space from vector type string summaries (NFCI)
This patch changes the string summaries for vector types by removing the
space between the type and the bracket, conforming to
277623f4d5a6.
This should also fix TestCompactVectors failure.
Differential Revision: https://reviews.llvm.org/D112340
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Jay Foad [Fri, 22 Oct 2021 13:39:39 +0000 (14:39 +0100)]
[AMDGPU] Fix latency for implicit vcc_lo operands on GFX10 wave32
As described in the comment, the way we change vcc to vcc_lo in these
operands confuses addPhysRegDataDeps into treating them as implicit
pseudo operands. Fix this by setting the correct latency from the
SchedModel after addPhysRegDataDeps wrongly set it to 0.
Differential Revision: https://reviews.llvm.org/D112317
Jay Foad [Fri, 22 Oct 2021 11:21:57 +0000 (12:21 +0100)]
[ScheduleDAGInstrs] Call adjustSchedDependency in more cases
This removes a condition and the corresponding FIXME comment, because
the Hexagon assertion it refers to has apparently been fixed, probably
by D76134.
NFCI. This just gives targets the opportunity to adjust latencies that
were set to 0 by the generic code because they involve "implicit pseudo"
operands.
Differential Revision: https://reviews.llvm.org/D112306
Stanislav Mekhanoshin [Fri, 22 Oct 2021 18:59:15 +0000 (11:59 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Duncan P. N. Exon Smith [Wed, 20 Oct 2021 19:03:31 +0000 (12:03 -0700)]
Support: Add Expected<T>::moveInto() to avoid extra names
Expected<T>::moveInto() takes as an out parameter any `OtherT&` that's
assignable from `T&&`. It moves any stored value before returning
takeError().
Since moveInto() consumes both the Error and the value, it's only
anticipated that we'd use call it on temporaries/rvalues, with naming
the Expected first likely to be an anti-pattern of sorts (either you
want to deal with both at the same time, or you don't). As such,
starting it out as `&&`-qualified... but it'd probably be fine to drop
that if there's a good use case for lvalues that appears.
There are two common patterns that moveInto() cleans up:
```
// If the variable is new:
Expected<std::unique_ptr<int>> ExpectedP = makePointer();
if (!ExpectedP)
return ExpectedP.takeError();
std::unique_ptr<int> P = std::move(*ExpectedP);
// If the target variable already exists:
if (Expected<T> ExpectedP = makePointer())
P = std::move(*ExpectedP);
else
return ExpectedP.takeError();
```
moveInto() takes less typing and avoids needing to name (or leak into
the scope) an extra variable.
```
// If the variable is new:
std::unique_ptr<int> P;
if (Error E = makePointer().moveInto(P))
return E;
// If the target variable already exists:
if (Error E = makePointer().moveInto(P))
return E;
```
It also seems useful for unit tests, to log errors (but continue) when
there's an unexpected failure. E.g.:
```
// Crash on error, or undefined in non-asserts builds.
std::unique_ptr<MemoryBuffer> MB = cantFail(makeMemoryBuffer());
// Avoid crashing on error without moveInto() :(.
Expected<std::unique_ptr<MemoryBuffer>>
ExpectedMB = makeMemoryBuffer();
ASSERT_THAT_ERROR(ExpectedMB.takeError(), Succeeded());
std::unique_ptr<MemoryBuffer> MB = std::move(ExpectedMB);
// Avoid crashing on error with moveInto() :).
std::unique_ptr<MemoryBuffer> MB;
ASSERT_THAT_ERROR(makeMemoryBuffer().moveInto(MB), Succeeded());
```
Differential Revision: https://reviews.llvm.org/D112278
Nikita Popov [Fri, 22 Oct 2021 17:15:22 +0000 (19:15 +0200)]
[ConstantFolding] Drop misleading comment (NFC)
As pointed out by Philip, this part of the comment is misleading,
as it describes undef rather than poison behavior. Just mentioning
poison should be sufficient.
Stephen Tozer [Mon, 18 Oct 2021 11:36:25 +0000 (12:36 +0100)]
[Dexter] Add DexFinishTest command to conditionally early-exit a test program
This patch adds a command, DexFinishTest, that allows a Dexter test to
be conditionally finished at a given breakpoint. This command has the
same set of arguments as DexLimitSteps, except that it does not allow a
line range (from_line, to_line), only a single line (on_line).
Reviewed By: Orlando
Differential Revision: https://reviews.llvm.org/D111988
Louis Dionne [Fri, 22 Oct 2021 16:03:00 +0000 (12:03 -0400)]
[libunwind] Fix path to libunwind for per-target-runtime-dir builds
We recently introduced a from-scratch config to run the libunwind tests.
However, that config was always looking for libunwind in <install>/lib,
and never in <install>/<target>/lib, which is necessary for tests to
work when the per-target-runtime-dir configuration is enabled.
This commit fixes that. I believe this is what caused the CI failures we
saw after
5a8ad80b6fa5 and caused it to be reverted.
Differential Revision: https://reviews.llvm.org/D112322
peter klausler [Tue, 19 Oct 2021 20:49:21 +0000 (13:49 -0700)]
[flang] Enforce rest of semantic constraint C919
A reference to an allocatable or pointer component must be applied
to a scalar base object. (This is the second part of constraint C919;
the first part is already checked.)
Differential Revision: https://reviews.llvm.org/D112241
Jeremy Morse [Fri, 22 Oct 2021 18:10:05 +0000 (19:10 +0100)]
[DebugInfo][Instr] Track subregisters across stack spills/restores
Sometimes we generate code that writes to a subregister, then spills /
restores a super-register to the stack, for example:
$eax = MOV32ri 0
MOV64mr $rsp, 1, $noreg, 16, $noreg, $rax
$rcx = MOV64rm $rsp, 1, $noreg, 8, $noreg
This patch takes a different approach: it adds another index to
MLocTracker that identifies a size/offset within a stack slot. A location
on the stack is then a pari of {FrameIndex, SlotNum}. Spilling and
restoring now involves pairing up the src/dest register numbers, and the
dest/src stack position to be transferred to/from. Location coverage
improves as a result, compile-time performance decreases, alas.
One limitation is that if a PHI occurs inside a stack slot:
DBG_PHI %stack.0, 1
We don't know how large the resulting value is, and so might have
difficulty picking which value to use. DBG_PHI might need to be augmented
in the future with such a size.
Unit tests added ensure that spills and restores correctly transfer to
positions in the Location => Value map, and that different register classes
written to the stack will correctly clobber all other positions in the
stack slot.
Differential Revision: https://reviews.llvm.org/D112133
peter klausler [Tue, 19 Oct 2021 21:46:23 +0000 (14:46 -0700)]
[flang] Emit unformatted headers & footers even with RECL=
The runtime library was emitting unformatted record headers and
footers when an external unit had no fixed RECL=. This is wrong
for sequential files, which should have headers & footers even
with RECL. Change to omit headers & footers from unformatted
I/O only for direct access files.
Differential Revision: https://reviews.llvm.org/D112243
Craig Topper [Fri, 22 Oct 2021 17:38:53 +0000 (10:38 -0700)]
[LegalizeTypes] Only expand CTLZ/CTTZ/CTPOP during type promotion if the new type is legal.
We might be promoting a large non-power of 2 type and the new type
may need to be split. Once we split it we may have a ctlz/cttz/ctpop
instruction for the split type.
I'm also concerned that we may create large shifts with shift amounts
that are too small.
peter klausler [Wed, 20 Oct 2021 17:37:09 +0000 (10:37 -0700)]
[flang] Fix bogus folding error for ISHFT(x, negative)
Negative shift counts are of course valid for ISHFT when
shifting to the right. This patch decouples the folding of
ISHFT from that of SHIFTA/L/R and adds tests.
Differential Revision: https://reviews.llvm.org/D112244
David Green [Fri, 22 Oct 2021 17:36:08 +0000 (18:36 +0100)]
[InstCombine] Various tests for truncating saturates and related patterns.
Simon Pilgrim [Fri, 22 Oct 2021 17:19:02 +0000 (18:19 +0100)]
[DAG] narrowExtractedVectorLoad - EXTRACT_SUBVECTOR indices are always constant
EXTRACT_SUBVECTOR indices are always constant, we don't need to check for ConstantSDNode, we should just use getConstantOperandVal which will assert for the constant.
Philip Reames [Fri, 22 Oct 2021 17:24:27 +0000 (10:24 -0700)]
[indvars] Use fact loop must exit to canonicalize to unsigned conditions
The logic in this patch is that if we find a comparison which would be unsigned except for when the loop is infinite, and we can prove that an infinite loop must be ill defined, we can still make the predicate unsigned.
The eventual goal (combined with a follow on patch) is to use the fact the loop exits to remove the zext (see tests) entirely.
A couple of points worth noting:
* We loose the ability to prove the loop unreachable by committing to the must exit interpretation. If instead, we later proved that rhs was definitely outside the range required for finiteness, we could have killed the loop entirely. (We don't currently implement this transform, but could in theory, do so.)
* simplifyAndExtend has a very limited list of users it walks. In particular, in the examples is stops at the zext and never visits the icmp. (Because we can't fold the zext to an addrec yet in SCEV.) Being willing to visit when we haven't simplified regresses multiple tests (seemingly because of less optimal results when computing trip counts). D112170 explores fixing that, but - at least so far - appears to be too expensive compile time wise.
Differential Revision: https://reviews.llvm.org/D111836
Jeremy Morse [Fri, 22 Oct 2021 17:26:35 +0000 (18:26 +0100)]
[DebugInfo][InstrRef] Add unit tests for transfer-function building
This patch adds some unit tests for the machine-location transfer-function
building parts of InstrRefBasedLDV: i.e., test that if we feed some MIR
into the transfer-function building code, does it create the correct
transfer function.
There are a number of minor defects that get corrected in the process:
* The unit test was selecting the x86 (i.e. 32 bit) backend rather than
x86_64's 64 bit backend,
* COPY instructions weren't actually having their subregister values
correctly represented in the transfer function. Subregisters were being
defined by the COPY, rather than taking the value in the source register.
* SP aliases were at risk of being clobbered, if an SP subregister was
clobbered.
Differential Revision: https://reviews.llvm.org/D112006
Craig Topper [Fri, 22 Oct 2021 17:19:57 +0000 (10:19 -0700)]
[TargetLowering] Simplify the interface of expandABS. NFC
Instead of returning a bool to indicate success and a separate
SDValue, return the SDValue and have the callers check if it is
null.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112331
Jonas Devlieghere [Fri, 22 Oct 2021 17:09:17 +0000 (10:09 -0700)]
[lldb] Pass the target triple when determining the DWARF version
When targeting iOS, the default dwarf version is 2 and not 4. Currently,
the test suite does not pick up on that because it invokes the test
compiler without a target triple. This patch fixes that and now
correctly skips tests that have a dwarf version specified in a skipIf
decorator.
rdar://
84530477
Differential revision: https://reviews.llvm.org/D112325
Quinn Pham [Fri, 22 Oct 2021 16:49:14 +0000 (11:49 -0500)]
[llvm]Inclusive language: replace master with main
[NFC] This patch fixes a url in a testcase due to the renaming of the branch.
Louis Dionne [Fri, 22 Oct 2021 16:49:58 +0000 (12:49 -0400)]
[libc++] Fix tests after
aee49255074f
Nikita Popov [Thu, 21 Oct 2021 18:46:06 +0000 (20:46 +0200)]
[Loads] Use more powerful constant folding API
This follows up on D111023 by exporting the generic "load value
from constant at given offset as given type" and using it in the
store to load forwarding code. We now need to make sure that the
load size is smaller than the store size, previously this was
implicitly ensured by ConstantFoldLoadThroughBitcast().
Differential Revision: https://reviews.llvm.org/D112260
Nikita Popov [Thu, 21 Oct 2021 19:42:14 +0000 (21:42 +0200)]
[Attributor] Generalize GEP construction
Make use of the getGEPIndicesForOffset() helper for creating GEPs.
This handles arrays as well, uses correct GEP index types and
reduces code duplication.
Differential Revision: https://reviews.llvm.org/D112263
Craig Topper [Fri, 22 Oct 2021 16:05:39 +0000 (09:05 -0700)]
[LegalizeTypes][RISCV][PowerPC] Expand CTLZ/CTTZ/CTPOP instead of promoting if they'll be expanded later.
Expanding these requires multiple constants. If we promote during type
legalization when they'll end up getting expanded in LegalizeDAG, we'll
use larger constants. These constants may be harder to materialize.
For example, 64-bit constants on 64-bit RISCV are very expensive.
This is similar to what has already been done to BSWAP and BITREVERSE.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112268
Steven Wan [Fri, 22 Oct 2021 16:07:57 +0000 (12:07 -0400)]
[AIX] Enable rtl for plugins test
On AIX, the plugins are linked with `-WL,-G`, which produces shared objects enabled for use with the run-time linker. This patch sets the run-time
linker at the main executable link step to allow symbols from the plugins shared objects to be properly bound.
Reviewed By: daltenty
Differential Revision: https://reviews.llvm.org/D112275
Craig Topper [Thu, 21 Oct 2021 17:22:02 +0000 (10:22 -0700)]
[RISCV] Merge vector tests for rv32 and rv64 into a single test file
These tests have nearly identical content the only difference is
that the rv64 test has a signext attribute on some parameters.
That attribute should be harmless on rv32.
Merge them into a single test file with 2 RUN lines.
Differential Revision: https://reviews.llvm.org/D112242
Vladimir Inđić [Thu, 21 Oct 2021 22:09:11 +0000 (17:09 -0500)]
[OpenMP][OMPT][GOMP] task frame support in KMP_API_NAME_GOMP_PARALLEL_SECTIONS
KMP_API_NAME_GOMP_PARALLEL_SECTIONS function was missing the task frame support.
This patch introduced a fix responsible to set properly the exit_frame of
the innermost implicit task that corresponds to the parallel section construct,
as well as the enter_frame of the task that encloses the mentioned implicit task.
This patch also introduced a simple test case sections_serialized.c that contains
serialized parallel section construct and validates whether the mentioned
task frames are set correctly.
Differential Revision: https://reviews.llvm.org/D112205
Kazu Hirata [Fri, 22 Oct 2021 15:52:33 +0000 (08:52 -0700)]
[Target, Transforms] Use StringRef::contains (NFC)
Jonas Paulsson [Fri, 22 Oct 2021 15:05:20 +0000 (17:05 +0200)]
[SystemZ] Give the EXRL_Pseudo a size value of 6 bytes.
This pseudo is expanded very late (AsmPrinter) and therefore has to have a
correct size value, or the branch relaxation pass may make a wrong decision.
Review: Ulrich Weigand
Mark de Wever [Thu, 21 Oct 2021 16:29:14 +0000 (18:29 +0200)]
[libc++][nfc] Remove double spaces.
Based on the comment of @Quuxplusone in D111961. It seems no tests are
affected, but give it a run on the CI to be sure.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D112231
Mark de Wever [Thu, 21 Oct 2021 18:06:30 +0000 (20:06 +0200)]
[libc++][doc] Fixes FeatureTestMacroTable.html.
`utils/generate_feature_test_macro_components.py` uses the wrong
indentation. `:name: feature-status-table :widths: auto` is rendered as
text instead of being used by Sphinx to render the table properly.
This fixes the identation in the souce and updates the generated output.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D112251
Piotr Sobczak [Fri, 22 Oct 2021 14:23:24 +0000 (16:23 +0200)]
[InstCombine][NFC] Precommit new tests
Konstantin Boyarinov [Fri, 22 Oct 2021 14:36:28 +0000 (17:36 +0300)]
[libc++][test][NFC] Add tests for std::vector comparisons
Add missing tests for std::vector operator==, !=, <, <=, >, >=
Reviewed By: ldionne, rarutyun, Quuxplusone, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D111738
Andrzej Warzynski [Fri, 22 Oct 2021 14:41:16 +0000 (14:41 +0000)]
[Flang][docs] Remove an out-dated section on the new driver
This section of the documentation should've been deleted in:
https://reviews.llvm.org/D105811
I am submitting this without a review as it's an obvious omission.
Bradley Smith [Mon, 18 Oct 2021 16:20:24 +0000 (16:20 +0000)]
[AArch64][SVE] Add new ld<n> intrinsics that return a struct of vscale types
This will allow us to reuse existing interleaved load logic in
lowerInterleavedLoad that exists for neon types, but for SVE fixed
types.
The goal eventually will be to replace the existing ld<n> intriniscs
with these, once a migration path has been sorted out.
Differential Revision: https://reviews.llvm.org/D112078
Zarko Todorovski [Fri, 22 Oct 2021 13:45:30 +0000 (09:45 -0400)]
[clang/llvm] Inclusive language: replace segregate with separate
Roman Lebedev [Fri, 22 Oct 2021 13:31:56 +0000 (16:31 +0300)]
[X86] `X86TTIImpl::getInterleavedMemoryOpCost()`: scale interleaving cost by the fraction of live members
By definition, interleaving load of stride N means:
load N*VF elements, and shuffle them into N VF-sized vectors,
with 0'th vector containing elements `[0, VF)*stride + 0`,
and 1'th vector containing elements `[0, VF)*stride + 1`.
Example: https://godbolt.org/z/df561Me5E (i64 stride 4 vf 2 => cost 6)
Now, not fully interleaved load, is when not all of these vectors is demanded.
So at worst, we could just pretend that everything is demanded,
and discard the non-demanded vectors. What this means is that the cost
for not-fully-interleaved group should be not greater than the cost
for the same fully-interleaved group, but perhaps somewhat less.
Examples:
https://godbolt.org/z/a78dK5Geq (i64 stride 4 (indices 012u) vf 2 => cost 4)
https://godbolt.org/z/G91ceo8dM (i64 stride 4 (indices 01uu) vf 2 => cost 2)
https://godbolt.org/z/5joYob9rx (i64 stride 4 (indices 0uuu) vf 2 => cost 1)
Right now, for such not-fully-interleaved loads we just use the costs
for fully-interleaved loads. But at least **in general**,
that is obviously overly pessimistic, because **in general**,
not all the shuffles needed to perform the full interleaving
will end up being live.
So what this does, is naively scales the interleaving cost
by the fraction of the live members. I believe this should still result
in the right ballpark cost estimate, although it may be over/under -estimate.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112307
Sylvestre Ledru [Fri, 22 Oct 2021 13:31:38 +0000 (15:31 +0200)]
Replace references to Makefile.sphinx
and fix some typos
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D112299
Pavel Labath [Fri, 22 Oct 2021 13:28:06 +0000 (15:28 +0200)]
[lldb] Another build fix for
8b8070e23
This particular usage was guarded by !__linux__, so it broke everywhere
else. It should probably be replaced by something else.
Simon Pilgrim [Fri, 22 Oct 2021 13:22:33 +0000 (14:22 +0100)]
[CodeGen] Add PR50197 AArch64/ARM/X86 test coverage
Pre-commit for D111530
Jay Foad [Fri, 22 Oct 2021 10:18:11 +0000 (11:18 +0100)]
[AMDGPU] Preserve deadness of vcc when shrinking instructions
This doesn't have any effect on codegen now, but it might do in the
future if we shrink instructions before post-RA scheduling, which is
sensitive to live vs dead defs.
Differential Revision: https://reviews.llvm.org/D112305
Mats Petersson [Tue, 6 Apr 2021 10:20:49 +0000 (11:20 +0100)]
[mlir][OpenMP]Support for modifiers in workshare loops
Pass the modifiers from the Flang parser to FIR/MLIR workshare
loop operation.
Not yet supporting the SIMD modifier, which is a bit more work
than just adding it to the list of modifiers, so will go in a
separate patch.
This adds a new field to the WsLoopOp.
Also add test for dynamic WSLoop, checking that dynamic schedule calls
the init and next functions as expected.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D111053
Florian Hahn [Fri, 22 Oct 2021 12:50:32 +0000 (13:50 +0100)]
[DSE] Add test cases with more complex redundant stores.
This patch adds more complex test cases with redundant stores of an
existing memset, with other stores in between.
It also makes a few of the existing tests more robust.
Michał Górny [Fri, 22 Oct 2021 12:00:07 +0000 (14:00 +0200)]
[lldb] [Utility/UriParser] Replace port==-1 with llvm::None
Use llvm::Optional<uint16_t> instead of int for port number
in UriParser::Parse(), and use llvm::None to indicate missing port
instead of a magic value of -1.
Differential Revision: https://reviews.llvm.org/D112309
Pavel Labath [Fri, 22 Oct 2021 12:28:52 +0000 (14:28 +0200)]
[lldb] Fix build errors from
8b8070e23
I missed windows and openbsd.
Roman Lebedev [Fri, 22 Oct 2021 11:56:04 +0000 (14:56 +0300)]
[NFC] Re-harden test/Transforms/LoopVectorize/X86/pr48340.ll
This test is quite fragile WRT improvements to the interleaved load cost
modelling. Let's bump the stride way up so that is no longer a concern.
Roman Lebedev [Fri, 22 Oct 2021 11:54:36 +0000 (14:54 +0300)]
Revert "[NFC][LV] Autogenerate check lines in a test for ease of future update"
This reverts commit
8ae83a1bafdfd726a657db43653195d35bda1179.
Simon Pilgrim [Fri, 22 Oct 2021 11:10:44 +0000 (12:10 +0100)]
AMDGPULibCalls - constify some FuncInfo& arguments. NFCI.
Roman Lebedev [Fri, 22 Oct 2021 11:04:38 +0000 (14:04 +0300)]
[TTI] `BasicTTIImplBase::getInterleavedMemoryOpCost()`: fix load discounting
The math here is:
Cost of 1 load = cost of n loads / n
Cost of live loads = num live loads * Cost of 1 load
Cost of live loads = num live loads * (cost of n loads / n)
Cost of live loads = cost of n loads * (num live loads / n)
But, all the variables here are integers,
and integer division rounds down,
but this calculation clearly expects float semantics.
Instead multiply upfront, and then perform round-up-division.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112302
Roman Lebedev [Fri, 22 Oct 2021 11:04:03 +0000 (14:04 +0300)]
[NFC][LV] Autogenerate check lines in a test for ease of future update
Pavel Labath [Tue, 19 Oct 2021 14:00:31 +0000 (16:00 +0200)]
Host::GetOSBuildString
Kristof Beyls [Fri, 22 Oct 2021 10:36:49 +0000 (11:36 +0100)]
Mark baremetal.cpp test as unsupported on Windows.
A new check was added in
3b93dc68, which seems to not be possible to get
working correctly on windows systems:
The test first "captures" the install directory of the clang toolchain
running the test as follows:
// CHECK-AARCH64-NO-HOST-INC: InstalledDir: [[INSTALLEDDIR:.+]]
Then, in a check line a bit later, it uses this to check if a particular
directory in the toolchain installation directory is included when
targeting aarch64-none-elf:
// CHECK-AARCH64-NO-HOST-INC-SAME: "-internal-isystem" "[[INSTALLEDDIR]]{{[/\\]+}}..{{[/\\]+}}lib{{[/\\]+}}clang-runtimes{{[/\\]+}}aarch64-none-elf{{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
Even though the test aims to take into account forward vs backward slash
differences between Windows and Unix paths, it still fails on Windows.
It seems that on Windows (this is based on the output log from a Windows
bot), the INSTALLEDDIR variable has the following value:
note: with "INSTALLEDDIR" equal to "c:\\\\b\\\\slave\\\\clang-x64-windows-msvc\\\\build\\\\stage1\\\\bin"
However the actual "InstalledDir:" output produced by the clang
toolchain on that Windows bot was:
InstalledDir: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin
It is unclear where the explosion of backslashes happens. Maybe this is
a bug in FileCheck somewhere?
Anyway, marking this test as not supported on Windows to make the bots
green again.
Simon Pilgrim [Fri, 22 Oct 2021 10:45:12 +0000 (11:45 +0100)]
AMDGPULibCalls::parseFunctionName - use reference instead of pointer. NFCI.
parseFunctionName allowed a default null pointer, despite it being dereferenced immediately to be used as a reference and that all callers were taking the address of an existing reference.
Fixes static analyzer warning about potential dereferenced nulls
Michał Górny [Mon, 27 Sep 2021 10:22:31 +0000 (12:22 +0200)]
[llvm] [ADT] Update llvm::Split() per Pavel Labath's suggestions
Optimize the iterator comparison logic to compare Current.data()
pointers. Use std::tie for assignments from std::pair. Replace
the custom class with a function returning iterator_range.
Differential Revision: https://reviews.llvm.org/D110535
Florian Hahn [Fri, 22 Oct 2021 10:00:23 +0000 (11:00 +0100)]
[LLVM-C]Add LLVMAddMetadataToInst, deprecated LLVMSetInstDebugLocation.
IRBuilder has been updated to support preserving metdata in a more
general manner. This patch adds `LLVMAddMetadataToInst` and
deprecates `LLVMSetInstDebugLocation` in favor of the more
general function.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D93454
Nicolas Vasilache [Fri, 22 Oct 2021 09:39:07 +0000 (09:39 +0000)]
[mlir][Vector] NFC - Extract rewrites related to insert/extract strided slice in a separate file.
Differential Revision: https://reviews.llvm.org/D112301
Manas [Fri, 22 Oct 2021 09:47:27 +0000 (11:47 +0200)]
[analyzer][solver] Introduce reasoning for not equal to operator
Prior to this, the solver was only able to verify whether two symbols
are equal/unequal, only when constants were involved. This patch allows
the solver to work over ranges as well.
Reviewed By: steakhal, martong
Differential Revision: https://reviews.llvm.org/D106102
Patch by: @manas (Manas Gupta)
Fraser Cormack [Thu, 21 Oct 2021 14:32:12 +0000 (15:32 +0100)]
[RISCV] Fix missing cross-block VSETVLI insertion
This patch fixes a codegen bug, the test for which was introduced in
D112223.
When merging VSETVLIInfo across blocks, if the 'exit' VSETVLIInfo
produced by a block is found to be compatible with the VSETVLIInfo
computed as the intersection of the 'exit' VSETVLIInfo produced by the
block's predecessors, that blocks' 'exit' info is discarded and the
intersected value is taken in its place.
However, we have one authority on what constitutes VSETVLIInfo
compatibility and we are using it in two different contexts.
Compatibility is used in one context to elide VSETVLIs between
straight-line vector instructions. But compatibility when evaluated
between two blocks' exit infos ignores any info produced *inside* each
respective block before the exit points. As such it does not guarantee
that a block will not produce a VSETVLI which is incompatible with the
'previous' block.
As such, we must ensure that any merging of VSETVLIInfo is performed
using some notion of "strict" compatibility. I've defined this as a full
vtype match, but this is perhaps too pessimistic. Given that test
coverage in this regard is lacking -- the only change is in the failing
test -- I think this is a good starting point.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D112228
Kristof Beyls [Fri, 22 Oct 2021 09:24:04 +0000 (10:24 +0100)]
Fix baremetal.cpp test to handle windows paths.
Gabor Marton [Thu, 23 Sep 2021 18:19:21 +0000 (20:19 +0200)]
[Analyzer] Extend ConstraintAssignor to handle remainder op
Summary:
`a % b != 0` implies that `a != 0` for any `a` and `b`. This patch
extends the ConstraintAssignor to do just that. In fact, we could do
something similar with division and in case of multiplications we could
have some other inferences, but I'd like to keep these for future
patches.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51940
Reviewers: noq, vsavchenko, steakhal, szelethus, asdenyspetrov
Subscribers:
Differential Revision: https://reviews.llvm.org/D110357
Gabor Marton [Mon, 11 Oct 2021 12:44:02 +0000 (14:44 +0200)]
[Analyzer][NFC] Add RangedConstraintManager to ConstraintAssignor
In this patch we store a reference to `RangedConstraintManager` in the
`ConstraintAssignor`. This way it is possible to call back and reuse some
functions of it. This patch is exclusively needed for its child patches,
it is not intended to be a standalone patch.
Differential Revision: https://reviews.llvm.org/D111640
Gabor Marton [Fri, 24 Sep 2021 07:15:59 +0000 (09:15 +0200)]
[Analyzer][NFC] Move RangeConstraintManager's def before ConstraintAssignor's def
In this patch we simply move the definition of RangeConstraintManager before
the definition of ConstraintAssignor. This patch is exclusively needed for it's
child patch, so in the child the diff would be clean and the review would be
easier.
Differential Revision: https://reviews.llvm.org/D110387
Pavel Labath [Tue, 19 Oct 2021 11:09:38 +0000 (13:09 +0200)]
[lldb] Remove ConstString from ABI, Architecture and Disassembler plugin names
Raphael Isemann [Fri, 22 Oct 2021 08:07:58 +0000 (10:07 +0200)]
[lldb] Fix TestCompressedVectors after array type name change
aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7 turns array names such as `int [1]`
into `int[1]` (without the space). This probably breaks some user formatters,
but let's first get this test running while this is being discussed.
Valentin Clement [Fri, 22 Oct 2021 07:59:44 +0000 (09:59 +0200)]
[fir] Add utility function to FIRBuilder and MutableBox
This patch is extracted from D111337 to make is smaller.
It introduce utility functions to the FIRBuilder and add the MutableBox
files.
- genShape
- readCharLen
- getExtents
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D112207
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Balázs Kéri [Fri, 22 Oct 2021 06:43:46 +0000 (08:43 +0200)]
[clang][ASTImporter] Fix for importing functions with EST_Unevaluated prototype.
Fix for importing functions where the TypeSourceInfo is set and the
exception specification information contains reference to the function
declaration itself.
Reviewed By: martong, steakhal
Differential Revision: https://reviews.llvm.org/D112013
Kristof Beyls [Tue, 5 Oct 2021 08:24:10 +0000 (09:24 +0100)]
Add basic aarch64-none-elf bare metal driver.
Differential Revision: https://reviews.llvm.org/D111134
Chen Zheng [Fri, 22 Oct 2021 06:18:07 +0000 (06:18 +0000)]
[PowerPC] iterate on the SmallSet directly; NFC
Chen Zheng [Fri, 22 Oct 2021 05:39:51 +0000 (05:39 +0000)]
[PowerPC] return early if there is no preparing candidate in the loop; NFC
This is to improve compiling time.
Differential Revision: https://reviews.llvm.org/D112196
Reviewed By: jsji
David Blaikie [Fri, 22 Oct 2021 03:14:04 +0000 (20:14 -0700)]
Fix for OutputStream->OutputBuffer rename
Chuanqi Xu [Fri, 22 Oct 2021 01:49:04 +0000 (09:49 +0800)]
[Coroutines] Ignore partial lifetime markers refer of an alloca
When I playing with Coroutines, I found that it is possible to generate
following IR:
```
%struct = alloca ...
%sub.element = getelementptr %struct, i64 0, i64 index ; index is not
%zero
lifetime.marker.start(%sub.element)
% use of %sub.element
lifetime.marker.end(%sub.element)
store %struct to xxx ; %struct is escaping!
<suspend points>
```
Then the AllocaUseVisitor would collect the lifetime marker for
sub.element and treat it as the lifetime markers of the alloca! So it
judges that the alloca could be put on the stack instead of the frame by
judging the lifetime markers only.
The root cause for the bug is that AllocaUseVisitor collects wrong
lifetime markers.
This patch fixes this.
Reviewed By: lxfind
Differential Revision: https://reviews.llvm.org/D112216
LLVM GN Syncbot [Fri, 22 Oct 2021 01:36:03 +0000 (01:36 +0000)]
[gn build] Port
2e97236aacbb
Vitaly Buka [Fri, 22 Oct 2021 01:34:29 +0000 (18:34 -0700)]
[libcxxabi] Fix build after D111947
Vitaly Buka [Thu, 21 Oct 2021 03:59:28 +0000 (20:59 -0700)]
[msan] Don't use TLS slots of noundef args
Transformations may strip the attribute from the
argument, e.g. for unused, which will result in
shadow offsets mismatch between caller and
callee.
Stripping noundef for used arguments can be
a problem, as TLS is not going to be set
by caller. However this is not the goal of the
patch and I am not aware if that's even
possible.
Differential Revision: https://reviews.llvm.org/D112197
Stanislav Mekhanoshin [Wed, 13 Oct 2021 22:47:07 +0000 (15:47 -0700)]
[AMDGPU] Allow to use a whole register file on gfx90a for VGPRs
In a kernel which does not have calls or AGPR usage we can allocate
the whole vector register budget for VGPRs and have no AGPRs as
long as VGPRs stay addressable (i.e. below 256).
Differential Revision: https://reviews.llvm.org/D111764
Matthias Springer [Fri, 22 Oct 2021 00:58:41 +0000 (09:58 +0900)]
[mlir][linalg][bufferize] Support scf::IfOp
This commit adds support for scf::IfOp to comprehensive bufferization. Support is currently limited to cases where both branches yield tensors that bufferize to the same buffer.
To keep the analysis simple, scf::IfOp are treated as memory writes for analysis purposes, even if no op inside any branch is writing. (scf::ForOps are handled in the same way.)
Differential Revision: https://reviews.llvm.org/D111929
Nico Weber [Thu, 21 Oct 2021 17:33:47 +0000 (13:33 -0400)]
[gn build] Make 'compiler-rt' depend on include dir
That way, the headers in llvm/utils/gn/secondary/compiler-rt/include
are copied when running `ninja compiler-rt`. (Previously, they were
only copied when running `check-hwasan` or when building the
compiler-rt/include target.)
(Since they should be copied only once, depend on the target in the
host toolchain. I think default_toolchain should work just as well,
it just needs to be a single fixed toolchain. check-hwasan depends
through host_toolchain, so let's use that here too.)
Prevents errors like
testing/fuzzed_data_provider.h:8:10: fatal error: 'fuzzer/FuzzedDataProvider.h' file not found
when building with locally-built clang. (For now, you still have to
explicitly build the 'compiler-rt' target. Maybe we should make the
clang target depend on that in the GN build?)
Differential Revision: https://reviews.llvm.org/D112238
Luís Ferreira [Fri, 22 Oct 2021 00:31:53 +0000 (17:31 -0700)]
[Demangle] Rename OutputStream to OutputString
This patch is a refactor to implement prepend afterwards. Since this changes a lot of files and to conform with guidelines, I will separate this from the implementation of prepend. Related to the discussion in https://reviews.llvm.org/D111414 , so please read it for more context.
Reviewed By: #libc_abi, dblaikie, ldionne
Differential Revision: https://reviews.llvm.org/D111947
Jonas Devlieghere [Fri, 22 Oct 2021 00:32:02 +0000 (17:32 -0700)]
[lldb] Include unistd.h for sleep in profile_vrs_detach
Jack Anderson [Fri, 22 Oct 2021 00:29:34 +0000 (17:29 -0700)]
[DebugInfo] Expand ability to load 2-byte addresses in dwarf sections
Some dwarf loaders in LLVM are hard-coded to only accept 4-byte and 8-byte address sizes. This patch generalizes acceptance into `DWARFContext::isAddressSizeSupported` and provides a common way to generate rejection errors.
The MSP430 target has been given new tests to cover dwarf loading cases that previously failed due to 2-byte addresses.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D111953
Jonas Devlieghere [Thu, 21 Oct 2021 23:45:48 +0000 (16:45 -0700)]
[lldb] Always set the minimum OS version in the Darwin builder
Tom Stellard [Thu, 21 Oct 2021 23:11:41 +0000 (16:11 -0700)]
compiler-rt: Fix arch detection for ppc64le
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D110377
Craig Topper [Thu, 21 Oct 2021 23:02:42 +0000 (16:02 -0700)]
[RISCV] Remove Zvamo C intrinsics and builtins.
Zvamo is not part of the 1.0 V spec. Remove the intrinsics
for now. This helps reduce clang binary size and lit test time.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D111692
Tom Stellard [Thu, 21 Oct 2021 23:04:51 +0000 (16:04 -0700)]
[docs] Remove Makefile.sphinx files
Does anyone still use these? I want to make some changes to the sphinx
html generation and I don't want to have to implement the changes in
two places.
Reviewed By: sylvestre.ledru, #libc, ldionne
Differential Revision: https://reviews.llvm.org/D112030
Craig Topper [Thu, 21 Oct 2021 22:23:41 +0000 (15:23 -0700)]
[TargetLowering] Simplify the interface for expandCTPOP/expandCTLZ/expandCTTZ.
There is no need to return a bool and have an SDValue output
parameter. Just return the SDValue and let the caller check if it
is null.
I have another patch to add more callers of these so I thought
I'd clean up the interface first.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112267
Valentin Clement [Thu, 21 Oct 2021 22:25:59 +0000 (00:25 +0200)]
[fir] Remove unused function in CharacterTest
Craig Topper [Thu, 21 Oct 2021 22:16:41 +0000 (15:16 -0700)]
[LegalizeVectorOps][X86] Don't defer BITREVERSE expansion to LegalizeDAG.
By expanding early it allows the shifts to be custom lowered in
LegalizeVectorOps. Then a DAG combine is able to run on them before
LegalizeDAG handles the BUILD_VECTORS for the masks used.
v16Xi8 shift lowering on X86 requires a mask to be applied to a v8i16
shift. The BITREVERSE expansion applied an AND mask before SHL ops and
after SRL ops. This was done to share the same mask constant for both shifts.
It looks like this patch allows DAG combine to remove the AND mask added
after v16i8 SHL by X86 lowering. This maintains the mask sharing that
BITREVERSE was trying to achieve. Prior to this patch it looks like
we kept the mask after the SHL instead which required an extra constant
pool or a PANDN to invert it.
This is dependent on D112248 because RISCV will end up scalarizing the BSWAP
portion of the BITREVERSE expansion if we don't disable BSWAP scalarization in
LegalizeVectorOps first.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D112254
Stanislav Mekhanoshin [Thu, 21 Oct 2021 22:15:54 +0000 (15:15 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Volodymyr Sapsai [Fri, 24 Sep 2021 21:51:21 +0000 (14:51 -0700)]
[modules] Update visibility for merged ObjCInterfaceDecl definitions.
We keep using the first encountered definition and need to take into
account visibility from subsequent definitions. For example, if the
first definition is hidden and the second is visible, we need to make
the first one visible too.
rdar://
82263843
Differential Revision: https://reviews.llvm.org/D110453