platform/upstream/llvm.git
13 months ago[clang][dataflow] Add `refreshStructValue()`.
Martin Braenne [Mon, 17 Jul 2023 06:31:36 +0000 (06:31 +0000)]
[clang][dataflow] Add `refreshStructValue()`.

Besides being a useful abstraction, this function will help insulate existing clients of the framework from upcoming changes to the API of `StructValue` and `AggregateStorageLocation`.

Depends On D155202

Reviewed By: ymandel, xazax.hun

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

13 months ago[clang][dataflow] Simplify implementation of `transferStdForwardCall()` in optional...
Martin Braenne [Mon, 17 Jul 2023 06:31:03 +0000 (06:31 +0000)]
[clang][dataflow] Simplify implementation of `transferStdForwardCall()` in optional check.

The argument and return value of `std::forward` is always a reference, so we can simply forward the storage location.

Depends On D155075

Reviewed By: ymandel, gribozavr2, xazax.hun

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

13 months ago[clang][dataflow] Add `DataflowEnvironment::createObject()`.
Martin Braenne [Mon, 17 Jul 2023 06:27:59 +0000 (06:27 +0000)]
[clang][dataflow] Add `DataflowEnvironment::createObject()`.

This consolidates the code used in various places to initialize objects (usually for variables) into one central location.

It will also help reduce the number of changes needed when we make the upcoming API changes to `AggregateStorageLocation` and `StructValue`.

Depends On D155074

Reviewed By: ymandel, xazax.hun

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

13 months ago[clang][dataflow] Add a test for not explicitly initialized fields in aggregate initi...
Martin Braenne [Mon, 17 Jul 2023 06:27:42 +0000 (06:27 +0000)]
[clang][dataflow] Add a test for not explicitly initialized fields in aggregate initialization.

Reviewed By: ymandel

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

