platform/upstream/llvm.git
3 years ago[X86] Remove unused 'OneUse' option from IsNOT helper. NFCI.
Simon Pilgrim [Wed, 24 Mar 2021 11:11:57 +0000 (11:11 +0000)]
[X86] Remove unused 'OneUse' option from IsNOT helper. NFCI.

3 years ago[X86][AVX] Cleanup gather_v8i32_v8i32 special test case
Simon Pilgrim [Wed, 24 Mar 2021 10:57:50 +0000 (10:57 +0000)]
[X86][AVX] Cleanup gather_v8i32_v8i32 special test case

Cleanup the gather_v8i32_v8i32 IR to more closely match how the middle-end will optimise the vector geps (exposing more splats).

This helps the gather scalarization case a lot, but shows a missed opportunity for AVX512 gathers to recognise uniform-constant indices.

And none of the cases realise that some of the gathers are really blended broadcasts....

3 years ago[AMDGPU] SIOptimizeExecMaskingPreRA should check constant bus constraint when folds...
alex-t [Thu, 18 Mar 2021 19:22:08 +0000 (22:22 +0300)]
[AMDGPU] SIOptimizeExecMaskingPreRA should check constant bus constraint when folds EXEC copy

Folding EXEC copy into it's single use may lead to constant bus constraint violation as it adds one more SGPR operand.
         This change makes it validate the user instruction with the new SGPR operand and only fold it if it is legal.

Reviewed By: rampitec, arsenm

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

3 years agoRevert "[lldb/Plugins] Add ScriptedProcess Process Plugin"
David Zarzycki [Wed, 24 Mar 2021 11:06:07 +0000 (07:06 -0400)]
Revert "[lldb/Plugins] Add ScriptedProcess Process Plugin"

This reverts commit dd391e1ef762d79f86112dc2480a89c9be066ce1.

This patch causes 17 LLDB test regressions on Fedora 33 (x86-64).

3 years ago[LV] Move exact FP math check out of Requirements.
Florian Hahn [Wed, 24 Mar 2021 10:01:20 +0000 (10:01 +0000)]
[LV] Move exact FP math check out of Requirements.

We know if the loop contains FP instructions preventing vectorization
after we are done with legality checks. This patch updates the code the
check for un-vectorizable FP operations earlier, to avoid unnecessarily
running the cost model and picking a vectorization factor. It also makes
the code more direct and moves the check to a position where similar
checks are done.

I might be missing something, but I don't see any reason to handle this
check differently to other, similar checks.

Reviewed By: lebedev.ri

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

3 years ago[clang][deps] NFC: Document collector, rename members
Jan Svoboda [Wed, 24 Mar 2021 10:58:19 +0000 (11:58 +0100)]
[clang][deps] NFC: Document collector, rename members

This patch documents how `ModuleDepCollector{,PP}` work and what their members store. Also renames somewhat vague `MainDeps` to `FileDeps` and `Deps` to `ModularDeps`.

Depends on D98943.

Reviewed By: Bigcheese

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

3 years ago[clang][deps] NFC: Extract ModuleID struct
Jan Svoboda [Wed, 24 Mar 2021 10:56:26 +0000 (11:56 +0100)]
[clang][deps] NFC: Extract ModuleID struct

This patch extracts the `ModuleName` and `ContextHash` members of `ClangModuleDep`, `FullDependencies` and `ModuleDeps` into a single struct `ModuleID`. This makes it easier to understand how the full dependency graph works.

Reviewed By: Bigcheese, dexonsmith

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

3 years ago[MCA] Disable RCU for InOrderIssueStage
Andrew Savonichev [Sun, 14 Mar 2021 22:25:51 +0000 (01:25 +0300)]
[MCA] Disable RCU for InOrderIssueStage

This is a follow-up for:
D98604 [MCA] Ensure that writes occur in-order

When instructions are aligned by the order of writes, they retire
in-order naturally. There is no need for an RCU, so it is disabled.

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

3 years ago[PowerPC] Change option to mrop-protect
Stefan Pintilie [Tue, 23 Mar 2021 13:20:08 +0000 (08:20 -0500)]
[PowerPC] Change option to mrop-protect

In order to have the same option on power PC LLVM and power PC gcc
the option will be changed from -mrop-protection to -mrop-protect.

The feature will be off by default and turned on when the option is used.

Reviewed By: lei, amyk

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

3 years ago[Analyzer][NFC] Fix typos in comments
Gabor Marton [Wed, 24 Mar 2021 10:46:10 +0000 (11:46 +0100)]
[Analyzer][NFC] Fix typos in comments

3 years ago[clang][lit] Allow test cases to use the compiler that are used to compile Clang
Ella Ma [Wed, 24 Mar 2021 10:32:57 +0000 (11:32 +0100)]
[clang][lit] Allow test cases to use the compiler that are used to compile Clang

Required by D83660.
Test cases may want to use the host compiler to compile some mocks for the
test case.

This patch adds two substitutions `%host_cc` and `%host_cxx` to use the host
compilers set via variable `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER`.

Patch by Ella Ma!

Reviewed By: steakhal

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

