Commit Graph

399214 Commits

Author SHA1 Message Date
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
Hansang Bae ae2a5facce [OpenMP][libomptarget] Minor fix in x86_64 plugin
Call to remove() was passing invalid address for the file name.

Differential Revision: https://reviews.llvm.org/D109846
2021-09-15 15:57:06 -05:00
Saleem Abdulrasool d249200fa7 Revert "Re-Revert "clang-tidy: introduce readability-containter-data-pointer check""
This reverts commit 626586fc25.

Tweak the test for Windows.  Windows defaults to delayed template
parsing, which resulted in the main template definition not registering
the test on Windows.  Process the file with the additional
`-fno-delayed-template-parsing` flag to change the default beahviour.
Additionally, add an extra check for the fix it and use a more robust
test to ensure that the value is always evaluated.

Differential Revision: https://reviews.llvm.org/D108893
2021-09-15 20:52:55 +00:00
David Blaikie 40acc0adad Improve type printing of size-dependent const arrays to normalize array-of-const and const-array
Follow-on from 2bd8493847 based on
postcommit feedback from Richard Smith.

The VariableArray case I couldn't figure out how to test/provoke - you
can't write/form a variable array in any context other than a local
variable that I know of, and in that case `const int x[n]` is the
normalized form already (array-of-const) and you can't use typedefs
(since you can't typedef int[n] with variable 'n') to force the
const-array AST that would produce the undesirable type printing "int
const [n]".
2021-09-15 13:46:37 -07:00
Anna Thomas 4ac4e52189 [InstCombine] Improve TryToSinkInstruction with multiple uses
This patch allows sinking an instruction which can have multiple uses in a
single user. We were previously over-restrictive by looking for exactly one use,
rather than one user.

Also, the API for retrieving undroppable user has been updated accordingly since
in both usecases (Attributor and InstCombine), we seem to care about the user,
rather than the use.

Reviewed-By: nikic

Differential Revision: https://reviews.llvm.org/D109700
2021-09-15 20:39:38 +00:00
Philip Reames 248e430f37 precommit test for D109845/D106852 2021-09-15 12:53:55 -07:00
Matt Morehouse acaca56471 [HWASan] Test longjmp(jmpbuf, 0).
Our interceptor needs to change retval to 1 when 0 is passed.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D109788
2021-09-15 12:11:59 -07:00
Kazu Hirata 385f380e80 [MemorySSA] Fix "set but not used" warnings 2021-09-15 11:41:41 -07:00
Sanjay Patel e5a32d720e [InstCombine] move extend after insertelement if both operands are extended
I was wondering how instcombine does on the examples in D109236,
and we're missing a basic transform:

inselt (ext X), (ext Y), Index --> ext (inselt X, Y, Index)

https://alive2.llvm.org/ce/z/z2aBu9

Note that there are several possible extensions of this fold
(see TODO comments).

Differential Revision: https://reviews.llvm.org/D109537
2021-09-15 14:38:03 -04:00
Philip Reames 9bdb19cca2 [SCEV] (udiv X, Y) * Y is always NUW
Motivated by the removal done in D109782. This implements the correct flag part generically.

Differential Revision: https://reviews.llvm.org/D109786
2021-09-15 11:34:50 -07:00
Simon Camphausen 1b79efdc72 [mlir] Fix printing of EmitC attrs/types with escape characters
Attributes and types were not escaped when printing.

Reviewed By: jpienaar, marbre

Differential Revision: https://reviews.llvm.org/D109143
2021-09-15 18:15:38 +00:00
Nicolas Vasilache 96ec0ff2b7 [mlir][Linalg] Revisit insertion points in comprehensive bufferization.
This revision fixes a corner case that could appear due to incorrect insertion point behavior in comprehensive bufferization.

Differential Revision: https://reviews.llvm.org/D109830
2021-09-15 18:11:38 +00:00
Philip Reames debbf8049d autogen a test for ease of update 2021-09-15 11:11:07 -07:00
Philip Reames a92f11b682 switch a couple of SCEV tests to autogen for ease of update 2021-09-15 11:11:07 -07:00
Alina Sbirlea b759381b75 [MemorySSA] Add verification levels to MemorySSA. [NFC]
Add two levels of verification for MemorySSA: Fast and Full.
The defaults are kept the same. Full verification always occurs under
EXPENSIVE_CHECKS, but now it can also be requested in a specific pass for
debugging purposes.
2021-09-15 11:09:54 -07:00
Mehdi Amini 13237c3b1e Add llvm_unreachable after fully covered switch (NFC)
This fixes a compiler warning for some version of GCC.
2021-09-15 17:53:05 +00:00
Peyton, Jonathan L 258e27aae1 [OpenMP] Add support for GOMP depobj
GOMP depobjs are represented as a two intptr_t array. The first
element is the base address of the dependency and the second element
is the flag indicating the type the depobj represents.

Differential Revision: https://reviews.llvm.org/D108790
2021-09-15 12:47:08 -05:00
Uday Bondhugula f68939d3d9 [MLIR] Tighten type constraint on memref.global op def
Tighten the def of memref.global op to use the right kind of TypeAttr
(of MemRefType).

Differential Revision: https://reviews.llvm.org/D109822
2021-09-15 22:41:03 +05:30
Yaxun (Sam) Liu ab5f2b505a [HIP] Diagnose -fopenmp-targets for HIP programs
Diagnose -fopenmp-targets for HIP programs since
dual HIP and OpenMP offloading in the same compilation
is currently not supported by HIP toolchain.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D109718
2021-09-15 13:03:57 -04:00
Fangrui Song f9dbca68d4 [CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux
This makes the default build closer to a -DLLVM_ENABLE_RUNTIMES=all build.
The layout is arguably superior because different libraries of target triples
are in different directories, similar to GCC/Debian multiarch.

When LLVM_DEFAULT_TARGET_TRIPLE is x86_64-unknown-linux-gnu,
`lib/clang/14.0.0/lib/libclang_rt.asan-x86_64.a`
is moved to
`lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.a`.

In addition, if the host compiler supports -m32 (multilib),
`lib/clang/14.0.0/lib/libclang_rt.asan-i386.a`
is moved to
`lib/clang/14.0.0/lib/i386-unknown-linux-gnu/libclang_rt.asan.a`.

Clang has been detecting both paths for lib/Driver/ToolChains/Gnu.cpp since 2018 (D50547).

---

Note: Darwin needs to be disabled. The hierarchy needs to be sorted out.
The current -DLLVM_DEFAULT_TARGET_TRIPLE=off state is like:
```
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_ios.a
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_iossim.a
lib/clang/14.0.0/lib/darwin/libclang_rt.profile_osx.a
```

Windows needs to be disabled: https://reviews.llvm.org/D107799?id=368557#2963311

Differential Revision: https://reviews.llvm.org/D107799
2021-09-15 09:32:59 -07:00
Michał Górny 210d72e9d6 [compiler-rt] Move -fno-omit-frame-pointer check to common config-ix
9ee64c3746 has started using
COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG inside scudo.  However,
the relevant CMake check was performed in builtin-config-ix.cmake,
so the definition was missing when builtins were not built.  Move
the check to config-ix.cmake, so that it runs unconditionally of
the components being built.

Fixes PR#51847

Differential Revision: https://reviews.llvm.org/D109812
2021-09-15 18:32:33 +02:00
Anna Thomas 36ef65adc3 [InstCombine] Update test checks through autogeneration, add more tests. NFC
Updated check lines.
Tests precommitted from D109700.
2021-09-15 16:20:30 +00:00
Fangrui Song 9111635cb7 [test] Fix asan/scudo -shared-libsan tests with -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=on
On x86_64-unknown-linux-gnu, `-m32` tests set LD_LIBRARY_PATH to
`config.compiler_rt_libdir` (`$build/lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu`)
instead of i386-unknown-linux-gnu, so `-shared-libsan` executables
cannot find their runtime (e.g. `TestCases/replaceable_new_delete.cpp`).

Detect -m32 and -m64 in config.target_cflags, and adjust `config.compiler_rt_libdir`.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D108859
2021-09-15 09:07:47 -07:00
Matt Morehouse 0a07789fe9 [HWASan] Add missing newlines. 2021-09-15 09:06:01 -07:00
Max Kazantsev c78ed20784 [Test] Add a test showing missing opportunities in branch deletion by indvars 2021-09-15 22:17:10 +07:00
Nicolas Vasilache 6fe77b1051 [mlir][Linalg] Fail comprehensive bufferization if a memref is returned.
Summary:

Reviewers:

Subscribers:

Differential revision: https://reviews.llvm.org/D109824
2021-09-15 15:11:17 +00:00
Alexey Bataev 446e11fa29 [SLP][NFC]Add a test for tiny tree with stores and with not
same/alternate instructions.
2021-09-15 08:07:01 -07:00
Matt Morehouse 1a3b3301d7 [HWASan] Catch cases where libc populated jmp_buf.
Some setjmp calls within libc cannot be intercepted while their matching
longjmp calls can be.  This causes problems if our setjmp/longjmp
interceptors don't use the exact same format as libc for populating and
reading the jmp_buf.

We add a magic field to our jmp_buf and populate it in setjmp.  This
allows our longjmp interceptor to notice when a libc jmp_buf is passed
to it.

See discussion on https://reviews.llvm.org/D109699 and
https://reviews.llvm.org/D69045.

Fixes https://github.com/google/sanitizers/issues/1244.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D109787
2021-09-15 07:53:54 -07:00