platform/upstream/llvm.git
20 months ago[clang] Perform sugared substitution of builtin templates
Matheus Izvekov [Sun, 23 Oct 2022 11:38:39 +0000 (13:38 +0200)]
[clang] Perform sugared substitution of builtin templates

Since these are much like template type aliases, where we don't
track a specialization for them and just substitute them eagerly,
we can't resugar them anyway, and there is no relevant cost in just
performing a finalizing sugared substitution.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136563

20 months ago[clang] Changes to produce sugared converted template arguments
Matheus Izvekov [Mon, 5 Sep 2022 19:57:37 +0000 (21:57 +0200)]
[clang] Changes to produce sugared converted template arguments

Makes CheckTemplateArgumentList and the template deduction functions
produce a sugared converted argument list in addition to the canonical one.

This is mostly NFC except that we hook this up to a few diagnostics in
SemaOverload.

The infrastructure here will be used in subsequent patches
where we perform a finalized sugared substitution for entities
which we do not unique per specializations on canonical arguments,
and later on will be used for template specialization resugaring.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D133874

20 months ago[clang] Include the type of a pointer or reference non-type template parameter in...
Richard Smith [Sun, 11 Oct 2020 22:57:52 +0000 (15:57 -0700)]
[clang] Include the type of a pointer or reference non-type template parameter in its notion of template argument identity.

We already did this for all the other kinds of non-type template
argument.

Note: Based on earlier reverted patch from zygoloid.

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

20 months ago[mlir][Tensor] Change `createDimValues` to return a list of `OpFoldResult`s.
Mahesh Ravishankar [Thu, 27 Oct 2022 03:12:40 +0000 (03:12 +0000)]
[mlir][Tensor] Change `createDimValues` to return a list of `OpFoldResult`s.

Reviewed By: nicolasvasilache, hanchung, ThomasRaoux

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

20 months agoRevert "[lldb-vscode] Send Statistics Dump in terminated event"
Wanyi Ye [Thu, 27 Oct 2022 02:49:03 +0000 (19:49 -0700)]
Revert "[lldb-vscode] Send Statistics Dump in terminated event"

This reverts commit c8a26f8c6de30dbd814546f02e4c89a4fcb2b4ef.

Returning full statistics result in "terminated" (DAP) event could result in delay in the UI when debugging from VSCode.

If the program run to exit and debug session terminates. The DAP event order will be: exited event --> terminateCommands --> terminated event --> disconnect request --> disconnect response.

The debugging UI in VSCode corresponds to "disconnect" request/response. If the terminated event is taking long to process, the IDE won't quit debugging UI until it's done.

For big binary (tested example has 29 GB of debug info), it can cause ~15s delay in terminated event itself. And the UI could take ~20s to reflect.

This may cause confusion in debug sessions. We should persuit a more lightweight return or other solution to return such info.

20 months ago[AArch64] Adjust operand sequence for Add+Sub to combine more inline shift
chenglin.bi [Thu, 27 Oct 2022 02:04:57 +0000 (10:04 +0800)]
[AArch64] Adjust operand sequence for Add+Sub to combine more inline shift

((X >> C) - Y) + Z --> (Z - Y) + (X >> C)

Fix AArch part: #55714

Reviewed By: dmgreen

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

20 months ago[CodeGen] Improve large stack frame diagnostic
Paul Kirth [Fri, 21 Oct 2022 18:22:03 +0000 (18:22 +0000)]
[CodeGen] Improve large stack frame diagnostic

Add statistics about how much memory is used, in variables, spills, and
unsafestack.

Issue #58168 describes some of the difficulty diagnosing stack size issues
identified by -Wframe-larger-than. D135488 addresses some of those issues by
giving developers a method to view the stack layout and thereby understand
where and how stack memory is used.

However, that solution requires an additional pass, when a short summary about
how the compiler has allocated stack memory can inform developers about where
they should investigate. When they need the complete context, D135488 can
provide them with a more comprehensive set of diagnostics.

Reviewed By: nickdesaulniers

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

20 months ago[NFC][PhaseOrdering] Add new test for SROA misplacement
Roman Lebedev [Thu, 27 Oct 2022 00:08:19 +0000 (03:08 +0300)]
[NFC][PhaseOrdering] Add new test for SROA misplacement

20 months ago[flang] Add atomic_fetch_and to list of intrinsics
Katherine Rasmussen [Tue, 25 Oct 2022 23:26:59 +0000 (16:26 -0700)]
[flang] Add atomic_fetch_and to list of intrinsics

Add the atomic subroutine, atomic_fetch_and, to the list of
intrinsic subroutines, add its last dummy argument to a check
for coindexed-object, and update test.

Reviewed By: jeanPerier

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

20 months ago[Driver] Allow target override containing . in executable name
Dan McGregor [Wed, 26 Oct 2022 23:52:32 +0000 (16:52 -0700)]
[Driver] Allow target override containing . in executable name

The gcc compatible driver has support for overriding the default
target based on the driver's executable name, for instance
x86_64-pc-linux-gnu-clang will set the default target to
x86_64-pc-linux-gnu.

Previously, this failed when the target contained a minor version, for
example x86_64-pc-freebsd13.1, so instead of finding the file's
stem, use the whole file name, but strip off any '.exe' from the tail.

Reviewed By: MaskRay

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

20 months ago[dwarfdump] Fix bogus incompatible tag warning
Jonas Devlieghere [Wed, 26 Oct 2022 23:38:09 +0000 (16:38 -0700)]
[dwarfdump] Fix bogus incompatible tag warning

Because DW_TAG_LLVM_ptrauth_type is not marked as a type, dwarfdump
currently emits a spurious error: DIE has DW_AT_type with incompatible
tag DW_TAG_LLVM_ptrauth_type. This patch fixes that and adds a test.

20 months agoFix MLIR Build with some version of GCC
Mehdi Amini [Wed, 26 Oct 2022 23:22:44 +0000 (23:22 +0000)]
Fix MLIR Build with some version of GCC

mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp:67:30: error: use 'template' keyword to treat 'dyn_cast_or_null' as a dependent template name
                            .dyn_cast_or_null<arith::FastMathFlagsAttr>();
                             ^
                             template

