Louis Dionne [Mon, 18 Jan 2021 17:18:18 +0000 (12:18 -0500)]
[libc++] Make LIBCXX_ENABLE_FILESYSTEM fully consistent
Previously, LIBCXX_ENABLE_FILESYSTEM controlled only whether the filesystem
support was compiled into libc++'s library. This commit promotes the
setting to a first-class option like LIBCXX_ENABLE_LOCALIZATION, where
the whole library is aware of the setting and features that depend on
<filesystem> won't be provided at all. The test suite is also properly
annotated such that tests that depend on <filesystem> are disabled when
the library doesn't support it.
This is an alternative to https://llvm.org/D94824, but also an improvement
along the lines of LIBCXX_ENABLE_LOCALIZATION that I had been wanting to
make for a while.
Differential Revision: https://reviews.llvm.org/D94921
Louis Dionne [Thu, 14 Jan 2021 21:27:53 +0000 (16:27 -0500)]
[libc++] Unbreak the debug mode
When the Debug mode is enabled, we disable extern declarations because we
don't want to use the functions compiled in the library, which might not
have had the debug mode enabled when built. However, some extern declarations
need to be kept, because code correctness depends on it.
31e820378b8a removed those declarations, which had the unintended
consequence of breaking the debug build. This commit fixes that by
re-introducing a separate macro for the required extern declarations,
and adds a comment so that we don't fall into that trap in the future.
Differential Revision: https://reviews.llvm.org/D94718
Reid Kleckner [Tue, 19 Jan 2021 19:03:18 +0000 (11:03 -0800)]
Add bounds checking assertions to APValue, NFC
These checks help find llvm.org/pr48582 without ASan
Reid Kleckner [Tue, 19 Jan 2021 19:00:33 +0000 (11:00 -0800)]
Consider ASan messages interesting for creduce
Helped me reduce llvm.org/pr48582
Jeroen Dobbelaere [Tue, 19 Jan 2021 19:04:52 +0000 (20:04 +0100)]
[noalias.decl] Look through llvm.experimental.noalias.scope.decl
Just like llvm.assume, there are a lot of cases where we can just ignore llvm.experimental.noalias.scope.decl.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D93042
Richard Smith [Tue, 19 Jan 2021 19:04:08 +0000 (11:04 -0800)]
[www] Fix background color in table cell.
Brendon Cahoon [Tue, 19 Jan 2021 18:42:29 +0000 (12:42 -0600)]
[Hexagon] Fix segment start to adjust for gaps between segments
The Hexagon Vector Combine pass genertes stores for a complete
aligned vector. The start of each section is a multiple of the
vector size, so that value is passed to normalize to compute
the offset of the stores in the section. The first store may
not occur at offset 0 when there is a gap between sections.
Utkarsh Saxena [Mon, 18 Jan 2021 20:01:46 +0000 (21:01 +0100)]
[clangd] Use ASTSignals in Heuristics CC Ranking.
Differential Revision: https://reviews.llvm.org/D94927
Jay Foad [Tue, 19 Jan 2021 16:15:23 +0000 (16:15 +0000)]
[AMDGPU] Simpler names for arch-specific ttmp registers. NFC.
Rename the *_gfx9_gfx10 ttmp registers to *_gfx9plus for simplicity,
and use the corresponding isGFX9Plus predicate to decide when to use
them instead of the old *_vi versions.
Differential Revision: https://reviews.llvm.org/D94975
Jessica Paquette [Tue, 19 Jan 2021 18:38:04 +0000 (10:38 -0800)]
Fix buildbot after
cfc60730179042a93cb9cb338982e71d20707a24
Windows buildbots were not happy with using find_if + instructionsWithoutDebug.
In
cfc60730179042a9, instructionsWithoutDebug is not technically necessary. So,
just iterate over the block directly.
http://lab.llvm.org:8011/#/builders/127/builds/4732/steps/7/logs/stdio
Jessica Paquette [Fri, 18 Dec 2020 20:56:14 +0000 (12:56 -0800)]
[GlobalISel] Combine (a[0]) | (a[1] << k1) | ...| (a[m] << kn) into a wide load
This is a restricted version of the combine in `DAGCombiner::MatchLoadCombine`.
(See D27861)
This tries to recognize patterns like below (assuming a little-endian target):
```
s8* x = ...
s32 val = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)
->
s32 val = *((i32)a)
s8* x = ...
s32 val = a[3] | (a[2] << 8) | (a[1] << 16) | (a[0] << 24)
->
s32 val = BSWAP(*((s32)a))
```
(This patch also handles the big-endian target case as well, in which the first
example above has a BSWAP, and the second example above does not.)
To recognize the pattern, this searches from the last G_OR in the expression
tree.
E.g.
```
Reg Reg
\ /
OR_1 Reg
\ /
OR_2
\ Reg
.. /
Root
```
Each non-OR register in the tree is put in a list. Each register in the list is
then checked to see if it's an appropriate load + shift logic.
If every register is a load + potentially a shift, the combine checks if those
loads + shifts, when OR'd together, are equivalent to a wide load (possibly with
a BSWAP.)
To simplify things, this patch
(1) Only handles G_ZEXTLOADs (which appear to be the common case)
(2) Only works in a single MachineBasicBlock
(3) Only handles G_SHL as the bit twiddling to stick the small load into a
specific location
An IR example of this is here: https://godbolt.org/z/4sP9Pj (lifted from
test/CodeGen/AArch64/load-combine.ll)
At -Os on AArch64, this is a 0.5% code size improvement for CTMark/sqlite3,
and a 0.4% improvement for CTMark/7zip-benchmark.
Also fix a bug in `isPredecessor` which caused it to fail whenever `DefMI` was
the first instruction in the block.
Differential Revision: https://reviews.llvm.org/D94350
Fraser Cormack [Wed, 13 Jan 2021 12:27:05 +0000 (12:27 +0000)]
[RISCV] Add ISel patterns for scalable mask exts & truncs
Original patch by @rogfer01.
This patch adds support for sign-, zero-, and any-extension from
scalable mask vector types to integer vector types, as well as
truncation in the opposite direction.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Fraser Cormack <fraser@codeplay.com>
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94590
Abhina Sreeskantharajan [Tue, 19 Jan 2021 18:04:27 +0000 (13:04 -0500)]
[SystemZ][z/OS] Fix Permission denied pattern matching
On z/OS, the error message "EDC5111I Permission denied." is not matched correctly in lit tests. This patch updates the check expression to match successfully.
Differential Revision: https://reviews.llvm.org/D94432
Michael Kruse [Tue, 19 Jan 2021 16:28:43 +0000 (10:28 -0600)]
[Polly] Update isl to isl-0.23-61-g24e8cd12.
This fixes llvm.org/PR48554
Some test cases had to be updated because the hash function for
union_maps have been changed which affects the output order.
Raphael Isemann [Tue, 19 Jan 2021 17:57:32 +0000 (18:57 +0100)]
[lldb][docs] Update .htaccess to redirect from old SB API documentation to new one
This is mostly SEO so that the new API can take over the old API when people
search for the different SB* classes. Sadly epydoc decided to throw in a -class
prefix behind all the class file names, so we can't just overwrite the old files
with the newly generated ones.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D94900
David Green [Tue, 19 Jan 2021 17:56:50 +0000 (17:56 +0000)]
[ARM] Expand vXi1 VSELECT's
We have no lowering for VSELECT vXi1, vXi1, vXi1, so mark them as
expanded to turn them into a series of logical operations.
Differential Revision: https://reviews.llvm.org/D94946
Raphael Isemann [Tue, 19 Jan 2021 17:53:52 +0000 (18:53 +0100)]
[lldb][docs] Add a doc page for enums and constants
Enums and constants are currently missing in the new LLDB Python API docs.
In theory we could just let them be autogenerated like the SB API classes, but sadly the generated documentation
suffers from a bunch of problems. Most of these problems come from the way SWIG is representing enums, which is
done by translating every single enum case into its own constant. This has a bunch of nasty effects:
* Because SWIG throws away the enum types, we can't actually reference the enum type itself in the API. Also because automodapi is impossible to script, this can't be fixed in post (at least without running like sed over the output files).
* The lack of enum types also causes that every enum *case* has its own full doc page. Having a full doc page that just shows a single enum case is pointless and it really slows down sphinx.
* There is no SWIG code for the enums, so there is also no place to write documentation strings for them. Also there is no support for copying the doxygen strings (which would be in the wrong format, but better than nothing) for enums (let alone our defines), so we can't really document all this code.
* Because the enum cases are just forwards to the native lldb module (which we mock), automodapi actually takes the `Mock` docstrings and adds it to every single enum case.
I don't see any way to solve this via automodapi or SWIG. The most reasonable way to solve this is IMHO to write a simple Clang tool
that just parses our enum/constant headers and emits an *.rst file that we check in. This way we can do all the LLDB-specific enum case and constant
grouping that we need to make a readable documentation page.
As we're without any real documentation until I get around to write that tool, I wrote a doc page for the enums/constants as a stop gap measure.
Most of this is done by just grepping our enum header and then manually cleaning up all the artifacts and copying the few doc strings we have.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D94959
Andrzej Warzynski [Tue, 19 Jan 2021 14:24:20 +0000 (14:24 +0000)]
[flang][driver] Move isFixedFormSuffix and isFreeFormSuffix to flangFrontend
isFixedFormSuffix and isFreeFormSuffix should be defined in
flangFrontend rather than flangFrontendTool library. That's for 2
reasons:
* these methods are used in flangFrontend rather than flangFrontendTool
* flangFrontendTool depends on flangFrontend
As mentioned in the post-commit review for D94228, without this change
shared library builds fail.
Differential Revision: https://reviews.llvm.org/D94968
Stella Laurenzo [Mon, 18 Jan 2021 19:27:19 +0000 (11:27 -0800)]
[mlir][python] Factor out standalone OpView._ods_build_default class method.
* This allows us to hoist trait level information for regions and sized-variadic to class level attributes (_ODS_REGIONS, _ODS_OPERAND_SEGMENTS, _ODS_RESULT_SEGMENTS).
* Eliminates some splicey python generated code in favor of a native helper for it.
* Makes it possible to implement custom, variadic and region based builders with one line of python, without needing to manually code access to the segment attributes.
* Needs follow-on work for region based callbacks and support for SingleBlockImplicitTerminator.
* A follow-up will actually add ODS support for generating custom Python builders that delegate to this new method.
* Also includes the start of an e2e sample for constructing linalg ops where this limitation was discovered (working progressively through this example and cleaning up as I go).
Differential Revision: https://reviews.llvm.org/D94738
Björn Schäpers [Mon, 18 Jan 2021 12:15:20 +0000 (13:15 +0100)]
[clang-format] Apply Allman style to lambdas
Differential Revision: https://reviews.llvm.org/D94906
Nikita Popov [Sat, 16 Jan 2021 14:32:40 +0000 (15:32 +0100)]
[ValueTracking] Strengthen impliesPoison reasoning
Split impliesPoison into two recursive walks, one over V, the
other over ValAssumedPoison. This allows us to reason about poison
implications in a number of additional cases that are important
in practice. This is a generalized form of D94859, which handles
the cmp to cmp implication in particular.
Differential Revision: https://reviews.llvm.org/D94866
Jay Foad [Tue, 19 Jan 2021 16:46:44 +0000 (16:46 +0000)]
[AMDGPU] Fix test case for D94010
KareemErgawy-TomTom [Tue, 19 Jan 2021 16:11:55 +0000 (17:11 +0100)]
[MLIR][SPIRV] Add `SignedOp` trait.
This commit adds a new trait that can be attached to ops that have
signed semantics.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D94896
Jay Foad [Tue, 19 Jan 2021 16:35:53 +0000 (16:35 +0000)]
[AMDGPU] Simplify test case for D94010
Hansang Bae [Fri, 15 Jan 2021 23:37:13 +0000 (17:37 -0600)]
[OpenMP] Fix atomic entries for captured logical operation
Added missing code for the captured atomic operation.
Differential Revision: https://reviews.llvm.org/D94848
Fraser Cormack [Wed, 13 Jan 2021 13:33:38 +0000 (13:33 +0000)]
[RISCV] Extend RVV VType info with the type's AVL (NFC)
This patch factors out the "VLMax" operand passed to most
scalable-vector ISel patterns into a property of each VType.
This is seen as a preparatory change to allow RVV in the future to
more easily support fixed-length vector types with constrained vector
lengths, with the AVL operand set to the length of the fixed-length
vector. It has no effect on the scalable code generation path.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D94594
David Green [Tue, 19 Jan 2021 15:38:46 +0000 (15:38 +0000)]
[ARM] Add MVE add.sat costs
This adds some basic MVE sadd_sat/ssub_sat/uadd_sat/usub_sat costs,
based on when the instruction is legal. With smaller than legal types
that are promoted we generate shr(qadd(shl, shl)), so the cost is 4
appropriately.
Differential Revision: https://reviews.llvm.org/D94958
Valentin Clement [Tue, 19 Jan 2021 15:28:09 +0000 (10:28 -0500)]
[flang][directive] Get rid of flangClassValue in TableGen
The TableGen emitter for directives has two slots for flangClass information and this was mainly
to be able to keep up with the legacy openmp parser at the time. Now that all clauses are encapsulated in
AccClause or OmpClause, these two strings are not necessary anymore and were the the source of couple
of problem while working with the generic structure checker for OpenMP.
This patch remove the flangClassValue string from DirectiveBase.td and use the string flangClass as the
placeholder for the encapsulated class.
Reviewed By: sameeranjoshi
Differential Revision: https://reviews.llvm.org/D94821
Victor Huang [Tue, 19 Jan 2021 15:01:22 +0000 (09:01 -0600)]
[PowerPC] Fix the check for the instruction using FRSP/XSRSP output register
When performing peephole optimization to simplify the code, after removing
passed FPSP/XSRSP instruction we will set any uses of that FRSP/XSRSP to the
source of the FRSP/XSRSP.
We are finding the machine instruction using virtual register holding FRSP/XSRSP
results by searching all following instructions and encountering an issue
that the first use of the virtual register is a debug MI causing:
1. virtual register in the debug MI removed unexpectedly.
2. virtual register used in non-debug MI not replaced with the source of
FRSP/XSRSP. which stays in a undef status.
This patch fix the issue by only searching non-debug machine instruction using
virtual register holding FRSP/XSRSP results when the vr only has one non debug
usage.
Differential Revisien: https://reviews.llvm.org/D94711
Reviewed by: nemanjai
Raul Tambre [Sun, 10 Jan 2021 12:11:35 +0000 (14:11 +0200)]
[CMake] Remove dead code setting policies to NEW
cmake_minimum_required(VERSION) calls cmake_policy(VERSION),
which sets all policies up to VERSION to NEW.
LLVM started requiring CMake 3.13 last year, so we can remove
a bunch of code setting policies prior to 3.13 to NEW as it
no longer has any effect.
Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne
Differential Revision: https://reviews.llvm.org/D94374
Utkarsh Saxena [Fri, 15 Jan 2021 16:19:53 +0000 (17:19 +0100)]
[clangd] Index local classes, virtual and overriding methods.
Previously we did not record local class declarations. Now with features like
findImplementation and typeHierarchy, we have a need to index such local
classes to accurately report subclasses and implementations of methods.
Performance testing results:
- No changes in indexing timing.
- No significant change in memory usage.
- **1%** increase in #relations.
- **0.17%** increase in #refs.
- **0.22%** increase #symbols.
**New index stats**
Time to index: **4:13 min**
memory usage **543MB**
number of symbols: **521.5K**
number of refs: **8679K**
number of relations: **49K**
**Base Index stats**
Time to index: **4:15 min**
memory usage **542MB**
number of symbols: **520K**
number of refs: **8664K**
number of relations: **48.5K**
Fixes: https://github.com/clangd/clangd/issues/644
Differential Revision: https://reviews.llvm.org/D94785
Andy Wingo [Mon, 30 Nov 2020 13:56:57 +0000 (14:56 +0100)]
[WebAssembly][lld] Fix call-indirect.s test to validate
Add missing address operand, so that we can validate the output files.
Depends on D92315.
Differential Revision: https://reviews.llvm.org/D92320
David Green [Tue, 19 Jan 2021 15:06:06 +0000 (15:06 +0000)]
[ARM] Expand add.sat/sub.sat cost checks. NFC
Alex Richardson [Tue, 19 Jan 2021 13:02:29 +0000 (13:02 +0000)]
[libc++] Sync TEST_HAS_TIMESPEC_GET and _LIBCPP_HAS_TIMESPEC_GET on FreeBSD
Commit
5e416ba943b7c737deb8eca62756f7b4fa925845 (D71522) updated the
__config header but didn't change test_macros.h.
This fixes libcxx/language.support/has_timespec_get.compile.pass.cpp on
FreeBSD12/13.
Reviewed By: #libc, dim, ldionne
Differential Revision: https://reviews.llvm.org/D94292
Florian Hahn [Tue, 19 Jan 2021 14:34:55 +0000 (14:34 +0000)]
[LoopRotate] Calls not lowered to calls should not block rotation.
83daa49758a1 made loop-rotate more conservative in the presence of
function calls in the prepare-for-lto stage. The code did not properly
account for calls that are no actual function calls, like calls to
intrinsics. This patch updates the code to ensure only calls that are
lowered to actual calls are considered inline candidates.
Praveen [Tue, 19 Jan 2021 12:58:44 +0000 (18:28 +0530)]
[Flang][OpenMP] Add semantic checks for OpenMP Workshare Construct
Add Semantic checks for OpenMP 4.5 - 2.7.4 Workshare Construct.
- The structured block in a workshare construct may consist of only
scalar or array assignments, forall or where statements,
forall, where, atomic, critical or parallel constructs.
- All array assignments, scalar assignments, and masked array
assignments must be intrinsic assignments.
- The construct must not contain any user defined function calls unless
the function is ELEMENTAL.
Test cases : omp-workshare03.f90, omp-workshare04.f90, omp-workshare05.f90
Resolve test cases (omp-workshare01.f90 and omp-workshare02.f90) marked as XFAIL
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D93091
Simon Pilgrim [Tue, 19 Jan 2021 14:28:30 +0000 (14:28 +0000)]
[X86] Regenerate fmin/fmax reduction tests
Add missing check-prefixes + v1f32 tests
Raphael Isemann [Tue, 19 Jan 2021 14:25:15 +0000 (15:25 +0100)]
[lldb] Fix two documentation typos
Lei Zhang [Tue, 19 Jan 2021 14:13:44 +0000 (09:13 -0500)]
[mlir][spirv] Define spv.GLSL.Fma and add lowerings
Also changes some rewriter.create + rewriter.replaceOp calls
into rewriter.replaceOpWithNewOp calls.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D94965
Tim Northover [Thu, 14 Jan 2021 09:09:54 +0000 (09:09 +0000)]
AArch64: add apple-a14 as a CPU
This CPU supports all v8.5a features except BTI, and so identifies as v8.5a to
Clang. A bit weird, but the best way for things like xnu to detect the new
features it cares about.
Nicolas Vasilache [Tue, 19 Jan 2021 13:48:08 +0000 (13:48 +0000)]
[mlir][Affine] Revisit and simplify composeAffineMapAndOperands.
In prehistorical times, AffineApplyOp was allowed to produce multiple values.
This allowed the creation of intricate SSA use-def chains.
AffineApplyNormalizer was originally introduced as a means of reusing the AffineMap::compose method to write SSA use-def chains.
Unfortunately, symbols that were produced by an AffineApplyOp needed to be promoted to dims and reordered for the mathematical composition to be valid.
Since then, single result AffineApplyOp became the law of the land but the original assumptions were not revisited.
This revision revisits these assumptions and retires AffineApplyNormalizer.
Differential Revision: https://reviews.llvm.org/D94920
Hans Wennborg [Tue, 19 Jan 2021 12:41:41 +0000 (13:41 +0100)]
[ThinLTO] Also prune Thin-* files from the ThinLTO cache
Such files (Thin-%%%%%%.tmp.o) are supposed to be deleted immediately
after they're used (either by renaming or deletion). However, we've seen
instances on Windows where this doesn't happen, probably due to the
filesystem being flaky. This is effectively a resource leak which has
prevented us from using the ThinLTO cache on Windows.
Since those temporary files are in the thinlto cache directory which we
prune periodically anyway, allowing them to be pruned too seems like a
tidy way to solve the problem.
Differential revision: https://reviews.llvm.org/D94962
Med Ismail Bennani [Tue, 19 Jan 2021 13:31:25 +0000 (14:31 +0100)]
[llvm/Orc] Fix ExecutionEngine module build breakage
This patch updates the llvm module map to reflect changes made in
`
24672ddea3c97fd1eca3e905b23c0116d7759ab8` and fixes the module builds
(`-DLLVM_ENABLE_MODULES=On`).
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Faris Rehman [Tue, 19 Jan 2021 13:15:53 +0000 (13:15 +0000)]
[flang][driver] Add standard macro predefinitions for compiler version
Add the following standard predefinitions that f18 supports:
* `__flang__`,
* `__flang_major__`,
* `__flang_minor__`,
* `__flang_patchlevel__`
Summary of changes:
- Populate Fortran::parser::Options#predefinitions with the default
supported predefinitions
Differential Revision: https://reviews.llvm.org/D94516
AndreyChurbanov [Tue, 19 Jan 2021 13:21:22 +0000 (16:21 +0300)]
[OpenMP] libomp: cleanup parsing of OMP_ALLOCATOR env variable.
Differential Revision: https://reviews.llvm.org/D94932
OCHyams [Tue, 19 Jan 2021 12:31:55 +0000 (12:31 +0000)]
[DebugInfo][dexter] Tweak dexter test for merged values
Tweak dexter-tests/memvars/inline-escaping-function.c added in D94761
(
b7e516202eb6) by adding a 'param' use after the merge point. The test XFAILS
with and without this change, but without it the test looks very similar to
memvars/unused-merged-value.c. The test now demonstrates the problem more
clearly.
Faris Rehman [Mon, 4 Jan 2021 16:49:33 +0000 (16:49 +0000)]
[flang][driver] Add support for fixed form detection
Currently the new flang driver always runs in free form mode. This patch
adds support for fixed form mode detection based on the file extensions.
Like `f18`, `flang-new` will treat files ending with ".f", ".F" and
".ff" as fixed form. Additionally, ".for", ".FOR", ".fpp" and ".FPP"
file extensions are recognised as fixed form files. This is consistent
with gfortran [1]. In summary, files with the following extensions are
treated as fixed-form:
* ".f", ".F", ".ff", ".for", ".FOR", ".fpp", ".FPP"
For consistency with flang/test/lit.cfg.py and f18, this patch also adds
support for the following file extensions:
* ".ff", ".FOR", ".for", ".ff90", ".fpp", ".FPP"
This is added in flang/lib/Frontend/FrontendOptions.cpp. Additionally,
the following extensions are included:
* ".f03", ".F03", ".f08", ".F08"
This is for compatibility with gfortran [1] and other popular Fortran
compilers [2].
NOTE: internally Flang will only differentiate between fixed and free
form files. Currently Flang does not support switching between language
standards, so in this regard file extensions are irrelevant. More
specifically, both `file.f03` and `file.f18` are represented with
`Language::Fortran` (as opposed to e.g. `Language::Fortran03`).
Summary of changes:
- Set Fortran::parser::Options::sFixedForm according to the file type
- Add isFixedFormSuffix and isFreeFormSuffix helper functions to
FrontendTool/Utils.h
- Change FrontendOptions::GetInputKindForExtension to support the missing
file extensions that f18 supports and some additional ones
- FrontendActionTest.cpp is updated to make sure that the test input is
treated as free-form
[1] https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-and-GCC.html
[2] https://github.com/llvm/llvm-project/blob/master/flang/docs/OptionComparison.md#notes
Differential Revision: https://reviews.llvm.org/D94228
Adam Czachorowski [Mon, 18 Jan 2021 22:16:05 +0000 (23:16 +0100)]
[clang] Check for nullptr when instantiating late attrs
This was already done in SemaTemplateInstantiateDecl.cpp, but not in
SemaTemplateInstantiate.cpp.
Anecdotally I've seen some clangd crashes where coredumps point to this
being a problem, but I cannot reproduce this so far.
Differential Revision: https://reviews.llvm.org/D94933
Alex Zinenko [Tue, 19 Jan 2021 12:42:16 +0000 (13:42 +0100)]
[mlir] Clarify docs around LLVM dialect-compatible types
Explicitly mention that there is exactly one MLIR type that corresponds
to a given LLVM IR type.
Abhina Sreeskantharajan [Tue, 19 Jan 2021 12:25:21 +0000 (07:25 -0500)]
[SystemZ][z/OS] Fix No such file or directory expression error
On z/OS, the following error message is not matched correctly in lit tests. This patch updates the CHECK expression to match the end period successfully.
```
EDC5129I No such file or directory.
```
Differential Revision: https://reviews.llvm.org/D94239
Caroline Concatto [Mon, 21 Dec 2020 15:04:29 +0000 (15:04 +0000)]
[AArch64][SVE]Add cost model for vector reduce for scalable vector
This patch computes the cost for vector.reduce<operand> for scalable vectors.
The cost is split into two parts: the legalization cost and the horizontal
reduction.
Differential Revision: https://reviews.llvm.org/D93639
OCHyams [Tue, 19 Jan 2021 11:04:25 +0000 (11:04 +0000)]
[DebugInfo][dexter] Add dexter tests for merged values
These dexter tests illustrate PR48719, the summary of which is:
Sometimes we insert dbg.values for merged values (PHIs) when promoting
variables, sometimes we don't. Sometimes there is no PHI because the merged
value is never used. It doesn't matter because LiveDebugValues understands these
merged values (implicit or otherwise) and correctly updates the debug
info. Importantly, these merged variable values (which may or may not exist as
PHIs, and may or not be represented with dbg.values) are //always// implicitly
defined by the combination of incoming edges and the incoming variable locations
along those edges by virtue of LiveDebugValues existing. Unfortunately, it is
possible to mess with the CFG and remove / move these edges before
LiveDebugValues runs. In this case our debug info model only works when the
merged value is tracked by a dbg.value. Currently, this is only done rigorously
for variables which are A) promoted in the first round of mem2reg and B) are
used after the merge point.
As an example, compile the following source with -O3 -g and step through with a
debugger. You will see parama=5 throughout the function fun which is incorrect -
we expect to see param=20 after the conditional assignment.
__attribute__((optnone))
void esc(int* p) {}
__attribute__((optnone))
void fluff() {}
__attribute__((noinline))
int fun(int parama, int paramb) {
if (parama)
parama = paramb;
fluff(); // DexLabel('s0')
esc(¶ma);
return 0;
}
int main() {
return fun(5, 20);
}
1. parama is escaped by esc(¶ma) so it is not promoted by
SROA/mem2reg (failing condition "A" above).
2. InstCombine's LowerDbgDeclare converts the dbg.declare to a set of
dbg.values (tracking the stored SSA values).
3. InstCombine replaces the two stores to parama's alloca (the initial
parameter register store in entry and the assignment in if.then) with a
PHI+store in the common sucessor.
4. SimplifyCFG folds the blocks together and converts the PHI to a
select.
The debug info is not updated to account for the merged value in the successor
prior to SimplifyCFG when it exists as a PHI, or during when it becomes a
select.
As with D89543, which added some dexter tests for escaped locals, the idea is
to build a set of source-level tests which highlights existing issues and
might be useful in evaluating a new debug info model.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D94761
Faris Rehman [Tue, 19 Jan 2021 10:01:38 +0000 (10:01 +0000)]
[flang][driver] Add support for `-I` in the new driver
Add support for option -I in the new Flang driver. This will allow for
included headers and module files in other directories, as the default
search path is currently the working folder. The behaviour of this is
consistent with the current f18 driver, where the current folder (i.e.
".") has the highest priority followed by the order of '-I's taking
priority from first to last.
Summary of changes:
- Add SearchDirectoriesFromDashI to PreprocessorOptions, to be forwarded
into the parser's searchDirectories
- Add header files and non-functional module files to be used in
regression tests. The module files are just text files and are used to
demonstrated that paths specified with `-I` are taken into account when
searching for .mod files.
Differential Revision: https://reviews.llvm.org/D93453
Alexander Belyaev [Tue, 19 Jan 2021 11:03:13 +0000 (12:03 +0100)]
[mlir] Add `complex.abs`, `complex.div` and `complex.mul` to ComplexOps.
Differential Revision: https://reviews.llvm.org/D94911
Simon Pilgrim [Tue, 19 Jan 2021 11:03:45 +0000 (11:03 +0000)]
[X86][SSE] combineVectorSignBitsTruncation - fold trunc(srl(x,c)) -> packss(sra(x,c))
If a srl doesn't introduce any sign bits into the truncated result, then replace with a sra to let us use a PACKSS truncation - fixes a regression noticed in D56387 on pre-SSE41 targets that don't have PACKUSDW.
Hans Wennborg [Tue, 19 Jan 2021 10:37:50 +0000 (11:37 +0100)]
Revert
5238e7b302 "[InstCombine] Replace one-use select operand based on condition"
This caused a miscompile in Chromium, see comments on the codereview for
discussion and pointer to a reproducer.
> InstCombine already performs a fold where X == Y ? f(X) : Z is
> transformed to X == Y ? f(Y) : Z if f(Y) simplifies. However,
> if f(X) only has one use, then we can always directly replace the
> use inside the instruction. To actually be profitable, limit it to
> the case where Y is a non-expr constant.
>
> This could be further extended to replace uses further up a one-use
> instruction chain, but for now this only looks one level up.
>
> Among other things, this also subsumes D94860.
>
> Differential Revision: https://reviews.llvm.org/D94862
This also reverts the follow-up
a003f26539cf4db744655e76c41f4c4a8913f116:
> [llvm] Prevent infinite loop in InstCombine of select statements
>
> This fixes an issue where the RHS and LHS the comparison operation
> creating the predicate were swapped back and forth forever.
>
> Differential Revision: https://reviews.llvm.org/D94934
Jay Foad [Tue, 19 Jan 2021 10:26:19 +0000 (10:26 +0000)]
[AMDGPU] Simplify AMDGPUInstPrinter::printExpSrcN. NFC.
Change-Id: Idd7f47647bc0faa3ad6f61f44728c0f20540ec00
Florian Hahn [Tue, 19 Jan 2021 09:22:40 +0000 (09:22 +0000)]
[LoopRotate] Add PrepareForLTO stage, avoid rotating with inline cands.
D84108 exposed a bad interaction between inlining and loop-rotation
during regular LTO, which is causing notable regressions in at least
CINT2006/473.astar.
The problem boils down to: we now rotate a loop just before the vectorizer
which requires duplicating a function call in the preheader when compiling
the individual files ('prepare for LTO'). But this then prevents further
inlining of the function during LTO.
This patch tries to resolve this issue by making LoopRotate more
conservative with respect to rotating loops that have inline-able calls
during the 'prepare for LTO' stage.
I think this change intuitively improves the current situation in
general. Loop-rotate tries hard to avoid creating headers that are 'too
big'. At the moment, it assumes all inlining already happened and the
cost of duplicating a call is equal to just doing the call. But with LTO,
inlining also happens during full LTO and it is possible that a previously
duplicated call is actually a huge function which gets inlined
during LTO.
From the perspective of LV, not much should change overall. Most loops
calling user-provided functions won't get vectorized to start with
(unless we can infer that the function does not touch memory, has no
other side effects). If we do not inline the 'inline-able' call during
the LTO stage, we merely delayed loop-rotation & vectorization. If we
inline during LTO, chances should be very high that the inlined code is
itself vectorizable or the user call was not vectorizable to start with.
There could of course be scenarios where we inline a sufficiently large
function with code not profitable to vectorize, which would have be
vectorized earlier (by scalarzing the call). But even in that case,
there probably is no big performance impact, because it should be mostly
down to the cost-model to reject vectorization in that case. And then
the version with scalarized calls should also not be beneficial. In a way,
LV should have strictly more information after inlining and make more
accurate decisions (barring cost-model issues).
There is of course plenty of room for things to go wrong unexpectedly,
so we need to keep a close look at actual performance and address any
follow-up issues.
I took a look at the impact on statistics for
MultiSource/SPEC2000/SPEC2006. There are a few benchmarks with fewer
loops rotated, but no change to the number of loops vectorized.
Reviewed By: sanwou01
Differential Revision: https://reviews.llvm.org/D94232
Muhammad Omair Javaid [Tue, 19 Jan 2021 09:52:23 +0000 (14:52 +0500)]
[LLDB] Test SVE dynamic resize with multiple threads
This patch adds a new test case which depends on AArch64 SVE support and
dynamic resize capability enabled. It created two seperate threads which
have different values of sve registers and SVE vector granule at various
points during execution.
We test that LLDB is doing the size and offset updates properly for all
of the threads including the main thread and when we VG is updated using
prctl call or by 'register write vg' command the appropriate changes are
also update in register infos.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D82866
Muhammad Omair Javaid [Tue, 19 Jan 2021 09:52:23 +0000 (14:52 +0500)]
[LLDB] Add support to resize SVE registers at run-time
This patch builds on previously submitted SVE patches regarding expedited
register set and per thread register infos. (D82853 D82855 and D82857)
We need to resize SVE register based on value received in expedited list.
Also we need to resize SVE registers when we write vg register using
register write vg command. The resize will result in a updated offset
for all of fpr and sve register set. This offset will be configured
in native register context by RegisterInfoInterface and will also be
be updated on client side in GDBRemoteRegisterContext.
A follow up patch will provide a API test to verify this change.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D82863
Pavel Labath [Tue, 19 Jan 2021 09:53:51 +0000 (10:53 +0100)]
[lldb] Re-enable TestPlatformProcessConnect on macos
The test couldn't find lldb-server as it's path was being overridden by
LLDB_DEBUGSERVER_PATH environment variable (pointing to debugserver).
This test should always use lldb-server, as it tests its platform
capabilities.
There's no need for the environment override, as lldb-server tests
should test the executable they just built, so I just remote the
override capability.
Yvan Roux [Tue, 19 Jan 2021 09:07:56 +0000 (10:07 +0100)]
[ARM][MachineOutliner] Add stack fixup feature
This patch handles cases where we have to save/restore the link register
into the stack and and load/store instruction which use the stack are
part of the outlined region. It checks that there will be no overflow
introduced by the new offset and fixup these instructions accordingly.
Differential Revision: https://reviews.llvm.org/D92934
David Spickett [Mon, 18 Jan 2021 15:36:16 +0000 (15:36 +0000)]
[lldb] Fix crash in "help memory read"
When a command option does not have a short version
(e.g. -f for --file), we use an arbitrary value in the
short_option field to mark it as invalid.
(though this value is unqiue to be used later for other
things)
We check that this short option is valid to print using
llvm::isPrint. This implicitly casts our int to char,
meaning we check the last char of any short_option value.
Since the arbitrary value we chose for these options is
some shortened hex version of the name, this returned true
even for invalid values.
Since llvm::isPrint returns true we later call std::islower
and/or std::isupper on the short_option value. (the int)
Calling these functions with something that cannot be validly
converted to unsigned char is undefined. Somehow we got/get
away with this but for me compiling with g++-9 I got a crash
for "help memory read".
The other command that uses this is "target variable" but that
didn't crash for unknown reasons.
Checking that short_option can fit into an unsigned char before
we call llvm::isPrint means we will not attempt to call islower/upper
on these options since we have no reason to print them.
This also fixes bogus short options being shown for "memory read"
and target variable.
For "target variable", before:
-e <filename> ( --file <filename> )
-b <filename> ( --shlib <filename> )
After:
--file <filename>
--shlib <filename>
(note that the bogus short options are just the bottom byte of our
arbitrary short_option value)
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D94917
Fraser Cormack [Thu, 14 Jan 2021 15:56:11 +0000 (15:56 +0000)]
[RISCV] Add scalable-vector integer extension patterns
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94694
Tres Popp [Mon, 18 Jan 2021 22:40:22 +0000 (23:40 +0100)]
[llvm] Prevent infinite loop in InstCombine of select statements
This fixes an issue where the RHS and LHS the comparison operation
creating the predicate were swapped back and forth forever.
Differential Revision: https://reviews.llvm.org/D94934
serge-sans-paille [Tue, 19 Jan 2021 09:22:57 +0000 (10:22 +0100)]
[lit] Harmonize lit and llvm versionning
In addition to consistency, we'll hit a wall when 11.1.0 gets released, because
we cannot represent it with lit versioning scheme.
Differential Revision: https://reviews.llvm.org/D94157
Lang Hames [Tue, 19 Jan 2021 08:51:19 +0000 (19:51 +1100)]
[ORC] Move LookupRequest from OrcShared to Orc.
It depends on Orc types (SymbolLookupSet), so can't be part of OrcShared.
Tres Popp [Fri, 15 Jan 2021 16:11:41 +0000 (17:11 +0100)]
[llvm][nvptx] add atomicity to counter in ISelLowering
Previously uniqueCallSite could have race conditions between different
threads. Now it is accessed with an atomic RMW and will be unique
between different threads.
Differential Revision: https://reviews.llvm.org/D94784
David Sherwood [Fri, 27 Nov 2020 08:36:28 +0000 (08:36 +0000)]
[NFC] Make remaining cost functions in LoopVectorize.cpp use InstructionCost
A previous patch has already changed getInstructionCost to return
an InstructionCost type. This patch changes the other various
getXXXCost functions to return an InstructionCost too. This is a
non-functional change - I've added a few asserts that the costs
are valid in places where we're selecting between vector call
and intrinsic costs. However, since we don't yet return invalid
costs from any of the TTI implementations these asserts should
not fire.
See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html
Differential Revision: https://reviews.llvm.org/D94065
Luo, Yuanke [Tue, 19 Jan 2021 04:42:59 +0000 (12:42 +0800)]
[X86][AMX] Fix the typo.
The dpbsud should be dpbssd.
Differential Revision: https://reviews.llvm.org/D94943
Jan Svoboda [Fri, 15 Jan 2021 16:55:03 +0000 (17:55 +0100)]
[clang][cli] Parse Lang and CodeGen options separately
This patch moves the parsing of `{Lang,CodeGen}Options` from `parseSimpleArgs` to the original `Parse{Lang,CodeGen}Args` functions.
This ensures all marshalled `LangOptions` are being parsed **after** the call `setLangDefaults`, which in turn enables us to marshall `LangOptions` that somehow depend on the defaults. (In a future patch.)
Now, `CodeGenOptions` need to be parsed **after** `LangOptions`, because `-cl-mad-enable` (a `CodeGenOpt`) depends on the value of `-cl-fast-relaxed-math` and `-cl-unsafe-math-optimizations` (`LangOpts`).
Unfortunately, this removes the nice property that marshalled options get parsed in the exact order they appear in the `.td` file. Now we cannot be sure that a TableGen record referenced in `ImpliedByAnyOf` has already been parsed. This might cause an ordering issues (i.e. reading value of uninitialized variable). I plan to mitigate this by moving each `XxxOpt` group from `parseSimpleArgs` back to their original parsing function. With this setup, if an option from group `A` references option from group `B` in TableGen, the compiler will require us to make the `CompilerInvocation` member for `B` visible in the parsing function for `A`. That's where we notice that `B` didn't get parsed yet.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D94682
Andy Wingo [Mon, 30 Nov 2020 13:55:29 +0000 (14:55 +0100)]
[WebAssembly] Change prefix on data segment flags to WASM_DATA_SEGMENT
Element sections will also need flags, so we shouldn't squat the
WASM_SEGMENT namespace.
Depends on D90948.
Differential Revision: https://reviews.llvm.org/D92315
Andy Wingo [Tue, 5 Jan 2021 10:05:18 +0000 (11:05 +0100)]
[WebAssembly] call_indirect issues table number relocs
This patch changes to make call_indirect explicitly refer to the
corresponding function table, residualizing TABLE_NUMBER relocs against
it.
With this change, wasm-ld now sees all references to tables, and can
link multiple tables.
Differential Revision: https://reviews.llvm.org/D90948
Timm Bäder [Sun, 17 Jan 2021 06:51:45 +0000 (07:51 +0100)]
[clang][driver][NFC][obvious] Remove obsolete unistd.h include
getuid() is not being called in this file anymore.
Guillaume Chatelet [Fri, 15 Jan 2021 11:07:44 +0000 (11:07 +0000)]
[libc][NFC] remove dependency on non standard ssize_t
`ssize_t` is from POSIX and is not standard unfortunately.
Rewritting the code so it doesn't depend on it.
Differential Revision: https://reviews.llvm.org/D94760
Guillaume Chatelet [Tue, 19 Jan 2021 08:11:37 +0000 (08:11 +0000)]
[libc][NFC] Remove dead code
Marek Kurdej [Tue, 19 Jan 2021 07:21:09 +0000 (08:21 +0100)]
[libc++] [P0935] [C++20] Eradicating unnecessarily explicit default constructors from the standard library.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D91292
ShihPo Hung [Fri, 8 Jan 2021 06:51:37 +0000 (22:51 -0800)]
[RISCV] Add intrinsics for vector AMO operations
Add vamoswap, vamoadd, vamoxor, vamoand, vamoor,
vamomin, vamomax, vamominu, vamomaxu intrinsics.
Reviewed By: craig.topper, khchen
Differential Revision: https://reviews.llvm.org/D94589
Yang Fan [Sun, 17 Jan 2021 04:35:01 +0000 (12:35 +0800)]
[NFC][AIX][XCOFF] Fix compile warning on strncpy
GCC warning:
```
In file included from /usr/include/string.h:495,
from /usr/include/c++/9/cstring:42,
from /llvm-project/llvm/include/llvm/ADT/Hashing.h:53,
from /llvm-project/llvm/include/llvm/ADT/ArrayRef.h:12,
from /llvm-project/llvm/include/llvm/MC/MCAsmBackend.h:12,
from /llvm-project/llvm/lib/MC/XCOFFObjectWriter.cpp:14:
In function ‘char* strncpy(char*, const char*, size_t)’,
inlined from ‘{anonymous}::Section::Section(const char*, llvm::XCOFF::SectionTypeFlags, bool, {anonymous}::CsectGroups)’ at /llvm-project/llvm/lib/MC/XCOFFObjectWriter.cpp:146:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 8 equals destination size [-Wstringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D94872
Siva Chandra [Tue, 19 Jan 2021 05:59:12 +0000 (21:59 -0800)]
[libc][NFC][Obvious] Add a missing dep.
Mehdi Amini [Tue, 19 Jan 2021 05:59:15 +0000 (05:59 +0000)]
Fix a few GCC compiler warnings (NFC)
Siva Chandra Reddy [Tue, 19 Jan 2021 05:36:40 +0000 (21:36 -0800)]
[libc][NFC] Use ASSERT_EQ instead of EXPECT_EQ in fenv/exception_status_test
Lang Hames [Tue, 19 Jan 2021 04:58:42 +0000 (15:58 +1100)]
[ORC] Move OrcError.h to include/llvm/ExecutionEngine/Orc/Shared.
OrcShared is the correct home for this header since Orc was split in
1d0676b54c4. (It should have been moved in that commit, but was overlooked).
Richard Smith [Sat, 7 Nov 2020 02:14:41 +0000 (18:14 -0800)]
[c++20] P1907R1: Support for generalized non-type template arguments of scalar type.
Previously committed as
9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and
reverted because a dependency commit was reverted. This incorporates the
following follow-on commits that were also reverted:
7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 by Simon Pilgrim
ed13d8c66781b50ff007cb089c5905f9bb9e8af2 by me
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc by Sam McCall
430d5d8429473c2b10b109991d7577a3cea41140 by Dave Zarzycki
Richard Smith [Wed, 16 Dec 2020 21:51:56 +0000 (13:51 -0800)]
Following up on PR48517, fix handling of template arguments that refer
to dependent declarations.
Treat an id-expression that names a local variable in a templated
function as being instantiation-dependent.
This addresses a language defect whereby a reference to a dependent
declaration can be formed without any construct being value-dependent.
Fixing that through value-dependence turns out to be problematic, so
instead this patch takes the approach (proposed on the core reflector)
of allowing the use of pointers or references to (but not values of)
dependent declarations inside value-dependent expressions, and instead
treating template arguments as dependent if they evaluate to a constant
involving such dependent declarations.
This ends up affecting a bunch of OpenMP tests, due to OpenMP
imprecisely handling instantiation-dependent constructs, bailing out
early instead of processing dependent constructs to the extent possible
when handling the template.
Previously committed as
8c1f2d15b826591cdf6bd6b468b8a7d23377b29e, and
reverted because a dependency commit was reverted.
Richard Smith [Fri, 18 Dec 2020 05:27:11 +0000 (21:27 -0800)]
PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of
the nested-name-specifier when determining whether a qualified type is
instantiation-dependent.
Previously reverted in
25a02c3d1a688d3cd18faef96c75fa553efbbac7 due to
causing us to reject some code. It turns out that the rejected code was
ill-formed (no diagnostic required).
Richard Smith [Thu, 17 Dec 2020 22:36:26 +0000 (14:36 -0800)]
DR2064: decltype(E) is only a dependent type if E is type-dependent, not
if E is merely instantiation-dependent.
Previously reverted in
34e72a146111dd986889a0f0ec8767b2ca6b2913;
re-committed with a fix to an issue that caused name mangling to assert.
Luo, Yuanke [Mon, 18 Jan 2021 13:24:09 +0000 (21:24 +0800)]
[X86][AMX] Clear AMX lit test case.
Add nounwind attribute to avoid generating cfi instructions. Also make
global buffer 64 bytes align in lit test case.
Differential Revision: https://reviews.llvm.org/D94910
Nemanja Ivanovic [Tue, 19 Jan 2021 03:19:11 +0000 (21:19 -0600)]
[PowerPC] Sign extend comparison operand for signed atomic comparisons
As of
8dacca943af8a53a23b1caf3142d10fb4a77b645, we sign extend the atomic loaded
operand for signed subword comparisons. However, the assumption that the other
operand is correctly sign extended doesn't always hold. This patch sign extends
the other operand if it needs to be sign extended.
This is a second fix for https://bugs.llvm.org/show_bug.cgi?id=30451
Differential revision: https://reviews.llvm.org/D94058
Richard Smith [Fri, 15 Jan 2021 23:50:25 +0000 (15:50 -0800)]
PR48763: Better handling for classes that inherit a default constructor.
The C++ standard wording doesn't appear to properly handle the case
where a class inherits a default constructor from a base class. Various
properties of classes are defined in terms of the corresponding property
of the default constructor, and in this case, the class does not have a
default constructor despite being default-constructible, which the
wording doesn't handle properly.
This change implements a tentative fix for these problems, which has
also been proposed to the C++ committee: if a class would inherit a
default constructor, and does not explicitly declare one, then one is
implicitly declared.
Luo, Yuanke [Fri, 15 Jan 2021 13:57:47 +0000 (21:57 +0800)]
[X86] Fix tile spill merge issue.
This is a additional bug fix for
c5be0e0cc0. The distance for
the spill instructions is wrong in previous patch.
Differential Revision: https://reviews.llvm.org/D94772
Chen Zheng [Tue, 19 Jan 2021 02:33:31 +0000 (21:33 -0500)]
Revert "[NFC] [TargetRegisterInfo] add one use check to lookThruCopyLike."
This reverts commit
3bdf4507b66348ad78df4655a8e4f36c3fc10f3c.
Post commit comments need to be addressed first.
Juneyoung Lee [Tue, 19 Jan 2021 00:30:16 +0000 (09:30 +0900)]
Address unused variable warning
Juneyoung Lee [Tue, 19 Jan 2021 00:00:46 +0000 (09:00 +0900)]
[InstCombine,InstSimplify] Optimize select followed by and/or/xor
This patch adds `A & (A && B)` -> `A && B` (similarly for or + logical or)
Also, this patch adds `~(select C, (icmp pred X, Y), const)` -> `select C, (icmp pred' X, Y), ~const`.
Alive2 proof:
merge_and: https://alive2.llvm.org/ce/z/teMR97
merge_or: https://alive2.llvm.org/ce/z/b4yZUp
xor_and: https://alive2.llvm.org/ce/z/_-TXHi
xor_or: https://alive2.llvm.org/ce/z/2uYx_a
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D94861
Arthur O'Dwyer [Tue, 19 Jan 2021 00:05:08 +0000 (19:05 -0500)]
Regenerate the feature test macro unit-tests. NFCI.
Somehow commit
1f1250151f222ba391d05dcc173f4b6c65d05ca2 added the
right code but with the wrong whitespace.
Kelvin Li [Mon, 18 Jan 2021 23:55:58 +0000 (18:55 -0500)]
[OpenMP][Docs] Fix typos in FAQ (NFC)
Juneyoung Lee [Mon, 18 Jan 2021 04:32:31 +0000 (13:32 +0900)]
[SimplifyCFG] Update SimplifyBranchOnICmpChain to recognize select form of and/or
This patch teaches SimplifyCFG::SimplifyBranchOnICmpChain to understand select form of
(x == C1 || x == C2 || ...) / (x != C1 && x != C2 && ...) and optimize them into switch if possible.
D93065 has more context about the transition, including links to the list of optimizations being updated.
Differential Revision: https://reviews.llvm.org/D93943
Kazu Hirata [Mon, 18 Jan 2021 22:53:21 +0000 (14:53 -0800)]
[LoopInfo] Fix a typo in compareLoops
The code here is checking to see if two sets are identical.
OtherBlocksSet should point to OtherL->getBlocksSet() instead.
Differential Revision: https://reviews.llvm.org/D94926
Sanjay Patel [Mon, 18 Jan 2021 22:46:39 +0000 (17:46 -0500)]
[x86] add cast to avoid compile-time warning; NFC
Louis Dionne [Tue, 12 Jan 2021 16:53:24 +0000 (11:53 -0500)]
[libc++] NFCI: Refactor allocator_traits
The implementation had a lot of boilerplate and was more complicated than
necessary. This NFC refactoring introduces a few macros to reduce code
duplication, and uses a consistent style and formatting for the whole file.
Differential Revision: https://reviews.llvm.org/D94544