platform/upstream/llvm.git
3 years agoReland "[DFSan] Handle fast16labels for all API functions."
Matt Morehouse [Thu, 23 Jul 2020 20:53:46 +0000 (20:53 +0000)]
Reland "[DFSan] Handle fast16labels for all API functions."

Support fast16labels in `dfsan_has_label`, and print an error for all
other API functions.  For `dfsan_dump_labels` we return silently rather
than crashing since it is also called from the atexit handler where it
is undefined behavior to call exit() again.

Reviewed By: kcc

Differential Revision: https://reviews.llvm.org/D84215

3 years ago[GlobalISel] Use existing MIR builder instead of creating one in combiner.
Amara Emerson [Thu, 23 Jul 2020 21:15:58 +0000 (14:15 -0700)]
[GlobalISel] Use existing MIR builder instead of creating one in combiner.

3 years ago[clang] Fix libdl linking for libclang in standalone mode
Tobias Hieta [Thu, 23 Jul 2020 21:10:22 +0000 (00:10 +0300)]
[clang] Fix libdl linking for libclang in standalone mode

Differential Revision: https://reviews.llvm.org/D81385

3 years ago[Loop Fusion] Integrate Loop Peeling into Loop Fusion (re-land after fixing ASAN...
Sidharth Baveja [Thu, 23 Jul 2020 21:02:04 +0000 (21:02 +0000)]
[Loop Fusion] Integrate Loop Peeling into Loop Fusion (re-land after fixing ASAN build failures)

This patch adds the ability to peel off iterations of the first loop in loop
fusion. This can allow for both loops to have the same trip count, making it
legal for them to be fused together.

Here is a simple scenario peeling can be used in loop fusion:

for (i = 0; i < 10; ++i)
  a[i] = a[i] + 3;
for (j = 1; j < 10; ++j)
  b[j] = b[j] + 5;

Here is we can make use of peeling, and then fuse the two loops together. We
can peel off the 0th iteration of the loop i, and then combine loop i and j for
i = 1 to 10.

a[0] = a[0] +3;
for (i = 1; i < 10; ++i) {
  a[i] = a[i] + 3;
  b[i] = b[i] + 5;
}

Currently peeling with loop fusion is only supported for loops with constant
trip counts and a single exit point. Both unguarded and guarded loops are
supported.

Reviewed By: bmahjour (Bardia Mahjour), MaskRay (Fangrui Song)

Differential Revision: https://reviews.llvm.org/D82927

3 years ago[ARM] Add predicated mla reduction patterns
David Green [Thu, 23 Jul 2020 20:47:59 +0000 (21:47 +0100)]
[ARM] Add predicated mla reduction patterns

Similar to 8fa824d7a3 but this time for MLA patterns, this selects
predicated vmlav/vmlava/vmlalv/vmlava instructions from
vecreduce.add(select(p, mul(x, y), 0)) nodes.

Differential Revision: https://reviews.llvm.org/D84102

3 years ago[lldb] Remove the user-defined copy-ctor in ConstString
Jonas Devlieghere [Thu, 23 Jul 2020 20:06:51 +0000 (13:06 -0700)]
[lldb] Remove the user-defined copy-ctor in ConstString

ConstString is essentially trivially copyable yet it has a user defined
copy constructor that copies its one member pointer. Remove it so it
qualifies as trivial in the eyes of the compiler.

This also fixes two unused variable warnings now that the compiler knows
that the constructor has no side-effects.

Differential revision: https://reviews.llvm.org/D84440

3 years ago[Bitcode] Avoid duplicating linker option when upgrading
Steven Wu [Thu, 23 Jul 2020 20:04:57 +0000 (13:04 -0700)]
[Bitcode] Avoid duplicating linker option when upgrading

Summary:
The upgrading path from old ModuleFlag based linker options to the new
NamedMetadata based linker option in in materializeMetadata() which gets
called once for the module and once for every GV. The linker options are
getting dup'ed every time and it can create massive amount of the linker
options in the object file that gets created from old bitcode. Fix the
problem by checking if the new option exists or not before upgrade
again.

rdar://64543389

Reviewers: pcc, t.p.northover, dexonsmith, arphaman

Reviewed By: arphaman

Subscribers: hiraditya, jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83688

3 years ago[SCCP] Add another switch+phi test (NFC)
Nikita Popov [Thu, 23 Jul 2020 19:50:47 +0000 (21:50 +0200)]
[SCCP] Add another switch+phi test (NFC)

3 years agoAdd new function properties to FunctionPropertiesAnalysis
Tarindu Jayatilaka [Thu, 23 Jul 2020 19:46:47 +0000 (12:46 -0700)]
Add new function properties to FunctionPropertiesAnalysis

 Added  LoadInstCount, StoreInstCount, MaxLoopDepth, LoopCount

Reviewed By: jdoerfert, mtrofin

Differential Revision: https://reviews.llvm.org/D82283

3 years agoAMDGPU: Fix failures from overflowing uint8_t number of operands
Matt Arsenault [Wed, 22 Jul 2020 23:22:34 +0000 (19:22 -0400)]
AMDGPU: Fix failures from overflowing uint8_t number of operands

If the operand index exceeded the limit of unsigned char, it wrapped
and would point to the wrong operand. Increase the size of the operand
index field to avoid this, and also don't bother trying to fold into
implicit operands.

3 years ago[libc] Remove unused #include <vector> in fmin_test, fminf_test, and fminl_test.
Tue Ly [Thu, 23 Jul 2020 19:26:05 +0000 (15:26 -0400)]
[libc] Remove unused #include <vector> in fmin_test, fminf_test, and fminl_test.

3 years ago[libc] Add implementations of fmax, fmaxf, and fmaxl.
Tue Ly [Thu, 23 Jul 2020 06:04:33 +0000 (02:04 -0400)]
[libc] Add implementations of fmax, fmaxf, and fmaxl.

Summary: Add implementations of fmax, fmaxf, and fmaxl.

Reviewers: sivachandra

Subscribers: mgorny, tschuett, libc-commits, ecnelises

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D84385

3 years agoscudo: Remove some boilerplate from the combined allocator tests. NFCI.
Peter Collingbourne [Thu, 23 Jul 2020 18:31:32 +0000 (11:31 -0700)]
scudo: Remove some boilerplate from the combined allocator tests. NFCI.

Differential Revision: https://reviews.llvm.org/D84454

3 years ago[libFuzzer] Expose fuzzer::FuzzerDriver()
Mitch Phillips [Thu, 23 Jul 2020 19:00:50 +0000 (12:00 -0700)]
[libFuzzer] Expose fuzzer::FuzzerDriver()

Summary:
Allows other-language libFuzzer derivatives to invoke the driver.

Patch By: Ian Eldred Pudney <ipudney@google.com>

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D84425

3 years ago[AArch64][GlobalISel] Add post-legalize combine for sext(trunc(sextload)) -> trunc...
Amara Emerson [Wed, 17 Jun 2020 18:55:53 +0000 (11:55 -0700)]
[AArch64][GlobalISel] Add post-legalize combine for sext(trunc(sextload)) -> trunc/copy

On AArch64 we generate redundant G_SEXTs or G_SEXT_INREGs because of this.

Differential Revision: https://reviews.llvm.org/D81993

3 years ago[SCCP] Add missing change reporting
Nikita Popov [Thu, 23 Jul 2020 18:58:03 +0000 (20:58 +0200)]
[SCCP] Add missing change reporting

Forgot to actually use the return value of the function.

3 years agoAdd a Printer to the FunctionPropertiesAnalysis
Tarindu Jayatilaka [Thu, 23 Jul 2020 18:56:56 +0000 (11:56 -0700)]
Add a Printer to the FunctionPropertiesAnalysis

 A printer pass and a lit test case was added.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D82523

3 years ago[IR] Add min/max/abs intrinsics
Nikita Popov [Sun, 19 Jul 2020 15:06:17 +0000 (17:06 +0200)]
[IR] Add min/max/abs intrinsics

This adds the llvm.abs(), llvm.umin(), llvm.umax(), llvm.smin(),
and llvm.smax() intrinsics specified in D81829. For SelectionDAG,
the ISD opcodes and all the legalization and lowering already exist,
so this just wires them up to the intrinsic in the SDAG builder and
adds rudimentary tests. For GlobalISel only the min/max intrinsics
are wired up, as llvm.abs() will require the addition of a G_ABS op,
and corresponding legalization support.

Differential Revision: https://reviews.llvm.org/D84125

3 years ago[LangRef] Add integer min/max/abs intrinsics
Roman Lebedev [Thu, 23 Jul 2020 18:45:50 +0000 (20:45 +0200)]
[LangRef] Add integer min/max/abs intrinsics

Add LangRef specification for the llvm.abs, llvm.umin, llvm.umax,
llvm.smin, and llvm.smax integer intrinsics.

Link to RFC:
https://lists.llvm.org/pipermail/llvm-dev/2020-June/142257.html

Proposed alive2 implementation:
https://github.com/AliveToolkit/alive2/pull/353

Differential Revision: https://reviews.llvm.org/D81829

3 years agoRefactor FunctionPropertiesAnalysis
Tarindu Jayatilaka [Thu, 23 Jul 2020 18:49:10 +0000 (11:49 -0700)]
Refactor FunctionPropertiesAnalysis

 this separates  `analyze` logic from  `FunctionPropertiesAnalysis`

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D82521

3 years agoAMDGPU/GlobalISel: Add some tests for stack passed pointers
Matt Arsenault [Wed, 8 Jul 2020 15:32:24 +0000 (11:32 -0400)]
AMDGPU/GlobalISel: Add some tests for stack passed pointers

3 years ago[SCCP] Directly remove non-feasible edges
Nikita Popov [Tue, 21 Jul 2020 19:26:30 +0000 (21:26 +0200)]
[SCCP] Directly remove non-feasible edges

Non-feasible control-flow edges are currently removed by replacing
the branch condition with a constant and then calling
ConstantFoldTerminator. This happens in a rather roundabout manner,
by inspecting the users (effectively: predecessors) of unreachable
blocks, and further complicated by the need to explicitly materialize
the condition for "forced" edges. I would like to extend SCCP to
discard switch conditions that are non-feasible based on range
information, but this is incompatible with the current approach
(as there is no single constant we could use.)

Instead, this patch explicitly removes non-feasible edges. It
currently only needs to handle the case where there is a single
feasible edge. The llvm_unreachable() branch will need to be
implemented for the aforementioned switch improvement.

Differential Revision: https://reviews.llvm.org/D84264

3 years agoAMDGPU/GlobalISel: Handle call return values
Matt Arsenault [Sun, 5 Jul 2020 20:15:36 +0000 (16:15 -0400)]
AMDGPU/GlobalISel: Handle call return values

The only case that I know doesn't work is the implicit sret case when
the return type doesn't fit in the return registers.

3 years ago[flang][openacc] Add missing comment in header
clementval [Thu, 23 Jul 2020 18:10:00 +0000 (14:10 -0400)]
[flang][openacc] Add missing comment in header

3 years ago[mlir][Linalg] Fixing bug in subview size computation in Linalg tiling.
MaheshRavishankar [Thu, 23 Jul 2020 17:20:54 +0000 (10:20 -0700)]
[mlir][Linalg] Fixing bug in subview size computation in Linalg tiling.

The `makeTiledViews` did not use the sizes of the tiled views based on
the result of the loop bound inference computation. This manifested as
an error in computing tile sizes with convolution where not all the
result expression of concatenated affine maps are simple
AffineDimExpr.

Differential Revision: https://reviews.llvm.org/D84366

3 years ago[libc++] Build the dylib with -faligned-allocation
Louis Dionne [Thu, 23 Jul 2020 15:05:47 +0000 (11:05 -0400)]
[libc++] Build the dylib with -faligned-allocation

This avoids issues when building the dylib for deployment targets that
don't support aligned allocation, where Clang normally triggers an
error to warn users their code would break at runtime when back-deployed.
Since we're building the dylib itself, which contains the aligned
allocation functions, we don't want to trigger that error.

Differential Revision: https://reviews.llvm.org/D84418

3 years agoRevert "[DFSan] Handle fast16labels for all API functions."
Matt Morehouse [Thu, 23 Jul 2020 17:48:10 +0000 (17:48 +0000)]
Revert "[DFSan] Handle fast16labels for all API functions."

This reverts commit 19d9c0397e61f2fb59a22d7c699436133a409aea due to
buildbot failure.

3 years ago[PredicateInfo][SCCP] Remove assertion (PR46814)
Nikita Popov [Thu, 23 Jul 2020 17:12:20 +0000 (19:12 +0200)]
[PredicateInfo][SCCP] Remove assertion (PR46814)

As long as RenamedOp is not guaranteed to be accurate, we cannot
assert here and should just return false. This was already done
for the other conditions in this function.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46814.

3 years ago[X86][SSE] Add additional (f)add(shuffle(x,y),shuffle(x,y)) tests for D83789
Simon Pilgrim [Thu, 23 Jul 2020 17:22:07 +0000 (18:22 +0100)]
[X86][SSE] Add additional (f)add(shuffle(x,y),shuffle(x,y)) tests for D83789

3 years ago[libFuzzer] Disable interceptor tests on non-Linux platforms.
Dokyung Song [Thu, 23 Jul 2020 16:31:12 +0000 (16:31 +0000)]
[libFuzzer] Disable interceptor tests on non-Linux platforms.

Summary: libFuzzer's interceptor support added in 831ae45e3dc609e43ba561af07670a8fe47461ef currently only works on Linux. This patch disables the test cases added as part of that commit on non-Linux platforms.

Reviewers: morehouse, hctim

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D84434

3 years ago[MSAN] Allow emitting checks for struct types
Gui Andrade [Thu, 23 Jul 2020 16:50:42 +0000 (16:50 +0000)]
[MSAN] Allow emitting checks for struct types

Differential Revision: https://reviews.llvm.org/D82680

3 years agoRegionInfo.cpp - remove duplicate includes that already exist in RegionInfo.h. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 16:50:00 +0000 (17:50 +0100)]
RegionInfo.cpp - remove duplicate includes that already exist in RegionInfo.h. NFC.

