Ulrich Weigand [Wed, 8 Jul 2020 16:17:03 +0000 (18:17 +0200)]
[SystemZ] Allow specifying integer registers as part of the address calculation
Revision
e1de2773a534957305d7a559c6d88c4b5ac354e2 provided support for
accepting integer registers in inline asm i.e.
__asm("lhi %r0, 5") -> lhi %r0, 5
__asm("lhi 0, 5") -> lhi 0,5
This patch aims to extend this support to instructions which compute
addresses as well. (i.e instructions of type BDMem and BD[X|R|V|L]Mem)
Author: anirudhp
Differential Revision: https://reviews.llvm.org/D83251
Nicolai Hähnle [Thu, 2 Jul 2020 18:36:30 +0000 (20:36 +0200)]
DomTree: remove explicit use of DomTreeNodeBase::iterator
Summary:
Almost all uses of these iterators, including implicit ones, really
only need the const variant (as it should be). The only exception is
in NewGVN, which changes the order of dominator tree child nodes.
Change-Id: I4b5bd71e32d71b0c67b03d4927d93fe9413726d4
Reviewers: arsenm, RKSimon, mehdi_amini, courbet, rriddle, aartbik
Subscribers: wdng, Prazek, hiraditya, kuhar, rogfer01, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, vkmr, Kayjukh, jurahul, msifontes, cfe-commits, llvm-commits
Tags: #clang, #mlir, #llvm
Differential Revision: https://reviews.llvm.org/D83087
serge-sans-paille [Wed, 8 Jul 2020 16:13:59 +0000 (18:13 +0200)]
Revert "Double check that passes correctly set their Modified status"
This reverts commit
37afd99c768b29c7df7c5f2eb645362fb61f9915.
Sjoerd Meijer [Wed, 8 Jul 2020 16:04:23 +0000 (17:04 +0100)]
[matrix] Add some more Verifier negative tests. NFC.
Louis Dionne [Wed, 8 Jul 2020 15:09:03 +0000 (11:09 -0400)]
[libc++] Mark some tests as unsupported on GCC 5
There used to be a workaround where we'd pretend that GCC 5 didn't support
C++14 because it doesn't implement it properly. Since that workaround has
been removed (in
1eb211ada17a), we need to mark a few individual tests as
failing with GCC 5.
Arthur Eubanks [Wed, 8 Jul 2020 15:56:27 +0000 (08:56 -0700)]
[NewPM][opt] Translate "-O#" to NPM's "default<O#>"
Fixes 52 check-llvm tests under NPM.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D83367
Aleksandr Platonov [Wed, 8 Jul 2020 15:46:30 +0000 (16:46 +0100)]
[clang] Fix a crash when passing a C structure of incompatible type to a function with a reference parameter.
__builtin_va_*() and __builtin_ms_va_*() are declared as functions with a
parameter of reference type.
This patch fixes a crash when using these functions in C where an argument
of structure type is incompatible with the parameter type.
Differential Revision: https://reviews.llvm.org/D82805
Reviewed By: riccibruno
Patch by: Aleksandr Platonov <platonov.aleksandr@huawei.com>
Chris Gyurgyik [Wed, 8 Jul 2020 15:56:21 +0000 (11:56 -0400)]
[libc] Fix typographical error in math_utils.h.
Arthur Eubanks [Wed, 8 Jul 2020 15:50:22 +0000 (08:50 -0700)]
[NewPM][opt] Share -disable-loop-unrolling between pass managers
There's no reason to introduce a new option for the NPM.
The various PGO options are shared in this manner.
Reviewed By: echristo
Differential Revision: https://reviews.llvm.org/D83368
Evgeny Leviant [Wed, 8 Jul 2020 15:50:00 +0000 (18:50 +0300)]
[MIR] Speedup parsing of function with large number of basic blocks
Patch eliminates string length calculation when lexing a token. Speedup can be up to
1000x.
Differential revision: https://reviews.llvm.org/D83389
Arthur Eubanks [Wed, 8 Jul 2020 15:48:44 +0000 (08:48 -0700)]
[Preallocated] Add @llvm.call.preallocated.teardown
This cleans up the stack allocated by a @llvm.call.preallocated.setup.
Should either call the teardown or the preallocated call to clean up the
stack. Calling both is UB.
Add LangRef.
Add verifier check that the token argument is a @llvm.call.preallocated.setup.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D83354
Eric Schweitz [Wed, 8 Jul 2020 15:47:13 +0000 (08:47 -0700)]
partial revert on RTBuilder.h to avoid warnings.
Pavel Labath [Wed, 8 Jul 2020 15:33:58 +0000 (17:33 +0200)]
[lldb] Modernize/clean up ValueObject::GetChildMemberWithName
Paul Walker [Wed, 8 Jul 2020 15:12:22 +0000 (15:12 +0000)]
[SelectionDAG] Fix incorrect offset when expanding CONCAT_VECTORS.
ExpandVectorBuildThroughStack is also used for CONCAT_VECTORS.
However, when calculating the offsets for each of the operands we
incorrectly use the element size rather than actual size and thus
the stores overlap.
Differential Revision: https://reviews.llvm.org/D83303
Bruno Ricci [Wed, 8 Jul 2020 15:36:48 +0000 (16:36 +0100)]
[clang][NFC] Also test for serialization in test/AST/ast-dump-APValue-*
This does not actually exercise the serialization of APValue, but it
will at least prevent a regression in the future. NFC.
serge-sans-paille [Thu, 28 May 2020 10:40:17 +0000 (12:40 +0200)]
Double check that passes correctly set their Modified status
The approach is simple: if a pass reports that it's not modifying a
Function/Module, compute a loose hash of that Function/Module and compare it
with the original one. If we report no change but there's a hash change, then we
have an error.
This approach misses a lot of change but it's not super intrusive and can
detect most of the simple mistakes.
Differential Revision: https://reviews.llvm.org/D80916
Sam McCall [Wed, 8 Jul 2020 15:30:24 +0000 (17:30 +0200)]
[clangd] Improve serialization error messages. NFC
sstefan1 [Sun, 5 Jul 2020 13:24:36 +0000 (15:24 +0200)]
[OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder.
Summary:
D82193 exposed a problem with global type definitions in
`OMPConstants.h`. This causes a race when running in thinLTO mode.
Types now live inside of OpenMPIRBuilder to prevent this from happening.
Reviewers: jdoerfert
Subscribers: yaxunl, hiraditya, guansong, dexonsmith, aaron.ballman, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D83176
Stanislav Mekhanoshin [Fri, 19 Jun 2020 18:48:37 +0000 (11:48 -0700)]
SLP: honor requested max vector size merging PHIs
At the moment this place does not check maximum size set
by TTI and just creates a maximum possible vectors.
Differential Revision: https://reviews.llvm.org/D82227
Sam McCall [Mon, 6 Jul 2020 15:23:08 +0000 (17:23 +0200)]
[clangd] Enable reading config from files behind a flag
Reviewers: kadircet, hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D83233
Eric Schweitz [Tue, 7 Jul 2020 22:39:09 +0000 (15:39 -0700)]
[flang] Upstreaming intrinsic call lowering.
This module implements the lowering of Fortran intrinsics to the
corresponding calls in support libraries (the Fortran runtime, math
libraries, etc.)
This revision is a tad larger because there are a large number of Fortran
intrinsics and this adds lowering for a fair number of them.
Differential revision: https://reviews.llvm.org/D83355
Pete Steinfeld [Tue, 7 Jul 2020 19:15:39 +0000 (12:15 -0700)]
[flang] Support for image selectors
Summary:
This change implements support for image selectors and image selector
specifications as described in section 9.6.
In check-coarray[.h,cpp] I changed the `Leave()` function for
`parser::ImageSelectorSpec` to take a `parser::ImageSelector`, which
contains a list of image selector specifications. This allows us to
detect when the same specification is used more than once. I also added
code to analyze the expressions for the image selector specifications to
expression.cpp and a test for all of the conditions to check at
compile-time.
Note that we do not check at compile-time to see if the value of the
cosubscripts are within the specified cobounds. We also do not check anything
related to selecting a valid team. We also do not check that the denotation of
the `stat-variable` is not dependent on the evaluation of an entity in the
same statement.
Reviewers: klausler, tskeith, DavidTruby
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83336
Ties Stuij [Wed, 8 Jul 2020 12:12:30 +0000 (13:12 +0100)]
[CodeGen] Don't combine extract + concat vectors with non-legal types
Summary:
The following combine currently breaks in the DAGCombiner:
```
extract_vector_elt (concat_vectors v4i16:a, v4i16:b), x
-> extract_vector_elt a, x
```
This happens because after we have combined these nodes we have inserted nodes
that use individual instances of the vector element type. In the above example
i16. However this isn't a legal type on all backends, and when the combining pass calls
the legalizer it breaks as it expects types to already be legal. The type legalizer has
already been run, and running it again would make a mess of the nodes.
In the example code at least, the generated code is still efficient after the change.
Reviewers: miyuki, arsenm, dmgreen, lebedev.ri
Reviewed By: miyuki, lebedev.ri
Subscribers: lebedev.ri, wdng, hiraditya, steven.zhang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83231
Eduardo Caldas [Wed, 24 Jun 2020 15:11:31 +0000 (15:11 +0000)]
Fix crash on overloaded postfix unary operators due to invalid sloc
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82954
Alexey Bataev [Wed, 8 Jul 2020 13:09:57 +0000 (09:09 -0400)]
[NVPTX]Add a test for debug info for packed bitfields, NFC.
Alexander Belyaev [Wed, 8 Jul 2020 11:44:36 +0000 (13:44 +0200)]
[mlir] Add ViewLikeOpInterface to std.memref_cast.
Summery: It's needed for correct work of BufferPlacement.
Differential Revision: https://reviews.llvm.org/D83385
Isuru Fernando [Wed, 8 Jul 2020 12:19:01 +0000 (07:19 -0500)]
[flang] Fix setting mxcsr on MSVC
Reviewers: sscalpone, jdoerfert, #flang, DavidTruby, jeanPerier
Reviewed By: jeanPerier
Subscribers: richard.barton.arm, jeanPerier, ro, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D77815
Sanjay Patel [Wed, 8 Jul 2020 12:20:49 +0000 (08:20 -0400)]
[x86] improve codegen for non-splat bit-masked vector compare and select (PR46531)
vselect ((X & Pow2C) == 0), LHS, RHS --> vselect ((shl X, C') < 0), RHS, LHS
Follow-up to D83073 - the non-splat mask cases where we actually see an
improvement are quite limited from what I can tell. AVX1 needs multiply
and blend capabilities and AVX2 needs vector shift and blend capabilities.
The intersection of those 2 constraints is only vectors with 32-bit or
64-bit elements.
XOP is/was better.
Differential Revision: https://reviews.llvm.org/D83181
Med Ismail Bennani [Wed, 8 Jul 2020 12:01:54 +0000 (14:01 +0200)]
[lldb/Core] Update comment to make it more explicit (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Sylvestre Ledru [Wed, 8 Jul 2020 11:33:34 +0000 (13:33 +0200)]
clang: Don't show a trailing space with --version when not built from the repo
Reported here:
https://bugs.llvm.org/show_bug.cgi?id=38998#c15
Reviewers: hans
Differential Revision: https://reviews.llvm.org/D83386
Pavel Labath [Wed, 8 Jul 2020 11:54:33 +0000 (13:54 +0200)]
[lldb/Utility] Simplify Scalar float accessors
Make use of APFloat conversion methods to avoid needing to switch based
on the stored value type.
Haojian Wu [Wed, 8 Jul 2020 11:53:47 +0000 (13:53 +0200)]
[AST][RecoveryExpr] Fix the value category for recovery expr.
RecoveryExpr was always lvalue, but it is wrong if we use it to model
broken function calls, function call expression has more compliated rules:
- a call to a function whose return type is an lvalue reference yields an lvalue;
- a call to a function whose return type is an rvalue reference yields an xvalue;
- a call to a function whose return type is nonreference type yields a prvalue;
This patch makes the recovery-expr align with the function call if it is
modeled a broken call.
Differential revision: https://reviews.llvm.org/D83201
Pavel Labath [Mon, 6 Jul 2020 14:44:37 +0000 (16:44 +0200)]
[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)
Summary:
This function was documented to overwrite entries with D76111, which was
adding a couple of similar functions. However, this function (unlike the
functions added in that patch) was/is not actually overwriting variables
-- any pre-existing variables would get ignored.
This behavior does not seem to be intentional. In fact, before the refactor in
D41359, this function could introduce duplicate entries, which could
have very surprising effects both inside lldb and on other applications
(some applications would take the first value, some the second one; in
lldb, attempting to unset a variable could make the second variable
become active, etc.).
Overwriting seems to be the most reasonable behavior here, so change the
code to match documentation.
Reviewers: clayborg, wallace, jingham
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D83306
Michael Forney [Wed, 8 Jul 2020 10:42:39 +0000 (12:42 +0200)]
[cmake] Use CMAKE_GENERATOR to determine if Ninja is used
The name of the make program does not necessarily match "ninja",
especially if an alternative implementation like samurai is used.
Using CMAKE_GENERATOR is a more robust detection method, and is
already used elsewhere in this file.
Differential revision: https://reviews.llvm.org/D77091
Simon Pilgrim [Wed, 8 Jul 2020 10:47:43 +0000 (11:47 +0100)]
[X86][AVX] SimplifyDemandedVectorEltsForTargetShuffle - ensure mask is same size as constant size
Fixes test regression reported on D81791
Alex Richardson [Wed, 8 Jul 2020 10:38:13 +0000 (11:38 +0100)]
Add missing REQUIRES: x86-registered-target
This should fix build bot failures after
a80afc032859ebe65af283f76b38a0f5921b683f
Raphael Isemann [Wed, 8 Jul 2020 10:32:07 +0000 (12:32 +0200)]
[lldb][NFC] Fix indentation in expect_expr
Petar Avramovic [Wed, 8 Jul 2020 10:32:17 +0000 (12:32 +0200)]
[GlobalISel][InlineAsm] Fix matching input constraints to mem operand
Mark matching input constraint to mem operand as not supported.
Differential Revision: https://reviews.llvm.org/D83235
Simon Pilgrim [Wed, 8 Jul 2020 10:26:16 +0000 (11:26 +0100)]
[X86][AVX] Add SimplifyDemandedVectorEltsForTargetShuffle test for v32i8->v16i8 PSHUFB
On SKX targets we end up loading a v16i8 PSHUFB mask from a v32i8 constant and scaling incorrectly indexes the demanded elts mask - we're missing a check that the constant pool is the same size as the loaded mask.
Test case from D81791 post-commit review.
Oliver Stannard [Wed, 8 Jul 2020 10:24:03 +0000 (11:24 +0100)]
[Support] Fix signed/unsigned comparison warning
Alex Richardson [Wed, 8 Jul 2020 09:59:50 +0000 (10:59 +0100)]
[UpdateTestChecks] Add UTC_ARGS support for update_{llc,cc}_test_checks.py
https://reviews.llvm.org/D69701 added support for on-the-fly argument
changes for update scripts. I recently wanted to keep some manual check
lines in a test generated by update_cc_test_checks.py in our CHERI fork, so
this commit adds support for UTC_ARGS in update_cc_test_checks.py. And since
I was refactoring the code to be in common.py, I also added it for
update_llc_test_checks.py.
Reviewed By: jdoerfert, MaskRay
Differential Revision: https://reviews.llvm.org/D78478
Alex Richardson [Tue, 7 Jul 2020 15:38:28 +0000 (16:38 +0100)]
[UpdateTestChecks] Move more update_test_checks.py logic to common.py
I intend to reuse this to add UTC_ARGS support for update_llc_test_checks.py
and update_cc_test_checks.py in D78478.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D78618
Paul Walker [Wed, 8 Jul 2020 09:10:16 +0000 (09:10 +0000)]
[SVE] Custom ISel for fixed length extract/insert_subvector.
We use extact_subvector and insert_subvector to "cast" between
fixed length and scalable vectors. This patch adds custom c++
based ISel for the following cases:
fixed_vector = ISD::EXTRACT_SUBVECTOR scalable_vector, 0
scalable_vector = ISD::INSERT_SUBVECTOR undef(scalable_vector), fixed_vector, 0
Which result in either EXTRACT_SUBREG/INSERT_SUBREG for NEON sized
vectors or COPY_TO_REGCLASS otherwise.
Differential Revision: https://reviews.llvm.org/D82871
Raphael Isemann [Wed, 8 Jul 2020 09:45:30 +0000 (11:45 +0200)]
[lldb] Skip TestIOHandlerResizeNoEditline on Windows
It seems opening the empty file and trying use that file object as an input
stream doesn't work on Windows. Skipping it for now.
George Mitenkov [Wed, 8 Jul 2020 08:33:27 +0000 (11:33 +0300)]
[MLIR][SPIRVToLLVM] Implementation of spv.BitFieldSExtract and spv.BitFieldUExtract patterns
This patch adds conversion patterns for `spv.BitFieldSExtract` and `spv.BitFieldUExtract`.
As in the patch for `spv.BitFieldInsert`, `offset` and `count` have to be broadcasted in
vector case and casted to match the type of the base.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D82640
Jeremy Morse [Wed, 8 Jul 2020 09:01:14 +0000 (10:01 +0100)]
[DWARF] Add cuttoff guarding quadratic validThroughout behaviour
Occasionally we see absolutely massive basic blocks, typically in global
constructors that are vulnerable to heavy inlining. When these blocks are
dense with DBG_VALUE instructions, we can hit near quadratic complexity in
DwarfDebug's validThroughout function. The problem is caused by:
* validThroughout having to step through all instructions in the block to
examine their lexical scope,
* and a high proportion of instructions in that block being DBG_VALUEs
for a unique variable fragment,
Leading to us stepping through every instruction in the block, for (nearly)
each instruction in the block.
By adding this guard, we force variables in large blocks to use a location
list rather than a single-location expression, as shown in the added test.
This shouldn't change the meaning of the output DWARF at all: instead we
use a less efficient DWARF encoding to avoid a poor-performance code path.
Differential Revision: https://reviews.llvm.org/D83236
Roman Lebedev [Wed, 8 Jul 2020 09:05:15 +0000 (12:05 +0300)]
[NFCI][llvm-reduce] Cleanup Delta passes to use Oracle abstraction
Summary:
I think, this results in much more understandable/readable flow.
At least the original logic was perhaps the most hard thing for me to grasp when taking an initial look on the delta passes.
Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv
Reviewed By: nickdesaulniers
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83287
Simon Pilgrim [Wed, 8 Jul 2020 09:18:20 +0000 (10:18 +0100)]
Fix MSVC "not all control paths return a value" warnings. NFC.
Simon Pilgrim [Tue, 7 Jul 2020 19:30:16 +0000 (20:30 +0100)]
[X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold
Noticed while looking for similar cases to rG931ec74f7a29 - SimplifyDemandedVectorElts and shuffle combining both should handle this now.
Georgii Rymar [Tue, 30 Jun 2020 12:02:28 +0000 (15:02 +0300)]
[DebugInfo/DWARF] - Test invalid CFI opcodes properly and refine related `CFIProgram::parse` code.
There are following issues with `CFIProgram::parse` code:
1) Invalid CFI opcodes were never tested. And currently a test would fail
when the `LLVM_ENABLE_ABI_BREAKING_CHECKS` is enabled. It happens because
the `DataExtractor::Cursor C` remains unchecked when the
"Invalid extended CFI opcode" error is reported:
```
.eh_frame section at offset 0x1128 address 0x0:
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
```
2) It is impossible to reach the "Invalid primary CFI opcode" error with the current code.
There are 3 possible primary opcode values and all of them are handled. Hence this error
should be replaced with llvm_unreachable.
3) Errors currently reported are upper-case.
This patch refines the code in the `CFIProgram::parse` method to fix all issues mentioned
and adds unit tests for all possible invalid extended CFI opcodes.
Differential revision: https://reviews.llvm.org/D82868
Georgii Rymar [Tue, 7 Jul 2020 15:13:26 +0000 (18:13 +0300)]
[llvm-readobj] - Refine error reporting in MipsGOTParser<ELFT> helper.
This is a follow-up for D83225. This does the following:
1) Adds missing tests for existent errors.
2) Stops using `unwrapOrError` to propagate errors to caller.
(I am trying to get rid of all `unwrapOrErr` calls in the llvm-readelf code).
3) Improves error messages reported slightly.
Differential revision: https://reviews.llvm.org/D83314
David Sherwood [Fri, 3 Jul 2020 12:32:02 +0000 (13:32 +0100)]
[CodeGen] Fix wrong use of getVectorNumElements() in DAGTypeLegalizer::SplitVecRes_ExtendOp
In DAGTypeLegalizer::SplitVecRes_ExtendOp I have replaced an invalid
call to getVectorNumElements() with a call to getVectorMinNumElements(),
since the code path works for both fixed and scalable vectors.
This fixes up a warning in the following test:
sve-sext-zext.ll
Differential Revision: https://reviews.llvm.org/D83197
David Sherwood [Fri, 3 Jul 2020 12:21:27 +0000 (13:21 +0100)]
[CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR
Calling getVectorNumElements() is not safe for scalable vectors and we
should normally use getVectorElementCount() instead. However, for the
code changed in this patch I decided to simply move the instantiation of
the variable 'OutNumElems' lower down to the place where only fixed-width
vectors are used, and hence it is safe to call getVectorNumElements().
Fixes up one warning in this test:
sve-sext-zext.ll
Differential Revision: https://reviews.llvm.org/D83195
Mikael Holmen [Wed, 8 Jul 2020 08:14:53 +0000 (10:14 +0200)]
[analyzer] Silence gcc -Wparentheses warning [NFC]
David Sherwood [Thu, 2 Jul 2020 11:24:45 +0000 (12:24 +0100)]
[CodeGen] Fix warnings in sve-ld1-addressing-mode-reg-imm.ll
For the GetElementPtr case in function
AddressingModeMatcher::matchOperationAddr
I've changed the code to use the TypeSize class instead of relying
upon the implicit conversion to a uint64_t. As part of this we now
check for scalable types and if we encounter one just bail out for
now as the subsequent optimisations doesn't currently support them.
This changes fixes up all warnings in the following tests:
llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-imm.ll
llvm/test/CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll
Differential Revision: https://reviews.llvm.org/D83124
George Mitenkov [Tue, 7 Jul 2020 10:35:45 +0000 (13:35 +0300)]
[MLIR][SPIRVToLLVM] Miscellaneous ops conversion: select, fmul and undef
This patch introduces 3 new direct conversions for SPIR-V ops:
- `spv.Select`
- `spv.Undef`
- `spv.FMul` that was skipped in the patch with arithmetic ops
Differential Revision: https://reviews.llvm.org/D83291
Heejin Ahn [Wed, 8 Jul 2020 07:59:21 +0000 (00:59 -0700)]
[WebAssembly] Generate unreachable after __stack_chk_fail
`__stack_chk_fail` does not return, but `unreachable` was not generated
following `call __stack_chk_fail`. This had a possibility to generate an
invalid binary for functions with a return type, because
`__stack_chk_fail`'s return type is void and `call __stack_chk_fail` can
be the last instruction in the function whose return type is non-void.
Generating `unreachable` after it makes sure CFGStackify's
`fixEndsAtEndOfFunction` handles it correctly.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D83277
Florian Hahn [Wed, 8 Jul 2020 07:42:55 +0000 (08:42 +0100)]
[DSE,MSSA] Eliminate stores by terminators (free,lifetime.end).
This patch adds support for eliminating stores by free & lifetime.end
calls. We can remove stores that are not read before calling a memory
terminator and we can eliminate all stores after a memory terminator
until we see a new lifetime.start. The second case seems to not really
trigger much in practice though.
Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea, Tyker
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D72410
LLVM GN Syncbot [Wed, 8 Jul 2020 07:52:15 +0000 (07:52 +0000)]
[gn build] Port
20e271a98de
Nithin Vadukkumchery Rajendrakumar [Fri, 26 Jun 2020 00:31:20 +0000 (02:31 +0200)]
[analyzer] Warning for default constructed unique_ptr dereference
Summary: Add support for warning incase of default constructed unique pointer dereferences
Reviewed By: NoQ, Szelethus, vsavchenko, xazax.hun
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81315
serge-sans-paille [Tue, 23 Jun 2020 13:44:29 +0000 (15:44 +0200)]
Upgrade TypePromotionTransaction to be able to report changes in CodeGenPrepare
optimizeMemoryInst was reporting no change while still modifying the IR.
Inspect the status of TypePromotionTransaction to get a better status.
Related to https://reviews.llvm.org/D80916
Differential Revision: https://reviews.llvm.org/D81256
Mehdi Amini [Wed, 8 Jul 2020 04:04:54 +0000 (04:04 +0000)]
Rename `xla_lhlo.terminator` into `return` in SCF parallel loop test (NFC)
It seems that these were inserted here inadvertently instead of using
standard `return`.
Nico Weber [Wed, 8 Jul 2020 02:56:08 +0000 (22:56 -0400)]
Revert "[X86] Add back the assert in getImpliedFeatures that I removed in
ef4cc70f3ed2a91e0a48c6448c517c3ba34c2846"
This reverts commit
91f70675cc6e5c872e0059c11d797b8726eeac67.
It seems to break most (all?) hwasan tests.
clementval [Wed, 8 Jul 2020 02:38:13 +0000 (22:38 -0400)]
[openmp][NFC] Remove duplicate clause defaultmap for target parallel do
Nico Weber [Wed, 8 Jul 2020 02:29:19 +0000 (22:29 -0400)]
[gn build] Port
baca8f977ed
Muhammad Omair Javaid [Wed, 8 Jul 2020 02:02:16 +0000 (07:02 +0500)]
[LLDB] Disable flaky lldb-vscode tests on arm
Summary:
These two tests are flaky on lldb Arm buildbot as well. They are already
being skipped for aarch64. I am going to mark them skipped for Arm.
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D81978
Craig Topper [Wed, 8 Jul 2020 02:01:22 +0000 (19:01 -0700)]
Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def."
These represent the same thing but 64BIT only showed up from
getHostCPUFeatures providing a list of featuers to clang. While
EM64T showed up from getting the features for a named CPU.
EM64T didn't have a string specifically so it would not be passed
up to clang when getting features for a named CPU. While 64bit
needed a name since that's how it is index.
Merge them by filtering 64bit out before sending features to clang
for named CPUs.
Ben Shi [Wed, 8 Jul 2020 01:54:22 +0000 (18:54 -0700)]
[RISCV] optimize addition with a pair of (addi imm)
For an addition with an immediate in specific ranges, a pair of
addi-addi can be generated instead of the ordinary lui-addi-add serial.
Reviewed By: MaskRay, luismarques
Differential Revision: https://reviews.llvm.org/D82262
Ben Shi [Wed, 8 Jul 2020 01:48:46 +0000 (18:48 -0700)]
[RISCV] Optimize multiplication by constant
... to shift/add or shift/sub.
Do not enable it on riscv32 with the M extension where decomposeMulByConstant
may not be an optimization.
Reviewed By: luismarques, MaskRay
Differential Revision: https://reviews.llvm.org/D82660
HazemAbdelhafez [Wed, 8 Jul 2020 01:32:39 +0000 (21:32 -0400)]
[mlir][spirv] Add MatrixTimesMatrix operation
Add MatrixTimesMatrix operation to SPIRV Dialect and add NoSideEffect trait
to Matrix ops.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D82671
Richard Smith [Wed, 8 Jul 2020 01:25:57 +0000 (18:25 -0700)]
PR45521: Preserve the value kind when performing a standard conversion
sequence on a glvalue expression.
If the sequence is supposed to perform an lvalue-to-rvalue conversion,
then one will be specified as the first conversion in the sequence.
Otherwise, one should not be invented.
Rahul Joshi [Tue, 7 Jul 2020 23:15:44 +0000 (16:15 -0700)]
[MLIR] Combine the 2 overloads of FuncOp::build() into one.
- This will eliminate the need to pass an empty `ArrayRef<NamedAttribute>{}` when
no named attributes are required on the function.
Differential Revision: https://reviews.llvm.org/D83356
Craig Topper [Wed, 8 Jul 2020 01:20:07 +0000 (18:20 -0700)]
Revert "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def."
An accidental change snuck in here
This reverts commit
f1d290d81298092b693076725cef4f34e951e974.
Craig Topper [Wed, 8 Jul 2020 00:55:07 +0000 (17:55 -0700)]
[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def.
These represent the same thing but 64BIT only showed up from
getHostCPUFeatures providing a list of featuers to clang. While
EM64T showed up from getting the features for a named CPU.
EM64T didn't have a string specifically so it would not be passed
up to clang when getting features for a named CPU. While 64bit
needed a name since that's how it is index.
Merge them by filtering 64bit out before sending features to clang
for named CPUs.
Wouter van Oortmerssen [Wed, 8 Jul 2020 00:47:43 +0000 (17:47 -0700)]
[WebAssembly] fix gcc 10 warning
Sid Manning [Fri, 19 Jun 2020 22:37:44 +0000 (17:37 -0500)]
[compiler-rt][Hexagon] Remove fma/fmin/max code
This code should reside in the c-library.
Differential Revision: https://reviews.llvm.org/D82263
Akira Hatanaka [Tue, 7 Jul 2020 02:48:21 +0000 (19:48 -0700)]
[Sema] Teach -Wcast-align to compute alignment of CXXThisExpr
This fixes https://bugs.llvm.org/show_bug.cgi?id=46605.
rdar://problem/
65158878
Differential Revision: https://reviews.llvm.org/D83317
Mauricio Sifontes [Tue, 7 Jul 2020 23:42:40 +0000 (23:42 +0000)]
Create the MLIR Reduce framework
Create the framework and testing environment for MLIR Reduce - a tool
with the objective to reduce large test cases into smaller ones while
preserving their interesting behavior.
Implement the functionality to parse command line arguments, parse the
MLIR test cases into modules and run the interestingness tests on
the modules.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D82803
peter klausler [Tue, 7 Jul 2020 22:30:47 +0000 (15:30 -0700)]
[flang] Fix CHARACTER length folding problem
Do not rewrite LEN(x) or x%len to the expression that specifies
the length of x when that length is not a constant expression.
Its value may have changed since the value of the expression was
first captured in the definition of the object.
Reviewed By: tskeith, sscalpone
Differential Revision: https://reviews.llvm.org/D83352
Philip Reames [Tue, 7 Jul 2020 22:50:50 +0000 (15:50 -0700)]
[Statepoint] Use early return to reduce nesting and clarify comments [NFC]
Philip Reames [Tue, 7 Jul 2020 22:44:06 +0000 (15:44 -0700)]
[Statepoint] Reduce intendation and change a variable name [NFC]
Michael Spencer [Tue, 7 Jul 2020 23:13:02 +0000 (17:13 -0600)]
[clang] Include missing LangOpts in `getModuleHash`.
`ObjCRuntime` and `CommentOpts.BlockCommandNames` are checked by
`ASTReader::checkLanguageOptions`, but are not part of the module
context hash. This can lead to errors when using implicit modules if
different TUs have different values for these options when using the
same module cache.
This was not hit very often due to the rare usage of
`-fblock-command-names=` and that `ObjCRuntime` is by default set by
the target triple, which is part of the existing context hash.
Joachim Protze [Tue, 7 Jul 2020 22:23:13 +0000 (00:23 +0200)]
[OpenMP][Tests] Update compatibility with GCC (NFC)
Commit
95a28df5c provided implementation for GOMP*_nonmonotonic*runtime*
functions. Now the tests succeed with gcc 9 and 10
Craig Topper [Tue, 7 Jul 2020 18:13:06 +0000 (11:13 -0700)]
[X86] Add back the assert in getImpliedFeatures that I removed in
ef4cc70f3ed2a91e0a48c6448c517c3ba34c2846
I've added additional features to the table so I want to see if
the bots are happier with this.
Florian Hahn [Tue, 7 Jul 2020 22:15:01 +0000 (23:15 +0100)]
Revert "[SLP] Make sure instructions are ordered when computing spill cost."
This seems to break http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/24371
This reverts commit
eb46137daa92723b75d828f2db959f2061612622.
Fangrui Song [Tue, 7 Jul 2020 22:04:48 +0000 (15:04 -0700)]
[RuntimeDyld][test] Fix ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_none.yaml after D60122
*.yaml tests don't currently run, so we failed to notice it.
Davide Italiano [Tue, 7 Jul 2020 22:03:08 +0000 (15:03 -0700)]
[dotest] Log a warning when --server and --out-of-tree-debugserver are set
Suggested by Vedant.
Davide Italiano [Tue, 7 Jul 2020 22:00:08 +0000 (15:00 -0700)]
Do not set LLDB_DEBUGSERVER_PATH if --out-of-tree-debugserver is passed.
This gets rid of some surprising interplay between the flags.
Mainly needed because of Rosetta debugserver & Apple Silicon.
Differential Revision: https://reviews.llvm.org/D82804
Fangrui Song [Tue, 7 Jul 2020 22:00:29 +0000 (15:00 -0700)]
[llvm-readobj][test] Fix ELF/verneed-flags.yaml
*.yaml tests don't currently run, so we failed to update it.
Christopher Tetreault [Tue, 7 Jul 2020 21:44:40 +0000 (14:44 -0700)]
[SVE] Remove calls to VectorType::getNumElements from AsmParserTest
Reviewers: efriedma, c-rhodes, david-arm, kmclaughlin, fpetrogalli, sdesmalen
Reviewed By: efriedma
Subscribers: tschuett, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83339
Med Ismail Bennani [Tue, 7 Jul 2020 20:08:20 +0000 (22:08 +0200)]
[lldb/api] Add checks for StackFrame::GetRegisterContext calls (NFC)
This patch fixes a crash that is happening because of a null pointer
dereference in SBFrame.
StackFrame::GetRegisterContext says explicitly that you might not get
a valid RegisterContext back but the pointer wasn't tested before,
resulting in crashes. This should solve the issue.
rdar://
54462095
Differential Revision: https://reviews.llvm.org/D83343
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
cgyurgyik [Sun, 28 Jun 2020 19:22:41 +0000 (14:22 -0500)]
[libc] Add memchr implementation.
Eric Astor [Tue, 7 Jul 2020 21:01:10 +0000 (17:01 -0400)]
[ms] [llvm-ml] Add initial MASM STRUCT/UNION support
Summary:
Add support for user-defined types to MasmParser, including initialization and field access.
Known issues:
- Omitted entry initializers (e.g., <,0>) do not work consistently for nested structs/arrays.
- Size checking/inference for values with known types is not yet implemented.
- Some ml64.exe syntaxes for accessing STRUCT fields are not recognized.
- `[<register>.<struct name>].<field>`
- `[<register>[<struct name>.<field>]]`
- `(<struct name> PTR [<register>]).<field>`
- `[<variable>.<struct name>].<field>`
- `(<struct name> PTR <variable>).<field>`
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D75306
Nicolas Vasilache [Tue, 7 Jul 2020 20:44:24 +0000 (16:44 -0400)]
[mlir][Vector] Add ExtractOp folding
This revision adds foldings for ExtractOp operations that come from previous InsertOp.
InsertOp have cumulative semantic where multiple chained inserts are necessary to produce the final value from which the extracts are obtained.
Additionally, TransposeOp may be interleaved and need to be tracked in order to follow the producer consumer relationships and properly compute positions.
Differential revision: https://reviews.llvm.org/D83150
Christopher Tetreault [Tue, 7 Jul 2020 20:16:00 +0000 (13:16 -0700)]
[SVE] Make Constant::getSplatValue work for scalable vector splats
Summary:
Make Constant::getSplatValue recognize scalable vector splats of the
form created by ConstantVector::getSplat. Add unit test to verify that
C == ConstantVector::getSplat(C)->getSplatValue() for fixed width and
scalable vector splats
Reviewers: efriedma, spatel, fpetrogalli, c-rhodes
Reviewed By: efriedma
Subscribers: sdesmalen, tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82416
Matt Arsenault [Tue, 7 Jul 2020 19:21:13 +0000 (15:21 -0400)]
GlobalISel: Handle EVT argument lowering correctly
handleAssignments was assuming every argument type is an MVT, and
assignArg would always fail. This fixes one of the hacks in the
current AMDGPU calling convention code that pre-processes the
arguments.
Matt Arsenault [Tue, 7 Jul 2020 17:57:09 +0000 (13:57 -0400)]
AMDGPU/GlobalISel: Fix skipping unused kernel arguments
The tests in
a5b9ad7e9aca1329ba310e638dafa58c47468a58 actually failed
the verifier, which for some reason is not the default. Also add tests
for 0-sized function arguments, which do not add entries to the
expected register lists.
Philip Reames [Tue, 7 Jul 2020 19:20:34 +0000 (12:20 -0700)]
[Statepoint] Factor out logic for non-stack non-vreg lowering [almost NFC]
This is inspired by D81648. The basic idea is to have the set of SDValues which are lowered as either constants or direct frame references explicit in one place, and to separate them clearly from the spilling logic.
This is not NFC in that the handling of constants larger than > 64 bit has changed. The old lowering would crash on values which could not be encoded as a sign extended 64 bit value. The new lowering just spills all constants > 64 bits. We could be consistent about doing the sext(Con64) optimization, but I happen to know that this code path is utterly unexercised in practice, so simple is better for now.
Zola Bridges [Wed, 13 May 2020 18:25:08 +0000 (11:25 -0700)]
[x86][seses] Add clang flag; Use lvi-cfi with seses
This patch creates a clang flag to enable SESES. This flag also ensures that
lvi-cfi is on when using seses via clang.
SESES should use lvi-cfi to mitigate returns and indirect branches.
The flag to enable the SESES functionality only without lvi-cfi is now
-x86-seses-enable-without-lvi-cfi to warn users part of the mitigation is not
enabled if they use this flag. This is useful in case folks want to see the
cost of SESES separate from the LVI-CFI.
Reviewed By: sconstab
Differential Revision: https://reviews.llvm.org/D79910
Muhammad Omair Javaid [Tue, 7 Jul 2020 19:27:10 +0000 (00:27 +0500)]
Minor fixups to LLDB AArch64 register infos macros for SVE register infos
Summary:
This patch adds some cosmetic changes to LLDB AArch64 register infos macros in order to use them in SVE register infos struct in follow up patches.
This patch initially added invalidate lists to register infos struct but that is no longer needed and problem disappeared after updating qemu testing environment.
old headline comments for reference:
AArch64 reigster X and V registers are primary GPR and vector registers respectively. If these registers are modified their corresponding children w regs or s/d regs should be invalidated. Specially when a register write fails it is important that failure gets reflected to all the registers which draw their value from a particular value register.
Reviewers: labath, rengolin
Reviewed By: labath
Subscribers: tschuett, kristof.beyls, danielkiss, lldb-commits
Differential Revision: https://reviews.llvm.org/D77045