Simon Pilgrim [Wed, 27 May 2020 10:26:14 +0000 (11:26 +0100)]
VPlanValue.h - reduce unnecessary includes to forward declarations. NFC.
Simon Pilgrim [Wed, 27 May 2020 10:05:55 +0000 (11:05 +0100)]
[X86][SSE] Convert PTEST to MOVMSK for allsign bits vector results
If we are using PTEST to check 'allsign bits' vector elements we can use MOVMSK to extract the signbits directly and perform the comparison on the scalar value.
For vXi16 cases, as we don't have a MOVMSK for this type, we must mask each signbit out of a PMOVMSKB v2Xi8 result, which folds into the TEST comparison.
If this allows us to remove a vector op (via the SimplifyMultipleUseDemandedBits call) this is consistently faster than a PTEST (https://godbolt.org/z/ziJUst).
I'm investigating whether we ever get regressions without the SimplifyMultipleUseDemandedBits call, even if this means we don't remove a vector op, but that has exposed some other poor codegen issues that I'm still investigating and would have to wait for a later patch.
Suggested on PR42035 to avoid unnecessary ashr(x,bw-1)/pcmpgt(0,x) sign splat patterns feeding into ptest.
Differential Revision: https://reviews.llvm.org/D80563
Konstantin Schwarz [Sat, 23 May 2020 11:26:09 +0000 (13:26 +0200)]
[GlobalISel][InlineAsm] Add missing EarlyClobber flag to inline asm output operands
Summary:
Previously, we only added early-clobber flags to the 'group' immediate flag operand
of an inline asm operand.
However, we also have to add the EarlyClobber flag to the MachineOperand itself.
This fixes PR46028
Reviewers: arsenm, leonardchan
Reviewed By: arsenm, leonardchan
Subscribers: phosek, wdng, rovka, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80467
Vitaly Buka [Wed, 27 May 2020 09:45:43 +0000 (02:45 -0700)]
[StackSafety] Bailout on some function calls
Don't miss values used in calls outside regular argument list.
Vitaly Buka [Wed, 27 May 2020 08:43:27 +0000 (01:43 -0700)]
[StackSafety] Fix formatting in the test
Vitaly Buka [Wed, 27 May 2020 08:42:28 +0000 (01:42 -0700)]
[StackSafety] Ignore some use of values
We should ignore value used in MemTransferInst
as other then src/dst argument.
Georgii Rymar [Wed, 27 May 2020 09:21:19 +0000 (12:21 +0300)]
[DebugInfo] - Fix typo in comment. NFC.
I've forgot to address this bit when landed D80476.
Djordje Todorovic [Wed, 27 May 2020 07:42:15 +0000 (09:42 +0200)]
[NFC][Debugify] Format the CheckModuleDebugify output
This fixes the output of the check-debugify option.
Without the patch an example of running the option:
$ opt -check-debugify test.ll -S -o testDebugify.ll
CheckModuleDebugifySkipping module without debugify metadata
After the patch:
$ opt -check-debugify test.ll -S -o testDebugify.ll
CheckModuleDebugify: Skipping module without debugify metadata
Differential Revision: https://reviews.llvm.org/D80553
Craig Topper [Wed, 27 May 2020 08:20:30 +0000 (01:20 -0700)]
[X86] Add helper function to reduce some code duplication when shrinking a vector load to a vzext_load.
There's more code for calling CombineTo and replacing the nodes
that I'd like to share, but its complicated by the getNode call
in the middle that needs to be specific to each opcode.
While there are also make sure we recursively delete the load
we're replacing. It eventually gets removed by a RemoveDeadNodes
call at the end of DAG combine, but we should be more eager about
it. We were inconsistently doing this in some places but not all.
Kazushi (Jam) Marukawa [Wed, 27 May 2020 07:39:39 +0000 (09:39 +0200)]
[VE] Dynamic stack allocation
Summary:
This patch implements dynamic stack allocation for the VE target. Changes:
* compiler-rt: `__ve_grow_stack` to request stack allocation on the VE.
* VE: base pointer support, dynamic stack allocation.
Differential Revision: https://reviews.llvm.org/D79084
Daniil Suchkov [Mon, 25 May 2020 07:59:25 +0000 (14:59 +0700)]
Add test exposing a bug in SimpleLoopUnswitch.
Saiyedul Islam [Thu, 14 May 2020 06:09:04 +0000 (06:09 +0000)]
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1
Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.
Originally authored by Greg Rodgers (@gregrodgers).
Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm
Reviewed By: sameerds
Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D79754
Mehdi Amini [Thu, 21 May 2020 05:30:49 +0000 (05:30 +0000)]
Automatically configure MLIR when flang is enabled
This is more friendly than the "Unknown CMake command “mlir_tablegen”."
that would be issued instead.
Differential Revision: https://reviews.llvm.org/D80359
serge-sans-paille [Mon, 25 May 2020 18:44:35 +0000 (20:44 +0200)]
[PGO] Fix computation of function Hash
And bump its version number accordingly.
This is a patched recommit of
7c298c104bfe725d4315926a656263e8a5ac3054
Previous hash implementation was incorrectly passing an uint64_t, that got converted
to an uint8_t, to finalize the hash computation. This led to different functions
having the same hash if they only differ by the remaining statements, which is
incorrect.
Added a new test case that trivially tests that a small function change is
reflected in the hash value.
Not that as this patch fixes the hash computation, it would invalidate all hashes
computed before that patch applies, this is why we bumped the version number.
Update profile data hash entries due to hash function update, except for binary
version, in which case we keep the buggy behavior for backward compatibility.
Differential Revision: https://reviews.llvm.org/D79961
Craig Topper [Wed, 27 May 2020 06:42:11 +0000 (23:42 -0700)]
[X86] Lower sse_cmp_ss/sse2_cmp_sd intrinsics to X86ISD::FSETCC with vector types.
Isel match that instead of the intrinsic. Similar to what we do
for avx512.
Trying to move more intrinsics to target specific ISD opcodes.
Hoping to add DAG combines to shrink simple loads going into
scalar intrinsics that only read 32 or 64 bits.
Craig Topper [Wed, 27 May 2020 05:36:58 +0000 (22:36 -0700)]
[X86] Use SIMD_EXC to remove some let statements in tablegen. NFCI
Wang, Pengfei [Wed, 27 May 2020 02:50:30 +0000 (10:50 +0800)]
[X86][llvm-mc] Make the suffix matcher more accurate.
Summary:
Some instruction like VPMULDQ is NOT the variant of VPMULD but a new
one.
So we should make sure the suffix matcher only works for memory variant
that has the same size with the suffix.
Currently we only check for SSE/AVX* instructions, because many legacy
instructions didn't declare the alias instructions of their variants.
Differential Revision: https://reviews.llvm.org/D80608
Vitaly Buka [Wed, 27 May 2020 06:20:12 +0000 (23:20 -0700)]
[StackSafety] Use SCEV to find mem operation length
Vitaly Buka [Wed, 27 May 2020 05:05:41 +0000 (22:05 -0700)]
[StackSafety] Use getSignedRange for offsets
Denys Petrov [Fri, 22 May 2020 15:01:53 +0000 (18:01 +0300)]
[analyzer] Add support for IE of keyboard and mouse navigation in HTML report
IE throws errors while using key and mouse navigation through the error path tips.
querySelectorAll method returns NodeList. NodeList belongs to browser API. IE doesn't have forEach among NodeList's methods. At the same time Array is a JavaScript object and can be used instead. The fix is in the converting NodeList into Array and keeps using forEach method as before.
Checked in IE11, Chrome and Opera.
Differential Revision: https://reviews.llvm.org/D80444
Siva Chandra Reddy [Wed, 27 May 2020 05:22:09 +0000 (22:22 -0700)]
[libc][NFC][Obvious] Convert the MPFR operations enum to an enum class.
This was suggested in https://reviews.llvm.org/D79149.
MaheshRavishankar [Tue, 26 May 2020 23:35:59 +0000 (16:35 -0700)]
[mlir][linalg] Allow promotion to use callbacks for
alloc/dealloc/copies.
Add options to LinalgPromotion to use callbacks for implementating the
allocation, deallocation of buffers used for the promoted subviews,
and to copy data into and from the original subviews to the allocated
buffers.
Also some misc. cleanup of the code.
Differential Revision: https://reviews.llvm.org/D80365
MaheshRavishankar [Tue, 26 May 2020 23:35:20 +0000 (16:35 -0700)]
[mlir][Linalg] Avoid using scf.parallel for non-parallel loops in Linalg ops.
Modifying the loop nest builder for generating scf.parallel loops to
not generate scf.parallel loops for non-parallel iterator types in
Linalg operations. The existing implementation incorrectly generated
scf.parallel for all tiled loops. It is rectified by refactoring logic
used while lowering to loops that accounted for this.
Differential Revision: https://reviews.llvm.org/D80188
Jinsong Ji [Wed, 27 May 2020 02:37:04 +0000 (02:37 +0000)]
[compiler-rt][NFC]Fix Wdeprecated warnings for fsanitize-coverage
A few testcases are still using deprecated options.
warning: argument '-fsanitize-coverage=[func|bb|edge]' is deprecated,
use '-fsanitize-coverage=[func|bb|edge],[trace-pc-guard|trace-pc]'
instead [-Wdeprecated]
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D79741
Kang Zhang [Wed, 27 May 2020 02:35:45 +0000 (02:35 +0000)]
[NFC][PowerPC] Modify the test case two-address-crash.mir
Eric Christopher [Wed, 27 May 2020 01:50:19 +0000 (18:50 -0700)]
Temporarily Revert "[Clang][AArch64] Capturing proper pointer alignment for Neon vld1 intrinsicts"
as it's causing crashes on code generation and https://bugs.llvm.org/show_bug.cgi?id=46084
This reverts commit
98cad555e29187a03e2bc3db5780762981913902.
Matt Arsenault [Sun, 24 May 2020 14:49:22 +0000 (10:49 -0400)]
GlobalISel: Add a clarification to G_STORE documentation
Mirror the note on G_LOAD. We probably do need to add an explicit
G_TRUNCSTORE opcode for the vector case, although I do not have a use
for it.
Matt Arsenault [Sat, 23 May 2020 22:10:34 +0000 (18:10 -0400)]
GlobalISel: Basic legalization for G_PTRMASK
Vitaly Buka [Wed, 27 May 2020 00:04:09 +0000 (17:04 -0700)]
[StackSafety] Simplify SCEVRewriteVisitor
Probably NFC.
Vitaly Buka [Tue, 26 May 2020 23:53:02 +0000 (16:53 -0700)]
[NFC, StackSafety] Add some missing includes
Vitaly Buka [Tue, 26 May 2020 23:48:08 +0000 (16:48 -0700)]
[NFC, StackSafety] Remove duplicate code
Vitaly Buka [Tue, 26 May 2020 23:12:08 +0000 (16:12 -0700)]
[NFC, StackSafety] Better names for internal stuff
Remove const from some parameters as upcoming changes in ScalarEvolution
calls will need non const pointers.
Jessica Paquette [Tue, 26 May 2020 19:56:14 +0000 (12:56 -0700)]
[AArch64][GlobalISel] Do not modify predicate when optimizing G_ICMP
This fixes a bug in `tryOptArithImmedIntegerCompare`.
It is unsafe to update the predicate on a MachineOperand when optimizing a
G_ICMP, because it may be used in more than one place.
For example, when we are optimizing G_SELECT, we allow compares which are used
in more than one G_SELECT. If we modify the G_ICMP, then we'll break one of
the G_SELECTs.
Since the compare is being produced to either
1) Select a G_ICMP
2) Fold a G_ICMP into an instruction when profitable
there's no reason to actually modify it. The change is local to the specific
compare.
Instead, pass a `CmpInst::Predicate` to `tryOptArithImmedIntegerCompare` which
can be modified by reference.
Differential Revision: https://reviews.llvm.org/D80585
Philip Reames [Wed, 27 May 2020 00:34:54 +0000 (17:34 -0700)]
Add self as code owner for SCEV and IndVars
This was discussed on llvm-dev thread "Transferring code ownership for SCEV and IndVars" a few months back. I just forgot to make the actual change.
Jonas Devlieghere [Wed, 27 May 2020 00:22:53 +0000 (17:22 -0700)]
[lldb/Docs] Add the application speicfic lldbinit to the man page
This used to be part of the man page but got lost when we moved to
generating it with Sphinx.
Philip Reames [Wed, 27 May 2020 00:33:07 +0000 (17:33 -0700)]
Split a test file so that most of it can be autogened
Philip Reames [Wed, 27 May 2020 00:27:46 +0000 (17:27 -0700)]
Autogen a couple of test files to make a future diff easier to read
Alex Langford [Mon, 11 May 2020 23:24:42 +0000 (16:24 -0700)]
[lldb][Core] Remove dead codepath in Mangled
Summary:
Objective-C names are stored in m_demangled, not in m_mangled. The
method in the condition will never return true.
Differential Revision: https://reviews.llvm.org/D79823
Jonas Devlieghere [Wed, 27 May 2020 00:00:48 +0000 (17:00 -0700)]
[lldb/Test] Modify TestSymbolTable.py for reproducers
Work around global module caching during reproducer replay. See inline
comment for the details.
Sean Silva [Thu, 21 May 2020 18:04:43 +0000 (11:04 -0700)]
[mlir][shape] Add `shape.get_extent`.
Summary:
This op extracts an extent from a shape.
This also is the first op which constant folds to shape.const_size,
which revealed that shape.const_size needs a folder (ConstantLike ops
seem to always need folders for the constant folding infra to work).
Differential Revision: https://reviews.llvm.org/D80394
Alexander Shaposhnikov [Tue, 26 May 2020 23:49:56 +0000 (16:49 -0700)]
[llvm-objcopy][MachO] Add support for removing Swift symbols
cctools strip has the option "-T" which removes Swift symbols.
This diff implements this option in llvm-strip for MachO.
Test plan: make check-all
Differential revision: https://reviews.llvm.org/D80099
Arthur Eubanks [Tue, 26 May 2020 19:36:03 +0000 (12:36 -0700)]
Modify verifier checks to support musttail + preallocated
Summary:
preallocated and musttail can work together, but we don't want to call
@llvm.call.preallocated.setup() to modify the stack in musttail calls.
So we shouldn't have the "preallocated" operand bundle when a
preallocated call is musttail.
Also disallow use of preallocated on calls without preallocated.
Codegen not yet implemented.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80581
stevewan [Tue, 26 May 2020 19:39:21 +0000 (15:39 -0400)]
[NFC] Fix formatting for the 'aix-ld.c' test case.
Summary:
Based on comments received in D80415 pertinent to test case format, the following fixes are provided to other tests in 'aix-ld.c' for the sake of consistency and readability,
- Align flags in RUN directives vertically.
- Align patterns in CHECK directives vertically.
- Remove the ‘-o %t.o’ as it’s unnecessary for tests with ‘-###’.
- Fix typos in comments.
Reviewers: ZarkoCA, hubert.reinterpretcast, daltenty
Reviewed By: hubert.reinterpretcast
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80532
Kristóf Umann [Tue, 25 Feb 2020 17:02:18 +0000 (18:02 +0100)]
[analyzer][MallocChecker] Make NewDeleteLeaks depend on DynamicMemoryModeling rather than NewDelete
If you remember the mail [1] I sent out about how I envision the future of the
already existing checkers to look dependencywise, one my main points was that no
checker that emits diagnostics should be a dependency. This is more problematic
for some checkers (ahem, RetainCount [2]) more than for others, like this one.
The MallocChecker family is a mostly big monolithic modeling class some small
reporting checkers that only come to action when we are constructing a warning
message, after the actual bug was detected. The implication of this is that
NewDeleteChecker doesn't really do anything to depend on, so this change was
relatively simple.
The only thing that complicates this change is that FreeMemAux (MallocCheckers
method that models general memory deallocation) returns after calling a bug
reporting method, regardless whether the report was ever emitted (which may not
always happen, for instance, if the checker responsible for the report isn't
enabled). This return unfortunately happens before cleaning up the maps in the
GDM keeping track of the state of symbols (whether they are released, whether
that release was successful, etc). What this means is that upon disabling some
checkers, we would never clean up the map and that could've lead to false
positives, e.g.:
error: 'warning' diagnostics seen but not expected:
File clang/test/Analysis/NewDelete-intersections.mm Line 66: Potential leak of memory pointed to by 'p'
File clang/test/Analysis/NewDelete-intersections.mm Line 73: Potential leak of memory pointed to by 'p'
File clang/test/Analysis/NewDelete-intersections.mm Line 77: Potential leak of memory pointed to by 'p'
error: 'warning' diagnostics seen but not expected:
File clang/test/Analysis/NewDelete-checker-test.cpp Line 111: Undefined or garbage value returned to caller
File clang/test/Analysis/NewDelete-checker-test.cpp Line 200: Potential leak of memory pointed to by 'p'
error: 'warning' diagnostics seen but not expected:
File clang/test/Analysis/new.cpp Line 137: Potential leak of memory pointed to by 'x'
There two possible approaches I had in mind:
Make bug reporting methods of MallocChecker returns whether they succeeded, and
proceed with the rest of FreeMemAux if not,
Halt execution with a sink node upon failure. I decided to go with this, as
described in the code.
As you can see from the removed/changed test files, before the big checker
dependency effort landed, there were tests to check for all the weird
configurations of enabled/disabled checkers and their messy interactions, I
largely repurposed these.
[1] http://lists.llvm.org/pipermail/cfe-dev/2019-August/063070.html
[2] http://lists.llvm.org/pipermail/cfe-dev/2019-August/063205.html
Differential Revision: https://reviews.llvm.org/D77474
Kirstóf Umann [Mon, 13 Apr 2020 18:51:27 +0000 (20:51 +0200)]
[analyzer][RetainCount] Tie diagnostics to osx.cocoa.RetainCount rather then RetainCountBase, for the most part
Similarly to other patches of mine, I'm trying to uniformize the checker
interface so that dependency checkers don't emit diagnostics. The checker that
made me most anxious so far was definitely RetainCount, because it is definitely
impacted by backward compatibility concerns, and implements a checker hierarchy
that is a lot different to other examples of similar size. Also, I don't have
authority, nor expertise regarding ObjC related code, so I welcome any
objection/discussion!
Differential Revision: https://reviews.llvm.org/D78099
Chris Jackson [Tue, 26 May 2020 21:33:59 +0000 (22:33 +0100)]
[debuginfo] Fix broken tests from MachineLICM salvaging fix
Previous commit:
bd7ff5d94f
- Added missing x86 triples
- Added missing asserts
Jon Roelofs [Fri, 22 May 2020 12:53:55 +0000 (06:53 -0600)]
[clang][docs] Document additional bits of libc that -ffreestanding envs must provide
Differential Revision: https://reviews.llvm.org/D80436
Vitaly Buka [Tue, 26 May 2020 21:27:22 +0000 (14:27 -0700)]
[sancov] Accommodate sancov and coverage report server for use under Windows
Summary:
This patch makes the following changes to SanCov and its complementary Python script in order to resolve issues pertaining to non-UNIX file paths in JSON symbolization information:
* Convert all paths to use forward slash.
* Update `coverage-report-server.py` to correctly handle paths to sources which contain spaces.
* Remove Linux platform restriction for all SanCov unit tests. All SanCov tests passed when ran on my local Windows machine.
Patch by Douglas Gliner.
Reviewers: kcc, filcab, phosek, morehouse, vitalybuka, metzman
Reviewed By: vitalybuka
Subscribers: vsk, Dor1s, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D51018
Vedant Kumar [Wed, 20 May 2020 22:30:58 +0000 (15:30 -0700)]
[DwarfExpression] Support entry values for indirect parameters
Summary:
A struct argument can be passed-by-value to a callee via a pointer to a
temporary stack copy. Add support for emitting an entry value DBG_VALUE
when an indirect parameter DBG_VALUE becomes unavailable. This is done
by omitting DW_OP_stack_value from the entry value expression, to make
the expression describe the location of an object.
rdar://
63373691
Reviewers: djtodoro, aprantl, dstenb
Subscribers: hiraditya, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D80345
Vitaly Buka [Sun, 24 May 2020 09:44:31 +0000 (02:44 -0700)]
[NFC, StackSafety] Remove unnecessary data
Vitaly Buka [Sun, 24 May 2020 05:47:21 +0000 (22:47 -0700)]
[NFC, StackSafety] Move FunctionInfo into :: namespace
Stanislav Mekhanoshin [Tue, 26 May 2020 20:30:19 +0000 (13:30 -0700)]
[AMDGPU] Bail alloca vectorization if GEP not found
Differential Revision: https://reviews.llvm.org/D80587
Florian Hahn [Tue, 26 May 2020 20:50:15 +0000 (21:50 +0100)]
[LoopUnroll] Simplify latch/header block handling (NFC).
I think the current code dealing with connecting the unrolled iterations
is a bit more complicated than necessary currently. To connect the
unrolled iterations, we have to update the unrolled latch blocks to
branch to the header of the next unrolled iteration.
We need to do this regardless whether the latch is exiting or not.
Additionally, we try to turn the conditional branch in the exiting block
to an unconditional one. This is an optimization only; alternatively we
could leave the conditional branches in place and rely on other passes
to simplify the conditions.
Logically, this is a separate step from connecting the latches to the
headers, but it is convenient to fold them into the same loop, if the
latch is also exiting. For headers (or other non-latch exiting blocks,
this is done separately).
Hopefully the patch with additional comments makes things a bit clearer.
Reviewers: efriedma, dmgreen, hfinkel, Whitney
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D80544
Davide Italiano [Tue, 26 May 2020 20:53:16 +0000 (13:53 -0700)]
[MLICM] Remove unneeded option so the test doesn't fail.
Adrian Prantl [Tue, 26 May 2020 20:49:23 +0000 (13:49 -0700)]
Let @skipUnlessAddressSanitizer imply @skipIfAsan
Don't run tests that use address sanitizer inside an address-sanitized
LLDB. The tests don't support that configuration. Incidentally they
were skipped on green dragon for a different reason, so this hasn't
come up there before.
Marco Elver [Tue, 26 May 2020 19:51:46 +0000 (12:51 -0700)]
[Clang][Driver] Add Bounds and Thread to SupportsCoverage list
Summary:
This permits combining -fsanitize-coverage with -fsanitize=bounds or
-fsanitize=thread. Note that, GCC already supports combining these.
Tested:
- Add Clang end-to-end test checking IR is generated for both combinations
of sanitizers.
- Several previously failing TSAN tests now pass.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45831
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: #sanitizers, dvyukov, nickdesaulniers, cfe-commits
Tags: #clang, #sanitizers
Differential Revision: https://reviews.llvm.org/D79628
Matt Arsenault [Sun, 24 May 2020 16:28:59 +0000 (12:28 -0400)]
AMDGPU: Fix wrong null value for private address space
I'm guessing this was a holdover from when 0 was an invalid stack
pointer, but surprised nobody has discovered this before.
Also don't allow offset folding for -1 pointers, since it looks weird
to partially fold this.
Nicolas Vasilache [Tue, 26 May 2020 20:24:56 +0000 (16:24 -0400)]
[mlir] Hotfix - Add inline to avoid multiple symbols on trivial functions
Nicolas Vasilache [Tue, 26 May 2020 20:21:15 +0000 (16:21 -0400)]
[mlir] Hotfix - Drop spurious constexpr that breaks build
Jonas Devlieghere [Tue, 26 May 2020 20:15:43 +0000 (13:15 -0700)]
[lldb/Test] Cleanup TestSymbolTable.py (NFC)
Chris Jackson [Tue, 26 May 2020 18:28:34 +0000 (19:28 +0100)]
[DebugInfo] Correct debuginfo for post-ra hoist and sink in Machine LICM
Reviewers: vsk, aprantl
Differential Revision: https://reviews.llvm.org/D79868
Stanislav Mekhanoshin [Thu, 30 Apr 2020 23:42:27 +0000 (16:42 -0700)]
Process gep (select ptr1, ptr2) in SROA
Differential Revision: https://reviews.llvm.org/D79217
Nicolas Vasilache [Tue, 26 May 2020 19:34:57 +0000 (15:34 -0400)]
[mlir][Vector] Add more vector.contract -> outerproduct lowerings and fix vector.contract type inference.
This revision expands the types of vector contractions that can be lowered to vector.outerproduct.
All 8 permutation cases are support.
The idiomatic manipulation of AffineMap written declaratively makes this straightforward.
In the process a bug with the vector.contract verifier was uncovered.
The vector shape verification part of the contract op is rewritten to use AffineMap composition.
One bug in the vector `ops.mlir` test is fixed and a new case not yet captured is added
to the vector`invalid.mlir` test.
Differential Revision: https://reviews.llvm.org/D80393
Shoaib Meenai [Tue, 26 May 2020 19:22:03 +0000 (12:22 -0700)]
[Support] Remove stale comment
Clang has supported __builtin_assume_aligned since r217349 back in 2014,
so the comment is very out of date.
Matt Arsenault [Sun, 24 May 2020 22:06:56 +0000 (18:06 -0400)]
AMDGPU: Update store node checks for atomics
Prepare to switch to using StoreSDNode for atomic stores.
Pete Steinfeld [Fri, 22 May 2020 19:08:56 +0000 (12:08 -0700)]
[flang] Fixes for problems with declaring procedure entities
Summary:
We were not detecting declaring multiple interfaces to the same procedure.
Also, we were not handling the initialization of entitiies where the associated
Symbol had previously had errors.
I added the function `IsInterfaceSet()` to ProcEntityDetails to see if
the value of `interface_` had been previously set. I then checked this
function before calling set_interface() and emitted an error message if
the interface was already set.
Also, in situations where we were emitting error messages for symbols, I
set the Error flag on the Symbol. Then when performing initialization
on the Symbol, I first check to see if the Symbol had an error.
Reviewers: tskeith, klausler, DavidTruby
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80453
Stefanos Baziotis [Tue, 26 May 2020 19:16:13 +0000 (22:16 +0300)]
[MSSA][Doc] Fix typo
Jonas Devlieghere [Tue, 26 May 2020 19:14:32 +0000 (12:14 -0700)]
[lldb/Test] Reinstate FoundationSymtabTestCase
David Blaikie [Tue, 26 May 2020 19:04:14 +0000 (12:04 -0700)]
Roll variables into an LLVM_DEBUG block to address -Wunused-but-set-variable
Eric Christopher [Tue, 26 May 2020 18:58:31 +0000 (11:58 -0700)]
Be more specific about auto * vs auto for po alias.
Sanjay Patel [Tue, 26 May 2020 18:32:57 +0000 (14:32 -0400)]
[InstCombine] reassociate sub+add to increase adds and throughput
The -reassociate pass tends to transform this kind of pattern into
something that is worse for vectorization and codegen. See PR43953:
https://bugs.llvm.org/show_bug.cgi?id=43953
Follows-up the FP version of the same transform:
rGa0ce2338a083
Sanjay Patel [Tue, 26 May 2020 18:30:48 +0000 (14:30 -0400)]
[LoopVectorize] regenerate full test checks; NFC
Sanjay Patel [Tue, 26 May 2020 17:27:16 +0000 (13:27 -0400)]
[InstCombine] add tests for reassociative sub/add expressions; NFC
Lei Huang [Fri, 15 May 2020 17:30:07 +0000 (12:30 -0500)]
[PowerPC] Add support for -mcpu=pwr10 in both clang and llvm
Summary:
This patch simply adds support for the new CPU in anticipation of
Power10. There isn't really any functionality added so there are no
associated test cases at this time.
Reviewers: stefanp, nemanjai, amyk, hfinkel, power-llvm-team, #powerpc
Reviewed By: stefanp, nemanjai, amyk, #powerpc
Subscribers: NeHuang, steven.zhang, hiraditya, llvm-commits, wuzish, shchenz, cfe-commits, kbarton, echristo
Tags: #clang, #powerpc, #llvm
Differential Revision: https://reviews.llvm.org/D80020
Adam Balogh [Tue, 26 May 2020 18:43:37 +0000 (20:43 +0200)]
[Analyzer] Fix buildbot failure of commit rGd70ec366c91b
Nemanja Ivanovic [Tue, 26 May 2020 18:34:52 +0000 (13:34 -0500)]
[PowerPC][NFC] Update test to prevent DCE from causing failures
The test case provided in PR45709 can be simplified by DCE to an
empty function. To prevent this from happening if DCE is run prior
to ISEL in the back end, just add optnone to the function. The
behaviour it is testing for is in the SDAG legalization and is
not sensitive to optnone so the test case still achieves its desired
objective.
Kostya Serebryany [Tue, 26 May 2020 18:31:24 +0000 (11:31 -0700)]
[fuzzer][afl] Fix build with GCC
Summary:
Fixes this build error with GCC 9.3.0:
```
../lib/fuzzer/afl/afl_driver.cpp:114:30: error: expected unqualified-id before string constant
114 | __attribute__((weak)) extern "C" void __sanitizer_set_report_fd(void *);
| ^~~
```
Reviewers: metzman, kcc
Reviewed By: kcc
Subscribers: #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D80479
Jonas Devlieghere [Tue, 26 May 2020 18:32:02 +0000 (11:32 -0700)]
[StaticAnalyzer] Fix non-virtual destructor warning
Ficed warning: 'clang::ento::ExprEngine' has virtual functions but non-virtual destructor [-
Wnon-virtual-dtor]
~ExprEngine() = default;
Jonas Devlieghere [Tue, 26 May 2020 18:22:48 +0000 (11:22 -0700)]
[lldb/Reproducers] Skip remaining failing test in python_api subdir
Skip the remaining two failing test in the python_api subdirectory. See
inline comments for the reason why.
Simon Pilgrim [Tue, 26 May 2020 18:09:36 +0000 (19:09 +0100)]
ObjCARCAnalysisUtils.h - remove unused includes. NFC.
We just need to include Passes.h in ObjCARCAliasAnalysis.cpp to compensate
Simon Pilgrim [Tue, 26 May 2020 17:46:37 +0000 (18:46 +0100)]
ResourcePriorityQueue.h - reduce unnecessary includes to forward declarations. NFC.
Move includes to ResourcePriorityQueue.cpp
Fangrui Song [Tue, 26 May 2020 18:06:07 +0000 (11:06 -0700)]
[ELF] Allow misaligned SHT_GNU_verneed
Bazel created interface shared objects (.ifso) may be misaligned. We use
llvm::support::detail::packed_endian_specific_integral under the hood
which allows reading of misaligned values, so there is not a need to
diagnose (in LLD we don't intend to support sophisticated parsing for
SHT_GNU_*).
Jonas Devlieghere [Tue, 26 May 2020 17:54:12 +0000 (10:54 -0700)]
[YAMLTraits] Remove char trait and serialize as uint8_t in lldb.
As discussed in https://reviews.llvm.org/D79745
LLVM GN Syncbot [Tue, 26 May 2020 17:56:17 +0000 (17:56 +0000)]
[gn build] Port
d70ec366c91
Adam Balogh [Tue, 26 May 2020 11:48:20 +0000 (13:48 +0200)]
[Analyzer][NFC] Remove the SubEngine interface
The `SubEngine` interface is an interface with only one implementation
`EpxrEngine`. Adding other implementations are difficult and very
unlikely in the near future. Currently, if anything from `ExprEngine` is
to be exposed to other classes it is moved to `SubEngine` which
restricts the alternative implementations. The virtual methods are have
a slight perofrmance impact. Furthermore, instead of the `LLVM`-style
inheritance a native inheritance is used here, which renders `LLVM`
functions like e.g. `cast<T>()` unusable here. This patch removes this
interface and allows usage of `ExprEngine` directly.
Differential Revision: https://reviews.llvm.org/D80548
mydeveloperday [Tue, 26 May 2020 17:47:56 +0000 (18:47 +0100)]
[clang-format] Fix an ObjC regression introduced with new [[likely]][[unlikely]] support in if/else clauses
Summary:
{D80144} introduce an ObjC regression
Only parse the `[]` if what follows is really an attribute
Reviewers: krasimir, JakeMerdichAMD
Reviewed By: krasimir
Subscribers: rdwampler, aaron.ballman, curdeius, cfe-commits
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D80547
Stefanos Baziotis [Tue, 26 May 2020 17:40:45 +0000 (20:40 +0300)]
[MSSA][Doc] Clobbers, more info on Defs / Def chain
- Added more info about what we refer as a clobber in MSSA.
- Added more info about MemoryDefs and how there is a single Def chain.
- The doc portrayed MSSA as modeling the heap whileit is modeling
the whole memory, so I changed the wording to not be heap-specific.
Differential Revision: https://reviews.llvm.org/D80000
Sean Fertile [Tue, 26 May 2020 17:06:50 +0000 (13:06 -0400)]
[PowerPC][NFC] Add colon to TODO's and fix indentation.
Hiroshi Yamauchi [Tue, 4 Feb 2020 23:19:33 +0000 (15:19 -0800)]
[PGO] Add memcmp/bcmp size value profiling.
Summary: This adds support for memcmp/bcmp to the existing memcpy/memset value profiling.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79751
Sanjay Patel [Tue, 26 May 2020 16:48:22 +0000 (12:48 -0400)]
[InstCombine] reassociate fsub+fadd with FMF to increase adds and throughput
The -reassociate pass tends to transform this kind of pattern into
something that is worse for vectorization and codegen. See PR43953:
https://bugs.llvm.org/show_bug.cgi?id=43953
Matt Arsenault [Tue, 26 May 2020 16:58:18 +0000 (12:58 -0400)]
Revert "[AMDGPU] NFC target dependent requiresUniformRegister refactored out"
This reverts commit
fb38b98338cc87442e3451665e82bf1c8ef9388f.
This will regress compile time.
alex-t [Tue, 26 May 2020 16:47:29 +0000 (19:47 +0300)]
[AMDGPU] NFC target dependent requiresUniformRegister refactored out
Summary: Target specific method encapsulated into the Target Lowering Info.
Reviewers: rampitec, vpykhtin
Reviewed By: rampitec
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70085
Jonas Devlieghere [Tue, 26 May 2020 16:37:14 +0000 (09:37 -0700)]
[dsymutil] Escape CFBundleIdentifier in plist.
Revision 333565 started escaping HTML special characters in the plist
written by dsymutil, but didn't include the updated CFBundleIdentifier.
Fangrui Song [Thu, 14 May 2020 20:55:20 +0000 (13:55 -0700)]
[ELF][PPC64] Synthesize _savegpr[01]_{14..31} and _restgpr[01]_{14..31}
In the 64-bit ELF V2 API Specification: Power Architecture, 2.3.3.1. GPR
Save and Restore Functions defines some special functions which may be
referenced by GCC produced assembly (LLVM does not reference them).
With GCC -Os, when the number of call-saved registers exceeds a certain
threshold, GCC generates `_savegpr0_* _restgpr0_*` calls and expects the
linker to define them. See
https://sourceware.org/pipermail/binutils/2002-February/017444.html and
https://sourceware.org/pipermail/binutils/2004-August/036765.html . This
is weird because libgcc.a would be the natural place. However, the linker
generation approach has the advantage that the linker can generate
multiple copies to avoid long branch thunks. We don't consider the
advantage significant enough to complicate our trunk implementation, so
we take a simple approach.
* Check whether `_savegpr0_{14..31}` are used
* If yes, define needed symbols and add an InputSection with the code sequence.
`_savegpr1_*` `_restgpr0_*` and `_restgpr1_*` are similar.
Reviewed By: sfertile
Differential Revision: https://reviews.llvm.org/D79977
Sean Fertile [Tue, 26 May 2020 14:37:51 +0000 (10:37 -0400)]
[PowerPC][AIX] Spill CSRs to the ABI specified stack offsets.
Extend the CSR save/restore insertion code to support both 32-bit and
64-bit AIX.
Differential Revision: https://reviews.llvm.org/D79252
Sanne Wouda [Tue, 26 May 2020 16:11:32 +0000 (17:11 +0100)]
Fix MemoryLocation.h use without Instructions.h
MemoryLocation.h was changed to only include Instruction.h. However,
cast<> still needs the full definiton, so move MemoryLocation::getOrNone
to the cpp file.
Matt Arsenault [Wed, 20 May 2020 17:26:10 +0000 (13:26 -0400)]
AMDGPU/GlobalISel: Fix assert on 16-bit G_EXTRACT results
I consider this to be a hack, since we probably should not mark any
16-bit extract as legal, and require all extracts to be done on
multiples of 32. There are quite a few more battles to fight in the
legalizer for sub-dword vectors, so just select this for now so we can
pass OpenCL conformance without crashing.
Also fix the same assert for G_INSERTs. Unlike G_EXTRACT there's not a
trivial way to select this so just fail on it.
Adrian Prantl [Tue, 26 May 2020 15:53:02 +0000 (08:53 -0700)]
Add missing forward decl to unbreak the modular build
Adrian Prantl [Sat, 23 May 2020 00:33:03 +0000 (17:33 -0700)]
Debug Info: Mark os_log helper functions as artificial
The os_log helper functions are linkonce_odr and supposed to be
uniqued across TUs, so attachine a DW_AT_decl_line on it is highly
misleading. By setting the function decl to implicit, CGDebugInfo
properly marks the functions as artificial and uses a default file /
line 0 location for the function.
rdar://problem/
63450824
Differential Revision: https://reviews.llvm.org/D80463
Matt Arsenault [Fri, 15 May 2020 22:33:01 +0000 (18:33 -0400)]
GlobalISel: Merge G_PTR_MASK with llvm.ptrmask intrinsic
Confusingly, these were unrelated and had different semantics. The
G_PTR_MASK instruction predates the llvm.ptrmask intrinsic, but has a
different format. G_PTR_MASK only allows clearing the low bits of a
pointer, and only a constant number of bits. The ptrmask intrinsic
allows an arbitrary mask. Replace G_PTR_MASK to match the intrinsic.
Only selects the cases that look like the old instruction. More work
is needed to select the general case. Also new legalization code is
still needed to deal with the case where the incoming mask size does
not match the pointer size, which has a specified behavior in the
langref.