Also remove some unnecessary forward declarations in RegionInfo.h.

3 years ago[MSAN] Never allow checking calls to __sanitizer_unaligned_{load,store}
Gui Andrade [Thu, 23 Jul 2020 16:36:19 +0000 (16:36 +0000)]
[MSAN] Never allow checking calls to __sanitizer_unaligned_{load,store}

These functions expect the caller to always pass shadows over TLS.

Differential Revision: https://reviews.llvm.org/D84351

3 years ago[libc++abi] Also build the static archive with C++17
Louis Dionne [Thu, 23 Jul 2020 16:39:38 +0000 (12:39 -0400)]
[libc++abi] Also build the static archive with C++17

The dylib and the static archive should really be built using the same
Standard, it was just an oversight.

3 years ago[lldb] Make socket_packet_pump.py work in Python3
Raphael Isemann [Thu, 23 Jul 2020 16:35:40 +0000 (18:35 +0200)]
[lldb] Make socket_packet_pump.py work in Python3

Summary:

The `string_escape` encoding used here was removed in Python 3 which makes the
test crash during tearDown:

```
  File "lldb/third_party/Python/module/unittest2/unittest2/case.py", line 386, in run
    self.tearDown()
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 124, in tearDown
    self._pump_queues.verify_queues_empty()
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py", line 55, in verify_queues_empty
    _dump_queue(self.packet_queue())
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py", line 28, in _dump_queue
    print(codecs.encode(the_queue.get(True), "string_escape"))
LookupError: unknown encoding: string_escape
```

