Commit Graph

399091 Commits

Author SHA1 Message Date
Michał Górny 47d57547f4 [lldb] [Process/gdb-remote] Alias sp to x31 on AArch64 for gdbserver
Alias the "sp" register to "x31" on AArch64 if one is present and does
not have the alt_name.  This is the case when connecting to gdbserver.

Differential Revision: https://reviews.llvm.org/D109695
2021-09-16 13:13:47 +02:00
Simon Pilgrim 1ef62cb200 [X86] SimplifyDemandedVectorEltsForTargetNode - add PSADBW handling
Peek through PSADBW operands to handle non demanded elements.
2021-09-16 11:28:31 +01:00
Sherwin da Cruz 005fc11ebd [PGO] Change ThinLTO test for targets with loop unrolling disabled
I am working on a target in a downstream LLVM repo, and it seems that if a target backend chooses to disable loop unrolling this test would fail. A solution would be to modify the test to search for a different string instead.

The specific test checks for `if.true.direct_targ` which appears in the output when thinlto is not used (ie samplepgo). The same is true for `if.false.orig_indirect`.

However, if a target disables loop unrolling in the backend, the test fails as  `if.true.direct_targ` no longer appears, though `if.false.orig_indirect` still does. This can be seen by using a clang pragma to disable loop unrolling in the `unroll()` function.

For reference, the following files are the outputs of the last 2 test functions being compiled as the test case does, with and without thinlto, and with and without loop unrolling on the latest x86 clang build. The loop unrolling pragma was used to simulate the loop unrolling being disabled in a backend.
```
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o out.ll
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o out.ll
```

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D109234
2021-09-16 11:13:16 +01:00
Michał Górny 86a58f1028 [lldb] [DynamicRegisterInfo] Pass name/alt_name via RegisterInfo
Remove the name and alt_name parameters from AddRegister() and instead
pass them via RegisterInfo.name and .alt_name fields.  This makes
the API simpler and removes some duplication.

Differential Revision: https://reviews.llvm.org/D109872
2021-09-16 12:00:20 +02:00
Gabor Marton 96ec9b6ff2 [Analyzer] ConversionChecker: track back the cast expression
Adding trackExpressionValue to the checker so it tracks the value of the
implicit cast's DeclRefExpression up to initialization/assignment. This
way the report becomes cleaner.

Differential Revision: https://reviews.llvm.org/D109836
2021-09-16 11:42:54 +02:00
Pavel Labath bd590a5f89 [lldb] Make Platform::DebugProcess take a Target reference
instead of a pointer. There are just two callers of this function, and
both of them have a valid target pointer, so there's no need for all
implementations to concern themselves with whether the pointer is null.
2021-09-16 11:33:47 +02:00
serge-sans-paille 85f2ae57f7 Be more flexible on the storage type allowed for llvm::Any::TypeId::Id
This is a follow-up to 2c42a73d6c.
2021-09-16 11:01:53 +02:00
Konstantin Schwarz d2e66d7fa4 [GlobalISel] Add a combine for and(load , mask) -> zextload
This only handles simple masks, not shifted masks, for now.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D109357
2021-09-16 10:42:46 +02:00
Max Kazantsev e4da0f9657 [Test] Add test showing missing opportunity in range inference for SCEV 2021-09-16 15:40:56 +07:00
Jason Molenda ceded41532 Don't set executable file in ObjectFileMachO::LoadCoreFileImages
When the corefile reader is adding binaries from the "all image
infos" LC_NOTE in a Mach-O corefile, it would detect if the binary
being added was an executable binary and set it as the Target's
executable binary.  This has the side effect of clearing the Target's
image list, so if the executable was in the middle of the all image
infos, the initial images would be dropped.  There's no need to set
the executable binary in the Target for these corefile processes,
so instead of doing multiple passes over the list to find the
executable, I'm dropping that.
2021-09-16 01:38:48 -07:00
Queen Dela Cruz 9c4a1686d7
[clangd] Fix clangd crash when including a header
Fixes https://github.com/clangd/clangd/issues/819

SourceLocation of macros change when a header file is included above it. This is not checked when creating a PreamblePatch, resulting in reusing previously built preamble with an incorrect source location for the macro in the example test case.
This patch stores the SourceLocation in the struct TextualPPDirective so that it gets checked when comparing old vs new preambles.

Also creates a preamble patch for code completion parsing so that clangd does not crash when following the example test case with a large file.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D108045
2021-09-16 10:27:15 +02:00
Anton Afanasyev 6a5f49a1ac [AggressiveInstCombine] Add `{insert/extract}element` to `TruncInstCombine` DAG
Alive2 for `{insert/extract}element`: https://alive2.llvm.org/ce/z/hwy_E-

Actually, no one file of test suite is touched by this change,
which means that is rare pattern not generated by frontend. But
it's worth being in place.

