platform/upstream/llvm.git
2 years ago[Clang][AST] Resolve FIXME: Remove ObjCObjectPointer from
Alfonso Gregory [Wed, 20 Oct 2021 17:29:02 +0000 (10:29 -0700)]
[Clang][AST] Resolve FIXME: Remove ObjCObjectPointer from
isSpecifierType

There is no reason to have this here, (since all tests pass) and it
isn't even a specifier anyway. We can just treat it as a pointer
instead.

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

2 years ago[IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol
Itay Bookstein [Wed, 20 Oct 2021 17:29:47 +0000 (10:29 -0700)]
[IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol

As discussed in:
* https://reviews.llvm.org/D94166
* https://lists.llvm.org/pipermail/llvm-dev/2020-September/145031.html

The GlobalIndirectSymbol class lost most of its meaning in
https://reviews.llvm.org/D109792, which disambiguated getBaseObject
(now getAliaseeObject) between GlobalIFunc and everything else.
In addition, as long as GlobalIFunc is not a GlobalObject and
getAliaseeObject returns GlobalObjects, a GlobalAlias whose aliasee
is a GlobalIFunc cannot currently be modeled properly. Creating
aliases for GlobalIFuncs does happen in the wild (e.g. glibc). In addition,
calling getAliaseeObject on a GlobalIFunc will currently return nullptr,
which is undesirable because it should return the object itself for
non-aliases.

This patch refactors the GlobalIFunc class to inherit directly from
GlobalObject, and removes GlobalIndirectSymbol (while inlining the
relevant parts into GlobalAlias and GlobalIFunc). This allows for
calling getAliaseeObject() on a GlobalIFunc to return the GlobalIFunc
itself, making getAliaseeObject() more consistent and enabling
alias-to-ifunc to be properly modeled in the IR.

I exercised some judgement in the API clients of GlobalIndirectSymbol:
some were 'monomorphized' for GlobalAlias and GlobalIFunc, and
some remained shared (with the type adapted to become GlobalValue).

Reviewed By: MaskRay

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

2 years agoInvalidPtrChecker - don't dereference a dyn_cast<> - use cast<> instead.
Simon Pilgrim [Wed, 20 Oct 2021 17:05:46 +0000 (18:05 +0100)]
InvalidPtrChecker - don't dereference a dyn_cast<> - use cast<> instead.

Avoid dereferencing a nullptr returned by dyn_cast<>, by using cast<> instead which asserts that the cast is valid.

2 years ago[mlir] fix region property generation in python bindings
Alex Zinenko [Wed, 20 Oct 2021 16:56:20 +0000 (18:56 +0200)]
[mlir] fix region property generation in python bindings

2 years agoFix unused variable warning.
Sterling Augustine [Wed, 20 Oct 2021 16:59:16 +0000 (09:59 -0700)]
Fix unused variable warning.

2 years ago[WebAssembly] Add prototype relaxed float min max instructions
Zhi An Ng [Wed, 20 Oct 2021 16:41:50 +0000 (09:41 -0700)]
[WebAssembly] Add prototype relaxed float min max instructions

Add relaxed. f32x4.min, f32x4.max, f64x2.min, f64x2.max. These are only
exposed as builtins, and require user opt-in.

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

2 years ago[OpenMP] Add GOMP allocator functions
Nawrin Sultana [Tue, 12 Oct 2021 19:54:46 +0000 (14:54 -0500)]
[OpenMP] Add GOMP allocator functions

This patch adds GOMP_alloc and GOMP_free functions of LIBGOMP.

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

2 years ago[InstCombine] add tests for casted insertelement; NFC
Sanjay Patel [Wed, 20 Oct 2021 16:14:45 +0000 (12:14 -0400)]
[InstCombine] add tests for casted insertelement; NFC

2 years ago[MLIR][OpenMP] Shifted hint from CriticalOp to CriticalDeclareOp
Shraiysh Vaishay [Wed, 20 Oct 2021 12:32:21 +0000 (18:02 +0530)]
[MLIR][OpenMP] Shifted hint from CriticalOp to CriticalDeclareOp

According to the OpenMP 5.0 standard, names and hints of critical operation are
closely related. The following are the restrictions on them:
 - Unless the effect is as if `hint(omp_sync_hint_none)` was specified, the
   critical construct must specify a name.
 - If the hint clause is specified, each of the critical constructs with the
   same name must have a hint clause for which the hint-expression evaluates to
   the same value.

These restrictions will be enforced by design if the hint expression is a part
of the `omp.critical.declare` operation.
 - Any operation with no "name" will be considered to have
   `hint(omp_sync_hint_none)`.
 - All the operations with the same "name" will have the same hint value.

Reviewed By: kiranchandramohan

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

2 years ago[clang] Add plugin ActionType to run command line plugin before main action
Arthur Eubanks [Tue, 19 Oct 2021 21:50:44 +0000 (14:50 -0700)]
[clang] Add plugin ActionType to run command line plugin before main action

Currently we have a way to run a plugin if specified on the command line
after the main action, and ways to unconditionally run the plugin before
or after the main action, but no way to run a plugin if specified on the
command line before the main action.

This introduces the missing option.

This is helpful because -clear-ast-before-backend clears the AST before
codegen, while some plugins may want access to the AST.

Reviewed By: dblaikie

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

2 years ago[CodeGenPrepare] Avoid a scalable-vector crash in ctlz/cttz
Fraser Cormack [Wed, 20 Oct 2021 14:51:36 +0000 (15:51 +0100)]
[CodeGenPrepare] Avoid a scalable-vector crash in ctlz/cttz

This patch fixes a crash when despeculating ctlz/cttz intrinsics with
scalable-vector types. It is not safe to speculatively get the size of
the vector type in bits in case the vector type is not a fixed-length type. As
it happens this isn't required as vector types are skipped anyway.

Reviewed By: RKSimon

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

2 years ago[RISCV] Use clang_builtin_alias for all RISCV vector intrinsics.
Craig Topper [Wed, 20 Oct 2021 14:54:05 +0000 (07:54 -0700)]
[RISCV] Use clang_builtin_alias for all RISCV vector intrinsics.

Previously we used builtin_alias for overloaded intrinsics, but
macros for the non-overloaded version. This patch changes the
non-overloaded versions to also use builtin_alias, but without
the overloadable attribute.

Reviewed By: khchen, HsiangKai

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

2 years ago[analyzer][NFC] Refactor llvm::isa<> usages in the StaticAnalyzer
Balazs Benics [Wed, 20 Oct 2021 15:43:31 +0000 (17:43 +0200)]
[analyzer][NFC] Refactor llvm::isa<> usages in the StaticAnalyzer

It turns out llvm::isa<> is variadic, and we could have used this at a
lot of places.

The following patterns:
  x && isa<T1>(x) || isa<T2>(x) ...
Will be replaced by:
  isa_and_non_null<T1, T2, ...>(x)

Sometimes it caused further simplifications, when it would cause even
more code smell.

Aside from this, keep in mind that within `assert()` or any macro
functions, we need to wrap the isa<> expression within a parenthesis,
due to the parsing of the comma.

Reviewed By: martong

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

2 years ago[lld-macho] Fix dangling string reference when adding frameworks
Kaining Zhong [Wed, 20 Oct 2021 15:20:21 +0000 (11:20 -0400)]
[lld-macho] Fix dangling string reference when adding frameworks

In Driver.cpp, addFramework used std::string instance to represent the path of a framework, which will be freed after the function returns. However, this string is stored in loadedArchive, which will be used later to compare with path of newly added frameworks. This caused https://bugs.llvm.org/show_bug.cgi?id=52133. A test is included in this commit to reproduce this bug.

Now resolveDylibPath returns a StringRef instance, and it uses StringSaver to save its data, then returns it to functions on the top. This ensures the resolved framework path is still valid after LC_LINKER_OPTION is parsed.

Reviewed By: int3, #lld-macho, oontvoo

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

2 years ago[NewPM][test] Strickly use -passes in some more lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 15:06:25 +0000 (17:06 +0200)]
[NewPM][test] Strickly use -passes in some more lit tests

Removed/replaced RUN lines using legacy PM syntax in favor of using
-passes in lit tests for Float2Int, MetaRenamer, StripDeadPrototypes
and StripSymbols.

2 years ago[NewPM][test] Use -passes syntax in Mem2Reg lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 13:45:29 +0000 (15:45 +0200)]
[NewPM][test] Use -passes syntax in Mem2Reg lit tests