3 years ago[NFC][PhaseOrdering] Add a testcase for additional LICM before LoopRotate (D99249...
Roman Lebedev [Wed, 24 Mar 2021 09:47:51 +0000 (12:47 +0300)]
[NFC][PhaseOrdering] Add a testcase for additional LICM before LoopRotate (D99249/D99204)

3 years ago[mlir][NFC] Replace `getMemorySpaceAsInt` with `getMemorySpace` where possible
Vladislav Vinogradov [Tue, 23 Mar 2021 08:45:24 +0000 (11:45 +0300)]
[mlir][NFC] Replace `getMemorySpaceAsInt` with `getMemorySpace` where possible

Use new `MemRefType::getMemorySpace` method with generic Attribute
in cases, where there is no specific logic around the memory space.

Reviewed By: rriddle

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

3 years ago[NFC] Improve debug message and test description in 4c1f74a
Ta-Wei Tu [Wed, 24 Mar 2021 10:21:13 +0000 (18:21 +0800)]
[NFC] Improve debug message and test description in 4c1f74a

3 years ago[LoopFlatten] Fix invalid assertion (PR49571)
Ta-Wei Tu [Wed, 24 Mar 2021 10:07:34 +0000 (18:07 +0800)]
[LoopFlatten] Fix invalid assertion (PR49571)

The `InductionPHI` is not necessarily the increment instruction, as
demonstrated in pr49571.ll.
This patch removes the assertion and instead bails out from the
`LoopFlatten` pass if that happens.

This fixes https://bugs.llvm.org/show_bug.cgi?id=49571

Reviewed By: SjoerdMeijer

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

3 years ago[NFC] Remove redundant `struct` prefix
Ta-Wei Tu [Wed, 24 Mar 2021 09:58:12 +0000 (17:58 +0800)]
[NFC] Remove redundant `struct` prefix

Reviewed By: SjoerdMeijer, fhahn

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

3 years ago[libcxx] [test] Add return values after assert(false) in some experimental tests
Martin Storsjö [Tue, 23 Mar 2021 16:42:32 +0000 (18:42 +0200)]
[libcxx] [test] Add return values after assert(false) in some experimental tests

When building in MSVC mode (in release mode), the assert(false) don't
make the end of the function unreachable, so add return statements to
silence compiler warnings (treated as errors).

Also change 'virtual' into 'override', which was requested in review,
as these files require C++11.

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

3 years ago[lldb] Add llgs_test decorator back to TestAutoInstallMainExecutable
Raphael Isemann [Wed, 24 Mar 2021 09:35:58 +0000 (10:35 +0100)]
[lldb] Add llgs_test decorator back to TestAutoInstallMainExecutable

This got removed in 68bb51acd572735d80d20adb2c2fc51a5cbbd88e and this enabled
the test on macOS (where it just causes lldb-server to crash). Re-adding the
decorator to get the tests passing again.

3 years agoHandle a LC_NOTE main bin spec for user process corefiles
Jason Molenda [Wed, 24 Mar 2021 09:18:17 +0000 (02:18 -0700)]
Handle a LC_NOTE main bin spec for user process corefiles

I was playing around with main bin spec LC_NOTEs and noticed
a small oversight in the parsing of user process corefile notes.

3 years ago[XCore][Test] XFAIL tests requiring 8-byte stack alignment.
Nigel Perks [Fri, 12 Feb 2021 13:02:35 +0000 (13:02 +0000)]
[XCore][Test] XFAIL tests requiring 8-byte stack alignment.

XCore default subtarget does not support 8-byte stack alignment. These failures
can be seen on builder clang-xcore-ubuntu-20-x64 on staging buildbot.

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

3 years ago[AArch64][ASAN] Re-enable fgets_fputs.cpp test.
Yvan Roux [Wed, 24 Mar 2021 09:06:04 +0000 (10:06 +0100)]
[AArch64][ASAN] Re-enable fgets_fputs.cpp test.

Now that AArch64 mapping symbols are correctly handled by
llvm-symbolizer this test can be re-enabled on that target.

3 years ago[WebAssembly][MC] Record limit constraints for table sizes
Andy Wingo [Tue, 23 Mar 2021 15:13:54 +0000 (16:13 +0100)]
[WebAssembly][MC] Record limit constraints for table sizes

This commit adds a full WasmTableType to MCSymbolWasm, differing from
the current situation (just an ElemType) in that it additionally records
a WasmLimits.

We add support for specifying the limits in .S files also, via the
following syntax variations:

  .tabletype SYM, ELEMTYPE
  .tabletype SYM, ELEMTYPE, MINSIZE
  .tabletype SYM, ELEMTYPE, MINSIZE, MAXSIZE

Depends on D99186.

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

3 years agoAdd a mechanism for Dialects to provide a fallback for OpInterface
Mehdi Amini [Wed, 24 Mar 2021 08:25:25 +0000 (08:25 +0000)]
Add a mechanism for Dialects to provide a fallback for OpInterface

This mechanism makes it possible for a dialect to not register all
operations but still answer interface-based queries.
This can useful for dialects that are "open" or connected to an external
system and still interoperate with the compiler. It can also open up the
possibility to have a more extensible compiler at runtime: the compiler
does not need a pre-registration for each operation and the dialect can
inject behavior dynamically.

Reviewed By: rriddle, jpienaar

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

3 years ago[clang][ASTImporter] Add import of DeducedTemplateSpecializationType.
Balázs Kéri [Wed, 24 Mar 2021 07:42:29 +0000 (08:42 +0100)]
[clang][ASTImporter] Add import of DeducedTemplateSpecializationType.

Reviewed By: shafik

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

3 years ago[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC.
Andy Wingo [Tue, 23 Mar 2021 13:46:32 +0000 (14:46 +0100)]
[WebAssembly] Rename WasmLimits::Initial to ::Minimum.  NFC.

This patch renames the "Initial" member of WasmLimits to the name used
in the spec, "Minimum".

In the core WebAssembly specification, the Limits data type has one
required "min" member and one optional "max" member, indicating the
minimum required size of the corresponding table or memory, and the
maximum size, if any.

Although the WebAssembly spec does instantiate locally-defined tables
and memories with the initial size being equal to the minimum size, it
can't impose such a requirement for imports.  It doesn't make sense to
require an initial size for a memory import, for example.  The compiler
can only sensibly express the minimum and maximum sizes.

See
https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits
for a related discussion that agrees that the right name of "initial" is
"minimum" when querying the type of a table or memory from JavaScript.
(Of course it still makes sense for JS to speak in terms of an initial
size when it explicitly instantiates memories and tables.)

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

3 years ago[Driver] Bring back i586-linxu-gnu
Fangrui Song [Wed, 24 Mar 2021 06:37:43 +0000 (23:37 -0700)]
[Driver] Bring back i586-linxu-gnu

This is used by Fuchsia for a Debian jessie based sysroot.

3 years agoUpdate SafeMachO.h to #undefine more names
Jason Molenda [Wed, 24 Mar 2021 06:34:22 +0000 (23:34 -0700)]
Update SafeMachO.h to #undefine more names

Depending on include order, these can cause build errors when
including the llvm MachO.h where these are defined as enums.
Update the list to include some more names.

3 years ago[RISCV] Add HasStdExtD predicate to copysign from double and to double patterns
Jim Lin [Wed, 24 Mar 2021 06:29:23 +0000 (14:29 +0800)]
[RISCV] Add HasStdExtD predicate to copysign from double and to double patterns

Copysign from double and to double patterns have lack of HasStdExtD predicate.

Reviewed By: craig.topper

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

3 years ago* Fix demangling of optional template-args for vendor extended type qualifier.
Alex Orlov [Wed, 24 Mar 2021 06:21:32 +0000 (10:21 +0400)]
* Fix demangling of optional template-args for vendor extended type qualifier.

This fixes https://bugs.llvm.org/show_bug.cgi?id=48009 bug.

Reviewed By: erik.pilkington, krisb

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

3 years ago[Driver] Gnu.cpp: remove unneeded getMultiarchTriple normalization
Fangrui Song [Wed, 24 Mar 2021 06:12:18 +0000 (23:12 -0700)]
[Driver] Gnu.cpp: remove unneeded getMultiarchTriple normalization

3 years ago[Polly] Port DeadCodeElim to the NewPM.
Michael Kruse [Wed, 24 Mar 2021 05:54:37 +0000 (00:54 -0500)]
[Polly] Port DeadCodeElim to the NewPM.

3 years ago[NFC] [Support] Fix unconsistent comment with codes for ExtendSigned
Chuanqi Xu [Wed, 24 Mar 2021 05:58:54 +0000 (13:58 +0800)]
[NFC] [Support] Fix unconsistent comment with codes for ExtendSigned

3 years ago[PowerPC] Make altivec.h work with AIX which has no __int128
Nemanja Ivanovic [Wed, 24 Mar 2021 05:25:03 +0000 (00:25 -0500)]
[PowerPC] Make altivec.h work with AIX which has no __int128

There are a number of functions in altivec.h that use
vector __int128 which isn't supported on AIX. Those functions
need to be guarded for targets that don't support the type.
Furthermore, the functions that produce quadword instructions
without using the type need a builtin. This patch adds the
macro guards to altivec.h using the __SIZEOF_INT128__ which
is only defined on targets that support the __int128 type.

3 years ago[NFC] Fix comment describing what EdgeBundles is
Max Kazantsev [Wed, 24 Mar 2021 04:03:21 +0000 (11:03 +0700)]
[NFC] Fix comment describing what EdgeBundles is

The original comment says the same thing twice, and does not mention that
edges entering the block are also in the same bundle (which seems true from
what the underlying code is doing).

Differential Revision: https://reviews.llvm.org/D99144
Reviewed By: RKSimon

3 years ago[RegAlloc] Fix "ran out of regs" with uses in statepoint
Serguei Katkov [Wed, 24 Mar 2021 03:19:52 +0000 (10:19 +0700)]
[RegAlloc] Fix "ran out of regs" with uses in statepoint

Statepoint instruction is known to have a variable and big number of operands.
It is possible that Register Allocator will split live intervals in the way that all
physical registers are occupied by "zero-length" live intervals which are marked
as not-spillable.
While intervals are marked as not-spillable in the moment of creation when they are
really zero-length it is possible that in future as part of re-materialization there will
need for physical register between def and use of such tiny interval (the use is not
related to this interval at all).
As all physical registers are assigned to not-spillable intervals there is not avaialbe
registers and RA reports an error.

The idea of the fix is avoid marking tiny live intervals where there is a use in statepoint
instruction in var args section. Such interval may be perfectly spilled and folded to
operand of statepoint.

Reviewers: reames, dantrushin, qcolombet, dsanders, dmgreen
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D98766

3 years ago[X86] Bale out of X86FastISel::X86SelectCmp for vectors.
Craig Topper [Wed, 24 Mar 2021 02:34:39 +0000 (19:34 -0700)]
[X86] Bale out of X86FastISel::X86SelectCmp for vectors.

None of the code in this function was written to handle
vectors.  Most of the cases already fail for vectors for one
reason or another. The exception is an optimization that
detects identical operands. This can be triggered by vectors,
but the code always creates a 0 or 1 constants in a scalar
register which is incorrect for vectors.

Fixes PR49706.

3 years agoRevert "[Driver] Bring back "Clean up Debian multiarch /usr/include/<triplet> madness...
Zequan Wu [Wed, 24 Mar 2021 03:12:09 +0000 (20:12 -0700)]
Revert "[Driver] Bring back "Clean up Debian multiarch /usr/include/<triplet> madness" and restore i586-linux-gnu"

This breaks bots in chromium goma building.

This reverts commit 424bf5d8918f6356f1b8e99205c5fc8b4783ca22.

3 years ago[RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.
Zakk Chen [Thu, 18 Mar 2021 03:25:32 +0000 (20:25 -0700)]
[RISCV][Clang] Add RVV Vector Indexed Load intrinsic functions.

Support Complex type transformer to define more complexity legal type.

Overall our downstream implementation there are only four instructions need to
use complex type transformer, it's not a common case.
I still feel using a string for prototypes is simple and clear.

Reviewed By: craig.topper

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

3 years ago[NFC] Clang-format includes
Vitaly Buka [Wed, 24 Mar 2021 02:11:11 +0000 (19:11 -0700)]
[NFC] Clang-format includes

3 years ago[InstSimplify] Fix unused variable warning (NFC)
Yang Fan [Wed, 24 Mar 2021 01:56:36 +0000 (09:56 +0800)]
[InstSimplify] Fix unused variable warning (NFC)

GCC warning:
```
/llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp: In function ‘llvm::Value* SimplifyWithOpReplaced(llvm::Value*, llvm::Value*, llvm::Value*, const llvm::SimplifyQuery&, bool, unsigned int)’:
/llvm-project/llvm/lib/Analysis/InstructionSimplify.cpp:3993:15: warning: unused variable ‘SI’ [-Wunused-variable]
 3993 |     if (auto *SI = dyn_cast<SelectInst>(I))
      |               ^~
```

3 years ago[OpenMP] Misc. changes that add or remove pointer/bound checks
Hansang Bae [Thu, 11 Mar 2021 23:34:06 +0000 (17:34 -0600)]
[OpenMP] Misc. changes that add or remove pointer/bound checks

-- Added or moved checks to appropriate places.
-- Removed ineffective null check where the pointer is already being
   dereferenced around the code.
-- Initialized variables that can be used without definitions.
-- Added call to dlclose/FreeLibrary in OMPT tool activation.
-- Added a new build compiler definition.

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

3 years agoSupport #__private_macro and #__public_macro in local submodule
Richard Smith [Tue, 23 Mar 2021 23:41:05 +0000 (16:41 -0700)]
Support #__private_macro and #__public_macro in local submodule
visibility mode.

3 years agoImprove const-correctness. NFC.
Richard Smith [Tue, 23 Mar 2021 22:45:40 +0000 (15:45 -0700)]
Improve const-correctness. NFC.

3 years ago[CGAtomic] Lift stronger requirements on cmpxch and support acquire failure mode
Bruno Cardoso Lopes [Tue, 23 Mar 2021 23:13:29 +0000 (16:13 -0700)]
[CGAtomic] Lift stronger requirements on cmpxch and support acquire failure mode

- Fix `emitAtomicCmpXchgFailureSet` to support release/acquire (succ/fail) memory order.
- Remove stronger checks for cmpxch.

Effectively, this addresses http://wg21.link/p0418

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

3 years ago[Coverage] Load records immediately
Choongwoo Han [Tue, 23 Mar 2021 22:59:45 +0000 (15:59 -0700)]
[Coverage] Load records immediately

The current implementation keeps buffers generated for each object file
until it completes loading of all files. This approach requires a lot of memory
if there are a lot of huge object files. Thus, make it to load coverage records
immediately rather than waiting for other binaries to be loaded.

This reduces memory usage of llvm-cov from >128GB to 5GB when
loading Chromium binaries in Windows.

Additional testing: check-profile, check-llvm

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

3 years ago[lld] Fix test to work with and without a vendor string
Shoaib Meenai [Tue, 23 Mar 2021 23:16:02 +0000 (16:16 -0700)]
[lld] Fix test to work with and without a vendor string

3 years ago[AArch64][GlobalISel] Add test for G_FSHR legalization.
Amara Emerson [Tue, 23 Mar 2021 23:11:45 +0000 (16:11 -0700)]
[AArch64][GlobalISel] Add test for G_FSHR legalization.

3 years ago[AArch64][GlobalISel] Lower G_FSHL and G_FSHR.
Amara Emerson [Tue, 23 Mar 2021 22:56:03 +0000 (15:56 -0700)]
[AArch64][GlobalISel] Lower G_FSHL and G_FSHR.

Codegen isn't as good as we need it, but that'll be done later.

3 years ago[mlir][tosa] Add tosa.argmax to linalg lowering
Rob Suderman [Tue, 23 Mar 2021 01:22:30 +0000 (18:22 -0700)]
[mlir][tosa] Add tosa.argmax to linalg lowering

Tosa's argmax lowering is representable as a linalg.indexed_generic
operation. Include the lowering to this type for both integer and
floating point types.

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

3 years ago[ValueTracking] Handle increasing mul recurrence in isKnownNonZero()
Jingu Kang [Mon, 22 Mar 2021 10:12:39 +0000 (10:12 +0000)]
[ValueTracking] Handle increasing mul recurrence in isKnownNonZero()

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

3 years ago[Sanitizer] Remove refactoring leftover [NFC]
Julian Lettner [Tue, 23 Mar 2021 22:09:13 +0000 (15:09 -0700)]
[Sanitizer] Remove refactoring leftover [NFC]

3 years agoAdd register size info back to MCRegisterClass
Rafael Auler [Wed, 3 Mar 2021 22:31:57 +0000 (14:31 -0800)]
Add register size info back to MCRegisterClass

This patch addresses the removal of register size information done in
commit c8b782c.

Without this change, there is no viable option to get register size
information outside libTarget. We need this information to run
analysis that know the register size from the MC layer, used by
BOLT.

Discussion D50285 and D47199.

Reviewed By: kparzysz

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

3 years ago[lld-macho] Fixed lld-version expectation in test so it works on Fuchsia.
Vy Nguyen [Tue, 23 Mar 2021 21:51:52 +0000 (17:51 -0400)]
[lld-macho] Fixed lld-version expectation in test so it works on Fuchsia.

On Fuchsia, it's called Fuchsia LLD

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

3 years ago[MSSA] Extending IsGuaranteedLoopInvariant to support an instruction defined in the...
Matteo Favaro [Tue, 23 Mar 2021 21:31:25 +0000 (21:31 +0000)]
[MSSA] Extending IsGuaranteedLoopInvariant to support an instruction defined in the entry block

As mentioned in [[ https://reviews.llvm.org/D96979 | D96979 ]], I'm extending the **IsGuaranteedLoopInvariant** check also to the `MemorySSA.cpp` file.

@fhahn For now I didn't unify the function into `MemorySSA.h` because, as you mentioned, it's not directly MSSA related. I'm open to suggestions to find a better place so we can improve the unification process.

Reviewed By: fhahn

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

3 years ago[NFC][LLDB] Removing extra semicolons to silence -Wc++98-compat-extra-semi diagnostics
Shafik Yaghmour [Tue, 23 Mar 2021 21:31:40 +0000 (14:31 -0700)]
[NFC][LLDB] Removing extra semicolons to silence -Wc++98-compat-extra-semi diagnostics

3 years ago[Analysis]Add getPointersDiff function to improve compile time.
Alexey Bataev [Tue, 23 Mar 2021 20:22:58 +0000 (13:22 -0700)]
[Analysis]Add getPointersDiff function to improve compile time.

Added getPointersDiff function to LoopAccessAnalysis and used it instead
direct calculatoin of the distance between pointers and/or
isConsecutiveAccess function in SLP vectorizer to improve compile time
and detection of stores consecutive chains.

Part of D57059

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

3 years ago[mlir][tosa] Add tosa.pad to linalg.pad operation
Rob Suderman [Fri, 19 Mar 2021 23:04:50 +0000 (16:04 -0700)]
[mlir][tosa] Add tosa.pad to linalg.pad operation

Lowers from tosa's pad op to the linalg equivalent for floating,
integer, and quantized values.

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

3 years agoRevert "[lld-macho][nfc] minor clean up, follow up to D98559"
Vy Nguyen [Tue, 23 Mar 2021 21:14:27 +0000 (17:14 -0400)]
Revert "[lld-macho][nfc] minor clean up, follow up to D98559"

This reverts commit 1bc33eb6a32bdb193a8b838df823b4563450f6b3.
tests failed on windows

3 years ago[mlir][Pattern] Add better support for using interfaces/traits to match root operatio...
River Riddle [Tue, 23 Mar 2021 20:44:14 +0000 (13:44 -0700)]
[mlir][Pattern] Add better support for using interfaces/traits to match root operations in rewrite patterns

To match an interface or trait, users currently have to use the `MatchAny` tag. This tag can be quite problematic for compile time for things like the canonicalizer, as the `MatchAny` patterns may get applied to  *every* operation. This revision adds better support by bucketing interface/trait patterns based on which registered operations have them registered. This means that moving forward we will only attempt to match these patterns to operations that have this interface registered. Two simplify defining patterns that match traits and interfaces, two new utility classes have been added: OpTraitRewritePattern and OpInterfaceRewritePattern.

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

3 years ago[ODS] Implement a new 'hasCanonicalizeMethod' bit for cann patterns.
Chris Lattner [Tue, 23 Mar 2021 05:15:39 +0000 (22:15 -0700)]
[ODS] Implement a new 'hasCanonicalizeMethod' bit for cann patterns.

This provides a simplified way to implement 'matchAndRewrite' style
canonicalization patterns for ops that don't need the full power of
RewritePatterns.  Using this style, you can implement a static method
with a signature like:

```
LogicalResult AssertOp::canonicalize(AssertOp op, PatternRewriter &rewriter) {
  return success();
}
```

instead of dealing with defining RewritePattern subclasses.  This also
adopts this for a few canonicalization patterns in the std dialect to
show how it works.

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

3 years ago[test] Add --sysroot= to make gcc-toolchain.cpp stable
Fangrui Song [Tue, 23 Mar 2021 20:32:30 +0000 (13:32 -0700)]
[test] Add --sysroot= to make gcc-toolchain.cpp stable

3 years ago[HWASan] Refactor in preparation for x86 aliasing mode. NFC
Matt Morehouse [Tue, 23 Mar 2021 18:57:12 +0000 (11:57 -0700)]
[HWASan] Refactor in preparation for x86 aliasing mode. NFC

Reviewed By: vitalybuka, eugenis

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

3 years ago[BasicAA] Handle assumes with operand bundles
Nikita Popov [Tue, 23 Mar 2021 20:18:30 +0000 (21:18 +0100)]
[BasicAA] Handle assumes with operand bundles

This fixes a regression reported on D99022: If a call has operand
bundles, then the inaccessiblememonly attribute on the function
will be ignored, as operand bundles can affect modref behavior in
the general case. However, for assume operand bundles in particular
this is not the case.

Adjust getModRefBehavior() to always report inaccessiblememonly
for assumes, regardless of presence of operand bundles.

3 years ago[BasicAA] Add test for assume with operand bundles (NFC)
Nikita Popov [Tue, 23 Mar 2021 20:07:36 +0000 (21:07 +0100)]
[BasicAA] Add test for assume with operand bundles (NFC)

3 years agoRevert "[Analysis]Add getPointersDiff function to improve compile time."
Alexey Bataev [Tue, 23 Mar 2021 20:17:26 +0000 (13:17 -0700)]
Revert "[Analysis]Add getPointersDiff function to improve compile time."

This reverts commit 065a14a12d2694f26f4e894641f5ab8cfc5da8bd to
investigate and fix crash in SLP vectorizer.

3 years ago[mlir][tosa] Add tosa.tile to linalg.generic lowering
Rob Suderman [Mon, 22 Mar 2021 21:38:39 +0000 (14:38 -0700)]
[mlir][tosa] Add tosa.tile to linalg.generic lowering

Tiling operations are generic operations with modified indexing. Updated to to
linalg lowerings to perform this lowering.

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

3 years ago[lld-macho][nfc] minor clean up, follow up to D98559
Vy Nguyen [Tue, 23 Mar 2021 19:54:01 +0000 (15:54 -0400)]
[lld-macho][nfc] minor clean up, follow up to D98559

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

3 years ago[mlir][tosa] Add tosa.matmul and tosa.fully_connected lowering
natashaknk [Tue, 23 Mar 2021 20:00:38 +0000 (13:00 -0700)]
[mlir][tosa] Add tosa.matmul and tosa.fully_connected lowering

Adds lowerings for matmul and fully_connected. Only supports 2D tensors for inputs and weights, and 1D tensors for bias.

Reviewed By: rsuderman

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

3 years ago[Analysis]Add getPointersDiff function to improve compile time.
Alexey Bataev [Fri, 19 Mar 2021 14:19:17 +0000 (07:19 -0700)]
[Analysis]Add getPointersDiff function to improve compile time.

Added getPointersDiff function to LoopAccessAnalysis and used it instead
direct calculatoin of the distance between pointers and/or
isConsecutiveAccess function in SLP vectorizer to improve compile time
and detection of stores consecutive chains.

Part of D57059

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

3 years ago[AArch64][GlobalISel] Lower G_CTLZ_ZERO_UNDEF.
Amara Emerson [Tue, 23 Mar 2021 18:31:13 +0000 (11:31 -0700)]
[AArch64][GlobalISel] Lower G_CTLZ_ZERO_UNDEF.

This adds some missing legalizer tests, which uncovered a v2s64 selection
test that wasn't working since there's no legalization or instruction for that.

3 years ago[ValueTracking] Teach canCreateUndefOrPoison that ctpop does not create undef or...
Craig Topper [Tue, 23 Mar 2021 19:20:04 +0000 (12:20 -0700)]
[ValueTracking] Teach canCreateUndefOrPoison that ctpop does not create undef or poison.

This select of ctpop with 0 pattern can get left behind after
loop idiom recognize converts a loop to ctpop. LLVM 10 was able
to optimize this, but LLVM 11 and later is not. The difference
seems to be that some select transforms are now limited based
on canCreateUndefOrPoison.

Teaching canCreateUndefOrPoison about ctpop restores the
LLVM 10 codegen.

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

3 years ago[libcxxabi] Use cxx-headers target to consume libcxx headers
Petr Hosek [Wed, 10 Mar 2021 19:21:41 +0000 (11:21 -0800)]
[libcxxabi] Use cxx-headers target to consume libcxx headers

Rather than including libc++ include dir, use the cxx-headers target.

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

3 years ago[sanitizer] Implement MapDynamicShadowAndAliases.
Matt Morehouse [Tue, 23 Mar 2021 18:21:08 +0000 (11:21 -0700)]
[sanitizer] Implement MapDynamicShadowAndAliases.

The function works like MapDynamicShadow, except that it creates aliased
memory to the right of the shadow.  The main use case is for HWASan
aliasing mode, which gets fast IsAlias() checks by exploiting the fact
that the upper bits of the shadow base and aliased memory match.

Reviewed By: vitalybuka, eugenis

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

3 years agoRevert "Revert "Revert "Revert "Revert "Revert "[lld-macho] Implement -dependency_inf...
Vy Nguyen [Tue, 23 Mar 2021 02:05:46 +0000 (22:05 -0400)]
Revert "Revert "Revert "Revert "Revert "Revert "[lld-macho] Implement -dependency_info (partially - more opcodes needed)""""""

This reverts commit 4876ba5b2d6a1264ec73e5cf3fcad083f6927d19.

Third-attemp relanding D98559, new change:
  - explicitly cast enum to underlying type to avoid ambiguity (workaround to clang's bug).

3 years ago[libc++] Remove old cache file that was left behind by accident
Louis Dionne [Tue, 23 Mar 2021 18:15:28 +0000 (14:15 -0400)]
[libc++] Remove old cache file that was left behind by accident

3 years agoscudo: Preserve no-memtag attribute on cached secondary allocations.
Peter Collingbourne [Mon, 22 Mar 2021 19:29:51 +0000 (12:29 -0700)]
scudo: Preserve no-memtag attribute on cached secondary allocations.

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

3 years ago[C++20] [P1825] Fix bugs with implicit-move from variables of reference type.
Arthur O'Dwyer [Fri, 19 Mar 2021 17:55:28 +0000 (13:55 -0400)]
[C++20] [P1825] Fix bugs with implicit-move from variables of reference type.

Review D88220 turns out to have some pretty severe bugs, but I *think*
this patch fixes them.

Paper P1825 is supposed to enable implicit move from "non-volatile objects
and rvalue references to non-volatile object types." Instead, what was committed
seems to have enabled implicit move from "non-volatile things of all kinds,
except that if they're rvalue references then they must also refer to non-volatile
things." In other words, D88220 accidentally enabled implicit move from
lvalue object references (super yikes!) and also from non-object references
(such as references to functions).

These two cases are now fixed and regression-tested.

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

3 years ago[libc++] Simpler Python script for generating a graph of libc++'s header dependencies
Arthur O'Dwyer [Mon, 22 Mar 2021 21:38:28 +0000 (17:38 -0400)]
[libc++] Simpler Python script for generating a graph of libc++'s header dependencies

My attempts to play around with the old graph_header_deps.py were mostly fruitless;
I needed to modify it in various ways to make it work, and then even when I got it
working, it generated pretty ugly graphs.

Old graph_header_deps.py (after my local changes to simplify the usage)
(producing https://i.imgur.com/zATrsaP.jpg )

    mkdir foo
    time ./graph_header_deps.py --libcxx-only -o foo --clang-command ~/llvm-project/build/bin/clang++
    dot -Tpng < foo/all_headers.dot > old.png
    file old.png

    real    0m37.453s
    old.png: PNG image data, 25882 x 3035, 8-bit/color RGBA, non-interlaced

New graph_header_deps.py
(producing https://i.imgur.com/ZU0G52U.png )

    time ./graph_header_deps.py | dot -Tpng > new.png
    file new.png

    real    0m1.063s
    new.png: PNG image data, 6162 x 1344, 8-bit/color RGBA, non-interlaced

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

3 years ago[test] Enable check-lsan on aarch64-*-linux
Fangrui Song [Tue, 23 Mar 2021 18:11:26 +0000 (11:11 -0700)]
[test] Enable check-lsan on aarch64-*-linux

`check-lsan` passed on an aarch64-*-linux machine.

Unsupport `many_tls_keys_pthread.cpp` for now: it requires GetTls to include
`specific_1stblock` and `specific` in `struct pthread`.

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

3 years ago[libc++] NFC: nodebug => no-debug in the CI configurations
Louis Dionne [Tue, 23 Mar 2021 18:09:52 +0000 (14:09 -0400)]
[libc++] NFC: nodebug => no-debug in the CI configurations

3 years ago[mlir] silence -Wunused-variable in release mode in Linalg transforms
Alex Zinenko [Tue, 23 Mar 2021 17:59:12 +0000 (18:59 +0100)]
[mlir] silence -Wunused-variable in release mode in Linalg transforms

3 years ago[dsymutil] Only look for ThinLTO suffixes if we failed to find symbol.
Jonas Devlieghere [Tue, 23 Mar 2021 17:52:01 +0000 (10:52 -0700)]
[dsymutil] Only look for ThinLTO suffixes if we failed to find symbol.

Only look for symbols with the ThinLTO suffix if we fail to find the
symbol.

3 years ago[NFC][AMDGPU] Reserve AMD GPU ELF machine number 0x41
Tony [Tue, 23 Mar 2021 15:27:51 +0000 (15:27 +0000)]
[NFC][AMDGPU] Reserve AMD GPU ELF machine number 0x41

Reviewed By: foad

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

3 years ago[MLIR][Linalg] Hoist padding across multiple levels of tiling
Nicolas Vasilache [Tue, 23 Mar 2021 17:17:30 +0000 (17:17 +0000)]
[MLIR][Linalg] Hoist padding across multiple levels of tiling

This revision introduces proper backward slice computation during the hoisting of
PadTensorOp. This allows hoisting padding even across multiple levels of tiling.
Such hoisting requires the proper handling of loop bounds that may depend on enclosing
loop variables.

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

3 years agoDocument -fcrash-diagnostics-dir
Paul Robinson [Thu, 18 Mar 2021 15:28:38 +0000 (08:28 -0700)]
Document -fcrash-diagnostics-dir

This was added in LLVM 7.0 but without help text or other docs.

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

3 years ago[libc++] [C++20] [P0482] Add missing tests and synopses for char8_t.
Marek Kurdej [Tue, 23 Mar 2021 16:15:07 +0000 (17:15 +0100)]
[libc++] [C++20] [P0482] Add missing tests and synopses for char8_t.

Left to finish P0482:
* <cuchar> header.
* Parts of <memory_resource> concerning char8_t. Also, tests for hash<pmr::*string>.

Reviewed By: ldionne, #libc, Quuxplusone

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

3 years ago[libc++] Add missing test_macros.h include in tests using TEST_STD_VER.
Marek Kurdej [Tue, 23 Mar 2021 16:13:15 +0000 (17:13 +0100)]
[libc++] Add missing test_macros.h include in tests using TEST_STD_VER.

3 years ago[runtimes] Add the libc project to the list of runtimes.
Siva Chandra [Mon, 22 Mar 2021 18:59:49 +0000 (18:59 +0000)]
[runtimes] Add the libc project to the list of runtimes.

This is possible as the default libc build now works under runtimes build.

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

3 years agoTeach DWARFExpression about DWARF 4+ Location Descriptions
Adrian Prantl [Tue, 23 Mar 2021 01:09:46 +0000 (18:09 -0700)]
Teach DWARFExpression about DWARF 4+ Location Descriptions

DWARFExpression implements the DWARF2 expression model that left
ambiguity on whether the result of an expression was a value or an
address. This patch implements the DWARF location description model
introduces in DWARF 4 and sets the result Value's kind accordingly, if
the expression comes from a DWARF v4+ compile unit. The nomenclature
is taken from DWARF 5, chapter 2.6 "Location Descriptions".

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

3 years ago[mlir] verify that operand/result_segment_sizes attributes have i32 element
Alex Zinenko [Tue, 23 Mar 2021 13:04:52 +0000 (14:04 +0100)]
[mlir] verify that operand/result_segment_sizes attributes have i32 element

This is an assumption that is made in numerous places in the code. In
particular, in the code generated by mlir-tblgen for operand/result accessors
in ops with attr-sized operand or result lists. Make sure to verify this
assumption.

Note that the operation traits are verified before running the custom op
verifier, which can expect the trait verifier to have passed, but some traits
may be verified before the AttrSizedOperand/ResultTrait and should not make
such assumptions.

Reviewed By: mehdi_amini

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

3 years ago[lldb/Plugins] Add ScriptedProcess Process Plugin
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:30 +0000 (16:22 +0000)]
[lldb/Plugins] Add ScriptedProcess Process Plugin

This patch introduces Scripted Processes to lldb.

The goal, here, is to be able to attach in the debugger to fake processes
that are backed by script files (in Python, Lua, Swift, etc ...) and
inspect them statically.

Scripted Processes can be used in cooperative multithreading environments
like the XNU Kernel or other real-time operating systems, but it can
also help us improve the debugger testing infrastructure by writting
synthetic tests that simulates hard-to-reproduce process/thread states.

Although ScriptedProcess is not feature-complete at the moment, it has
basic execution capabilities and will improve in the following patches.

rdar://65508855

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/bindings] Add Python ScriptedProcess base class to lldb module
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:26 +0000 (16:22 +0000)]
[lldb/bindings] Add Python ScriptedProcess base class to lldb module

In order to facilitate the writting of Scripted Processes, this patch
introduces a `ScriptedProcess` python base class in the lldb module.

The base class holds the python interface with all the - abstract -
methods that need to be implemented by the inherited class but also some
methods that can be overwritten.

This patch also provides an example of a Scripted Process with the
`MyScriptedProcess` class.

rdar://65508855

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:18 +0000 (16:22 +0000)]
[lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess

This patch adds a ScriptedProcess interface to the ScriptInterpreter and
more specifically, to the ScriptInterpreterPython.

This interface will be used in the C++ `ScriptProcess` Process Plugin to
call the script methods.

At the moment, not all methods are implemented, they will upstreamed in
upcoming patches.

This patch also adds helper methods to the ScriptInterpreter to
convert `SBAPI` Types (SBData & SBError) to `lldb_private` types
(DataExtractor & Status).

rdar://65508855

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch
Med Ismail Bennani [Tue, 23 Mar 2021 16:22:07 +0000 (16:22 +0000)]
[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch

This patch adds a new command options to the CommandObjectProcessLaunch
for scripted processes.

Among the options, the user need to specify the class name managing the
scripted process. The user can also use a key-value dictionary holding
arbitrary data that will be passed to the managing class.

This patch also adds getters and setters to `SBLaunchInfo` for the
class name managing the scripted process and the dictionary.

rdar://65508855

Differential Review: https://reviews.llvm.org/D95710

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[SystemZ][z/OS] fix lit test related to alignment
Nancy Wang [Tue, 23 Mar 2021 17:09:05 +0000 (13:09 -0400)]
[SystemZ][z/OS] fix lit test related to alignment

This patch is to fix lit test case failure relate to alignment, on z/OS, maximum alignment value for 64 bit mode is 16 and also fixed clang/test/Layout/itanium-union-bitfield.cpp, attribute ((aligned(4))) is needed for bit-field member in Union for z/OS because single bit-field has one byte alignment, this will make sure size and alignment will be correct value on z/OS.

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

3 years ago[sanitizer] Support dynamic premapped R/W range in primary allocator.
Matt Morehouse [Tue, 23 Mar 2021 16:31:19 +0000 (09:31 -0700)]
[sanitizer] Support dynamic premapped R/W range in primary allocator.

The main use case for this change is HWASan aliasing mode, which premaps
the alias space adjacent to the dynamic shadow.  With this change, the
primary allocator can allocate from the alias space instead of a
separate region.

Reviewed By: vitalybuka, eugenis

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

3 years ago[AMDGPU] Simplify AMDGPUAnnotateUniformValues::visitBranchInst. NFC.
Jay Foad [Tue, 23 Mar 2021 16:54:01 +0000 (16:54 +0000)]
[AMDGPU] Simplify AMDGPUAnnotateUniformValues::visitBranchInst. NFC.

A BranchInst is always the terminator of its containing BasicBlock.

3 years ago[NFC] Enable RVALUE_REFERENCE_THIS on MSVC 2019
Nathan James [Tue, 23 Mar 2021 16:40:01 +0000 (16:40 +0000)]
[NFC] Enable RVALUE_REFERENCE_THIS on MSVC 2019

In https://reviews.llvm.org/D72948 This was enabled for all MSVC but reverted as it was determined not to work on some 2017 versions.
The issue is assumed to be fixed on 2019 so enable for 2019 and newer.

Some testing could be done to determine which version of MSVC 2017 support this feature but its safer right now to leave it at 2019.

Reviewed By: aaron.ballman

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

3 years ago[ASTMatchers][NFC] Use SmallVector when building variadic matcher descriptor
Nathan James [Tue, 23 Mar 2021 16:38:44 +0000 (16:38 +0000)]
[ASTMatchers][NFC] Use SmallVector when building variadic matcher descriptor

Saves having to manually deallocate storage and keeps InnerArgs will have good cache locality.

Reviewed By: aaron.ballman

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

3 years ago[flang][driver] Add -fintrinsic-modules-path option
Arnamoy Bhattacharyya [Tue, 23 Mar 2021 16:24:57 +0000 (12:24 -0400)]
[flang][driver] Add -fintrinsic-modules-path option

Reviewed By: awarzynski

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