Differential Revision: https://reviews.llvm.org/D109236
2021-09-16 11:24:31 +03:00
Anton Afanasyev 8371a4c9d5 [Test][AggressiveInstCombine] Add test for truncation of vector instructions
Precommit test for D109236
2021-09-16 11:24:30 +03:00
Michał Górny c208deb900 [lldb] [ABI/AArch64] Recognize special regs by their xN names too
Recognize lr/sp/fp by their numeric register names in the ABI plugin.
This is necessary to mark them appropriately when interfacing with
gdbserver.

Differential Revision: https://reviews.llvm.org/D109691
2021-09-16 10:23:31 +02:00
Michał Górny 66249323d2 [lldb] [gdb-remote] Try using <architecture/> for remote arch unconditionally
Try determining the process architecture from <architecture/> tag
unconditionally, rather than for very specific cases.  Generic gdbserver
implementations do not support LLDB-specific packets used to determine
the process architecture, therefore this fallback is necessary to
support architecture-specific behavior on these targets.  Rather than
maintaining a mapping of all known architectures, just try mapping
the GDB values into triplets, as that is going to work most of the time.

This change is confirmed to fix LLDB against gdbserver when debugging
i386 and aarch64 executables.

Differential Revision: https://reviews.llvm.org/D109272
2021-09-16 10:23:31 +02:00
Sjoerd Meijer a4e437e3c9 [FuncSpec] Add a test for specialising on a non-constant global argument. NFC. 2021-09-16 09:17:39 +01:00
Jay Foad 128a49727a [AMDGPU] Fix upcoming TableGen warnings on unused template arguments. NFC.
The warning is implemented by D109359 which is still in review.

Differential Revision: https://reviews.llvm.org/D109826
2021-09-16 09:07:18 +01:00
Sam Parker c98a8a09b5 [HardwareLoops] Loop guard intrinsic to recognise zext
If a loop count was initially represented by a 32b unsigned int in C
then the hardware-loop pass can recognise the loop guard and insert
the llvm.test.set.loop.iterations intrinsic. If this was instead a
unsigned short/char then clang inserts a zext instruction to expand
the loop count to an i32. This patch adds the necessary pattern
matching to enable the use of lvm.test.set.loop.iterations in those
cases.

Patch by: sherwin-dc

Differential Revision: https://reviews.llvm.org/D109631
2021-09-16 08:33:16 +01:00
David Green e06767fdcb [AArch64] Regenerate some test checks. NFC
This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.
2021-09-16 08:30:08 +01:00
Stuart Ellis 7acf92943b [flang][driver] Add documentation for Plugins
Adding documentation covering the Frontend Driver Plugins

Reviewed By: awarzynski, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D108283
2021-09-16 06:51:02 +00:00
Tobias Gysi 8f2db36b01 [mlir][OpDSL] Update op definitions to make shapes more concise (NFC).
Express the input shape definitions of convolution and pooling operations in terms of the output shapes, filter shapes, strides, and dilations.

Reviewed By: shabalin, rsuderman, stellaraccident

Differential Revision: https://reviews.llvm.org/D109815
2021-09-16 06:02:00 +00:00
Alok Kumar Sharma a5b72abc9e [DebugInfo] Enhance DIImportedEntity to accept children entities
New field `elements` is added to '!DIImportedEntity', representing
list of aliased entities.
This is needed to dump optimized debugging information where all names
in a module are imported, but a few names are imported with overriding
aliases.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D109343
2021-09-16 10:41:55 +05:30
Lang Hames a01f772d19 [ORC] Add MethodWrapperHandler utility for WrapperFunction.
MethodWrapperHandler removes some of the boilerplate when writing wrapper
functions to wrap method calls. It can be used as a handler for wrapper
functions whose first argument is an ExecutorAddress: the address is cast to a
pointer of the given class type, then the given method function pointer is
called on that object pointer (passing the rest of the arguments).

E.g.

class MyClass {
public:
  void myMethod(uint32_t, bool) { ... }
};

// SPS Method signature for myMethod -- note MyClass object address as first
// argument.
using SPSMyMethodWrapperSignature =
  SPSTuple<SPSExecutorAddress, uint32_t, bool>;