Just replace it with `repr` which should work in both Python versions.

Reviewers: labath, JDevlieghere

Reviewed By: labath, JDevlieghere

Subscribers: JDevlieghere

Differential Revision: https://reviews.llvm.org/D84017

3 years ago[lldb][NFC] Remove FormatMap
Raphael Isemann [Thu, 23 Jul 2020 16:18:25 +0000 (18:18 +0200)]
[lldb][NFC] Remove FormatMap

Summary:

FormattersContainer.h has two containers: FormatMap and FormattersContainer
itself. FormatMap is essentially just a SetVector with a listener interface that
is aspiring to be thread-safe as most of its functions lock its member mutex.

FormattersContainer is for the most part just calling the matching functions of
internal FormatMap instance and essentially acts as a wrapper class with some
minor formatter search functionality on top. The only difference is that the
FormattersContainer's public `Get` function is actually searching formatters in
the list of formatters (and for example doing regex-matching) while FormatMap's
`Get` function is just looking up a a format by the type matcher string.

This patch deletes `FormatMap` by just renaming it to `FormattersContainer` and
pulling in the two `Get` functions from the original `FormattersContainer`
class.

The only other user of `FormatMap` was the `NamedSummariesMap` in the
`FormatManager` which I migrated by just making it also a `FormattersContainer`
and replaced the only call to the `Get` function (which now has new semantics)
with `GetExact` (which is FormattersContainer's function that has the semantics
of FormatMap's `Get`). As `NamedSummariesMap` only stores non-regex-based
formatters, both `Get` and `GetExact` would have worked, so this was mostly to
clarify that this is supposed to be NFC.

I also added the missing mutex lock in the `GetCount` function which was
previously missing in the `FormatMap` implementation. Technically not "NFC" but
I anyway had to change the function...

Reviewers: labath, mib

Reviewed By: labath

Subscribers: abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D84296

3 years ago[MSAN] Mark libatomic test unsupported on PowerPC
Gui Andrade [Thu, 23 Jul 2020 16:30:49 +0000 (16:30 +0000)]
[MSAN] Mark libatomic test unsupported on PowerPC

3 years ago[IPSCCP] Add test case for PR46717 for argmemonly handling.
Florian Hahn [Thu, 23 Jul 2020 16:17:40 +0000 (17:17 +0100)]
[IPSCCP] Add test case for PR46717 for argmemonly handling.

3 years agoReland [lldb] Unify type name matching in FormattersContainer II
Raphael Isemann [Tue, 21 Jul 2020 16:44:16 +0000 (18:44 +0200)]
Reland [lldb] Unify type name matching in FormattersContainer II

This was originally reverted because the m_valid member in TypeMatcher was
unused in builds with disabled asserts. Now the member is gone and the default
constructor is deleted (thanks Eric for the idea!).

Summary:

FormattersContainer stores LLDB's formatters. It's implemented as a templated
map-like data structures that supports any kind of value type and only allows
ConstString and RegularExpression as the key types. The keys are used for
matching type names (e.g., the ConstString key `std::vector` matches the type
with the same name while RegularExpression keys match any type where the
RegularExpression instance matches).

The fact that a single FormattersContainer can only match either by string
comparison or regex matching (depending on the KeyType) causes us to always have
two FormatterContainer instances in all the formatting code. This also leads to
us having every type name matching logic in LLDB twice. For example,
TypeCategory has to implement every method twice (one string matching one, one
regex matching one).

This patch changes FormattersContainer to instead have a single `TypeMatcher`
key that wraps the logic for string-based and regex-based type matching and is
now the only possible KeyType for the FormattersContainer. This means that a
single FormattersContainer can now match types with both regex and string
comparison.

To summarize the changes in this patch:
* Remove all the `*_Impl` methods from `FormattersContainer`
* Instead call the FormatMap functions from `FormattersContainer` with a
  `TypeMatcher` type that does the respective matching.
* Replace `ConstString` with `TypeMatcher` in the few places that directly
  interact with `FormattersContainer`.

I'm working on some follow up patches that I split up because they deserve their
own review:

* Unify FormatMap and FormattersContainer (they are nearly identical now).
* Delete the duplicated half of all the type matching code that can now use one
  interface.
* Propagate TypeMatcher through all the formatter code interfaces instead of
  always offering two functions for everything.

There is one ugly design part that I couldn't get rid of yet and that is that we
have to support getting back the string used to construct a `TypeMatcher` later
on. The reason for this is that LLDB only supports referencing existing type
matchers by just typing their respective input string again (without even
supplying if it's a regex or not).

Reviewers: davide, mib

Reviewed By: mib

Subscribers: mgorny, JDevlieghere

Differential Revision: https://reviews.llvm.org/D84151

3 years agoCSEInfo.h - remove unused includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 16:16:00 +0000 (17:16 +0100)]
CSEInfo.h - remove unused includes. NFC.

3 years ago[X86] Add Feature64Bit to the 'generic' CPU and remove feature string hacking in...
Craig Topper [Thu, 23 Jul 2020 15:52:06 +0000 (08:52 -0700)]
[X86] Add Feature64Bit to the 'generic' CPU and remove feature string hacking in X86Subtarget constructor

Feature64Bit is only used by a check in the X86Subtarget
constructor to ensure that the CPU selected supports 64-bit mode
when the triple is for 64-bit mode.

'generic' is the default CPU in llc and so needs to be able to
pass this check. Previously we did this by detecting the name and
adding the feature to the feature string. But there doesn't seem
to be any reason we can't just add the feature to the CPU directly.

3 years ago[flang] Fix a crash when a BOZ literal is used as a relational operator
Pete Steinfeld [Wed, 15 Jul 2020 23:02:49 +0000 (16:02 -0700)]
[flang] Fix a crash when a BOZ literal is used as a relational operator

Summary:
Expressions like `iVar==z'fe'` were causing an assertion error  because
the `Relate()` function in `Evaluate/tools.cpp` that processes
relational operators didn't deal with BOZ literals, which are typeless.
I fixed this by checking to see if the operands are BOZ literals.  If
so, if the other operand is REAL, I convert them to REAL.  Otherwise, I convert
them to integers with default kind.

I also added a test to resolve63.f90 that triggers the problem.

Reviewers: tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83917

3 years ago[lldb] Pass ConstString by value (again) (NFC)
Jonas Devlieghere [Thu, 23 Jul 2020 15:54:56 +0000 (08:54 -0700)]
[lldb] Pass ConstString by value (again) (NFC)

This reverts "Eliminate unneeded value parameters in Utility" for
ConstString. As Pavel pointed out on the mailing list, the class *is*
trivially copyable.

3 years ago[Bitcode] Drop invalid branch_weight in BitcodeReader
Steven Wu [Thu, 23 Jul 2020 16:06:47 +0000 (09:06 -0700)]
[Bitcode] Drop invalid branch_weight in BitcodeReader

Summary:
If bitcode reader gets an invalid branch weight, drop that from the
inputs. This allows us to read the broken modules we generated before
the verifier was able to catch this.

rdar://64870641

Reviewers: yrouban, t.p.northover, dexonsmith, arphaman, aprantl

Reviewed By: aprantl

Subscribers: aprantl, hiraditya, jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83699

3 years agoRecommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes...
Dokyung Song [Thu, 16 Jul 2020 20:26:03 +0000 (20:26 +0000)]
Recommit "[libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked."

Summary: libFuzzer intercepts certain library functions such as memcmp/strcmp by defining weak hooks. Weak hooks, however, are called only when other runtimes such as ASan is linked. This patch defines libFuzzer's own interceptors, which is linked into the libFuzzer executable when other runtimes are not linked, i.e., when -fsanitize=fuzzer is given, but not others.

The patch once landed but was reverted in 8ef9e2bf355d05bc81d8b0fe1e5333eec59a0a91 due to an assertion failure caused by calling an intercepted function, strncmp, while initializing the interceptors in fuzzerInit(). This issue is now fixed by calling libFuzzer's own implementation of library functions (i.e., internal_*) when the fuzzer has not been initialized yet, instead of recursively calling fuzzerInit() again.

Reviewers: kcc, morehouse, hctim

Subscribers: #sanitizers, krytarowski, mgorny, cfe-commits

Tags: #clang, #sanitizers

Differential Revision: https://reviews.llvm.org/D83494

3 years ago[DFSan] Print more debugging info on test failure.
Matt Morehouse [Thu, 23 Jul 2020 15:46:44 +0000 (15:46 +0000)]
[DFSan] Print more debugging info on test failure.

3 years ago[lldb] Make deleting frame recognizers actually work
Raphael Isemann [Thu, 23 Jul 2020 15:25:17 +0000 (17:25 +0200)]
[lldb] Make deleting frame recognizers actually work

Summary:

Frame recognizers are stored alongside a flag that indicates whether they were
deleted by the user. If the flag is set, they are supposed to be ignored by the
rest of the frame recognizer code. 'frame recognizer delete' is supposed to set
that flag. 'frame recognizer clear' however actually deletes all frame
recognizers (so, it doesn't set the flag but directly deletes them from the
list).

The current implementation of this concept is pretty broken. `frame recognizer
delete` sets the flag, but it somehow thinks that the recognizer id is an index
in the recognizer list. That's not true as it's actually just a member of each
recognizer entry. So it actually just sets the `deleted` flag for a random other
recognizer. The tests for the recognizer still pass as `frame recognizer list`
is also broken and just completely ignored the `deleted` flag and lists all
recognizers. Also `frame recognizer delete` just ignores if it can't actually
delete a recognizer if the id is invalid.

I think we can simplify this whole thing by just actually deleting recognizers
instead of making sure all code is actually respecting the `deleted` flag. I
assume the intention of this was to make sure that all recognizers are getting
unique ids over the course of an LLDB session, but as `clear` is actually
deleting them and we keep recycling ids, that didn't really work to begin with.

This patch deletes the `deleted` flag and just actually deletes the stored
recognizer. Also adds the missing error message in case it find a recognizer
with a given id.

Reviewers: mib

Reviewed By: mib

Subscribers: abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D84404

3 years ago[llvm][NFC] Add comments and common-case API to MachineBlockFrequencyInfo
Mircea Trofin [Thu, 23 Jul 2020 15:42:34 +0000 (08:42 -0700)]
[llvm][NFC] Add comments and common-case API to MachineBlockFrequencyInfo

Clarify the relation between a block's BlockFrequency and the
getEntryFreq() API, and added an API for the relatively common case of
finding a block's frequency relative to the entrypoint.

Added / moved some comments to header.

Differential Revision: https://reviews.llvm.org/D84357

3 years ago[libc++abi] Build the dylib with C++17, like for libc++
Louis Dionne [Thu, 23 Jul 2020 15:35:04 +0000 (11:35 -0400)]
[libc++abi] Build the dylib with C++17, like for libc++

3 years ago[X86][docs] Add mention of removal of 'mpx' backend feature to the release notes.
Craig Topper [Thu, 23 Jul 2020 15:24:45 +0000 (08:24 -0700)]
[X86][docs] Add mention of removal of 'mpx' backend feature to the release notes.

I removed the feature from X86.td in ebe5f17f9c396f14742a7c747951b65eaada158e

3 years ago[VectorCombine] add tests for load vectorization; NFC
Sanjay Patel [Thu, 23 Jul 2020 14:35:03 +0000 (10:35 -0400)]
[VectorCombine] add tests for load vectorization; NFC

3 years agoGISelKnownBits.h - remove unused includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 14:52:16 +0000 (15:52 +0100)]
GISelKnownBits.h - remove unused includes. NFC.