20 months ago[Polly] Add support for -polly-enable-mse with NPM.
Michael Kruse [Wed, 26 Oct 2022 22:24:43 +0000 (17:24 -0500)]
[Polly] Add support for -polly-enable-mse with NPM.

The MaximalStaticExpansionPass was already ported to the NPM in
02f640672e2875c4e7578366bb2e22582548d7c1. Allow adding it to the default
NPM pass builder pipeline using -polly-enable-mse.

20 months ago[Polly] Add support for -polly-export with NPM.
Michael Kruse [Wed, 26 Oct 2022 21:50:50 +0000 (16:50 -0500)]
[Polly] Add support for -polly-export with NPM.

The JSONExporter pass was already ported to the NPM, the pass builder
jsut had to add it to the pass pipeline when requested.

20 months agoAdd a warning for not packing non-POD members in packed structs
David Blaikie [Fri, 28 Jan 2022 22:22:21 +0000 (14:22 -0800)]
Add a warning for not packing non-POD members in packed structs

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

20 months ago[LTO] Fix lto_module_create_in_codegen_context return value on error
Steven Wu [Wed, 26 Oct 2022 22:13:00 +0000 (15:13 -0700)]
[LTO] Fix lto_module_create_in_codegen_context return value on error

According to the documentation, lto_module_create_in_codegen_context
should return NULL on error but currently it is accidentally return
error_code. Since this is a bug fix and it seems to be a one-off bug
that only affects this API, there is no need to bump API version.

rdar://101505192

Reviewed By: pete

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

20 months ago[libc] Add a testing macro for MPFR matchers skipping `explainError` calls.
Tue Ly [Wed, 26 Oct 2022 02:10:32 +0000 (22:10 -0400)]
[libc] Add a testing macro for MPFR matchers skipping `explainError` calls.

Adding `EXPECT_MPFR_MATCH_ROUNDING_SILENTLY` macro that does not call
`explainError` when the tests fail.  This is useful to check the passing or
failing rates, such as hitting percentages of fast passes in math
implementations.

Reviewed By: michaelrj, sivachandra

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

20 months agoExtend the C++03 definition of POD to include defaulted functions
David Blaikie [Sat, 5 Feb 2022 04:06:13 +0000 (20:06 -0800)]
Extend the C++03 definition of POD to include defaulted functions