// Wrapper function for myMethod.
WrapperFunctionResult
myMethodCallWrapper(const char *ArgData, size_t ArgSize) {
  return WrapperFunction<SPSMyMethodWrapperSignature>::handle(
     ArgData, ArgSize, makeMethodWrapperHandler(&MyClass::myMethod));
}
2021-09-16 14:36:05 +10:00
Fangrui Song 03c8b24ace Delete unused GlobalIndirectSymbol::getBaseObject overloads 2021-09-15 20:44:24 -07:00
Aart Bik b1d44e5902 [mlir][sparse] add affine subscripts to sparse compilation pass
This enables the sparsification of more kernels, such as convolutions
where there is a x(i+j) subscript. It also enables more tensor invariants
such as x(1) or other affine subscripts such as x(i+1). Currently, we
reject sparsity altogether for such tensors. Despite this restriction,
however, we can already handle a lot more kernels with compound subscripts
for dense access (viz. convolution with dense input and sparse filter).
Some unit tests and an integration test demonstrate new capability.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D109783
2021-09-15 20:28:04 -07:00
Kazu Hirata 24c8eaec94 [Transforms] Use make_early_inc_range (NFC) 2021-09-15 19:55:24 -07:00
Jessica Paquette c8b3d7d6d6 [AArch64][GlobalISel] Ensure atomic loads always get assigned GPR destinations
The default register bank selection code for G_LOAD assumes that we ought to
use a FPR when the load is casted to a float/double.

For atomics, this isn't true; we should always use GPRs.

Without this patch, we crash in the following example:

https://godbolt.org/z/MThjas441

Also make the code a little more stylistically consistent while we're here.

Also test some other weird cast combinations as well.

Differential Revision: https://reviews.llvm.org/D109771
2021-09-15 17:05:09 -07:00
Ahmed Bougacha e159d3cbfc [AArch64][GlobalISel] Use MI::getIntrinsicID in more spots. NFC.
There's technically a difference in the logic used by these
findIntrinsicID and MachineInstr::getIntrinsicID, but it shouldn't
be a meaningful difference here, with G_INTRINSIC instructions.
getIntrinsicID's "first non-def" logic should be correct for those.
2021-09-15 16:45:34 -07:00
Ahmed Bougacha 94a2f9cdb6 [GlobalISel] Fix CombinerHelper::isPredecessor for same def/use MI.
The doc comment for isPredecessor says:
  Returns true if \p DefMI precedes \p UseMI or they are the same
  instruction.
And dominates relies on that behavior for its own:
  Returns true if \p DefMI dominates \p UseMI. By definition an
  instruction dominates itself.

Make both statements correct by fixing isPredecessor.
Found by inspection.
2021-09-15 16:45:27 -07:00
Teresa Johnson 242524741f [MemProf] Fix format warnings
Fix the warnings that show up with -Wformat in this file.
2021-09-15 16:27:21 -07:00
Ted Woodward 17589538aa [lldb-vscode] Fix focus thread when previous thread exits
The thread that Visual Studio Code displays on a stop is called the focus thread. When the previous focus thread exits and we stop in a new thread, lldb-vscode does not tell vscode to set the new thread as the focus thread, so it selects the first thread in the thread list.

This patch changes lldb-vscode to tell vscode that the new thread is the focus thread. It also includes a test that verifies the DAP stop message for this case contains the correct values.

Reviewed By: clayborg, wallace

Differential Revision: https://reviews.llvm.org/D109633
2021-09-15 18:09:32 -05:00
Teresa Johnson 37a5a3ae55 [MemProf] Avoid global lock when updating MIB cache
Previously we used a global Allocator-scope mutex to lock when adding a
deallocation to the MIB cache. This resulted in a lot of contention.
Instead add and use per-set mutexes.

Along with this, we now need to remove the global miss and access count
variables and instead utilize the per-set statistics to report the
overall miss rate.

Differential Revision: https://reviews.llvm.org/D109853
2021-09-15 16:06:11 -07:00
Richard Smith 699da98739 PR51874: Fix diagnostics for defaulted, implicitly deleted 'operator!='.
Don't say we couldn't find an 'operator<=>' when we were actually
looking for an 'operator=='. Also fix a crash when attempting to
diagnose if we select a built-in 'operator!=' in this lookup.
2021-09-15 15:43:02 -07:00
Arthur Eubanks 5d78e33ce5 [test] Move some llvm-extract tests into the proper directory 2021-09-15 15:42:04 -07:00
Arthur Eubanks c3ddc13d7d [NFC] Split up PassBuilder.cpp
PassBuilder.cpp is the slowest file to compile in LLVM.
When trying to test changes to pipelines, it takes a long time to recompile.

This doesn't actually speedup building PassBuilder.cpp itself since most
of the time is spent in other large/duplicated functions caused by
PassRegistry.def.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D109798
2021-09-15 15:30:39 -07:00
LLVM GN Syncbot c90cbb2d34 [gn build] Port d249200fa7 2021-09-15 22:14:18 +00:00
Michael Kruse 658eb9e142 [Polly] Remove autotools build systems from Externals. NFC.
Building a source distribution using autotools adds GPL-licenced
files into the the sources. Although redistribution of theses files is
explicitly allowed with an exception, these are not used by Polly
which uses a CMake replacement. Use the direct source checkout
instead (replacing the output of 'make dist').