3 years agoAggressiveInstCombine.h - remove unused includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 14:47:53 +0000 (15:47 +0100)]
AggressiveInstCombine.h - remove unused includes. NFC.

3 years agoPassTimingInfo.h - remove unused includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 14:42:25 +0000 (15:42 +0100)]
PassTimingInfo.h - remove unused includes. NFC.

Remove duplicate includes from PassTimingInfo.cpp that already exist in PassTimingInfo.h

3 years ago[ELF] Support -r --gc-sections
Fangrui Song [Thu, 23 Jul 2020 15:16:01 +0000 (08:16 -0700)]
[ELF] Support -r --gc-sections

-r --gc-sections is usually not useful because it just makes intermediate output
smaller. https://bugs.llvm.org/show_bug.cgi?id=46700#c7 mentions a use case:
validating the absence of undefined symbols ealier than in the final link.

After D84129 (SHT_GROUP support in -r links), we can support -r
--gc-sections without extra code. So let's allow it.

Reviewed By: grimar, jhenderson

Differential Revision: https://reviews.llvm.org/D84131

3 years ago[gn build] Port 92874d28669
LLVM GN Syncbot [Thu, 23 Jul 2020 15:07:01 +0000 (15:07 +0000)]
[gn build] Port 92874d28669

3 years ago[CodeGen][TargetPassConfig] Add unreachable-mbb-elimination pass explicitly
Evgeny Leviant [Thu, 23 Jul 2020 15:05:11 +0000 (18:05 +0300)]
[CodeGen][TargetPassConfig] Add unreachable-mbb-elimination pass explicitly