The legacy PM is deprecated, so use the new PM syntax in lit tests
verifying the mem2reg pass.

2 years ago[Sema, StaticAnalyzer] Use StringRef::contains (NFC)
Kazu Hirata [Wed, 20 Oct 2021 15:02:36 +0000 (08:02 -0700)]
[Sema, StaticAnalyzer] Use StringRef::contains (NFC)

2 years ago[RISCV][WebAssembly][TargetLowering] Allow expandCTLZ/expandCTTZ to rely on CTPOP...
Craig Topper [Tue, 19 Oct 2021 23:10:02 +0000 (16:10 -0700)]
[RISCV][WebAssembly][TargetLowering] Allow expandCTLZ/expandCTTZ to rely on CTPOP expansion for vectors.

Our fallback expansion for CTLZ/CTTZ relies on CTPOP. If CTPOP
isn't legal or custom for a vector type we would scalarize the
CTLZ/CTTZ. This is different than CTPOP itself which would use a
vector expansion.

This patch teaches expandCTLZ/CTTZ to rely on the vector CTPOP
expansion instead of scalarizing. To do this I had to add additional
checks to make sure the operations used by CTPOP expansions are all
supported. Some of the operations were already needed for the CTLZ/CTTZ
expansion.

This is a huge improvement to the RISCV which doesn't have a scalar
ctlz or cttz in the base ISA.

For WebAssembly, I've added Custom lowering to keep the scalarizing
behavior. I've also extended the scalarizing to CTPOP.

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

2 years ago[clangd] Fix use-after-free in HeaderIncluderCache
Kadir Cetinkaya [Wed, 20 Oct 2021 10:52:49 +0000 (12:52 +0200)]
[clangd] Fix use-after-free in HeaderIncluderCache

Includer cache could get into a bad state when a main file went bad and
added back afterwards. This patch adds a check to invalidate to prevent
that.

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

2 years ago[clangd] Only publish preamble after rebuilds
Kadir Cetinkaya [Wed, 20 Oct 2021 13:12:25 +0000 (15:12 +0200)]
[clangd] Only publish preamble after rebuilds

Don't invoke parsing callback for preamble if clangd is using a
previously built one.

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

2 years ago[x86] make helper for useVPTERNLOG; NFC
Sanjay Patel [Wed, 20 Oct 2021 13:01:11 +0000 (09:01 -0400)]
[x86] make helper for useVPTERNLOG; NFC

See D112085 for another use case.

2 years ago[mlir] Expand prefixing to OpFormatGen
Jacques Pienaar [Wed, 20 Oct 2021 14:08:36 +0000 (07:08 -0700)]
[mlir] Expand prefixing to OpFormatGen

Follow up to also use the prefixed emitters in OpFormatGen (moved
getGetterName(s) and getSetterName(s) to Operator as that is most
convenient usage wise even though it just depends on Dialect). Prefix
accessors in Test dialect and follow up on missed changes in
OpDefinitionsGen.

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

2 years ago[DebugInfo][InstrRef] Track a single variable at a time
Jeremy Morse [Wed, 20 Oct 2021 13:57:07 +0000 (14:57 +0100)]
[DebugInfo][InstrRef] Track a single variable at a time

Here's another performance patch for InstrRefBasedLDV: rather than
processing all variable values in a scope at a time, instead, process one
variable at a time. The benefits are twofold:
 * It's easier to reason about one variable at a time in your mind,
 * It improves performance, apparently from increased locality.

The downside is that the value-propagation code gets indented one level
further, plus there's some churn in the unit tests.

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

2 years ago[mlir][Linalg] Add a first vectorization pattern for conv1d in NWCxWCF format.
Nicolas Vasilache [Wed, 20 Oct 2021 13:53:56 +0000 (13:53 +0000)]
[mlir][Linalg] Add a first vectorization pattern for conv1d in NWCxWCF format.