13 months ago[CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour
Martin Storsjö [Wed, 12 Jul 2023 12:40:37 +0000 (12:40 +0000)]
[CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour

With the new behaviour, the /MD or similar options aren't added to
e.g. CMAKE_CXX_FLAGS_RELEASE, but are added separately by CMake.
They can be changed by the cmake variable
CMAKE_MSVC_RUNTIME_LIBRARY or with the target property
MSVC_RUNTIME_LIBRARY.

LLVM has had its own custom CMake flags, e.g. LLVM_USE_CRT_RELEASE,
which affects which CRT is used for release mode builds. Deprecate
these and direct users to use CMAKE_MSVC_RUNTIME_LIBRARY directly
instead (and do a best effort attempt at setting CMAKE_MSVC_RUNTIME_LIBRARY
based on the existing LLVM_USE_CRT_ flags). This only handles the
simple cases, it doesn't handle multi-config generators with
different LLVM_USE_CRT_* variables for different configs though,
but that's probably fine - we should move over to the new upstream
CMake mechanism anyway, and push users towards that.

Change code in compiler-rt, that previously tried to override the
CRT choice to /MT, to set CMAKE_MSVC_RUNTIME_LIBRARY instead of
meddling in the old variables.

This resolves the policy issue in
https://github.com/llvm/llvm-project/issues/63286, and should
handle the issues that were observed originally when the
minimum CMake version was bumped, in
https://github.com/llvm/llvm-project/issues/62719 and
https://github.com/llvm/llvm-project/issues/62739.

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

13 months ago[mlir][ODS] Add support for passing properties to `ref` in `custom`
Markus Böck [Fri, 14 Jul 2023 14:49:09 +0000 (16:49 +0200)]
[mlir][ODS] Add support for passing properties to `ref` in `custom`

This is essentially a follow up to https://reviews.llvm.org/D155072

This adds support for also passing properties as `ref` parameter to `custom`. This requires the property to have been bound previously and will error otherwise. This makes it possible for an implementation of `custom` to take previously parsed data into account, creating nice context-dependent grammars :-)

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

13 months ago[clang-tidy][NFC] Fix syntax in release notes
Piotr Zegar [Mon, 17 Jul 2023 06:20:17 +0000 (06:20 +0000)]
[clang-tidy][NFC] Fix syntax in release notes

Add missing : character to links in release notes
so they could shown properly.

13 months ago[NFC][clang] Fix format in UnsafeBufferUsage.cpp
Evan Wilde [Mon, 17 Jul 2023 05:43:47 +0000 (22:43 -0700)]
[NFC][clang] Fix format in UnsafeBufferUsage.cpp

There were two whitespaces on an otherwise empty that were causing the
bots to fail due to formatting issues. Deleting extra whitespace now.

13 months ago[gn build] Port 42179bbf6bcc
LLVM GN Syncbot [Mon, 17 Jul 2023 05:11:41 +0000 (05:11 +0000)]
[gn build] Port 42179bbf6bcc

13 months ago[clang-tidy] Add check for possibly incomplete switch statements
Shivam Gupta [Sun, 16 Jul 2023 16:43:55 +0000 (22:13 +0530)]
[clang-tidy] Add check for possibly incomplete switch statements

While clang warns about a possibly incomplete switch statement when switching over an enum variable and failing to cover all enum values (either explicitly or with a default case), no such warning is emitted if a plain integer variable is used as switch variable.

Add a clang-tidy check to diagnose these scenarios.

No fixit hint is provided since there are multiple possible solutions.

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

13 months ago[RISCV] Implement prefetch locality by NTLH
Piyou Chen [Mon, 17 Jul 2023 02:23:19 +0000 (19:23 -0700)]
[RISCV] Implement prefetch locality by NTLH

We add the MemOperand then backend will generate NTLH automatically.

```
__builtin_prefetch(ptr,  0 /* rw==read */, 0 /* locality */); => ntl.all + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 1 /* locality */); => ntl.pall + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 2 /* locality */); => ntl.p1 + prefetch.r (ptr)
__builtin_prefetch(ptr,  0 /* rw==read */, 3 /* locality */); => prefetch.r (ptr)
```

Reviewed By: craig.topper

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

13 months ago[RISCV] Adjust the Zfhmin handling in RISCVInstrInfo::copyPhysReg.
Craig Topper [Mon, 17 Jul 2023 03:15:52 +0000 (20:15 -0700)]
[RISCV] Adjust the Zfhmin handling in RISCVInstrInfo::copyPhysReg.

Instead of checking '!Zfh && Zhfmin' first, handle Zfh. Then assert
that the other case is F+Zfhmin. The F+Zfhmin check will need to be
relaxed for bfloat16 support. As it was written before there would
be now error to catch that. Instead it would just silently create
fsgnj.h instructions.

13 months ago[ORC] In defineMaterializing, error out early if tracker is defunct.
Lang Hames [Mon, 17 Jul 2023 00:33:02 +0000 (17:33 -0700)]
[ORC] In defineMaterializing, error out early if tracker is defunct.

An in-flight materialization may try to claim responsibility for new symbols
(via MaterializationResponsibility::defineMaterializing) after the tracker that
is associated with the materialization is removed, leaving the tracker defunct.

Failure to error out early here could leave the JITDylib in an invalid state,
with defineMaterializing associating new symbols with the already-defunct
tracker. Erroring out early prevents this.

13 months ago[Driver] Warn about all instances -mios-version-min not just the last
Cassie Jones [Sun, 16 Jul 2023 23:45:30 +0000 (16:45 -0700)]
[Driver] Warn about all instances -mios-version-min not just the last

Follow-up to D155123, uniformly handle cases where there are duplicate
-mios-verion-min arguments.

Reviewed By: MaskRay

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

13 months ago[ORC] Assert that ExecutionSession is still open when JITDylibs are created.
Lang Hames [Sun, 16 Jul 2023 23:37:09 +0000 (16:37 -0700)]
[ORC] Assert that ExecutionSession is still open when JITDylibs are created.

13 months ago[InferAddressSpaces] Use poison instead of undef as placeholder [NFC]
Nuno Lopes [Sun, 16 Jul 2023 21:33:00 +0000 (22:33 +0100)]
[InferAddressSpaces] Use poison instead of undef as placeholder [NFC]
This placeholder is only used during the execution of the algorithm, and it's patched with a
concrete value at the end

13 months ago[LoopIdiomRecognize] Use poison instead of undef as placeholder [NFC]
Nuno Lopes [Sun, 16 Jul 2023 21:31:17 +0000 (22:31 +0100)]
[LoopIdiomRecognize] Use poison instead of undef as placeholder [NFC]
It was using undef as placeholder for getting the TTI cost for cttz
While at it, update the comments about cttz's last argument (is_zero_poison)

13 months ago[RISCV] Move comments before 'if' instead of after. NFC
Craig Topper [Sun, 16 Jul 2023 19:56:41 +0000 (12:56 -0700)]
[RISCV] Move comments before 'if' instead of after. NFC

This allows us to remove some curly braces around the if body.
The code wasn't consistent about it anyway. Comments before is
used in other places in this file already.

Reviewed By: wangpc, MaskRay

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

13 months ago[RISCV] Make selectSETCC return SDValue instead of bool. NFC
Craig Topper [Sun, 16 Jul 2023 19:56:03 +0000 (12:56 -0700)]
[RISCV] Make selectSETCC return SDValue instead of bool. NFC

We can use a null SDValue for the 'false' case. This avoids the
need for an output parameter. This is consistent with other
SelectionDAG code.

Reviewed By: wangpc

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

13 months ago[clang-tidy] Improve build-in type handling in bugprone-swapped-arguments
Piotr Zegar [Sun, 16 Jul 2023 18:28:39 +0000 (18:28 +0000)]
[clang-tidy] Improve build-in type handling in bugprone-swapped-arguments

Improved detection of argument swaps involving integral and floating-point
types by enhancing handling of implicit conversions. Now implicit casts
from float to double are also considered, same for integers.
Improved documentation.

Fixes: #62926

Reviewed By: carlosgalvezp

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

13 months ago[JITLink] Replace isInRangeForImm* functions with isInt / isUInt equivalents.
Lang Hames [Sun, 16 Jul 2023 17:03:38 +0000 (10:03 -0700)]
[JITLink] Replace isInRangeForImm* functions with isInt / isUInt equivalents.

Avoids some code duplication.

13 months agoCreate diagnostic group for definition deprecation warning
Nuri Amari [Sun, 16 Jul 2023 16:35:25 +0000 (12:35 -0400)]
Create diagnostic group for definition deprecation warning

In https://reviews.llvm.org/D126664, a warning is introduced
warning against the deprecated out of line definition of a
static constexpr member in C++17 and later. Prior to this patch,
the only diagnostic group controlling this diagnostic was -Wdeprecated,
which controls many many diagnostics. This patch creates
a diagnostic group specifically for this warning so it can
be controlled in isolation, while also being included with -Wdeprecated.

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

13 months ago[libc++] Implement stringstream members of P0408R7 (Efficient Access to basic_stringb...
Piotr Fusik [Sun, 16 Jul 2023 13:33:05 +0000 (15:33 +0200)]
[libc++] Implement stringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Reviewed By: Mordante, #libc

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

13 months ago[NewGVN] Canonicalize expressions for commutative intrinsics
ManuelJBrito [Fri, 14 Jul 2023 16:29:44 +0000 (17:29 +0100)]
[NewGVN] Canonicalize expressions for commutative intrinsics

Ensure that commutative intrinsics that only differ by a permutation
of their operands get the same value number by sorting the operand value
numbers.

Fixes https://github.com/llvm/llvm-project/issues/46753

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

13 months ago[docs][JITLink] Update JITLink COFF/x86-64 backend status.
Lang Hames [Sun, 16 Jul 2023 16:12:57 +0000 (09:12 -0700)]
[docs][JITLink] Update JITLink COFF/x86-64 backend status.

The COFF/x86-64 backend has been usable since LLVM 16.

13 months ago[libc++] Implement ostringstream members of P0408R7 (Efficient Access to basic_string...
Piotr Fusik [Sun, 16 Jul 2023 13:18:20 +0000 (15:18 +0200)]
[libc++] Implement ostringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Reviewed By: #libc, Mordante

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

13 months ago[GlobalISel] Fix infinite loop in reassociation combine
Jay Foad [Fri, 14 Jul 2023 10:33:20 +0000 (11:33 +0100)]
[GlobalISel] Fix infinite loop in reassociation combine

Don't reassociate (C1+C2)+Y -> C1+(C2+Y).

Fixes https://github.com/llvm/llvm-project/issues/63849

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

13 months ago[gn] port f0dfe682bca0 (no more _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)
Nico Weber [Sun, 16 Jul 2023 11:25:55 +0000 (07:25 -0400)]
[gn] port f0dfe682bca0 (no more _LIBCPP_ENABLE_ASSERTIONS_DEFAULT)

13 months ago[NFC][libc++] Fixes some comments.
Mark de Wever [Sun, 16 Jul 2023 09:34:41 +0000 (11:34 +0200)]
[NFC][libc++] Fixes some comments.

13 months agoRevert "[RISCV] Move comments before 'if' instead of after. NFC"
Craig Topper [Sun, 16 Jul 2023 05:54:06 +0000 (22:54 -0700)]
Revert "[RISCV] Move comments before 'if' instead of after. NFC"

This reverts commit ef1ccc493e6167488ac10da2842fa7cac2746565.

Committed by mistake.

13 months ago[RISCV] Use isScalarInteger instead of isInteger. NFC
Craig Topper [Sun, 16 Jul 2023 05:52:36 +0000 (22:52 -0700)]
[RISCV] Use isScalarInteger instead of isInteger. NFC

The type should only be scalar here and the isScalarInteger
should be a simpler check.

13 months ago[RISCV] Move comments before 'if' instead of after. NFC
Craig Topper [Sun, 16 Jul 2023 05:46:38 +0000 (22:46 -0700)]
[RISCV] Move comments before 'if' instead of after. NFC

This allows us to remove some curly braces around the if body.
The code wasn't consistent about it anyway. Comments before is
used in other places in this file already.

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

13 months ago[RISCV] Move vector handling earlier in lowerSELECT. NFC
Craig Topper [Sun, 16 Jul 2023 05:34:16 +0000 (22:34 -0700)]
[RISCV] Move vector handling earlier in lowerSELECT. NFC

This keeps all the scalar code together.

13 months ago[RISCV] Remove 'else' after 'return'. NFC
Craig Topper [Sun, 16 Jul 2023 05:25:26 +0000 (22:25 -0700)]
[RISCV] Remove 'else' after 'return'. NFC

13 months ago[RISCV] Merge rv32/rv64 vector single-width shift intrinsic tests that have the same...
Jim Lin [Wed, 12 Jul 2023 09:40:38 +0000 (17:40 +0800)]
[RISCV] Merge rv32/rv64 vector single-width shift intrinsic tests that have the same content. NFC.

13 months ago[docs] Update JITLink's support matrix in the JITLink doc.
Lang Hames [Sun, 16 Jul 2023 00:19:35 +0000 (17:19 -0700)]
[docs] Update JITLink's support matrix in the JITLink doc.

13 months ago[clangd] Implement end-definition-comment inlay hints
daiyousei-qz [Sat, 15 Jul 2023 23:15:44 +0000 (01:15 +0200)]
[clangd] Implement end-definition-comment inlay hints

This patch implements a new inlay hint feature proposed in https://github.com/clangd/clangd/issues/1634. It introduces a new inlay hint kind BlockEnd which shows a comment-like hint after a definition brace pair, including function/type/namespace. For example,
```
void foo() {
} ^
```
In the code shown above, a hint should be displayed at ^ labelling `// foo`. Such hint only shows when there's no trailing character after the position except whitespaces and optionally ';'.

Also, new configurations are introduced in the inlay hints block
```
InlayHints:
    BlockEnd: Yes # toggling the feature
```

Reviewed By: sammccall

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

13 months agoRe-land "5b012bf5ab5fcb840fe7f6c8664b8981ce6f24f3"
ziqingluo-90 [Sat, 15 Jul 2023 23:11:37 +0000 (16:11 -0700)]
Re-land "5b012bf5ab5fcb840fe7f6c8664b8981ce6f24f3"

Removed dependency on `clangSema` from UnsafeBufferAnalysis.

13 months ago[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform
Maksim Kita [Sat, 15 Jul 2023 20:55:04 +0000 (15:55 -0500)]
[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform

Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform to more than two pairs of variables https://github.com/llvm/llvm-project/issues/57831.
Depends D154384.

Reviewed By: goldstein.w.n, nikic

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

13 months ago[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform tests
Maksim Kita [Sat, 15 Jul 2023 20:55:03 +0000 (15:55 -0500)]
[InstCombine] Generalise ((x1 ^ y1) | (x2 ^ y2)) == 0 transform tests

Precommit tests for D154306.

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

13 months ago[Mips] Set setMaxAtomicSizeInBitsSupported
Brad Smith [Sat, 15 Jul 2023 21:26:05 +0000 (17:26 -0400)]
[Mips] Set setMaxAtomicSizeInBitsSupported

Set setMaxAtomicSizeInBitsSupported for Mips. Set the value as appropriate for 64-bit MIPS vs 32-bit.

Reviewed By: efriedma

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

13 months ago[ELF] Support operator ^ and ^=
Fangrui Song [Sat, 15 Jul 2023 21:10:40 +0000 (14:10 -0700)]
[ELF] Support operator ^ and ^=

GNU ld added ^ support in July 2023 and it looks like ^= is in plan as
well.

For now, we don't support `a^=0` (^= without a preceding space).

13 months ago[amdgpu] Accept an optional max to amdgpu-lds-size attribute for use in PromoteAlloca
Jon Chesterfield [Sat, 15 Jul 2023 19:38:15 +0000 (20:38 +0100)]
[amdgpu] Accept an optional max to amdgpu-lds-size attribute for use in PromoteAlloca

13 months agoUse empty symbol name for XCOFF text csect
Stephen Peckham [Thu, 13 Jul 2023 21:15:48 +0000 (17:15 -0400)]
Use empty symbol name for XCOFF text csect

When generating XCOFF, the compiler generates a csect with an internal
name.  Each function results in a label within the csect.  This patch
replaces the internal name ".text" with an empty string "".  This avoids
adding special code to handle a function text() in the source file, and
works better with some XCOFF tools that are confused when the csect and
the first function have the same address.

Reviewed By: hubert.reinterpretcast

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

13 months agoAdd option -fkeep-persistent-storage-variables to emit all variables that have a...
Zheng Qian [Sat, 15 Jul 2023 00:02:13 +0000 (20:02 -0400)]
Add option -fkeep-persistent-storage-variables to emit all variables that have a persistent storage duration

This patch adds a new option -fkeep-persistent-storage-variables to emit
all variables that have a persistent storage duration, including global,
static and thread-local variables. This could be useful in cases where
the presence of all these variables as symbols in the object file are
required, so that they can be directly addressed.

Reviewed By: hubert.reinterpretcast

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

13 months ago[amdgpu][nfc] Use unsigned for getIntegerPairAttribute to match the only call sites
Jon Chesterfield [Sat, 15 Jul 2023 19:38:15 +0000 (20:38 +0100)]
[amdgpu][nfc] Use unsigned for getIntegerPairAttribute to match the only call sites

13 months ago[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest
Kazuki Sakamoto [Fri, 14 Jul 2023 17:59:39 +0000 (10:59 -0700)]
[lldb][LocateModuleCallback] Fix LocateModuleCallbackTest

ModuleList unexpectedly caches module beyond test.
Tear it down.

- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModule/
- https://green.lab.llvm.org/green/view/LLDB/job/as-lldb-cmake/2260/testReport/junit/lldb-unit/Target___TargetTests_LocateModuleCallbackTest/GetOrCreateModuleWithCachedModuleAndSymbol/

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

13 months ago[docs] GettingStarted.rst cmake should reference build
Farid Zakaria [Sat, 15 Jul 2023 18:36:13 +0000 (11:36 -0700)]
[docs] GettingStarted.rst cmake should reference build

The next sections in GettingStarted assume you are still in the root
directory llvm-project when using ninja.

Make the `cmake --build` command match it as well.

Note: I am a new cmake user and this confused me.

Reviewed By: MaskRay

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

13 months ago[llvm-objcopy] Remove unused internal helper function template makeStringError. NFC
Thomas Köppe [Sat, 15 Jul 2023 18:22:53 +0000 (11:22 -0700)]
[llvm-objcopy] Remove unused internal helper function template makeStringError. NFC

Reviewed By: jhenderson, MaskRay

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

13 months ago[RISCV] Use unsigned instead of signed types for Zk* and Zb* builtins.
Craig Topper [Sat, 15 Jul 2023 18:19:18 +0000 (11:19 -0700)]
[RISCV] Use unsigned instead of signed types for Zk* and Zb* builtins.

Unsigned is a better representation for bitmanipulation and cryptography.w

The only exception being the return values for clz and ctz intrinsics is
a signed int. That matches the target independent clz and ctz builtins.

This is consistent with the current scalar crypto proposal
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/44

Reviewed By: VincentWu

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

13 months ago[clang-format] Correctly annotate overloaded operator function name
Owen Pan [Sat, 15 Jul 2023 07:45:18 +0000 (00:45 -0700)]
[clang-format] Correctly annotate overloaded operator function name

The operator keyword preceded by a template closer should be annotated as
TT_FunctionDeclarationName.

Fixes #63879.

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

13 months ago[libc++][Modules] Restore the <string> include to <__format/format_functions.h>
Ian Anderson [Wed, 12 Jul 2023 20:54:16 +0000 (13:54 -0700)]
[libc++][Modules] Restore the <string> include to <__format/format_functions.h>

<__format/format_functions.h> was using <string>, we need to bring the include back that was removed in D154122.

Reviewed By: Mordante, #libc

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

13 months ago[ubsan] Disable sigaction.cpp on archs for debugging
Caslyn Tonelli [Fri, 14 Jul 2023 17:45:54 +0000 (17:45 +0000)]
[ubsan] Disable sigaction.cpp on archs for debugging

Add `ubsan-tsan` condition to test disablement.

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

13 months ago[X86] LowerMemArgument - remove else clause after return (style). NFC.
Simon Pilgrim [Sat, 15 Jul 2023 14:57:32 +0000 (15:57 +0100)]
[X86] LowerMemArgument - remove else clause after return (style). NFC.

13 months ago[X86] getIRStackGuard - remove else clause after return (style). NFC.
Simon Pilgrim [Sat, 15 Jul 2023 14:55:40 +0000 (15:55 +0100)]
[X86] getIRStackGuard - remove else clause after return (style). NFC.

13 months ago[X86] Fix znver4 fcmp/fma throughputs
Simon Pilgrim [Sat, 15 Jul 2023 14:46:16 +0000 (15:46 +0100)]
[X86] Fix znver4 fcmp/fma throughputs

Reported by SeeSpring - it looks like when the numbers were copied from the znver3 model, the resources were altered when it should have just been the latency.

Now matches uops.info / Agner / AMD SoG

Fixes #63877

13 months ago[libc++] Adds a missing include.
Mark de Wever [Sat, 15 Jul 2023 14:29:36 +0000 (16:29 +0200)]
[libc++] Adds a missing include.

It turns out D153336 needs a new include. This should fix the broken
LLVM CI runners.

13 months ago[libc++][tests] Fix a test testing wrong class
Piotr Fusik [Sat, 15 Jul 2023 09:14:02 +0000 (11:14 +0200)]
[libc++][tests] Fix a test testing wrong class

Reviewed By: #libc, Mordante

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

13 months ago[NFC][libc++][bitset] Refactors constructors.
Mark de Wever [Sun, 9 Jul 2023 13:36:12 +0000 (15:36 +0200)]
[NFC][libc++][bitset] Refactors constructors.

Based on the review comments in D153201 this combines the string and
c-string constructors. The common constructor is using a string_view:
- it allows propagating the _Traits, which are required to be used for
  comparison.
- it avoids allocating
- libc++ supports it in C++03

Reviewed By: philnik, #libc, ldionne

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

13 months ago[ValueTracking] Support vscale assumes for isKnownToBeAPowerOfTwo
zhongyunde [Sat, 15 Jul 2023 11:40:25 +0000 (19:40 +0800)]
[ValueTracking] Support vscale assumes for isKnownToBeAPowerOfTwo

This patch is separated from D154953 to see what tests are affected by this
change alone according comment.
Depend on the related updating of LangRef on D155193.

Reviewed By: paulwalker-arm, nikic, david-arm
Differential Revision: https://reviews.llvm.org/D155350

13 months ago[tests] precommit tests for D155350
zhongyunde [Sat, 15 Jul 2023 11:36:05 +0000 (19:36 +0800)]
[tests] precommit tests for D155350

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D155363

13 months ago[libc++] add basic runtime assertions to <barrier>
Edoardo Sanguineti [Sat, 15 Jul 2023 10:48:10 +0000 (12:48 +0200)]
[libc++] add basic runtime assertions to <barrier>

Adding assertions will aid users that have bugs in their code to receive better error messages.

Reviewed By: #libc, ldionne

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

13 months ago[libc++][chrono] Fixes formatter duration.
Mark de Wever [Sat, 26 Nov 2022 17:15:45 +0000 (18:15 +0100)]
[libc++][chrono] Fixes formatter duration.

@EricWF spotted this issue in the post-commit review comments of
D134742. However the suggestion to just use chrono calculations can
result in similar issues when using small fractional seconds.

Reviewed By: EricWF, #libc

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

13 months ago[libc++] Fixes thread::id's operator<<.
Mark de Wever [Fri, 2 Jun 2023 09:25:50 +0000 (11:25 +0200)]
[libc++] Fixes thread::id's operator<<.

The output of

  template<class charT, class traits>
    basic_ostream<charT, traits>&
      operator<<(basic_ostream<charT, traits>& out, thread::id id);

is affected by the state of out. The wording states

[thread.thread.id]/2
  The text representation for the character type charT of an object of
  type thread::id is an unspecified sequence of charT such that, for two
  objects of type thread::id x and y, if x == y is true, the thread::id
  objects have the same text representation, and if x != y is true, the
  thread::id objects have distinct text representations.

[thread.thread.id]/9
  template<class charT, class traits>
    basic_ostream<charT, traits>&
      operator<< (basic_ostream<charT, traits>& out, thread::id id);

  Effects: Inserts the text representation for charT of id into out.

This wording changed in C++23 due to adding a formatter specialization for
thread::id. However the requirement was the same in older versions of C++.

This issue is that thread::id is an integral or pointer and affected by the
formatting manipulators for them. Thus the text representation can differ if
x == y which violates the requirements.

The fix has to hard-code some formatting style for the text
representation. It uses the Standard specified default values

Table 124: basic_ios::init() effects [tab:basic.ios.cons] flags()
  flags() skipws | dec

Fixes PR: https://llvm.org/PR62073

Reviewed By: #libc, ldionne

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

13 months ago[libc++][NFC] Remove redundant defined(_LIBCPP_BUILDING_LIBRARY)
Nikolas Klauser [Sat, 15 Jul 2023 08:38:07 +0000 (01:38 -0700)]
[libc++][NFC] Remove redundant defined(_LIBCPP_BUILDING_LIBRARY)

13 months agoRevert "Revert "[MemCpyOpt] implement single BB stack-move optimization which unify...
khei4 [Thu, 13 Jul 2023 09:59:21 +0000 (18:59 +0900)]
Revert "Revert "[MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas""

This reverts commit 36a6eb7d12a9f827bf3d5d4e5fdc68b8a62807b2.

[MemCpyOpt] check that load/store and dest/src alloca are all in the same bb

Differential Revision: https://reviews.llvm.org/D153453
Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
13 months ago[MemCpyOpt] precommit tests to add multi-BB stack-move optimization to check crash...
khei4 [Thu, 13 Jul 2023 09:59:02 +0000 (18:59 +0900)]
[MemCpyOpt] precommit tests to add multi-BB stack-move optimization to check crash for D153453 (NFC)
Differential Revision: https://reviews.llvm.org/D155179
Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
13 months ago[mlir][sparse][gpu] add the 2:4 spmm integration test from linalg
Kun Wu [Sat, 15 Jul 2023 05:58:48 +0000 (05:58 +0000)]
[mlir][sparse][gpu] add the 2:4 spmm integration test from linalg

Reviewed By: aartbik

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

13 months agoReformat
NAKAMURA Takumi [Sat, 15 Jul 2023 04:50:21 +0000 (13:50 +0900)]
Reformat

13 months agoRevert D150338, "[-Wunsafe-buffer-usage] Improving insertion of the [[clang::unsafe_b...
NAKAMURA Takumi [Sat, 15 Jul 2023 04:46:10 +0000 (13:46 +0900)]
Revert D150338, "[-Wunsafe-buffer-usage] Improving insertion of the [[clang::unsafe_buffer_usage]] attribute"

clangAnalysis should not depend on clangSema.

This reverts commit 5b012bf5ab5fcb840fe7f6c8664b8981ce6f24f3.

13 months ago[RISCV] Split clmul/clmulh/clmulr builtins into _32 and _64 versions.
Craig Topper [Sat, 15 Jul 2023 02:09:15 +0000 (19:09 -0700)]
[RISCV] Split clmul/clmulh/clmulr builtins into _32 and _64 versions.

This removes another use of 'long' to mean xlen from builtins.

I've also converted the types to unsigned as proposed in D154616.

clmul_32 is available to RV64 as its emulation is clmul+sext.w
clmulh_32 and clmulr_32 are not available on RV64 as their emulation
is currently 6 instructions in the worst case.

13 months ago[libc++] Set correct size at the end of growing std::string
Advenam Tacet [Thu, 13 Jul 2023 00:30:36 +0000 (02:30 +0200)]
[libc++] Set correct size at the end of growing std::string

This commit deprecates `std::basic_string::__grow_by`, which is part of ABIv1. The function is replaced by `std::basic_string:__grow_by_without_replace`, which is not part of ABI.

- The original function `__grow_by` is deprecated because it does not set the string size,  therefore it may not update the size when the size is changed, and it may also not set the size at all when the string was short initially. This leads to unpredictable size value. It is not removed or changed to avoid breaking the ABI.
- The commit adds `_LIBCPP_HIDE_FROM_ABI`  guarded by `_LIBCPP_ABI_VERSION >= 2` to `__grow_by`. This allows the function to be used in the dylib in ABIv1 without raising the `[abi:v170000]` error and removes it from future ABIs. `_LIBCPP_HIDE_FROM_ABI_AFTER_V1` cannot be used.
- Additionally, `__grow_by` has been removed from `_LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST` in `libcxx/include/__string/extern_template_lists.h`.

This bugfix is necessary to implement string ASan annotations, because it mitigates the problems encountered in D132769.

Reviewed By: ldionne, #libc, philnik

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

13 months ago[RISCV][GlobalISel] Legalize add, sub and binary logical instructions for narrow...
Nitin John Raj [Fri, 14 Jul 2023 07:00:17 +0000 (00:00 -0700)]
[RISCV][GlobalISel] Legalize add, sub and binary logical instructions for narrow types

For rv32, we test the legalization of i8, i16 and i32. For rv64, we additionally test the legalization of i64.

This is the first of a series of commits aiming to legalize arithmetic instructions for RISCV.

Reviewed By: craig.topper, arsenm

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

13 months ago[mlir] Fix printing of dialect resources
Jeff Niu [Fri, 14 Jul 2023 23:30:17 +0000 (19:30 -0400)]
[mlir] Fix printing of dialect resources

It was forgetting commas.

Reviewed By: rriddle, jpienaar

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

13 months ago[LangRef] vscale_range implies the vscale is power-of-two
Zhongyunde [Sat, 15 Jul 2023 01:04:51 +0000 (09:04 +0800)]
[LangRef] vscale_range implies the vscale is power-of-two

According the discuss on D154953, we need to make the LangRef change
before the optimization relied on the new behaviour:
      vscale_range implies vscale is a power-of-two value, parse of the
  attribute to reject values that are not a power-of-two.

Thanks nikic for the wonderful summary of discussing on D154953:
To provide a bit more context here. We would like to have power of two vscale exposed in a target-independent way, so we can make use of this in places like ValueTracking, just like we currently do the vscale range. Some options that have been discussed are:
  - Remove support for non-power-of-two vscales entirely. (This is my personal preference, but this is hard to undo if it turns out someone does need them.)
  - Add an extra attribute vscale_pow2, or a data layout property.
  - Make vscale_range imply power-of-two vscale, as a compromise solution (what this patch does). This would be relatively easy to turn into one of the two above at a later point.

Reviewed By: paulwalker-arm, nikic, efriedma
Differential Revision: https://reviews.llvm.org/D155193

14 months ago[GitHub] Update repo lockdown to exclude lldb
Chris Bieneman [Sat, 15 Jul 2023 00:34:50 +0000 (19:34 -0500)]
[GitHub] Update repo lockdown to exclude lldb

This change enables the LLDB project to begin experimenting with
pull-request workflows to help identify issues was we move toward
adopting pull requests.

Reviewed By: tstellar, JDevlieghere

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

14 months ago[OpenMP][FIX] Adjust "known" attributes for runtime functions
Johannes Doerfert [Fri, 14 Jul 2023 23:14:56 +0000 (16:14 -0700)]
[OpenMP][FIX] Adjust "known" attributes for runtime functions

This showed up when we started to deduce readnone for the argument of
__kmpc_global_thread_num. The known attributes for "getters" did not
allow to read arguments, but that is sometimes the case.

14 months ago[libc++][hardening] Deprecate `_LIBCPP_ENABLE_ASSERTIONS`.
varconst [Fri, 14 Jul 2023 23:58:15 +0000 (16:58 -0700)]
[libc++][hardening] Deprecate `_LIBCPP_ENABLE_ASSERTIONS`.

`_LIBCPP_ENABLE_ASSERTIONS` was used to enable the "safe" mode in
libc++. Libc++ now provides the hardened mode and the debug mode that
replace the safe mode.

For backward compatibility, enabling `_LIBCPP_ENABLE_ASSERTIONS` now
enables the hardened mode. Note that the hardened mode provides
a narrower set of checks than the previous "safe" mode (only
security-critical checks that are performant enough to be used in
production).

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

14 months ago[MLIR] Don't sort operand of commutative ops when comparing two ops as there is a...
tomnatan [Fri, 14 Jul 2023 23:11:46 +0000 (16:11 -0700)]
[MLIR] Don't sort operand of commutative ops when comparing two ops as there is a correctness issue

This feature was introduced in `D123492`.

Doing equivalence on pointers to sort operands of commutative operations is incorrect when checking equivalence of ops in separate regions (where the lhs and rhs operands are marked as equivalent but are not the same value).

It was also discussed in `D123492` and `D129480` that the correct solution would be to stable sort the operands in canonicalization (based on some numbering in the region maybe), but until that lands, reverting this change will unblock us and other users.

An example of a pass that might not work properly because of this is `DuplicateFunctionEliminationPass`.

Reviewed By: mehdi_amini, jpienaar

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

14 months ago[MLIR:Python] Make DenseElementsAttr.get() only request a buffer format if no explici...
Peter Hawkins [Fri, 14 Jul 2023 23:08:15 +0000 (16:08 -0700)]
[MLIR:Python] Make DenseElementsAttr.get() only request a buffer format if no explicit type was provided.

Not every NumPy type (e.g., the `ml_dtypes.bfloat16` NumPy extension
type) has a type in the Python buffer protocol, so exporting such a
buffer with `PyBUF_FORMAT` may fail.

However, we don't care about the self-reported type of a buffer if the
user provides an explicit type. In the case that an explicit type is
provided, don't request the format from the buffer protocol, which
allows arrays whose element types are unknown to the buffer protocol to
be passed.

Reviewed By: jpienaar, ftynse

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

14 months ago[Clang] Fix crash when emitting diagnostic for out of order designated initializers...
Shafik Yaghmour [Fri, 14 Jul 2023 22:56:17 +0000 (15:56 -0700)]
[Clang] Fix crash when emitting diagnostic for out of order designated initializers in C++

In C++ we are not allowed to use designated initializers to initialize fields
out of order. In some cases when diagnosing this we are crashing because we are
not indexing correctly and therefore going out of bounds.

This fixes: https://github.com/llvm/llvm-project/issues/63605

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

14 months agoAMDGPU: Expand testing of AMDGPUCodeGenPrepare fdiv handling
Matt Arsenault [Thu, 13 Jul 2023 10:21:46 +0000 (06:21 -0400)]
AMDGPU: Expand testing of AMDGPUCodeGenPrepare fdiv handling

- Switch to generated checks
- Use a different run line per denormal mode to reduce test duplication
- Add test coverage for rsqrt cases
- Add test coverage for repeated arcp denominator
- Fix the optnone test

14 months agoFix nanosecond printing for TimePoint formatter.
Eli Friedman [Fri, 14 Jul 2023 22:41:50 +0000 (15:41 -0700)]
Fix nanosecond printing for TimePoint formatter.

There was a copy-paste of the wrong field width, so the nanoseconds
weren't correctly padded with zeros.  Found by inspection.

14 months agoclang: Attach !fpmath metadata to __builtin_sqrt based on language flags
Matt Arsenault [Mon, 3 Jul 2023 20:04:52 +0000 (16:04 -0400)]
clang: Attach !fpmath metadata to __builtin_sqrt based on language flags

OpenCL and HIP have -cl-fp32-correctly-rounded-divide-sqrt and
-fno-hip-correctly-rounded-divide-sqrt. The corresponding fpmath metadata
was only set on fdiv, and not sqrt. The backend is currently underutilizing
sqrt lowering options, and the responsibility is split between the libraries
and backend and this metadata is needed.

CUDA/NVCC has -prec-div and -prev-sqrt but clang doesn't appear to be
aiming for compatibility with those. Don't know if OpenMP has a similar
control.

14 months agoMachineSink: Remove unnecessary empty block check
Matt Arsenault [Fri, 14 Jul 2023 20:43:40 +0000 (16:43 -0400)]
MachineSink: Remove unnecessary empty block check

14 months agoMachineSink: Move helper function and use more const
Matt Arsenault [Fri, 14 Jul 2023 17:06:25 +0000 (13:06 -0400)]
MachineSink: Move helper function and use more const

14 months ago[clang][JumpDiagnostics] bring VerifyIndirectOrAsmJumps to C++17
Nick Desaulniers [Fri, 14 Jul 2023 22:20:05 +0000 (15:20 -0700)]
[clang][JumpDiagnostics] bring VerifyIndirectOrAsmJumps to C++17

Update the code to more modern C++ style.

Reviewed By: void, MaskRay

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

14 months ago[-Wunsafe-buffer-usage] Improving insertion of the [[clang::unsafe_buffer_usage]...
ziqingluo-90 [Fri, 14 Jul 2023 21:43:48 +0000 (14:43 -0700)]
[-Wunsafe-buffer-usage] Improving insertion of the [[clang::unsafe_buffer_usage]] attribute

For a fix-it that inserts the `[[clang::unsafe_buffer_usage]]`
attribute, it will lookup existing macros defined for the attribute
and use the (last defined such) macro directly. Fix-its will use raw
`[[clang::unsafe_buffer_usage]]` if no such macro is defined.

The implementation mimics how a similar machine for the
`[[fallthrough]]` attribute was implemented.

Reviewed by: NoQ (Artem Dergachev)

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

14 months ago[OMPT] Fix use of 'DEBUG_PREFIX' in the OMPT headers
Joseph Huber [Fri, 14 Jul 2023 17:36:00 +0000 (12:36 -0500)]
[OMPT] Fix use of 'DEBUG_PREFIX' in the OMPT headers

This is the only place that defines  this prefix in a header file and
was thus overriding and redefining other users of it. If we must use it
in a header file, at least repsect its old values.

Reviewed By: tianshilei1992

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

14 months ago[Attributor] Allow IR-attr deduction for non-IPO amendable functions
Johannes Doerfert [Mon, 10 Jul 2023 23:43:27 +0000 (16:43 -0700)]
[Attributor] Allow IR-attr deduction for non-IPO amendable functions

If the function is non-IPO amendable we do skip most attributes/AAs.
However, if an AA has a isImpliedByIR that can deduce the attribute from
other attributes, we can run those. For now, we manually enable them,
if we have more later we can use some automation/flag.

14 months ago[Attributor][NFC] Update all tests with the script
Johannes Doerfert [Fri, 14 Jul 2023 20:28:09 +0000 (13:28 -0700)]
[Attributor][NFC] Update all tests with the script

Three tests needed manual adjustment after
https://reviews.llvm.org/D148216 got reverted. See
https://github.com/llvm/llvm-project/issues/63746.

14 months agoRevert "[UTC] Add fallback support for specific metadata, and check their defs"
Johannes Doerfert [Fri, 14 Jul 2023 19:22:43 +0000 (12:22 -0700)]
Revert "[UTC] Add fallback support for specific metadata, and check their defs"

This reverts commit 8a3fdf7b908978625e9a7e57fbb443e4e6f98976 as it is
broken. See https://github.com/llvm/llvm-project/issues/63746.

Effectively fixes: https://github.com/llvm/llvm-project/issues/63746

14 months agoRevert "[UTC] Fix git URL regex"
Johannes Doerfert [Fri, 14 Jul 2023 19:22:20 +0000 (12:22 -0700)]
Revert "[UTC] Fix git URL regex"

This reverts commit 6d64faf3b1d96f4dba8c2c46b8b65f1cc978e82b, as it is
built on top of https://reviews.llvm.org/D148216 which is broken.

See also https://github.com/llvm/llvm-project/issues/63746

14 months agoRevert "[UTC] Generalize version regex"
Johannes Doerfert [Fri, 14 Jul 2023 19:21:55 +0000 (12:21 -0700)]
Revert "[UTC] Generalize version regex"

This reverts commit 4488ee259064532dda24024a7e96037fe9a3c0d9, as it is
built on top of https://reviews.llvm.org/D148216 which is broken.

See also https://github.com/llvm/llvm-project/issues/63746

14 months agoRevert "[UTC] Adapt version matcher to glob CLANG_VENDOR"
Johannes Doerfert [Fri, 14 Jul 2023 19:20:57 +0000 (12:20 -0700)]
Revert "[UTC] Adapt version matcher to glob CLANG_VENDOR"

This reverts commit 68f5d1be3d8f9b2ee2f25098203b24a32057b4e6 as it is
built on top of https://reviews.llvm.org/D148216 which is broken.

See also https://github.com/llvm/llvm-project/issues/63746

14 months agoORC: drop a FIXME that was addressed in dc078e6eaacf. NFC
Jon Roelofs [Fri, 14 Jul 2023 20:48:37 +0000 (13:48 -0700)]
ORC: drop a FIXME that was addressed in dc078e6eaacf. NFC

14 months agoTargetParser: fix getProcessTriple in universal builds
Jon Roelofs [Fri, 14 Jul 2023 20:23:00 +0000 (13:23 -0700)]
TargetParser: fix getProcessTriple in universal builds

The bug happens when you build e.g. an x64_64;arm64 JIT with
LLVM_HOST_TRIPLE=x86_64-apple-macos, and then run it on an apple-m1 not under
Rosetta. In that case, sys::getProcessTriple() will return an x86_64 triple,
not an arm64 one.

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

14 months agoRevert "[clang][Interp][NFC] Trim Source.h includes"
Sterling Augustine [Fri, 14 Jul 2023 20:34:26 +0000 (13:34 -0700)]
Revert "[clang][Interp][NFC] Trim Source.h includes"

This reverts commit 245d10b7a2c12ec25e7b5860a38c61991543a739 which causes
errors like the ones below on slightly older versions of clang:

```
In file included from .../clang/lib/AST/Interp/Source.h:17:
In file included from .../llvm/include/llvm/ADT/PointerUnion.h:19:
In file included from .../llvm/include/llvm/ADT/PointerIntPair.h:18:
.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:61:28: error: invalid application of 'alignof' to an incomplete type 'clang::Decl'
   61 |       detail::ConstantLog2<alignof(T)>::value;
      |                            ^~~~~~~~~~
.../llvm/include/llvm/Support/PointerLikeTypeTraits.h:101:56: note: in instantiation of static data member 'llvm::PointerLikeTypeTraits<clang::Decl *>::NumLowBitsAvailable' requested here
  101 |   static constexpr int NumLowBitsAvailable = NonConst::NumLowBitsAvailable;
      |                                                        ^
.../llvm/include/llvm/ADT/PointerUnion.h:38:54: note: in instantiation of static data member 'llvm::PointerLikeTypeTraits<const clang::Decl *>::NumLowBitsAvailable' requested here
   38 |     return std::min<int>({PointerLikeTypeTraits<Ts>::NumLowBitsAvailable...});
      |                                                      ^
.../llvm/include/llvm/ADT/PointerUnion.h:52:48: note: in instantiation of function template specialization 'llvm::pointer_union_detail::lowBitsAvailable<const clang::Decl *, const clang::Stmt *>' requested here
   52 |     static constexpr int NumLowBitsAvailable = lowBitsAvailable<PTs...>();
      |                                                ^
.../llvm/include/llvm/ADT/PointerIntPair.h:169:28: note: in instantiation of static data member 'llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>::NumLowBitsAvailable' requested here
  169 |   static_assert(PtrTraits::NumLowBitsAvailable <
      |                            ^
.../llvm/include/llvm/ADT/PointerIntPair.h:111:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<void *, 1, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>' requested here
  111 |     Value = Info::updateInt(Info::updatePointer(0, PtrVal),
      |             ^
.../llvm/include/llvm/ADT/PointerIntPair.h:89:5: note: in instantiation of member function 'llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>::setPointerAndInt' requested here
   89 |     setPointerAndInt(PtrVal, IntVal);
      |     ^
.../llvm/include/llvm/ADT/PointerUnion.h:77:16: note: in instantiation of member function 'llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>::PointerIntPair' requested here
   77 |         : Base(ValTy(const_cast<void *>(
      |                ^
.../clang/lib/AST/Interp/Source.h:76:31: note: in instantiation of member function 'llvm::pointer_union_detail::PointerUnionMembers<llvm::PointerUnion<const clang::Decl *, const clang::Stmt *>, llvm::PointerIntPair<void *, 1, int, llvm::pointer_union_detail::PointerUnionUIntTraits<const clang::Decl *, const clang::Stmt *>>, 1, const clang::Stmt *>::PointerUnionMembers' requested here
   76 |   SourceInfo(const Stmt *E) : Source(E) {}
      |                               ^
.../clang/lib/AST/Interp/Source.h:22:7: note: forward declaration of 'clang::Decl'
   22 | class Decl;
      |       ^
```

14 months ago[LV] Address post-commit NFC comments in interleave
Anna Thomas [Fri, 14 Jul 2023 20:24:04 +0000 (16:24 -0400)]
[LV] Address post-commit NFC comments in interleave

Addressed most of post-commit comments in D154309.

14 months agoPrecommit follow-up testcase for interleaved miscompile
Anna Thomas [Fri, 14 Jul 2023 20:03:08 +0000 (16:03 -0400)]
Precommit follow-up testcase for interleaved miscompile

Follow-up testcase for PR63602.

Suggested by Ayal in D154309, more complete fix coming up which should
handle this testcase as well.