Differential revision: https://reviews.llvm.org/D84228

3 years ago[Matrix] Add asserts for mismatched element types.
Braedy Kuzma [Thu, 23 Jul 2020 14:57:22 +0000 (15:57 +0100)]
[Matrix] Add asserts for mismatched element types.

This patch clarifies the failing point of having input or output vectors
of differing types. Before, lowering would fail elsewhere (e.g. in
`fmul` creation) which may have been not immediately clear.

As a side effect, the `getElementType` and `getVectoryTy` functions
required the `const` qualifier to be added.

Reviewers: fhahn

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D84374

3 years ago[AMDGPU] Fix typo. NFC
Sebastian Neubauer [Thu, 23 Jul 2020 14:58:16 +0000 (16:58 +0200)]
[AMDGPU] Fix typo. NFC

3 years ago[DWARFYAML] Refactor emitDebugInfo() to make the length be inferred.
Xing GUO [Thu, 23 Jul 2020 15:00:19 +0000 (23:00 +0800)]
[DWARFYAML] Refactor emitDebugInfo() to make the length be inferred.

This patch refactors `emitDebugInfo()` to make the length field be
inferred from its content. Besides, the `Visitor` class is removed in
this patch. The original `Visitor` class helps us determine an
appropriate length and emit the .debug_info section. These two
processes can be merged into one process. Besides, the length field
should be inferred when it's missing rather than when it's zero.

Reviewed By: jhenderson, labath

Differential Revision: https://reviews.llvm.org/D84008

3 years ago[DWARFYAML] Pull out common helper functions for rnglist and loclist tables. NFC.
Xing GUO [Thu, 23 Jul 2020 14:57:30 +0000 (22:57 +0800)]
[DWARFYAML] Pull out common helper functions for rnglist and loclist tables. NFC.

This patch helps pull out some common helper functions for range list
and location list tables. NFC.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D84383

3 years ago[mlir]: NFC: Fix trivial typo in documents and comments
Kazuaki Ishizaki [Thu, 23 Jul 2020 14:40:35 +0000 (23:40 +0900)]
[mlir]: NFC: Fix trivial typo in documents and comments

Differential Revision: https://reviews.llvm.org/D84400