This revision uses the newly refactored StructuredGenerator to create a simple vectorization for conv1d_nwc_wcf.

Note that the pattern is not specific to the op and is technically not even specific to the ConvolutionOpInterface (modulo minor details related to dilations and strides).

The overall design follows the same ideas as the lowering of vector::ContractionOp -> vector::OuterProduct: it seeks to be minimally complex, composable and extensible while avoiding inference analysis. Instead, we metaprogram the maps/indexings we expect and we match against them.

This is just a first stab and still needs to be evaluated for performance.
Other tradeoffs are possible that should be explored.

Reviewed By: ftynse

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

2 years ago[libFuzzer] Update InputInfo.TimeOfUnit when replacing it in the corpus.
PZ Read [Wed, 20 Oct 2021 13:14:22 +0000 (06:14 -0700)]
[libFuzzer] Update InputInfo.TimeOfUnit when replacing it in the corpus.

Previously, when the fuzzing loop replaced an input in the corpus, it didn't update the execution time of the input. Therefore, some schedulers (e.g. Entropic) would adjust weights based on the incorrect execution time.

This patch updates the execution time of the input when replacing it.

Reviewed By: morehouse

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

2 years ago[libc++] Move LIBCXX-DEBUG-FIXME to params.py
Louis Dionne [Mon, 18 Oct 2021 20:19:52 +0000 (16:19 -0400)]
[libc++] Move LIBCXX-DEBUG-FIXME to params.py

This temporary FIXME really belongs to the testing config, not to the
specific CMake cache that enables that configuration.

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

2 years ago[NewPM][test] Only use -passes syntax in Scalarizer lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 13:00:07 +0000 (15:00 +0200)]
[NewPM][test] Only use -passes syntax in Scalarizer lit tests

With legacy PM being deprecated it should be enough to verify the
scalarizer pass using the new-PM syntax when invoking opt.

2 years ago[NewPM][test] Use -passes syntax in VectorCombine lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 12:47:49 +0000 (14:47 +0200)]
[NewPM][test] Use -passes syntax in VectorCombine lit tests

The legacy PM is deprecated, so use the new PM syntax in lit tests
running the vector-combine pass.

2 years ago[NewPM][test] Use -passes syntax in BoundsChecking lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 10:34:45 +0000 (12:34 +0200)]
[NewPM][test] Use -passes syntax in BoundsChecking lit tests

The legacy PM is deprecated, so use the new PM syntax in lit tests
running the bounds-checking pass.

2 years ago[NewPM][test] Use -passes syntax in SpeculativeExecution lit tests
Bjorn Pettersson [Wed, 20 Oct 2021 10:32:08 +0000 (12:32 +0200)]
[NewPM][test] Use -passes syntax in SpeculativeExecution lit tests

The legacy PM is deprecated, so use the new PM syntax in lit tests
running the speculative-execution pass.

2 years ago[NewPM][test] Avoid using -enable-new-pm=1 since -passes implies new PM
Bjorn Pettersson [Wed, 20 Oct 2021 09:28:07 +0000 (11:28 +0200)]
[NewPM][test] Avoid using -enable-new-pm=1 since -passes implies new PM

