Commit Graph

355699 Commits

Author SHA1 Message Date
Vitaly Buka 32a1f60d11 [StackSafety] Use SCEV to find mem operation length 2020-05-26 23:22:37 -07:00
Vitaly Buka d0f1f5adfa [StackSafety] Use getSignedRange for offsets 2020-05-26 23:22:36 -07:00
Denys Petrov 6bbaa62d26 [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
2020-05-27 09:04:30 +03:00
Siva Chandra Reddy 9f69d3d0bc [libc][NFC][Obvious] Convert the MPFR operations enum to an enum class.
This was suggested in https://reviews.llvm.org/D79149.
2020-05-26 22:26:41 -07:00
MaheshRavishankar 0ed2d4c7cb [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
2020-05-26 21:33:57 -07:00
MaheshRavishankar 5759e47316 [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
2020-05-26 21:33:57 -07:00
Jinsong Ji a7141480fb [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
2020-05-27 02:37:30 +00:00
Kang Zhang 23a2f45214 [NFC][PowerPC] Modify the test case two-address-crash.mir 2020-05-27 02:35:45 +00:00
Eric Christopher 97a133f157 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 98cad555e2.
2020-05-26 18:51:00 -07:00
Matt Arsenault 8e3307f551 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.
2020-05-26 21:20:30 -04:00
Matt Arsenault ef3e831226 GlobalISel: Basic legalization for G_PTRMASK 2020-05-26 21:20:30 -04:00
Vitaly Buka b5ae70046b [StackSafety] Simplify SCEVRewriteVisitor
Probably NFC.
2020-05-26 18:09:43 -07:00
Vitaly Buka 4320d4aa1c [NFC, StackSafety] Add some missing includes 2020-05-26 18:09:43 -07:00
Vitaly Buka 5afef79ff4 [NFC, StackSafety] Remove duplicate code 2020-05-26 18:09:43 -07:00
Vitaly Buka f20ace6f33 [NFC, StackSafety] Better names for internal stuff
Remove const from some parameters as upcoming changes in ScalarEvolution
calls will need non const pointers.
2020-05-26 18:09:43 -07:00
Jessica Paquette ae597a771e [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
2020-05-26 17:51:08 -07:00
Philip Reames 323d850427 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.
2020-05-26 17:35:54 -07:00
Jonas Devlieghere 40c4ecabc2 [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.
2020-05-26 17:34:09 -07:00
Philip Reames bed6624ac4 Split a test file so that most of it can be autogened 2020-05-26 17:33:32 -07:00
Philip Reames b90eb0f23b Autogen a couple of test files to make a future diff easier to read 2020-05-26 17:33:32 -07:00
Alex Langford 1079978b3c [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
2020-05-26 17:12:20 -07:00
Jonas Devlieghere e724db0375 [lldb/Test] Modify TestSymbolTable.py for reproducers
Work around global module caching during reproducer replay. See inline
comment for the details.
2020-05-26 17:07:41 -07:00
Sean Silva cf42b70439 [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
2020-05-26 17:03:40 -07:00
Alexander Shaposhnikov 842a8cc10c [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
2020-05-26 16:49:56 -07:00
Arthur Eubanks 9a0b0855a9 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
2020-05-26 15:20:20 -07:00
stevewan a924dac44f [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
2020-05-26 18:11:49 -04:00
Kristóf Umann efd1a8e66e [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
2020-05-27 00:03:53 +02:00
Kirstóf Umann 5192783bb2 [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
2020-05-27 00:01:47 +02:00
Chris Jackson 9eacda51fa [debuginfo] Fix broken tests from MachineLICM salvaging fix
Previous commit: bd7ff5d94f

- Added missing x86 triples
- Added missing asserts
2020-05-26 22:46:07 +01:00
Jon Roelofs 1e06b169be [clang][docs] Document additional bits of libc that -ffreestanding envs must provide
Differential Revision: https://reviews.llvm.org/D80436
2020-05-26 15:42:32 -06:00
Vitaly Buka 6a74ad6baa [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
2020-05-26 14:36:44 -07:00
Vedant Kumar 6e39379bbb [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
2020-05-26 14:22:28 -07:00
Vitaly Buka 9abb0e8d5b [NFC, StackSafety] Remove unnecessary data 2020-05-26 14:13:20 -07:00
Vitaly Buka ecb66f50ee [NFC, StackSafety] Move FunctionInfo into :: namespace 2020-05-26 14:13:20 -07:00
Stanislav Mekhanoshin 512e806a33 [AMDGPU] Bail alloca vectorization if GEP not found
Differential Revision: https://reviews.llvm.org/D80587
2020-05-26 13:59:49 -07:00
Florian Hahn 5cf90d6cf1 [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
2020-05-26 21:54:12 +01:00
Davide Italiano 01fee8aa24 [MLICM] Remove unneeded option so the test doesn't fail. 2020-05-26 13:53:56 -07:00
Adrian Prantl 09de6e0fbd 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.
2020-05-26 13:51:08 -07:00
Marco Elver 14de6e29b1 [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
2020-05-26 13:36:21 -07:00
Matt Arsenault bb10fa3a53 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.
2020-05-26 16:35:13 -04:00
Nicolas Vasilache c990bdf7f8 [mlir] Hotfix - Add inline to avoid multiple symbols on trivial functions 2020-05-26 16:24:56 -04:00
Nicolas Vasilache e900320759 [mlir] Hotfix - Drop spurious constexpr that breaks build 2020-05-26 16:21:31 -04:00
Jonas Devlieghere e1d2cecec5 [lldb/Test] Cleanup TestSymbolTable.py (NFC) 2020-05-26 13:17:43 -07:00
Chris Jackson bd7ff5d94f [DebugInfo] Correct debuginfo for post-ra hoist and sink in Machine LICM
Reviewers: vsk, aprantl

Differential Revision: https://reviews.llvm.org/D79868
2020-05-26 21:07:10 +01:00
Stanislav Mekhanoshin 42725aeed8 Process gep (select ptr1, ptr2) in SROA
Differential Revision: https://reviews.llvm.org/D79217
2020-05-26 12:56:02 -07:00
Nicolas Vasilache ba10daa820 [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
2020-05-26 15:40:55 -04:00
Shoaib Meenai e99d50d844 [Support] Remove stale comment
Clang has supported __builtin_assume_aligned since r217349 back in 2014,
so the comment is very out of date.
2020-05-26 12:22:03 -07:00
Matt Arsenault e09064e97f AMDGPU: Update store node checks for atomics
Prepare to switch to using StoreSDNode for atomic stores.
2020-05-26 15:20:03 -04:00
Pete Steinfeld c4dbe59ae8 [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
2020-05-26 12:17:20 -07:00
Stefanos Baziotis ef94f60ff7 [MSSA][Doc] Fix typo 2020-05-26 22:16:13 +03:00