3 years ago[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add SSE shift multiple use handling
Simon Pilgrim [Thu, 23 Jul 2020 13:09:31 +0000 (14:09 +0100)]
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add SSE shift multiple use handling

Add SimplifyMultipleUseDemandedVectorElts peek through for imm/var SSE shifts

3 years ago[SystemZ] Ensure -mno-vx disables any use of vector features
Ulrich Weigand [Thu, 23 Jul 2020 13:31:15 +0000 (15:31 +0200)]
[SystemZ] Ensure -mno-vx disables any use of vector features

When passing the -vector feature to LLVM (or equivalently the
-mno-vx command line argument to clang), the intent is that
generated code must not use any vector features (in particular,
no vector registers must be used).

However, there are some cases where we still could generate
such uses; these are all related to some of the additional
vector features (like +vector-enhancements-1).  Since none
of those features are actually usable with -vector, just make
sure we disable them all if -vector is given.

3 years ago[SCEVExpander] Use IRBuilderCallbackInserter to call rememberInstruction.
Florian Hahn [Thu, 23 Jul 2020 13:19:01 +0000 (14:19 +0100)]
[SCEVExpander] Use IRBuilderCallbackInserter to call rememberInstruction.

Currently there are plenty of instructions that SCEVExpander creates but
does not track as created. IRBuilder allows specifying a callback
whenever an instruction is inserted. Use this to call
rememberInstruction automatically for each created instruction.

There are still a few rememberInstruction calls remaining, because in
some cases Inst::Create functions are used to construct instructions.

Suggested by @lebedev.ri in D75980.

Reviewers: mkazantsev, reames, sanjoy.google, lebedev.ri

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D84326

3 years ago[docs] Fix TestSuiteGuide.md to mention scipy
Russell Gallop [Tue, 23 Jun 2020 13:50:11 +0000 (14:50 +0100)]
[docs] Fix TestSuiteGuide.md to mention scipy

This has been required since https://reviews.llvm.org/D57828.

Differential Revision: https://reviews.llvm.org/D82379

3 years ago[libcxx] Adjust trivial_abi tests for C++03 and C++11 testing
Mikhail Maltsev [Thu, 23 Jul 2020 13:20:30 +0000 (14:20 +0100)]
[libcxx] Adjust trivial_abi tests for C++03 and C++11 testing

This change replaces std::make_unique with manual construction of
std::unique_ptr to make the tests compatible with C++11
(std::make_unique is a C++14 feature).

libc++ supports std::unique_ptr and std::shared_ptr even in C++03 but
with some limitations: unique_ptr_array.pass.cpp and
shared_ptr_arg.pass.cpp fail to compile in C++03 mode and need to be
disabled.

Differential Revision: https://reviews.llvm.org/D84394

3 years ago[GlobalISel][AMDGPU] Legalize saturating add/subtract
Jay Foad [Sun, 12 Jul 2020 18:18:45 +0000 (14:18 -0400)]
[GlobalISel][AMDGPU] Legalize saturating add/subtract

Add support in LegalizerHelper for lowering G_SADDSAT etc. either
using add/subtract-with-overflow or using max/min instructions.

Enable this lowering for AMDGPU so it can be tested. The legalization
rules are still approximate and skips out on using the clamp bit to
treat these as legal, which has never been used before. This also
doesn't yet try to deal with expanding SALU cases.

3 years ago[LSR] Re-generate check lines for test.
Florian Hahn [Thu, 23 Jul 2020 12:26:22 +0000 (13:26 +0100)]
[LSR] Re-generate check lines for test.

The test is quite frafile, as the check lines match IR numbers and it is
not obvious why only a very small subset is checked.

Re-generate check lines, so further changes are more obvious.

3 years ago[LoopIdiom] Add additional test cases.
Florian Hahn [Thu, 23 Jul 2020 09:20:55 +0000 (10:20 +0100)]
[LoopIdiom] Add additional test cases.

3 years agoUpdate make_cxx_dr_status and cxx_dr_status.html for the new release.
Erich Keane [Thu, 23 Jul 2020 12:50:10 +0000 (05:50 -0700)]
Update make_cxx_dr_status and cxx_dr_status.html for the new release.

Our latest release is now 11, so update the make_cxx_dr_status and
regenerate the cxx_dr_status.html document.

3 years ago[InstSimplify] reduce code duplication for binop expansion; NFC
Sanjay Patel [Thu, 23 Jul 2020 12:33:45 +0000 (08:33 -0400)]
[InstSimplify] reduce code duplication for binop expansion; NFC

D84250 proposes to extend this code, so the duplication for
the commuted case would continue to grow.

3 years agoFix -Wparentheses warning - add missing brackets around the entire assertion condition
Simon Pilgrim [Thu, 23 Jul 2020 11:51:18 +0000 (12:51 +0100)]
Fix -Wparentheses warning - add missing brackets around the entire assertion condition

3 years agoRecommit "[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append...
Pavel Labath [Mon, 6 Jul 2020 14:44:37 +0000 (16:44 +0200)]
Recommit "[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)"

The patch was reverted 27d52cd86a2c because of failures in
TestWeakSymbols.py. These have now been addressed in D83552.

The original commit message was:
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.

Differential Revision: https://reviews.llvm.org/D83306

3 years ago[Attributor] Cache query results for isPotentiallyReachable in AAReachability
Shinji Okumura [Thu, 23 Jul 2020 11:26:30 +0000 (20:26 +0900)]
[Attributor] Cache query results for isPotentiallyReachable in AAReachability

Summary:
This is the next patch of [[ https://reviews.llvm.org/D76210 | D76210 ]].
This patch made a map in `InformationCache` for caching results.

Reviewers: jdoerfert, sstefan1, uenoku, homerdin, baziotis

Reviewed By: jdoerfert

Subscribers: hiraditya, uenoku, kuter, bbn, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83246

3 years ago[GlobalISel][InlineAsm] Add register class ID to the flags of register input operands
Konstantin Schwarz [Tue, 30 Jun 2020 13:59:55 +0000 (15:59 +0200)]
[GlobalISel][InlineAsm] Add register class ID to the flags of register input operands

Summary: We do this already for output operands, but missed it for (non-tied) input operands.

Reviewers: arsenm, Petar.Avramovic

Reviewed By: arsenm

Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, llvm-commits, kerbowa

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83763

3 years agoFix implicit dependency on CommandLine.h
Simon Pilgrim [Thu, 23 Jul 2020 11:32:53 +0000 (12:32 +0100)]
Fix implicit dependency on CommandLine.h

3 years agoValueProfileCollector.h - remove unnecessary includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 11:31:12 +0000 (12:31 +0100)]
ValueProfileCollector.h - remove unnecessary includes. NFC.

3 years ago[lldb/test] Fix TestHistoryRecall failure (NFC)
Med Ismail Bennani [Thu, 23 Jul 2020 11:21:26 +0000 (13:21 +0200)]
[lldb/test] Fix TestHistoryRecall failure (NFC)

This patch fixes a test failure in TestHistoryRecall caused by the move
of the `history` subcommand to the `session` command.

This change was introduced by commit 85fbb08fa2ac5195dc7a2f13eea7de1471da2a21.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years agoFix implicit dependency on CommandLine.h
Simon Pilgrim [Thu, 23 Jul 2020 11:14:35 +0000 (12:14 +0100)]
Fix implicit dependency on CommandLine.h

3 years ago[lldb/interpreter] Move the history subcommand to session (NFCI)
Med Ismail Bennani [Wed, 22 Jul 2020 11:07:12 +0000 (13:07 +0200)]
[lldb/interpreter] Move the history subcommand to session (NFCI)

This patch moves the `history` subcommand from the `command` to `session`
command. I think it makes more sense to have it there because as the `command`
usage suggests, it should be used to manage custom LLDB commands.

However, `history` is essentially tied to a debugging session and holds
all the commands (not specifically custom ones).

This also makes it more discoverable by adding an alias for it (mimicking
the shell builtin).

Differential Revision: https://reviews.llvm.org/D84307

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years agoSpeculation.h - remove unnecessary includes. NFC.
Simon Pilgrim [Thu, 23 Jul 2020 10:54:10 +0000 (11:54 +0100)]
Speculation.h - remove unnecessary includes. NFC.

3 years ago[ScheduleDAGRRList] Pacify overload mismatch in std::min.
Florian Hahn [Thu, 23 Jul 2020 10:54:38 +0000 (11:54 +0100)]
[ScheduleDAGRRList] Pacify overload mismatch in std::min.

On systems where size() doesn't return unsigned long, this leads to an
overloading mismatch. Convert the constant to whatever type is used for
Q.size() on the system.

3 years ago[ScheduleDAGRRList] Limit number of candidates to explore.
Florian Hahn [Thu, 23 Jul 2020 09:14:32 +0000 (10:14 +0100)]
[ScheduleDAGRRList] Limit number of candidates to explore.

Currently popFromQueueImpl iterates over all candidates to find the best
one. While the candidate queue is small, this is not a problem. But it
becomes a problem once the queue gets larger. For example, the snippet
below takes 330s to compile with llc -O0, but completes in 3s with this
patch.

define void @test(i4000000* %ptr) {
entry:
  store i4000000 0, i4000000* %ptr, align 4
  ret void
}

This patch limits the number of candidates to check to 1000. This limit
ensures that it never triggers for test-suite/SPEC2000/SPEC2006 on X86
and AArch64 with -O3, while still drastically limiting the compile-time
in case of very large queues.

It would be even better to use a binary heap to manage to queue
(D83335), but some heuristics change the score of a node in the queue
after another node has been scheduled. I plan to address this for
backends that use the MachineScheduler in the future, but that requires
a more careful evaluation. In the meantime, the limit should help users
impacted by this issue.

The patch includes a slightly smaller version of the motivating example
as test case, to guard against the issue.

Reviewers: efriedma, paquette, niravd

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D84328

3 years ago[mlir][Linalg] emitLoopRanges and emitLoopRangesWithSymbols merged into one
Jakub Lichman [Thu, 23 Jul 2020 10:27:46 +0000 (12:27 +0200)]
[mlir][Linalg] emitLoopRanges and emitLoopRangesWithSymbols merged into one

Right now there is a branching for 2 functions based on whether target map has
symbols or not. In this commit these functions are merged into one.
Furthermore, emitting does not require inverse and map applying as it computes
the correct Range in a single step and thus reduces unnecessary overhead.

Differential Revision: https://reviews.llvm.org/D83756

3 years ago[mlir] Added verification check for linalg.conv to ensure memrefs are of rank > 2
Jakub Lichman [Thu, 23 Jul 2020 10:26:05 +0000 (12:26 +0200)]
[mlir] Added verification check for linalg.conv to ensure memrefs are of rank > 2

linalg.conv does not support memrefs with rank smaller than 3 as stated here:
https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nn/convolution

However it does not verify it and thus crashes with "LLVM ERROR: out of memory"
error for 1D case and "nWin > 0 && "expected at least one window dimension"" assertion
for 2D case. This commit adds check for that in the verification method.

Differential Revision: https://reviews.llvm.org/D84317

3 years ago[lit] Include total elapsed time in xunit output
Alex Richardson [Thu, 23 Jul 2020 09:45:55 +0000 (10:45 +0100)]
[lit] Include total elapsed time in xunit output

The time= attribute can also be used for the testsuites tag. While this
attribute appears to be ignored by Jenkins (https://github.com/jenkinsci/junit-plugin/blob/bab34bcc96154a494f8c371953efe06d45813f67/src/main/java/hudson/tasks/junit/SuiteResult.java#L202),
it is still useful if you manually inspect the xml file.

Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D84230

3 years ago[libcxx][lit] Fix incorrect lambda capture in hasLocale checks
Alex Richardson [Thu, 23 Jul 2020 09:45:25 +0000 (10:45 +0100)]
[libcxx][lit] Fix incorrect lambda capture in hasLocale checks

The lambda being used to check whether locales are supported was always
passing the value of alts from the last loop iteration due to the way that
python lambda captures work. Fix this by using a default argument capture.

To help debug future similar issues I also added a prefix to the config
test binary indicating which locale is being tested.
I originally found this issue when implementing a new executor that simply
collects test binaries in a given directory and was surprised to see many
additional executables other than the expected test binaries. I therefore
added the locale prefix to the test binaries and noticed that they were all
checking for cs_CZ.ISO8859-2.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84040

3 years ago[llvm-readelf] - Simplify the implementation of getSectionTypeString() helper. NFCI.
Georgii Rymar [Wed, 22 Jul 2020 14:44:32 +0000 (17:44 +0300)]
[llvm-readelf] - Simplify the implementation of getSectionTypeString() helper. NFCI.

It is used for printing section headers in the GNU style
and the implementation can be simplified.

Differential revision: https://reviews.llvm.org/D84330

3 years ago[Analyzer][StreamChecker] Use BugType::SuppressOnSink at resource leak report.
Balázs Kéri [Thu, 23 Jul 2020 08:53:16 +0000 (10:53 +0200)]
[Analyzer][StreamChecker] Use BugType::SuppressOnSink at resource leak report.

Summary:
Use the built-in functionality BugType::SuppressOnSink
instead of a manual solution in StreamChecker.

Differential Revision: https://reviews.llvm.org/D83120

3 years ago[DebugInfo] Attempt to fix regression test failure after 59a76d957a2603ee0
Sourabh Singh Tomar [Thu, 23 Jul 2020 09:13:24 +0000 (14:43 +0530)]
[DebugInfo] Attempt to fix regression test failure after 59a76d957a2603ee0

Test case `test/CodeGen/WebAssembly/stackified-debug.ll`
was failing due to malformed DwarfExpression.

This failure has been seen in lot of bots, for instance in:
http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/18794

: 'RUN: at line 1'
/home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/build/bin/llc
/home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/build/bin/FileCheck /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/test/CodeGen/WebAssembly/stackified-debug.ll
home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/test/CodeGen/WebAssembly/stackified-debug.ll:26:10: error: CHECK: expected string not found in input
 CHECK: .int16 4 # Loc expr size
         ^
<stdin>:34:2: note: scanning from here
 .int16 3 # Loc expr size

Differential Revision: https://reviews.llvm.org/D83560

3 years ago[mlir] Loop bounds inference in linalg.generic op improved to support bounds for...
Jakub Lichman [Thu, 23 Jul 2020 08:58:21 +0000 (10:58 +0200)]
[mlir] Loop bounds inference in linalg.generic op improved to support bounds for convolution

Loop bound inference is right now very limited as it supports only permutation maps and thus
it is impossible to implement convolution with linalg.generic as it requires more advanced
loop bound inference. This commits solves it for the convolution case.

Depends On D83158

Differential Revision: https://reviews.llvm.org/D83191

3 years agoRe-apply:" Emit DW_OP_implicit_value for Floating point constants"
Sourabh Singh Tomar [Thu, 23 Jul 2020 01:51:06 +0000 (07:21 +0530)]
Re-apply:" Emit DW_OP_implicit_value for Floating point constants"

This patch was reverted in 9d2da6759b4d due to assertion failure seen
in `test/DebugInfo/Sparc/subreg.ll`. Assertion failure was happening
due to malformed/unhandeled DwarfExpression.

Differential Revision: https://reviews.llvm.org/D83560

3 years ago[Reduce] Rewrite runDeltaPass() workloop: do reduce a single and/or last target
Roman Lebedev [Thu, 23 Jul 2020 07:51:09 +0000 (10:51 +0300)]
[Reduce] Rewrite runDeltaPass() workloop: do reduce a single and/or last target

Summary:
If there was a single target to begin with, because a single target
can only occupy a single chunk, we couldn't increase granularity.
and would immediately give up.

Likewise, if we had multiple targets, if by the end we'd end up with
a single target, we wouldn't finish reducing it, it would always
end up being "interesting"

Reviewers: dblaikie, nickdesaulniers, diegotf

Reviewed By: dblaikie

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D84318

3 years agoTemporarily Revert "Reland [lldb] Unify type name matching in FormattersContainer"
Eric Christopher [Thu, 23 Jul 2020 07:46:03 +0000 (00:46 -0700)]
Temporarily Revert "Reland [lldb] Unify type name matching in FormattersContainer"
as it breaks bots with due to m_valid being an unused class member
except in assert builds.

This reverts commit 074b121642b286afb16adeebda5ec8236f7b8ea9.

3 years ago[compiler-rt][sanitizers] Fix Solaris madvise declaration
Rainer Orth [Thu, 23 Jul 2020 07:37:14 +0000 (09:37 +0200)]
[compiler-rt][sanitizers] Fix Solaris madvise declaration

A last-minute silent change in  D84046 <https://reviews.llvm.org/D84046> broke the Solaris buildbots (Solaris/sparcv9 <http://lab.llvm.org:8014/builders/clang-solaris11-sparcv9/builds/6772>, Solaris/amd64 <http://lab.llvm.org:8014/builders/clang-solaris11-amd64/builds/5434>):

  [2/3679] Building CXX object projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.sparc.dir/sanitizer_posix_libcdep.cpp.o
  FAILED: projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.sparc.dir/sanitizer_posix_libcdep.cpp.o
  /opt/llvm-buildbot/bin/c++  -DHAVE_RPC_XDR_H=1 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/sanitizer_common -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/sanitizer_common -Iinclude -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/include -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/include/llvm/Support/Solaris -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/sanitizer_common/.. -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -std=c++14 -Wno-unused-parameter -O3     -m32 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -UNDEBUG -std=c++14 -MD -MT projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.sparc.dir/sanitizer_posix_libcdep.cpp.o -MF projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.sparc.dir/sanitizer_posix_libcdep.cpp.o.d -o projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonLibc.sparc.dir/sanitizer_posix_libcdep.cpp.o -c /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
  /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:50:16: error: conflicting declaration of C function ‘int madvise(caddr_t, std::size_t, int)’
   extern "C" int madvise(caddr_t, size_t, int);
                  ^~~~~~~
  In file included from /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp:32:0:
  /usr/include/sys/mman.h:232:12: note: previous declaration ‘int madvise(void*, std::size_t, int)’
   extern int madvise(void *, size_t, int);
              ^~~~~~~

This patch undoes that change.

Tested on `amd64-pc-solaris2.11` (Solaris 11.4 and OpenIndiana).

Differential Revision: https://reviews.llvm.org/D84388

3 years ago[mlir] [VectorOps] Improve scatter/gather CPU performance
aartbik [Thu, 23 Jul 2020 06:47:33 +0000 (23:47 -0700)]
[mlir] [VectorOps] Improve scatter/gather CPU performance

Replaced the linearized address with the proper LLVM way of
defining vector of base + indices in SIMD style. This yields
much better code. Some prototype results with microbencmarking
sparse matrix x vector with 50% sparsity (about 2-3x faster):

         LINEARIZED     IMPROVED
GFLOPS  sdot  saxpy     sdot saxpy
16x16    1.6   1.4       4.4  2.1
32x32    1.7   1.6       5.8  5.9
64x64    1.7   1.7       6.4  6.4
128x128  1.7   1.7       5.9  5.9
256x256  1.6   1.6       6.1  6.0
512x512  1.4   1.4       4.9  4.7

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D84368

3 years ago[Windows] Fix limit on command line size
Serge Pavlov [Tue, 14 Jul 2020 10:57:04 +0000 (17:57 +0700)]
[Windows] Fix limit on command line size

This reapplies commit d4020ef7c474, reverted in ac0edc55887b because it
broke build of LLDB. This commit contains appropriate changes for LLDB.
The original commit message is below.

Documentation on CreateProcessW states that maximal size of command line
is 32767 characters including ternimation null character. In the
function llvm::sys::commandLineFitsWithinSystemLimits this limit was set
to 32768. As a result if command line was exactly 32768 characters long,
a response file was not created and CreateProcessW was called with
too long command line.

Differential Revision: https://reviews.llvm.org/D83772

3 years agoReland D84057 [PGO][PGSO] Remove a temporary flag used for gradual rollout.
Hiroshi Yamauchi [Thu, 23 Jul 2020 03:57:25 +0000 (20:57 -0700)]
Reland D84057 [PGO][PGSO] Remove a temporary flag used for gradual rollout.

The revert was a misfire.

Remove the temporary flag PGSOIRPassOrTestOnly and the guard code which was used
for the staged rollout. This is a cleanup (NFC) as it's now false by default.

Differential Revision: https://reviews.llvm.org/D84057

3 years agoRevert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"
Sourabh Singh Tomar [Thu, 23 Jul 2020 03:17:39 +0000 (08:47 +0530)]
Revert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"

This reverts commit 6b55a95898e98664164caae4aba7c5e24fd1a05e.
Temporal revert due to a failing/assertion in test case in Sparc backend.
`test/DebugInfo/Sparc/subreg.ll`
Seen in lot of bots, for instance in:
`http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/24679`