2 years ago[lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*
Michał Górny [Fri, 27 Aug 2021 16:55:37 +0000 (18:55 +0200)]
[lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*

gdbserver does not expose combined ymm* registers but rather XSAVE-style
split xmm* and ymm*h portions.  Extend value_regs to support combining
multiple registers and use it to create user-friendly ymm* registers
that are combined from split xmm* and ymm*h portions.

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

2 years ago[lldb] [Process/Utility] Fix value_regs/invalidate_regs for ARM
Michał Górny [Tue, 19 Oct 2021 12:17:20 +0000 (14:17 +0200)]
[lldb] [Process/Utility] Fix value_regs/invalidate_regs for ARM

Fix incorrect values for value_regs, and incomplete values for
invalidate_regs in RegisterInfos_arm.  The value_regs entry needs
to list only one base (i.e. larger) register that needs to be read
to get the value for this register, while invalidate_regs needs to list
all other registers (including pseudo-register) whose values would
change when this register is written to.

7a8ba4ffbeecb5070926b80bb839a4d80539f1ac fixed a similar problem
for ARM64.

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

2 years ago[lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM
Michał Górny [Wed, 20 Oct 2021 11:35:35 +0000 (13:35 +0200)]
[lldb] [Process/Linux] Support arbitrarily-sized FPR writes on ARM

Support arbitrarily-sized FPR writes on ARM in order to fix writing qN
registers directly.  Currently, writing them works only by accident
due to value_regs splitting them into smaller writes via dN and sN
registers.

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

2 years ago[SelectionDAG] Fix getVectorSubVecPointer for scalable subvectors.
Sander de Smalen [Tue, 12 Oct 2021 11:37:42 +0000 (12:37 +0100)]
[SelectionDAG] Fix getVectorSubVecPointer for scalable subvectors.

When inserting a scalable subvector into a scalable vector through
the stack, the index to store to needs to be scaled by vscale.
Before this patch, that didn't yet happen, so it would generate the
wrong offset, thus storing a subvector to the incorrect address
and overwriting the wrong lanes.

For some insert:
  nxv8f16 insert_subvector(nxv8f16 %vec, nxv2f16 %subvec, i64 2)

The offset was not scaled by vscale:
  orr     x8, x8, #0x4
  st1h    { z0.h }, p0, [sp]
  st1h    { z1.d }, p1, [x8]
  ld1h    { z0.h }, p0/z, [sp]

And is changed to:
  mov x8, sp
  st1h { z0.h }, p0, [sp]
  st1h { z1.d }, p1, [x8, #1, mul vl]
  ld1h { z0.h }, p0/z, [sp]

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

2 years ago[libunwind] Use the from-scratch testing configuration by default
Louis Dionne [Tue, 12 Oct 2021 18:10:02 +0000 (14:10 -0400)]
[libunwind] Use the from-scratch testing configuration by default

This commit switches libunwind from using the complicated logic in
libc++'s testing configuration to a from-scratch configuration.
I tried to make sure that all cases that were handled in the old
config were handled by this one too, so hopefully this shouldn't
break anyone. However, if you encounter issues with this change,
please let me know and feel free to revert if I don't reply quickly.

This change was engineered to be easily revertable.

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

2 years ago[SLP][X86] Improve SLP tests for division/multiplication by +/- pow2
Simon Pilgrim [Wed, 20 Oct 2021 12:30:27 +0000 (13:30 +0100)]
[SLP][X86] Improve SLP tests for division/multiplication by +/- pow2

Add PR51436 test as well as some basic multiply tests, and include SSE2 division coverage

2 years ago[CostModel][X86] Add costs for multiply-by-pow2 constants
Simon Pilgrim [Wed, 20 Oct 2021 12:11:21 +0000 (13:11 +0100)]
[CostModel][X86] Add costs for multiply-by-pow2 constants

These are folded to left shifts in the backend.

We should be able to extend this for multiply-by-negpow2 after D111968 has landed to resolve PR51436

2 years agoconsteval if does not form a discarded statement
Aaron Ballman [Wed, 20 Oct 2021 11:23:09 +0000 (07:23 -0400)]
consteval if does not form a discarded statement

When we added support for if consteval, we accidentally formed a discarded
statement evaluation context for the branch-not-taken. However, a discarded
statement is a property of an if constexpr statement, not an if consteval
statement (https://eel.is/c++draft/stmt.if#2.sentence-2). This turned out to
cause issues when deducing the return type from a function with a consteval if
statement -- we wouldn't consider the branch-not-taken when deducing the return
type.

This fixes PR52206.

Note, there is additional work left to be done. We need to track discarded
statement and immediate evaluation contexts separately rather than as being
mutually exclusive.

2 years ago[lldb] [Process/Utility] Define qN regs on ARM via helper macro
Michał Górny [Tue, 19 Oct 2021 15:10:52 +0000 (17:10 +0200)]
[lldb] [Process/Utility] Define qN regs on ARM via helper macro

Add a FPU_QREG macro to define qN registers.  This is a piece-wise
attempt of reconstructing D112066 with the goal of figuring out which
part of the larger change breaks the buildbot.

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

2 years ago[X86] Remove X86ProcFamilyEnum::IntelSLM
Simon Pilgrim [Wed, 20 Oct 2021 10:08:54 +0000 (11:08 +0100)]
[X86] Remove X86ProcFamilyEnum::IntelSLM

Replace X86ProcFamilyEnum::IntelSLM enum with a TuningUseSLMArithCosts flag instead, matching what we already do for Goldmont.

This just leaves X86ProcFamilyEnum::IntelAtom to replace with general Tuning/Feature flags and we can finally get rid of the old X86ProcFamilyEnum enum.

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

2 years ago[lldb] Improve assert message in TestCPPAccelerator
Raphael Isemann [Wed, 20 Oct 2021 10:02:49 +0000 (12:02 +0200)]
[lldb] Improve assert message in TestCPPAccelerator

`log` is just some IO object that gets printed as `<_io.TextIOWrapper = filename`
but the intention here was to print the actual found log contents.

2 years ago[lldb/test] Remove quote/unquote steps from the make invocations
Pavel Labath [Mon, 18 Oct 2021 13:14:43 +0000 (15:14 +0200)]
[lldb/test] Remove quote/unquote steps from the make invocations

None of the commands we run really rely on shell features. Running them
with shell=False, simplifies the code as there is no need for elaborate
quoting.

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

2 years ago[docs] Fix hyperlink
Sven van Haastregt [Wed, 20 Oct 2021 09:20:17 +0000 (10:20 +0100)]
[docs] Fix hyperlink

2 years ago[lldb/DWARF] Ignore debug info pointing to the low addresses
Pavel Labath [Tue, 19 Oct 2021 08:26:27 +0000 (10:26 +0200)]
[lldb/DWARF] Ignore debug info pointing to the low addresses

specifically, ignore addresses that point before the first code section.

This resurrects D87172 with several notable changes:
- it fixes a bug where the early exits in InitializeObject left
  m_first_code_address "initialized" to LLDB_INVALID_ADDRESS (0xfff..f),
  which caused _everything_ to be ignored.
- it extends the line table fix to function parsing as well, where it
  replaces a similar check which was checking the executable permissions
  of the section. This was insufficient because some
  position-independent elf executables can have an executable segment
  mapped at file address zero. (What makes this fix different is that it
  checks for the executable-ness of the sections contained within that
  segment, and those will not be at address zero.)
- It uses a different test case, with an elf file with near-zero
  addresses, and checks for both line table and function parsing.

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

2 years ago[AArch64] Emit .cfi_negate_ra_state for PAC-auth instructions.
Daniel Kiss [Wed, 20 Oct 2021 08:26:31 +0000 (10:26 +0200)]
[AArch64] Emit .cfi_negate_ra_state for PAC-auth instructions.

autiasp, autibsp instructions are the counterpart of paciasp/pacibsp instructions
therefore let's emit .cfi_negate_ra_state for these too.
In case of Armv8.3 instruction set the retaa/retbb will do the return and authentication
in one step here we can't emit the . cfi_negate_ra_state because that would be point after
the ret* instruction.

Reviewed By: nickdesaulniers, MaskRay

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

2 years ago[SPARC] Recognize the prefetch instruction
Joerg Sonnenberger [Wed, 20 Oct 2021 08:36:27 +0000 (10:36 +0200)]
[SPARC] Recognize the prefetch instruction

Reviewed By: LemonBoy

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

2 years ago[AArch64] Improve div and rem costmodel tests. NFC
David Green [Wed, 20 Oct 2021 08:58:35 +0000 (09:58 +0100)]
[AArch64] Improve div and rem costmodel tests. NFC

Copied from the X86 tests, these give a better test coveraged than the
existing tests.

2 years ago[WebAssembly] Implementation of table.get/set for reftypes in LLVM IR
Paulo Matos [Thu, 7 Oct 2021 10:10:52 +0000 (12:10 +0200)]
[WebAssembly] Implementation of table.get/set for reftypes in LLVM IR

This change implements new DAG nodes TABLE_GET/TABLE_SET, and lowering
methods for load and stores of reference types from IR arrays. These
global LLVM IR arrays represent tables at the Wasm level.

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

2 years ago[clang-format] [PR52015] clang-format should put __attribute__((foo)) on its own...
mydeveloperday [Wed, 20 Oct 2021 08:09:31 +0000 (09:09 +0100)]
[clang-format] [PR52015] clang-format should put __attribute__((foo)) on its own line before @interface / @implementation / @protocol

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

A newline should be place between attribute and @ for objectivec

Reviewed By: benhamilton, HazardyKnusperkeks

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

2 years ago[clang-format] git-clang-format throws an assertion when removing files as part of...
mydeveloperday [Wed, 20 Oct 2021 08:04:04 +0000 (09:04 +0100)]
[clang-format] git-clang-format throws an assertion when removing files as part of the commit

Following a change {D111273} to allow git-clang-format to see single lines being removed,
we introduced a regression such that if you are removing a whole file it will
assert in clang-format as its given the -lines=0:0  (lines are 1 based)

Reviewed By: HazardyKnusperkeks

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

2 years ago[flang] flang-omp-report replace std::map with llvm::DenseMap
Josh Mottley [Wed, 20 Oct 2021 07:56:56 +0000 (07:56 +0000)]
[flang] flang-omp-report replace std::map with llvm::DenseMap

This patch replaces the uses of std::map with llvm::DenseMap in the
flang-omp-report plugin. It also removed the 'constructClauseCount' map
due to no longer being needed after the plugin was stripped down.
This is a one of several patches focusing on switching containers from STL to LLVM's ADT library.

Reviewed By: kiranchandramohan, clementval

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

2 years ago[Flang][flang-omp-report] Switch from std::string to StringRef (where possible)
Josh Mottley [Wed, 20 Oct 2021 07:42:14 +0000 (07:42 +0000)]
[Flang][flang-omp-report] Switch from std::string to StringRef (where possible)

This patch makes the following changes to flang-omp-report:
 - Update 'normalize_clause_name' parameter to use llvm::StringRef instead of
   std::sting.
 - Change usages of std::tolower to llvm::toLower from
   "ADT/StringExtras.h".
This is a one of several patches focusing on switching containers from STL to LLVM's ADT library.

Reviewed By: Leporacanthicus, clementval

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

2 years ago[CSKY] Complete to add basic integer instruction set
Zi Xuan Wu [Wed, 20 Oct 2021 06:38:29 +0000 (14:38 +0800)]
[CSKY] Complete to add basic integer instruction set

Complete the basic integer instruction set and add related predictor in CSKY.td.
And it includes the instruction definition and asm parser support.

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

2 years ago[NARY-REASSOCIATE] Fix infinite recursion optimizing min\max
Evgeniy Brevnov [Tue, 19 Oct 2021 08:26:28 +0000 (15:26 +0700)]
[NARY-REASSOCIATE] Fix infinite recursion optimizing min\max

To guarantee convergence of the algorithm each optimization step should decrease number of instructions when IR is modified. This property is not held in this test case. The problem is that SCEV Expander may do "unexpected" reassociation what results in creation of new min/max chains and introduction of extra instructions. As a result on each step we indefinitely optimize back and forth.

The solution is to restrict SCEV Expander to perform uncontrolled reassociations by means of "Unknown" expressions.

Reviewed By: nikic

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

2 years ago[llvm-profgen] Skip duplication factor outside of body sample computation
Wenlei He [Tue, 19 Oct 2021 00:44:45 +0000 (17:44 -0700)]
[llvm-profgen] Skip duplication factor outside of body sample computation

We incorrectly use duplication factor for total samples even though we already accumulate samples instead of taking MAX. It causes profile to have bloated total samples for functions with loop unrolled or vectorized. The change fix the issue for total sample, head sample and call target samples.

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

2 years ago[clang] Add option to disable -clear-ast-before-backend
Arthur Eubanks [Tue, 19 Oct 2021 22:17:07 +0000 (15:17 -0700)]
[clang] Add option to disable -clear-ast-before-backend

Some downstream users have plugins that -clear-ast-before-backend may
affect. Add an option to opt out.

Reviewed By: dblaikie

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

2 years ago[NFC] Fix typos
Shao-Ce SUN [Wed, 20 Oct 2021 03:47:26 +0000 (11:47 +0800)]
[NFC] Fix typos

2 years ago[ORC-RT] Add MethodWrapperHandler utility for WrapperFunction.
Lang Hames [Tue, 19 Oct 2021 22:28:07 +0000 (15:28 -0700)]
[ORC-RT] Add MethodWrapperHandler utility for WrapperFunction.

This is an ORC runtime counterpart to a01f772d19d, which introduced the same
functionality into LLVM.

2 years ago[ORC-RT] Use function pointer type (rather than reference) for traits class.
Lang Hames [Tue, 19 Oct 2021 05:16:44 +0000 (22:16 -0700)]
[ORC-RT] Use function pointer type (rather than reference) for traits class.

Aligns this template with the corresponding one in LLVM.

2 years ago[ORC-RT] Avoid switching out-of-band error value into __orc_rt::Error and back.
Lang Hames [Tue, 19 Oct 2021 05:11:16 +0000 (22:11 -0700)]
[ORC-RT] Avoid switching out-of-band error value into __orc_rt::Error and back.

WrapperFunctionResult can already convey serialization errors as out-of-band
error values, so there's no need to wrap it in an Expected here. Removing the
wrapper simplifies the plumbing and call sites.

2 years ago[WebAssembly] Add prototype relaxed swizzle instructions
Zhi An Ng [Wed, 20 Oct 2021 00:53:04 +0000 (17:53 -0700)]
[WebAssembly] Add prototype relaxed swizzle instructions

Add i8x16 relaxed_swizzle instructions. These are only
exposed as builtins, and require user opt-in.

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

2 years ago[LLDB][NFC] Remove parameter names from forward declarations from hand written expres...
Shafik Yaghmour [Tue, 19 Oct 2021 23:52:36 +0000 (16:52 -0700)]
[LLDB][NFC] Remove parameter names from forward declarations from hand written expressions used in heap.py part 2

heap.py has a lot of large hand written expressions and each name in the
expression will be looked up by clang during expression parsing. For
function parameters this will be in Sema::ActOnParamDeclarator(...) in order to
catch redeclarations of parameters. The names are not needed and we have seen
some rare cases where since we don't have symbols we end up in
SymbolContext::FindBestGlobalDataSymbol(...) which may conflict with other global
symbols.

There may be a way to make this lookup smarter to avoid these cases but it is
not clear how well tested this path is and how much work it would be to fix it.
So we will go with this fix while we investigate more.

This is a second try at getting all the cases we care about.

Ref: rdar://78265641

2 years agoBPF: set .BTF and .BTF.ext section alignment to 4
Yonghong Song [Tue, 19 Oct 2021 22:29:12 +0000 (15:29 -0700)]
BPF: set .BTF and .BTF.ext section alignment to 4

Currently, .BTF and .BTF.ext has default alignment of 1.
For example,
  $ cat t.c
    int foo() { return 0; }
  $ clang -target bpf -O2 -c -g t.c
  $ llvm-readelf -S t.o
    ...
    Section Headers:
    [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
    ...
    [ 7] .BTF              PROGBITS        0000000000000000 000167 00008b 00      0   0  1
    [ 8] .BTF.ext          PROGBITS        0000000000000000 0001f2 000050 00      0   0  1

But to have no misaligned data access, .BTF and .BTF.ext
actually requires alignment of 4. Misalignment is not an issue
for architecture like x64/arm64 as it can handle it well. But
some architectures like mips may incur a trap if .BTF/.BTF.ext
is not properly aligned.

This patch explicitly forced .BTF and .BTF.ext alignment to be 4.
For the above example, we will have
    [ 7] .BTF              PROGBITS        0000000000000000 000168 00008b 00      0   0  4
    [ 8] .BTF.ext          PROGBITS        0000000000000000 0001f4 000050 00      0   0  4

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

2 years ago[NVPTX] Add a late SROA pass which allows optimizing away more allocas.
Artem Belevich [Fri, 8 Oct 2021 23:16:25 +0000 (16:16 -0700)]
[NVPTX] Add a late SROA pass which allows optimizing away more allocas.

Fixes performance regression https://bugs.llvm.org/show_bug.cgi?id=52037

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

2 years agoAdd MLIR_INSTALL_AGGREGATE_OBJECTS and default it to ON.
Stella Laurenzo [Tue, 19 Oct 2021 19:22:56 +0000 (12:22 -0700)]
Add MLIR_INSTALL_AGGREGATE_OBJECTS and default it to ON.

* Package maintainers can opt to disable installation of these objects.
* Per discussion on https://reviews.llvm.org/D111504

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

2 years agoImplementation of `ReshapeNoopOptimization` canonicalizer.
Kojo Acquah [Tue, 19 Oct 2021 22:49:49 +0000 (15:49 -0700)]
Implementation of `ReshapeNoopOptimization` canonicalizer.

This canonicalizer replaces reshapes of constant tensors that contain the updated shape (skipping the reshape operation).

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

2 years ago[WebAssembly] Emit clangast in custom section aligned by 4 bytes
Yuta Saito [Tue, 19 Oct 2021 22:42:00 +0000 (15:42 -0700)]
[WebAssembly] Emit clangast in custom section aligned by 4 bytes

Emit __clangast in custom section instead of named data segment
to find it while iterating sections.
This could be avoided if all data segements (the wasm sense) were
represented as their own sections (in the llvm sense).
This can be resolved by https://github.com/WebAssembly/tool-conventions/issues/138

And the on-disk hashtable in clangast needs to be aligned by 4 bytes,
so add paddings in name length field in custom section header.

The length of clangast section name can be represented in 1 byte
by leb128, and possible maximum pads are 3 bytes, so the section
name length won't be invalid in theory.

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

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

2 years ago[llvm-reduce] Add reduction passes to reduce operands to undef/1/0
Arthur Eubanks [Wed, 13 Oct 2021 23:00:00 +0000 (16:00 -0700)]
[llvm-reduce] Add reduction passes to reduce operands to undef/1/0

Having non-undef constants in a final llvm-reduce output is nicer than
having undefs.

This splits the existing reduce-operands pass into three, one which does
the same as the current pass of reducing to undef, and two more to
reduce to the constant 1 and the constant 0. Do not reduce to undef if
the operand is a ConstantData, and do not reduce 0s to 1s.

Reducing GEP operands very frequently causes invalid IR (since types may
not match up if we index differently into a struct), so don't touch GEPs.

Reviewed By: Meinersbur

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

2 years ago[Driver][Gnu] Delete unneeded -Bstatic dispatch for arm/thumb
Fangrui Song [Tue, 19 Oct 2021 22:24:07 +0000 (15:24 -0700)]
[Driver][Gnu] Delete unneeded -Bstatic dispatch for arm/thumb

Historically -static and -Bstatic are synonym.
gold made the semantics of -static slightly stronger but that does not matter.

2 years ago[x86] add special-case lowering for usubsat for pre-SSE4
Sanjay Patel [Tue, 19 Oct 2021 21:12:02 +0000 (17:12 -0400)]
[x86] add special-case lowering for usubsat for pre-SSE4

usubsat X, SMIN --> (X ^ SMIN) & (X s>> BW-1)

This would be a regression with D112085 where we combine to
usubsat more aggressively, so avoid that by matching the
special-case where we are subtracting SMIN (signmask):
https://alive2.llvm.org/ce/z/4_3gBD

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

2 years ago[clang][Driver] Make multiarch output file basenames reproducible
Keith Smiley [Wed, 6 Oct 2021 19:43:40 +0000 (19:43 +0000)]
[clang][Driver] Make multiarch output file basenames reproducible

When building a multiarch MachO binary, previously the intermediate
output file names would contain random characters. On macOS this
filename, since it's used when linking, ended up being used as a
stable-ish identifier for the adhoc codesignature of the binary, leading
to non-reproducible binaries. This change uses the architecture, when
available, to create a stable, but unique, basename for the file.

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

2 years ago[x86] add tests for psubus; NFC
Sanjay Patel [Tue, 19 Oct 2021 17:58:06 +0000 (13:58 -0400)]
[x86] add tests for psubus; NFC

2 years ago[fir] Add character utility functions in FIRBuilder
Valentin Clement [Tue, 19 Oct 2021 20:22:17 +0000 (22:22 +0200)]
[fir] Add character utility functions in FIRBuilder

Extract part of D111337 in order to mke it smaller
and easier to review. This patch add some utility
functions to the FIRBuilder.

Add the following utility functions:
- getCharacterLengthType
- createStringLiteral
- locationToFilename
- characterWithDynamicLen
- sequenceWithNonConstantShape
- hasDynamicSize

These bring up the BoxValue implementation together with it.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: AlexisPerry

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years ago[driver] Explicitly specify `-fbuild-session-timestamp` in seconds.
Volodymyr Sapsai [Wed, 6 Oct 2021 02:37:32 +0000 (19:37 -0700)]
[driver] Explicitly specify `-fbuild-session-timestamp` in seconds.

Representation of the file's last modification time depends on the file
system and isn't guaranteed to be in seconds. Cast to seconds explicitly
and tighten the test case to check the magnitude of the calculated
value, so we can catch passing milliseconds or nanoseconds.

rdar://83915615

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

2 years ago[lldb/test] Update test/API/functionalities/load_lazy to macOS 12
Vedant Kumar [Mon, 18 Oct 2021 21:39:10 +0000 (14:39 -0700)]
[lldb/test] Update test/API/functionalities/load_lazy to macOS 12

In macOS 12, dyld switched to using chained fixups. As a result, all symbols
are bound at launch and there are no lazy pointers any more. Since we wish to
import/dlopen() a dylib with missing symbols, we need to use a weak import.
This applies to all macOS 12-aligned OS releases, e.g. iOS 15, etc.

rdar://81295101

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

2 years ago[cuda] Add address space predicate funuctions.
Michael Liao [Wed, 6 Oct 2021 20:02:41 +0000 (16:02 -0400)]
[cuda] Add address space predicate funuctions.

- Add the missing NVVM predicate builtins on address space checking
- Redefine them as pure functions so that they could be used in
  __builtin_assume.

Reviewed By: tra

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

2 years ago[lldb] improve the help strings for gdb-remote and kdp-remote
Lawrence D'Anna [Tue, 19 Oct 2021 20:08:13 +0000 (13:08 -0700)]
[lldb] improve the help strings for gdb-remote and kdp-remote

The help string can be more helpful by explaining these are
aliases for 'process connect'

Reviewed By: JDevlieghere

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

2 years ago[SCEV] Fix formatting error introduced by D112080
Bjorn Pettersson [Tue, 19 Oct 2021 19:43:50 +0000 (21:43 +0200)]
[SCEV] Fix formatting error introduced by D112080

Accidentally pushed D112080 without this clang-format cleanup.

2 years agoRevert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"
Zequan Wu [Tue, 19 Oct 2021 19:38:05 +0000 (12:38 -0700)]
Revert "Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()"

This reverts commit 1fb24fe85a19ae71b00875ff6c96ef1831dcf7e3.

This causes clang crash on chromium. See repro at https://bugs.chromium.org/p/chromium/issues/detail?id=1261551#c1.

2 years ago[SCEV] Avoid compile time explosion in ScalarEvolution::isImpliedCond
Bjorn Pettersson [Tue, 19 Oct 2021 15:05:11 +0000 (17:05 +0200)]
[SCEV] Avoid compile time explosion in ScalarEvolution::isImpliedCond

As seen in PR51869 the ScalarEvolution::isImpliedCond function might
end up spending lots of time when doing the isKnownPredicate checks.

Calling isKnownPredicate for example result in isKnownViaInduction
being called, which might result in isLoopBackedgeGuardedByCond being
called, and then we might get one or more new calls to isImpliedCond.
Even if the scenario described here isn't an infinite loop, using
some random generated C programs as input indicates that those
isKnownPredicate checks quite often returns true. On the other hand,
the third condition that needs to be fulfilled in order to "prove
implications via truncation", i.e. the isImpliedCondBalancedTypes
check, is rarely fulfilled.
I also made some similar experiments to look at how often we would
get the same result when using isKnownViaNonRecursiveReasoning instead
of isKnownPredicate. So far I haven't seen a single case when codegen
is negatively impacted by using isKnownViaNonRecursiveReasoning. On
the other hand, it seems like we get rid of the compile time explosion
seen in PR51869 that way. Hence this patch.

Reviewed By: nikic

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

2 years agoExtend transform introduced in D111896 to multiple exits
Philip Reames [Tue, 19 Oct 2021 19:12:19 +0000 (12:12 -0700)]
Extend transform introduced in D111896 to multiple exits

This is trivial.  It was left out of the original review only because we had multiple copies of the same code in review at the same time, and keeping them in sync was easiest if the structure was kept in sync.

2 years ago[indvars] Canonicalize exit conditions to unsigned using range info
Philip Reames [Tue, 19 Oct 2021 18:47:15 +0000 (11:47 -0700)]
[indvars] Canonicalize exit conditions to unsigned using range info

This patch duplicates a bit of logic we apply to comparisons encountered during the IV users walk to conditions which feed exit conditions. Why? simplifyAndExtend has a very limited list of users it walks. In particular, in the examples is stops at the zext and never visits the icmp. (Because we can't fold the zext to an addrec yet in SCEV.) Being willing to visit when we haven't simplified regresses multiple tests (seemingly because of less optimal results when computing trip counts).

Note that this can be trivially extended to multiple exiting blocks. I'm leaving that to a future patch (solely to cut down on the number of versions of the same code in review at once.)

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

2 years ago[RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC
Craig Topper [Tue, 19 Oct 2021 18:37:36 +0000 (11:37 -0700)]
[RISCV] Use llvm::stable_sort instead of std::stable_sort. NFC

2 years ago[LoopPredication] Calculate profitability without BPI
Anna Thomas [Tue, 12 Oct 2021 19:04:26 +0000 (15:04 -0400)]
[LoopPredication] Calculate profitability without BPI

Using BPI within loop predication is non-trivial because BPI is only
preserved lossily in loop pass manager (one fix exposed by lossy
preservation is up for review at D111448). However, since loop
predication is only used in downstream pipelines, it is hard to keep BPI
from breaking for incomplete state with upstream changes in BPI.
Also, correctly preserving BPI for all loop passes is a non-trivial
undertaking (D110438 does this lossily), while the benefit of using it
in loop predication isn't clear.

In this patch, we rely on profile metadata to get almost similar benefit as
BPI, without actually using the complete heuristics provided by BPI.
This avoids the compile time explosion we tried to fix with D110438 and
also avoids fragile bugs because BPI can be lossy in loop passes
(D111448).

Reviewed-By: asbirlea, apilipenko
Differential Revision: https://reviews.llvm.org/D111668

2 years ago[libc++] Make __weekday_from_days private in weekday
Joe Loser [Tue, 19 Oct 2021 18:21:25 +0000 (14:21 -0400)]
[libc++] Make __weekday_from_days private in weekday

`weekday` has a static member function `__weekday_from_days` which is
not part of the mandated public interface of `weeekday` according to the
standard. Since it is only used internally in the constructors of
`weekday`, let's make it private.

Reviewed By: ldionne, Mordante, #libc

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

2 years ago[libc++][NFC] Mark LWG3573 as complete
Joe Loser [Tue, 19 Oct 2021 18:18:36 +0000 (14:18 -0400)]
[libc++][NFC] Mark LWG3573 as complete

Mark LWG3573 as complete. It involves a change in wording around when
`basic_string_view`'s constructor for iterator/sentinel can throw. The
current implementation is not marked conditionally `noexcept`, so there
is nothing to do here. Add a test that binds this behavior to verify the
constructor is not marked `noexcept(true)` when `end - begin` throws.

Reviewed By: ldionne, Mordante, #libc

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

2 years ago[runtimes] Trigger CI on changes to libunwind
Louis Dionne [Tue, 19 Oct 2021 17:16:24 +0000 (13:16 -0400)]
[runtimes] Trigger CI on changes to libunwind

2 years agoFix clang-tidy warnings in MLIR Python bindings (NFC)
Mehdi Amini [Tue, 19 Oct 2021 17:13:54 +0000 (17:13 +0000)]
Fix clang-tidy warnings in MLIR Python bindings (NFC)

2 years ago[AMDGPU] add test for usubsat; NFC
Sanjay Patel [Tue, 19 Oct 2021 16:13:49 +0000 (12:13 -0400)]
[AMDGPU] add test for usubsat; NFC

2 years ago[x86] add tests for psubus; NFC
Sanjay Patel [Tue, 19 Oct 2021 15:20:03 +0000 (11:20 -0400)]
[x86] add tests for psubus; NFC

2 years ago[libc++] [test] Add tests for converting array types in shared_ptr.
Konstantin Varlamov [Tue, 19 Oct 2021 17:02:21 +0000 (13:02 -0400)]
[libc++] [test] Add tests for converting array types in shared_ptr.

The only possible kind of a conversion in initialization of a shared
pointer to an array is a qualification conversion (i.e., adding
cv-qualifiers). This patch adds tests for converting from `A[]` to
`const A[]` to the following functions:

```
template<class Y> explicit shared_ptr(Y* p);

template<class Y> shared_ptr(const shared_ptr<Y>& r);
template<class Y> shared_ptr(shared_ptr<Y>&& r);

template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r);
template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r);

template<class Y> void reset(Y* p);
template<class Y, class D> void reset(Y* p, D d);
template<class Y, class D, class A> void reset(Y* p, D d, A a);
```

Similar tests for converting functions that involve a `weak_ptr` should
be added once LWG issue [3001](https://cplusplus.github.io/LWG/issue3001)
is implemented.

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

2 years agoRemove unneeded variable num_found.
Jim Ingham [Tue, 19 Oct 2021 16:56:34 +0000 (09:56 -0700)]
Remove unneeded variable num_found.

2 years ago[debugserver] Fix BUILDING_FOR_ARM64_OSX
Jonas Devlieghere [Tue, 19 Oct 2021 16:24:31 +0000 (09:24 -0700)]
[debugserver] Fix BUILDING_FOR_ARM64_OSX

Check for TARGET_CPU_ARM64 (ARM instructions for 64-bit mode) rather
than TARGET_CPU_ARM (instructions for 32-bit mode).

2 years ago[Verifier] Add context for assume operand bundles verifier errors
Arthur Eubanks [Tue, 19 Oct 2021 16:52:04 +0000 (09:52 -0700)]
[Verifier] Add context for assume operand bundles verifier errors

And fix a typo.

2 years agoUse reference type in for loop
Carlos Galvez [Tue, 19 Oct 2021 16:37:37 +0000 (16:37 +0000)]
Use reference type in for loop

To fix failing build job.

2 years ago[clang-tidy] Support globbing in NOLINT* expressions
Carlos Galvez [Wed, 6 Oct 2021 06:17:13 +0000 (06:17 +0000)]
[clang-tidy] Support globbing in NOLINT* expressions

To simplify suppressing warnings (for example, for
when multiple check aliases are enabled).

The globbing format reuses the same code as for
globbing when enabling checks, so the semantics
and behavior is identical.

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

2 years ago[OpenMP] Remove macro guards for device debugging
Joseph Huber [Tue, 19 Oct 2021 16:13:04 +0000 (12:13 -0400)]
[OpenMP] Remove macro guards for device debugging

The plugin currently uses a macro to check if this is a debug built
before assigning the debug kind variable to the device environment
struct. This is being deprecated because the new device runtime does not
maintain separate debug builds and should always be availible.

Reviewed By: tianshilei1992

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

2 years ago[libunwind] Add a from-scratch config for running libunwind tests
Louis Dionne [Tue, 12 Oct 2021 16:46:21 +0000 (12:46 -0400)]
[libunwind] Add a from-scratch config for running libunwind tests

Running tests for libunwind is a lot simpler than running tests for
libc++, so a simple Lit config file is sufficient. The benefit is that
we disentangle the libunwind test configuration from the libc++ and
libc++abi test configuration. The setup was too complicated, which led
to some bugs (notably we were running against the system libunwind on
Apple platforms).

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

2 years ago[Driver, Frontend] Use StringRef::contains (NFC)
Kazu Hirata [Tue, 19 Oct 2021 15:54:02 +0000 (08:54 -0700)]
[Driver, Frontend] Use StringRef::contains (NFC)