The AST/conditionally-trivial-smfs tests look a bit questionable, but
are consistent with GCC's POD-ness, at least as far as packing is
concerned: https://godbolt.org/z/36nqPMbKM
(questionable because it looks like the type would be non-copyable, so
how could it be pod? But the calling convention/pass by value seems to
work correctly (local testing verifies that this behavior is preserved
even with this patch: https://godbolt.org/z/3Pa89zsv6 ))

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

20 months ago[bazel][mlir][arith] build fixes for arith fastmath flags
Emilio Cota [Wed, 26 Oct 2022 21:45:25 +0000 (17:45 -0400)]
[bazel][mlir][arith] build fixes for arith fastmath flags

20 months ago[ADT] Add deduction guide for llvm::Optional
David Blaikie [Wed, 26 Oct 2022 21:37:25 +0000 (21:37 +0000)]
[ADT] Add deduction guide for llvm::Optional

Added to address some uses of implicit CTAD added in clang recently.

20 months ago[RISCV] Inline scalar ceil/floor/trunc/rint/round/roundeven.
Craig Topper [Wed, 26 Oct 2022 21:23:51 +0000 (14:23 -0700)]
[RISCV] Inline scalar ceil/floor/trunc/rint/round/roundeven.

This avoids the call overhead as well as the the save/restore of
fflags and the snan handling in the libm function.

The save/restore of fflags and snan handling are needed to be
correct for -ftrapping-math. I think we can ignore them in the
default environment.

The inline sequence will generate an invalid exception for nan
and an inexact exception if fractional bits are discarded.

I've used a custom inserter to explicitly create the control flow
around the float->int->float conversion.

We can probably avoid the final fsgnj after the conversion for
no signed zeros FMF, but I'll leave that for future work.

Note the comparison constant is slightly different than glibc uses.
They use 1<<53 for double, I'm using 1<<52. I believe either are valid.
Numbers >= 1<<52 can't have any fractional bits. It's ok to do the
float->int->float conversion on numbers between 1<<53 and 1<<52 since
they will all fit in 64. We only have a problem if the double can't fit
in i64

Reviewed By: reames

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

20 months ago[mlir][MemRefToLLVM] Lower extract_strided_metadata
Quentin Colombet [Fri, 14 Oct 2022 21:00:55 +0000 (21:00 +0000)]
[mlir][MemRefToLLVM] Lower extract_strided_metadata

The `extract_strided_metadata` operation literally breaks down a memory
descriptor into its different components.
Teach the MemRefToLLVM conversion framework this fact.

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

20 months agogit clang-format HEAD~
Nick Desaulniers [Wed, 26 Oct 2022 21:24:08 +0000 (14:24 -0700)]
git clang-format HEAD~

for
commit ad78ce44bb47 ("[clang][Toolchains][Gnu] pass -gdwarf-* through to
assembler")

20 months ago[InstCombine] add tests for demanded bits of sub; NFC
Sanjay Patel [Wed, 26 Oct 2022 18:34:42 +0000 (14:34 -0400)]
[InstCombine] add tests for demanded bits of sub; NFC

20 months ago[RISCV] Add tests for fixed vector sshl_sat/ushl_sat. NFC
Craig Topper [Wed, 26 Oct 2022 19:09:39 +0000 (12:09 -0700)]
[RISCV] Add tests for fixed vector sshl_sat/ushl_sat. NFC

20 months ago[libc] Enable more entrypoints on aarch64.
Siva Chandra [Wed, 26 Oct 2022 21:02:52 +0000 (14:02 -0700)]
[libc] Enable more entrypoints on aarch64.

20 months ago[dexter-tests] Add attribute optnone to main function
Guozhi Wei [Wed, 26 Oct 2022 20:57:49 +0000 (20:57 +0000)]
[dexter-tests] Add attribute optnone to main function

The test case optnone-simple-functions.cpp is expected to be compiled
unoptimized even under -O2 because of attribute optnone. But this attribute is
missed for main function, and caused the fail in
https://lab.llvm.org/buildbot/#/builders/217/builds/14046 when it triggered
optimizations. This patch fixes that by adding attribute optnone to main
function.

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

20 months ago[Clang][Sema] Add -Wcast-function-type-strict
Sami Tolvanen [Mon, 19 Sep 2022 23:06:18 +0000 (23:06 +0000)]
[Clang][Sema] Add -Wcast-function-type-strict

Clang supports indirect call Control-Flow Integrity (CFI) sanitizers
(e.g. -fsanitize=cfi-icall), which enforce an exact type match between
a function pointer and the target function. Unfortunately, Clang
doesn't provide diagnostics that would help developers avoid function
type casts that lead to runtime CFI failures. -Wcast-function-type,
while helpful, only warns about ABI incompatibility, which isn't
sufficient with CFI.

Add -Wcast-function-type-strict, which checks for a strict type
compatibility in function type casts and helps warn about casts that
can potentially lead to CFI failures.

Reviewed By: nickdesaulniers, aaron.ballman

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

20 months ago[dexter] Temporary disable optnone-simple-functions
Jonas Devlieghere [Wed, 26 Oct 2022 20:06:22 +0000 (13:06 -0700)]
[dexter] Temporary disable optnone-simple-functions

D136396 broke optnone-simple-functions. Temporary disabling the test to
unblock the bot until the Sony folks can have a look.

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/47878/

20 months agoRevert "[NFC] Make format() more amenable to format attributes"
Félix Cloutier [Wed, 26 Oct 2022 19:53:14 +0000 (12:53 -0700)]
Revert "[NFC] Make format() more amenable to format attributes"

This reverts commit fb1e90ef07fec0d64a05c0b6d41117a5ea3e8344.

20 months ago[clang] Move getenv call for SOURCE_DATE_EPOCH out of frontend NFC
Ben Langmuir [Tue, 25 Oct 2022 22:12:24 +0000 (15:12 -0700)]
[clang] Move getenv call for SOURCE_DATE_EPOCH out of frontend NFC

Move the check for SOURCE_DATE_EPOCH to the driver and use a cc1 option
to pass it to the frontend. This avoids hidden state in the cc1
invocation and makes this env variable behave more like other env
variables that clang handles in the driver.

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

20 months ago[OpenMP][FIX] Adjust to clang tests after D136740
Johannes Doerfert [Wed, 26 Oct 2022 19:31:33 +0000 (12:31 -0700)]
[OpenMP][FIX] Adjust to clang tests after D136740

20 months ago[gn build] port cb0eb9d8dd5 (lldb test libc++ refs)
Nico Weber [Wed, 26 Oct 2022 19:30:10 +0000 (15:30 -0400)]
[gn build] port cb0eb9d8dd5 (lldb test libc++ refs)

20 months ago[NFC][Offload Bundler] Formatting clang offloadbundler source file.
raghavmedicherla [Wed, 26 Oct 2022 19:08:10 +0000 (15:08 -0400)]
[NFC][Offload Bundler] Formatting clang offloadbundler source file.

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

20 months ago[NFC] Make format() more amenable to format attributes
Félix Cloutier [Fri, 9 Sep 2022 21:08:19 +0000 (14:08 -0700)]
[NFC] Make format() more amenable to format attributes

This change modifies the implementation of the format() function
so that vendor forks committed to building with compilers that
support __attribute__((format)) on non-variadic functions can
check the format() function with it.

Reviewed By: ahatanak
Differential Revision: https://reviews.llvm.org/D132413
rdar://84571523

20 months ago[test] Fix LLDB tests with just-built libcxx when using a target directory.
Jordan Rupprecht [Wed, 26 Oct 2022 19:07:22 +0000 (12:07 -0700)]
[test] Fix LLDB tests with just-built libcxx when using a target directory.

In certain configurations, libc++ headers all exist in the same directory, and libc++ binaries exist in the same directory as lldb libs. When `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is enabled (*and* the host is not Apple, which is why I assume this wasn't caught by others?), this is not the case: most headers will exist in the usual `include/c++/v1` directory, but `__config_site` exists in `include/$TRIPLE/c++/v1`. Likewise, the libc++.so binary exists in `lib/$TRIPLE/`, not `lib/` (where LLDB libraries reside).

This also adds the just-built-libcxx functionality to the lldb-dotest tool.

The `LIBCXX_` cmake config is borrowed from `libcxx/CMakeLists.txt`. I could not figure out a way to share the cmake config; ideally we would reuse the same config instead of copy/paste.

Reviewed By: JDevlieghere, fdeazeve

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

20 months ago[mlir][arith] Initial support for fastmath flag attributes in the Arithmetic dialect...
Jeremy Furtek [Wed, 26 Oct 2022 18:07:20 +0000 (11:07 -0700)]
[mlir][arith] Initial support for fastmath flag attributes in the Arithmetic dialect (v2)

This diff adds initial (partial) support for "fastmath" attributes for floating
point operations in the arithmetic dialect. The "fastmath" attributes are
implemented using a default-valued bit enum. The defined flags currently mirror
the fastmath flags in the LLVM dialect (and in LLVM itself). Extending the
set of flags (if necessary) is left as a future task.

In this diff:
- Definition of FastMathAttr as a custom attribute in the Arithmetic dialect
  that inherits from the EnumAttr class.
- Definition of ArithFastMathInterface, which is an interface that is
  implemented by operations that have an arith::fastmath attribute.
- Declaration of a default-valued fastmath attribute for unary and (some) binary
  floating point operations in the Arithmetic dialect.
- Conversion code to lower arithmetic fastmath flags to LLVM fastmath flags

NOT in this diff (but planned or currently in progress):
- Documentation of flag meanings
- Addition of FastMathAttr attributes to other dialects that might lower to the
  Arithmetic dialect (e.g. Math and Complex)
- Folding/rewrite implementations that are enabled by fastmath flags
- Specification of fastmath values from Python bindings (pending other in-
  progress diffs)

Reviewed By: mehdi_amini, vzakhari

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

20 months ago[trace][intelpt] Fix multi CPU decoding TSC assertion error
Jakob Johnson [Mon, 24 Oct 2022 14:01:40 +0000 (07:01 -0700)]
[trace][intelpt] Fix multi CPU decoding TSC assertion error

Occasionally the assertion that enforces increasing TSC values in `DecodedThread::NotifyTsc`
would get tripped during large multi CPU trace decoding.
The root cause of this issue was an assumption that all the data of a
PSB will fit within the start,end TSC of the "owning"
`ThreadContinuousExecution`. After investigating, this is not the case
because PSBs can have multiple TSCs.
This diff works around this issue by introducing a TSC upper bound for
each `PSBBlockDecoder`. This fixes the assertion failure by simply
"dropping" the remaining data of PSB whenever the TSC upper bound is
exceeded during decoding.
Future work will do a larger refactor of the multi CPU decoding to
remove the dependencies on this incorrect assumption so that PSB blocks
that span multiple `ThreadContinuousExecutions` are correctly handled.
correctly

Test Plan:

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

20 months ago[flang] Add semantics tests for lock-stmt
Katherine Rasmussen [Wed, 19 Oct 2022 16:16:28 +0000 (10:16 -0600)]
[flang] Add semantics tests for lock-stmt

Add three tests for lock-stmt. The first includes
standard-conforming statements, the second includes
non-standard-conforming statements because of errors where
something unexpected occurs, such as a missing lock-variable,
and the third includes non-standard-conforming statements
because of semantic errors, such as type or rank mismatches.

Reviewed By: rouson

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

20 months ago[libc] tighten strtofloat cutoffs
Michael Jones [Tue, 25 Oct 2022 17:10:00 +0000 (10:10 -0700)]
[libc] tighten strtofloat cutoffs

When a number for strtofloat has an exponent that's too big or small, it
doesn't need to be calculated precisely since it is guaranteed to be
either INF or 0.0. This tightens those cutoffs to improve performance.

Reviewed By: sivachandra

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

20 months ago[scudo] Fix size of MaxNumCachedHint Trusty Config
Chia-hung Duan [Wed, 26 Oct 2022 00:26:14 +0000 (00:26 +0000)]
[scudo] Fix size of MaxNumCachedHint Trusty Config

Also add a test for TrustyConfig to ensure it'll be awared of any scudo
configuration change.

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

20 months ago[flang][runtime] New APIs for copyin/copyout of non-contiguous objects.
Slava Zakharin [Thu, 20 Oct 2022 20:46:49 +0000 (13:46 -0700)]
[flang][runtime] New APIs for copyin/copyout of non-contiguous objects.

The intention is to use these APIs for copyin/copyout of subprogram
arguments at the call sites. Currently, Flang generates loop nests
to do this, and in some corner cases this results in very long
compilation times due to LLVM loop optimizations.

For example, Flang produces 25245 loops for 521.wrf/module_dm.f90.
If we extract the copyin/copyout loops into runtime, Flang will only
produce 207 loops, and the compilation time may reduce by 47x.

Given that the copyin/copyout loop nests can not be fused with other
loop nests, extracting them into runtime functions should not reduce
performance if the runtime optimizes the leading contiguous dimension
copies.

The implementation will come in separate patches.

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

20 months ago[MIPS] Fix useDeprecatedPositionallyEncodedOperands errors.
James Y Knight [Mon, 19 Sep 2022 20:17:18 +0000 (16:17 -0400)]
[MIPS] Fix useDeprecatedPositionallyEncodedOperands errors.

This is a follow-on to https://reviews.llvm.org/D134073.

The number of MIPS16 changes here is a bit surprising. Many of the
fields with mismatched names were NOT previously choosing the correct
argument positionally, but instead doing something completely wrong
(e.g. it would encode a register where an immediate was expected).

But, machine-code generation for MIPS16 has never actually functioned.
It's also fully untested, thus, the MIPS16 changes, despite changing
behavior, breaks (and fixes) zero tests. This change does not fix
MIPS16 output, but it ought to be at least incrementally less broken.

Outside MIPS16, I believe the only functional change is to the 'ginvi'
instruction: it was previously encoding garbage into a field which was
specified to be '00'. Fortunately, it was covered by tests -- and the
tests were testing the incorrect behavior. So, fixed.

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

20 months ago[Sparc] Fix useDeprecatedPositionallyEncodedOperands errors.
James Y Knight [Mon, 13 Jun 2022 04:14:03 +0000 (04:14 +0000)]
[Sparc] Fix useDeprecatedPositionallyEncodedOperands errors.

This is a follow-on to https://reviews.llvm.org/D134073.

It renames a few fields to have consistent names, as well as renaming
operands to match the field names.

Behavior is unchanged by this cleanup. (The only generated code change
is for the disassembler for LDSTUB/LDSTUBA, but in both old and new
versions, it fails to add enough operands, and thus triggers a runtime
abort. I will address that bug in a future commit.)

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

20 months agoUpdate "Writing a Backend" doc to use named operand matching.
James Y Knight [Mon, 26 Sep 2022 21:56:07 +0000 (17:56 -0400)]
Update "Writing a Backend" doc to use named operand matching.

This brings it in line with recommended practice after the
introduction of sub-operand naming in a538d1f13a13, and the
deprecation of positional argument matching in 5351878ba196.

20 months ago[InstCombine] add tests for demanded bits of sub; NFC
Sanjay Patel [Wed, 26 Oct 2022 16:31:57 +0000 (12:31 -0400)]
[InstCombine] add tests for demanded bits of sub; NFC

20 months ago[SDAG] avoid vector extract/insert around binop
Sanjay Patel [Wed, 26 Oct 2022 15:53:49 +0000 (11:53 -0400)]
[SDAG] avoid vector extract/insert around binop

scalar-to-vector (scalar binop (extractelt V, Idx), C) --> shuffle (vector binop V, C'), {Idx, -1, -1...}

We generally try to avoid ad-hoc vectorization in SDAG,
but the motivating case from issue #39482 escapes our
normal vectorization folds in IR. It seems like it should
always be a win to transform this pattern in cases where
we have the same vector type for input and output and the
target supports the vector operation. That avoids
transfers from vector to scalar and back.

In the x86 shift examples, we create the scalar-to-vector
node during legalization. I'm not sure if there's a more
general way to create the pattern for testing. (If so, I
could add tests for other targets.)

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

20 months agoConstantFold: Reduce code duplication for checking commuted compare
Matt Arsenault [Wed, 26 Oct 2022 15:37:56 +0000 (08:37 -0700)]
ConstantFold: Reduce code duplication for checking commuted compare

20 months ago[Driver] Avoid unsafe Twine local variable after D136707
Fangrui Song [Wed, 26 Oct 2022 17:58:21 +0000 (10:58 -0700)]
[Driver] Avoid unsafe Twine local variable after D136707

20 months agoAdd tests for C11 DRs and update the status page
Aaron Ballman [Wed, 26 Oct 2022 17:53:13 +0000 (13:53 -0400)]
Add tests for C11 DRs and update the status page

This gets a start on testing how we're doing for C11 DRs

20 months ago[NFC] Introduce range based singleton searches for loop queries.
Jamie Schmeiser [Wed, 26 Oct 2022 17:50:11 +0000 (13:50 -0400)]
[NFC] Introduce range based singleton searches for loop queries.

Summary:
Several loop queries look for a singleton by finding all instances and then
returning whether there is 1 instance or not. This can be improved by
stopping the search after 2 have been found. Introduce generic range
based singleton searches that stop after finding a second value
and use them for these loop queries.

There is no intended functional change other than improved compile-time
efficiency.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: Meinersbur (Michael Kruse)
Differential Revision: https://reviews.llvm.org/D136261

20 months ago[clang][Toolchains][Gnu] pass -gdwarf-* through to assembler
Nick Desaulniers [Wed, 26 Oct 2022 17:39:08 +0000 (10:39 -0700)]
[clang][Toolchains][Gnu] pass -gdwarf-* through to assembler

We've been working around this for a long time in the Linux kernel; we
bend over backwards to continue to support CC=clang (w/
-fno-integrated-as) for architectures where clang can't yet be used to
assemble the kernel's assembler sources. Supporting debug info for the
combination of CC=clang w/ GNU binutils as "GAS" has been painful.

Fix this in clang so that we can work towards dropping complexity in the
Linux kernel's build system, Kbuild, for supporting this combination of
tools.

GAS added support for -gdwarf-{3|4|5} in 2020 2.35 release via
commit 31bf18645d98 ("Add support for --dwarf-[3|4|5] to assembler command line.")

Refactor code to share logic between integrated-as and non-integrated-as
for determining the implicit default.  This change will now always
explicitly pass a -gdwarf-* flag to the GNU assembler when -g is
specified.

Reviewed By: MaskRay

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

20 months ago[OpenMP][FIX] Do not add custom state machine eagerly in LTO runs
Johannes Rudolf Doerfert [Wed, 26 Oct 2022 05:50:12 +0000 (22:50 -0700)]
[OpenMP][FIX] Do not add custom state machine eagerly in LTO runs

If we run LTO optimization we migth end up introducing a custom state machine
and later transforming the region into SPMD. This is a problem. While a follow
up will introduce a check for the SPMD conversion, this already prevents the
eager custom state machine generation. Only if the kernel init function is
defined, rather then declared, we will emit a custom state machine. SPMD-zation
can happen eagerly though. Tests are adjusted via a weak definition. The LTO
test was added to verify this works as expected.

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

20 months ago[lldb] Fix a -Wdeprecated-declarations warning
Nico Weber [Fri, 14 Oct 2022 19:24:27 +0000 (15:24 -0400)]
[lldb] Fix a -Wdeprecated-declarations warning

Fixes:

    ../../lldb/source/Symbol/LocateSymbolFileMacOSX.cpp:633:26:
        warning: 'CFPropertyListCreateFromXMLData' is deprecated:
                 first deprecated in macOS 10.10 -
                 Use CFPropertyListCreateWithData instead.
                 [-Wdeprecated-declarations]
        (CFDictionaryRef)::CFPropertyListCreateFromXMLData(
                           ^

Hopefully no behavior change.

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

20 months agoclang: Add a cmake toggle to disable libclang's libxml2 dependency
Nico Weber [Tue, 25 Oct 2022 17:22:23 +0000 (13:22 -0400)]
clang: Add a cmake toggle to disable libclang's libxml2 dependency

By default, libclang will still depend on libxml2 according to
LLVM_ENABLE_LIBXML2, but with this it's possible to make libclang
not depend on libxml2 even though LLVM does.

The motivation is that libclang uses a bigger API surface of libxml2
than LLVM, and we're statically linking a very minimal build of
libxml2 in our LLVM/clang distribution.

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

20 months ago[Flang] Add MLIRComplexToLLVM, MLIRComplexToStandard in link libs
Kiran Chandramohan [Wed, 26 Oct 2022 17:05:34 +0000 (17:05 +0000)]
[Flang] Add MLIRComplexToLLVM, MLIRComplexToStandard in link libs

Reviewed By: vzakhari

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

20 months agoReland "[PGO] Make emitted symbols hidden"
Alex Brachet [Wed, 26 Oct 2022 17:13:05 +0000 (17:13 +0000)]
Reland "[PGO] Make emitted symbols hidden"

This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
https://github.com/llvm/llvm-project/commit/f5380185623be243ba0f1b18d4bd594ac5cc7163

Then reverted again because it broke tests on MacOS, they should be
fixed now.

Bug: https://github.com/llvm/llvm-project/issues/58265

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

20 months ago[RISCV] add svinval extension
Piyou Chen [Wed, 26 Oct 2022 16:32:43 +0000 (09:32 -0700)]
[RISCV] add svinval extension

1. Add the svinval extension support
2. Add the svinval Predicates for its instruction

Note: the svinval instructions defined in https://reviews.llvm.org/D117654

Reviewed By: reames

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

20 months ago[RISCV] Use vslide1down for i64 insertelt on RV32.
Craig Topper [Wed, 26 Oct 2022 16:26:58 +0000 (09:26 -0700)]
[RISCV] Use vslide1down for i64 insertelt on RV32.

Instead of using vslide1up, use vslide1down and build the other
direction. This avoids the overlap constraint early clobber of
vslide1up.

Reviewed By: reames

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

20 months ago[AMDGPU][test] precommiting tests for D136663
Yashwant Singh [Wed, 26 Oct 2022 16:33:19 +0000 (22:03 +0530)]
[AMDGPU][test] precommiting tests for D136663

More tests for si-peephole-sdwa pass

20 months ago[FuncSpec] Add a testcase for the treatment of constant and unused arguments
Momchil Velikov [Wed, 26 Oct 2022 16:25:18 +0000 (17:25 +0100)]
[FuncSpec] Add a testcase for the treatment of constant and unused arguments

Increase test coverage - check that functions are not specialised on
constant or unused arguments.

Reviewed By: SjoerdMeijer

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

20 months ago[mlir][sparse] Extend sparse_tensor.push_back to allow push_back a value n times.
bixia1 [Wed, 26 Oct 2022 15:42:44 +0000 (08:42 -0700)]
[mlir][sparse] Extend sparse_tensor.push_back to allow push_back a value n times.

Reviewed By: aartbik, Peiming

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

20 months ago[TableGen] Add log bang operator
Michael Maitland [Fri, 16 Sep 2022 19:44:37 +0000 (12:44 -0700)]
[TableGen] Add log bang operator

This patch adds base 2 logarithm that returns integer result. I initially wanted to name it `!log2`,
but numbers are not permitted in the name. The documentation makes sure to clarify that it is
base 2 since it is not explicit in the operator name.

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

20 months ago[libc++][test] Don't use _LIBCPP macros.
Mark de Wever [Tue, 25 Oct 2022 18:42:10 +0000 (20:42 +0200)]
[libc++][test] Don't use _LIBCPP macros.

This was discovered by @ldionne.

Reviewed By: #libc, ldionne

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

20 months ago[clang][dataflow] Remove unused 'Analysis' field from 'TerminatorVisitor'
Gabor Marton [Wed, 26 Oct 2022 15:27:16 +0000 (17:27 +0200)]
[clang][dataflow] Remove unused 'Analysis' field from 'TerminatorVisitor'

This is to silence the warning: private field 'Analysis' is not used

20 months ago[analyzer] Initialize regions returned by CXXNew to undefined
Kristóf Umann [Wed, 5 Oct 2022 16:11:12 +0000 (18:11 +0200)]
[analyzer] Initialize regions returned by CXXNew to undefined

Discourse mail:
https://discourse.llvm.org/t/analyzer-why-do-we-suck-at-modeling-c-dynamic-memory/65667

malloc() returns a piece of uninitialized dynamic memory. We were (almost)
always able to model this behaviour. Its C++ counterpart, operator new is a
lot more complex, because it allows for initialization, the most complicated of which is the usage of constructors.

We gradually became better in modeling constructors, but for some reason, most
likely for reasons lost in history, we never actually modeled the case when the
memory returned by operator new was just simply uninitialized. This patch
(attempts) to fix this tiny little error.

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

20 months ago[SDAG] add helper for opcodes that are not speculatable
Sanjay Patel [Wed, 26 Oct 2022 15:01:18 +0000 (11:01 -0400)]
[SDAG] add helper for opcodes that are not speculatable

This is not quite NFC because one of the users should
now avoid the DIVREM opcodes too, but I'm not sure
how to test that.

I used the same name as an analysis function in IR
in case we want to expand this to include other
operations.

Another potential use is proposed in D136713.

20 months ago[x86] add tests for extract + insert of vector shift amount; NFC
Sanjay Patel [Tue, 25 Oct 2022 19:02:53 +0000 (15:02 -0400)]
[x86] add tests for extract + insert of vector shift amount; NFC

20 months ago[Docs][NFC] Update my office hour information
Johannes Doerfert [Wed, 26 Oct 2022 15:14:54 +0000 (08:14 -0700)]
[Docs][NFC] Update my office hour information

20 months ago[mlir][spirv] Flip createConvertGPUToSPIRVPass mapMemorySpace default
jackalcooper [Wed, 26 Oct 2022 15:01:07 +0000 (11:01 -0400)]
[mlir][spirv] Flip createConvertGPUToSPIRVPass mapMemorySpace default

Some down-stream libraries only have access to CAPI, setting
default value of mapMemorySpace to true will help them convert IR
to SPIR-V.

Reviewed By: antiagainst

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

20 months agoAdd a testcase for D136192.
Wael Yehia [Wed, 26 Oct 2022 14:32:19 +0000 (10:32 -0400)]
Add a testcase for D136192.

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

20 months ago[analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg
Gabor Marton [Fri, 14 Oct 2022 14:10:21 +0000 (16:10 +0200)]
[analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg
constraints

In this patch I add a new NoteTag for each applied argument constraint.
This way, any other checker that reports a bug - where the applied
constraint is relevant - will display the corresponding note. With this
change we provide more information for the users to understand some
bug reports easier.

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

Reviewed By: NoQ

20 months ago[clang][ASTImporter] Remove use of ParentMapContext.
Balázs Kéri [Wed, 26 Oct 2022 13:53:53 +0000 (15:53 +0200)]
[clang][ASTImporter] Remove use of ParentMapContext.

Function 'isAncestorDeclContextOf' was using 'ParentMapContext' for
looking up parent of statement nodes. There may be cases (bugs?) with
ParentMapContext when parents of specific statements are not found.
This leads to 'ASTImporter' infinite import loops when function
'hasAutoReturnTypeDeclaredInside' returns false incorrectly.
A real case was found but could not be reproduced with test code.
Use of 'ParentMapContext' is now removed and changed to a more safe
(currently) method by searching for declarations in statements
and find parent of these declarations. The new code was tested on
a number of projects and no related crash was found.

Reviewed By: martong

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

20 months ago[Lex] Stop allocating/deallocating MacroInfo on a linked list. NFC
Sam McCall [Wed, 26 Oct 2022 01:03:08 +0000 (03:03 +0200)]
[Lex] Stop allocating/deallocating MacroInfo on a linked list. NFC

This list was originally used for to make sure MacroInfo's clever memory
management got called (1f1e4bdbf7815c), but that was
simplified in 73a29662b9bf640a and 1f1e4bdbf7815c, and there's nothing left.

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

20 months ago[UpdateTestChecks] Sync flags in update_mir_test_checks.py with MIFlags
Anton Sidorenko [Tue, 18 Oct 2022 13:35:19 +0000 (16:35 +0300)]
[UpdateTestChecks] Sync flags in update_mir_test_checks.py with MIFlags

Some instructions are not matched by update_mir_test_checks.py because MIFlags and
regex in the script are not synchronized.

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

20 months ago[gn build] Port bb72d0dde29e
LLVM GN Syncbot [Wed, 26 Oct 2022 13:25:32 +0000 (13:25 +0000)]
[gn build] Port bb72d0dde29e

20 months ago[clang][dataflow] Implement transferBranch
Gabor Marton [Mon, 12 Sep 2022 13:44:53 +0000 (15:44 +0200)]
[clang][dataflow] Implement transferBranch

This patch introduces `transferBranch`, which Applies the analysis
transfer function for a given edge from a CFG block of a conditional
statement.

RFC:
https://discourse.llvm.org/t/rfc-clang-dataflow-signanalysis-edgetransfer-branchtransfer/65220

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

20 months ago[gn build] Port 93ce23adb548
LLVM GN Syncbot [Wed, 26 Oct 2022 13:20:22 +0000 (13:20 +0000)]
[gn build] Port 93ce23adb548

20 months ago[clang][dataflow] Add initial sign analysis
Gabor Marton [Tue, 25 Oct 2022 08:57:39 +0000 (10:57 +0200)]
[clang][dataflow] Add initial sign analysis

This patch adds an initial implementation for sign analysis, with the
following lattice (T: top, N: negative, Z: zero, P: positive, B: bottom):
  T
/ | \
N Z P
\ | /
  B
The lattice is implemented with `BoolValue` properties attached to other
`Value`s.

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

20 months agoRevert "[FuncSpec] Fix specialisation based on literals"
Momchil Velikov [Wed, 26 Oct 2022 12:49:18 +0000 (13:49 +0100)]
Revert "[FuncSpec] Fix specialisation based on literals"

This reverts commit a8b0f580170089fcd555ade5565ceff0ec60f609 because
of "reverse-iteration" buildbot failure.

20 months agoRevert "[FuncSpec][NFC] Refactor finding specialisation opportunities"
Momchil Velikov [Wed, 26 Oct 2022 12:48:35 +0000 (13:48 +0100)]
Revert "[FuncSpec][NFC] Refactor finding specialisation opportunities"

This reverts commit a8853924bd3c50deebfbf993c037257ccf9805f4 due to dependency
on a8b0f5801700

20 months ago[UpdateTestChecks] Precommit test for D136170
Anton Sidorenko [Thu, 20 Oct 2022 13:29:14 +0000 (16:29 +0300)]
[UpdateTestChecks] Precommit test for D136170

20 months ago[flang] Use mlir complex dialect for supported operations
David Truby [Mon, 24 Oct 2022 12:42:29 +0000 (12:42 +0000)]
[flang] Use mlir complex dialect for supported operations

This patch lowers the complex operations supported by the MLIR complex
dialect to those operations rather than libm. When the math runtime flag
is set to precise, libm lowering is used instead.

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

20 months ago[LLDB] Correct env vars for Android port selection
David Spickett [Wed, 26 Oct 2022 12:31:27 +0000 (12:31 +0000)]
[LLDB] Correct env vars for Android port selection

These should have "LOCAL" in them.

First added in 1e210abf9925ad08fb7c79894b4ec5ef8f0ef173.

20 months ago[flang] Use tdesc on fir.embox in code generation
Valentin Clement [Wed, 26 Oct 2022 12:16:43 +0000 (14:16 +0200)]
[flang] Use tdesc on fir.embox in code generation

For polymoprhic entities, the type descriptor is dynamic. The tdesc
operand on fir.embox is meant to propagate the dynamic type when
embox a polymorphic entity.
This patch makes use of this operand in code generation and update
the created descriptor accordingly.

Reviewed By: jeanPerier

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

20 months ago[Lex] Bring back the magic number 50 in updateConsecutiveMacroArgTokens.
Haojian Wu [Wed, 26 Oct 2022 09:47:44 +0000 (11:47 +0200)]
[Lex] Bring back the magic number 50 in updateConsecutiveMacroArgTokens.

This patch is a reland of 74e4f778cf16cbf7163b5c6de6027a43f5e9169f and
f83347b0bedb22ea676861c8e4e2ed9c31371ade with the removed 50 trick back.

The magic number 50 was removed in D134942, as a behavior change for
performance reason.

While it reduces the number of SLocEntry, it increases the usage of
SourceLocation address space usage, which is critical for compiling
large TU.

This fixes a regression caused in D134942 -- clang failed to compile one of
our internal files, complaining the file is too large to process because clang
runs out of source location space (we spend 40% more address space!)

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

20 months agoTake memset_inline into account in analyzeLoadFromClobberingMemInst
Guillaume Chatelet [Wed, 26 Oct 2022 09:34:34 +0000 (09:34 +0000)]
Take memset_inline into account in analyzeLoadFromClobberingMemInst

This appeared in https://reviews.llvm.org/D126903#3884061

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

20 months ago[analyzer] Fix assertion failure with conflicting prototype calls
Balazs Benics [Wed, 26 Oct 2022 09:27:01 +0000 (11:27 +0200)]
[analyzer] Fix assertion failure with conflicting prototype calls

It turns out we can reach the `Init.castAs<nonlock::CompoundVal>()`
expression with other kinds of SVals. Such as by `nonloc::ConcreteInt`
in this example: https://godbolt.org/z/s4fdxrcs9

```lang=C++
int buffer[10];
void b();
void top() {
  b(&buffer);
}
void b(int *c) {
  *c = 42; // would crash
}
```
In this example, we try to store `42` to the `Elem{buffer, 0}`.

This situation can appear if the CallExpr refers to a function
declaration without prototype. In such cases, the engine will pick the
redecl of the referred function decl which has function body, hence has
a function prototype.

This weird situation will have an interesting effect to the AST, such as
the argument at the callsite will miss a cast, which would cast the
`int (*)[10]` expression into `int *`, which means that when we evaluate
the `*c = 42` expression, we want to bind `42` to an array, causing the
crash.

Look at the AST of the callsite with and without the function prototype:
https://godbolt.org/z/Gncebcbdb
The only difference is that without the proper function prototype, we
will not have the `ImplicitCastExpr` `BitCasting` from `int (*)[10]`
to `int *` to match the expected type of the parameter declaration.

In this patch, I'm proposing to emit a cast in the mentioned edge-case,
to bind the argument value of the expected type to the parameter.

I'm only proposing this if the runtime definition has exactly the same
number of parameters as the callsite feeds it by arguments.
If that's not the case, I believe, we are better off by binding `Unknown`
to those parameters.

Reviewed By: martong

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

20 months ago[FuncSpec][NFC] Refactor finding specialisation opportunities
Momchil Velikov [Wed, 26 Oct 2022 09:18:35 +0000 (10:18 +0100)]
[FuncSpec][NFC] Refactor finding specialisation opportunities

This patch reorders the traversal of function call sites and function
formal parameters to:

* do various argument feasibility checks (`isArgumentInteresting` ) only once per argument, i.e. doing N-args checks instead of N-calls x N-args checks.

* do hash table lookups only once per call site, i.e. N-calls lookups/inserts instead of N-call x N-args lookups/inserts.

Reviewed By: ChuanqiXu, labrinea

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

20 months ago[FuncSpec] Compute specialisation gain even when forcing specialisation
Momchil Velikov [Wed, 26 Oct 2022 09:08:03 +0000 (10:08 +0100)]
[FuncSpec] Compute specialisation gain even when forcing specialisation

When rewriting the call sites to call the new specialised functions, a
single call site can be matched by two different specialisations - a
"less specialised" version of the function and a "more specialised"
version of the function, e.g.  for a function

    void f(int x, int y)

the call like `f(1, 2)` could be matched by either

    void f.1(int x /* int y == 2 */);

or

    void f.2(/* int x == 1, int y == 2 */);

The `FunctionSpecialisation` pass tries to match specialisation in the
order of decreasing gain, so "more specialised" functions are
preferred to "less specialised" functions. This breaks, however, when
using the flag `-force-function-specialization`, in which case the
cost/benefit analysis is not performed and all the specialisations are
equally preferable.

This patch makes the pass calculate specialisation gain and order the
specialisations accordingly even when `-force-function-specialization`
is used, under the assumption that this flag has purely debugging
purpose and it is reasonable to ignore the extra computing effort it
incurs.

Reviewed By: ChuanqiXu, labrinea

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

20 months ago[FuncSpec] Fix specialisation based on literals
Momchil Velikov [Tue, 25 Oct 2022 22:35:12 +0000 (23:35 +0100)]
[FuncSpec] Fix specialisation based on literals

The `FunctionSpecialization` pass has support for specialising
functions, which are called with literal arguments. This functionality
is disabled by default and is enabled with the option
`-function-specialization-for-literal-constant` .  There are a few
issues with the implementation, though:

* even with the default, the pass will still specialise based on
   floating-point literals

* even when it's enabled, the pass will specialise only for the `i1`
    type (or `i2` if all of the possible 4 values occur, or `i3` if all
    of the possible 8 values occur, etc)

The reason for this is incorrect check of the lattice value of the
function formal parameter. The lattice value is `overdefined` when the
constant range of the possible arguments is the full set, and this is
the reason for the specialisation to trigger. However, if the set of
the possible arguments is not the full set, that must not prevent the
specialisation.

This patch changes the pass to NOT consider a formal parameter when
specialising a function if the lattice value for that parameter is:

* unknown or undef
* a constant
* a constant range with a single element

on the basis that specialisation is pointless for those cases.

Is also changes the criteria for picking up an actual argument to
specialise if the argument is:

* a LLVM IR constant
* has `constant` lattice value
 has `constantrange` lattice value with a single element.

Reviewed By: ChuanqiXu

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

20 months ago[clangd] Hover: Only drop UsingDecl instead of BaseUsingDecl
Tom Praschan [Sun, 9 Oct 2022 12:18:30 +0000 (14:18 +0200)]
[clangd] Hover: Only drop UsingDecl instead of BaseUsingDecl

Since https://reviews.llvm.org/D135506 it's sufficient to only drop UsingDecl here

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

20 months ago[SelectionDAG] Clamp stack alignment for memset, memmove
Haohai Wen [Wed, 26 Oct 2022 08:05:01 +0000 (16:05 +0800)]
[SelectionDAG] Clamp stack alignment for memset, memmove

memcpy has clamped dst stack alignment to NaturalStackAlignment if
hasStackRealignment is false. We should also clamp stack alignment
for memset and memmove. If we don't clamp, SelectionDAG may first
do tail call optimization which requires no stack realignment. Then
memmove, memset in same function may be lowered to load/store with
larger alignment leading to PEI emit stack realignment code which
is absolutely not correct.

Reviewed By: LuoYuanke

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

20 months ago[mlir][llvm] Tighten LLVM dialect intrinsic type constraints.
Tobias Gysi [Wed, 26 Oct 2022 08:26:35 +0000 (11:26 +0300)]
[mlir][llvm] Tighten LLVM dialect intrinsic type constraints.

The revision specifies more precise argument and result type
constraints for many of the llvm intrinsics. Additionally, add
tests to verify intrinsics with invalid arguments/result result
in a verification error.

Reviewed By: ftynse

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

20 months agoRevert "[clang] Changes to produce sugared converted template arguments"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:40 +0000 (10:14 +0200)]
Revert "[clang] Changes to produce sugared converted template arguments"

This reverts commit 11ce78940b4c6f44ae6ee5a6611d6c9b1bade1c2.

20 months agoRevert "[clang] Perform sugared substitution of builtin templates"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:37 +0000 (10:14 +0200)]
Revert "[clang] Perform sugared substitution of builtin templates"

This reverts commit e5d9e802e50dd55a326e31a0d562e5263b208f3b.

20 months agoRevert "[clang] Implement sugared substitution changes to infrastructure"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:31 +0000 (10:14 +0200)]
Revert "[clang] Implement sugared substitution changes to infrastructure"

This reverts commit c4c2a3c65684e062efcd101a957c6cae0a304a7a.

20 months agoRevert "[clang] Instantiate NTTPs and template default arguments with sugar"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:27 +0000 (10:14 +0200)]
Revert "[clang] Instantiate NTTPs and template default arguments with sugar"

This reverts commit 2560c1266993af6e6c15900ce673c6db23132f8b.

20 months agoRevert "[clang] Instantiate alias templates with sugar"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:21 +0000 (10:14 +0200)]
Revert "[clang] Instantiate alias templates with sugar"

This reverts commit 4c44c91ad980304c5cca3792115349e68cfafd2b.

20 months agoRevert "[clang] Instantiate concepts with sugared template arguments"
Matheus Izvekov [Wed, 26 Oct 2022 08:14:14 +0000 (10:14 +0200)]
Revert "[clang] Instantiate concepts with sugared template arguments"

This reverts commit d0a6de59c78010118fea811514e03ed9f400215a.