Some m4 scripts with the same licence are also included in isl/ppcg
repository. Removing them renders the autotools-based build scipts
inoperable, so remove the autotools build system altogether.
2021-09-15 17:11:15 -05:00
Owen Anderson 68079ef0eb Teach SimplifyCFG to fold switches into lookup tables in more cases.
In particular, it couldn't handle cases where lookup table constant
expressions involved bitcasts. This does not seem to come up
frequently in C++, but comes up reasonably often in Rust via
`#[derive(Debug)]`.

Originally reported by pcwalton.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D109565
2021-09-15 22:07:08 +00:00
Anna Thomas f9e4aebe4a Revert "[InstCombine] Improve TryToSinkInstruction with multiple uses"
This reverts commit 4ac4e52189.
There are couple of test failures, which needs update of the test cases.

Doing a clean revert and will recommit the change along with fixed
testcases.
2021-09-15 18:03:11 -04:00
owenca 8025c03f70 [clang-format] Top-level unwrapped lines don't follow a left brace
Differential Revision: https://reviews.llvm.org/D109752
2021-09-15 14:52:07 -07:00
David Blaikie 065bb08bb8 NFC: DWARFTypePrinter: Remove "type" from member function names to reduce redundancy 2021-09-15 14:46:28 -07:00
Anna Thomas b6cb03e6b9 Revert use of getUniqueUndroppableUser in AssumeBundleBuilder
Fix build bot failure in rG4ac4e521 caused due to assumeBundleBuilder
using new API (getUniqueUndroppableUser).
We now continue using the existing API for AssumeBundleBuilder
(getSingleUndroppableUser).

Sorry for the noise here.

Tests-Run: failing testcase passes.
2021-09-15 17:45:09 -04:00
Matt Arsenault 87c00878d3 SplitKit: Remove decade old live interval hack
This was trying to fixup broken live intervals coming out of the
coalescer. The verifier is more complete now and no tests seem to fail
without this.
2021-09-15 17:35:59 -04:00
Mogball cb8c30d35d [DRR] Explicit Return Types in Rewrites
Adds a new rewrite directive returnType that can be added at the end of an op's
argument list to explicitly specify return types.

```
(OpX $v0, $v1, (returnType "$_builder.getI32Type()"))
```

Pass in a bound value to copy its return type, or pass a native code call to
dynamically create new types.

```
(OpX $v0, $v1, (returnType $v0, (NativeCodeCall<"..."> $v1)))
```

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D109472
2021-09-15 14:25:29 -07:00
Dan Liew f4382d4b09 [Compiler-RT] For arm64e test suites use the SDK version as the minimum deployment target.
Previously we used the minimum deployment target used for the platform
(e.g. iOS is 9.0). Unfortunately this leads to ABI incompatibilities with
arm64e devices running newer OSs. In particular the following TSan test
cases that used libcxx would fail due to the ABI mismatch.

* Darwin/libcxx-shared-ptr-recursive.mm
* Darwin/libcxx-shared-ptr-stress.mm
* Darwin/libcxx-shared-ptr.mm
* libcxx/std_shared_ptr.cpp

Given that arm64e is not ABI stable we should ideally match the
deployment target for sanitizer runtimes and their tests cases to the
device when building for arm64e. Unfortunately having a mixed deployment
target (based on architecture) isn't currently supported by the build system
and is non-trivial to implement.

As a stop-gap measure this patch changes the sanitizer test suites (but not the
sanitizer runtimes themselves) to use a newer deployment target when
targetting arm64e.

The deployment target used for arm64e is the SDK version because this
"should" match the OS version running on the target device (it is a
configuration error to not match them).

rdar://83080611
2021-09-15 14:22:25 -07:00
Rob Suderman 1ac2d195ec [mlir][linalg] Add canonicalizers for depthwise conv
There are two main versions of depthwise conv depending whether the multiplier
is 1 or not. In cases where m == 1 we should use the version without the
multiplier channel as it can perform greater optimization.

Add lowering for the quantized/float versions to have a multiplier of one.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D108959
2021-09-15 14:09:15 -07:00
Anna Thomas 3273430406 Re-add getSingleUndroppableUse API
The API was removed in 4ac4e52189 in favor of
getUniqueUndroppableUser.
However, this caused a buildbot failure in AbstractCallSiteTest.cpp,
which uses the API and the AbstractCallSite class requires a "use"
rather than a user.
Retain the API so that the unittest compiles and passes.
2021-09-15 17:06:20 -04:00
Kim-Anh Tran 7d437cf76e Test commit to check commit access 2021-09-15 17:03:49 -04:00
Mats Larsen 8b946ab0bb [NFC] Test commit to verify commit access 2021-09-15 17:03:49 -04:00
David Blaikie 8264846c0e Senticify some comments - post-commit review for e4b9f5e851
Based on feedback from Paul Robinson.
2021-09-15 13:59:11 -07:00