platform/upstream/llvm.git
16 months ago[RDF] Do not return register masks in PhysicalRegisterInfo::getAliasSet
Krzysztof Parzyszek [Fri, 2 Jun 2023 23:39:14 +0000 (16:39 -0700)]
[RDF] Do not return register masks in PhysicalRegisterInfo::getAliasSet

16 months ago[RDF] Print regmask index in more user-friendly way
Krzysztof Parzyszek [Fri, 2 Jun 2023 23:24:35 +0000 (16:24 -0700)]
[RDF] Print regmask index in more user-friendly way

16 months ago[SLP][X86] Add test coverage for Issue #62969
Simon Pilgrim [Tue, 13 Jun 2023 15:12:20 +0000 (16:12 +0100)]
[SLP][X86] Add test coverage for Issue #62969

16 months ago[CostModel][X86] Add test coverage for vXi64 multiplies of sign/zero-extended vector
Simon Pilgrim [Tue, 13 Jun 2023 14:16:35 +0000 (15:16 +0100)]
[CostModel][X86] Add test coverage for vXi64 multiplies of sign/zero-extended vector

Part of test coverage for Issue #62969

16 months ago[HIP] Fix HIP path detection
Yaxun (Sam) Liu [Mon, 12 Jun 2023 17:45:19 +0000 (13:45 -0400)]
[HIP] Fix HIP path detection

Fix two issues:

--hip-path should not do rigorous checking, i.e. if .hipVersion exists it
will use it, otherwise it will not error out but assumes the default
HIP version. This is to be consistent with --rocm-path behavior.

when HIP_PATH is empty, it should be ignored. This is to be consistent
with ROCM_PATH behavior.

Reviewed by: Artem Belevich

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

Fixes: SWDEV-404771

16 months ago[libc++] Add [[nodiscard]] extensions to the functions in <bit>
Nikolas Klauser [Tue, 13 Jun 2023 14:57:26 +0000 (07:57 -0700)]
[libc++] Add [[nodiscard]] extensions to the functions in <bit>

Reviewed By: #libc, ldionne, Mordante

Spies: Mordante, ldionne, libcxx-commits

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

16 months ago[gn build] Port cd916108b4c6
LLVM GN Syncbot [Tue, 13 Jun 2023 14:55:33 +0000 (14:55 +0000)]
[gn build] Port cd916108b4c6

16 months ago[libc++][PSTL] Implement std::generate{,_n}
Nikolas Klauser [Fri, 9 Jun 2023 20:45:34 +0000 (13:45 -0700)]
[libc++][PSTL] Implement std::generate{,_n}

Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

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

16 months ago[RISCV][NFC] Improve encoding/decoding tests for Zbb instructions
Venkata Ramanaiah Nalamothu [Tue, 13 Jun 2023 14:36:08 +0000 (20:06 +0530)]
[RISCV][NFC] Improve encoding/decoding tests for Zbb instructions

Currently `llvm/test/MC/RISCV/rv64zbb-valid.s` doesn't cover all
the instructions e.g. `maxu` and `llvm/test/MC/RISCV/rv32zbb-valid.s`
can have rv64 run lines, similar to what Zba instruction tests have.

This patch does the following.
- Add rv64 run lines in `llvm/test/MC/RISCV/rv32zbb-valid.s`
- Keep only rv64 specific instructions in `llvm/test/MC/RISCV/rv64zbb-valid.s`
- Move rv32 instructions, with different encodings from rv64, into
  `llvm/test/MC/RISCV/rv32zbb-only-valid.s`

Reviewed By: asb

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

16 months ago[Support] Remove TaskQueue
Raphael Isemann [Tue, 13 Jun 2023 12:27:20 +0000 (08:27 -0400)]
[Support] Remove TaskQueue

TaskQueue was added several years ago as part of D48240.

There are currently no uses of this class anywhere in LLVM and I don't see
any patch that plans to use this class, so it doesn't seem useful to keep
compiling and testing this class at the moment.

The code itself is fine, so if we actually end up having a use for this code,
then I think it's perfectly fine to just re-commit this class then.

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

16 months ago[lldb][test] Re-XFAIL prefer-debug-over-eh-frame.test
Michael Buch [Tue, 13 Jun 2023 12:33:06 +0000 (13:33 +0100)]
[lldb][test] Re-XFAIL prefer-debug-over-eh-frame.test

This was un-XFAILed in `83cb2123be487302070562c45e6eb4955b22c2b4`
due to D144999. Since then D152540 fixed emission of eh_frame's
on Darwin, causing this test to fail again.

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

16 months ago[libc] Add Int<> type and fix (U)Int<128> compatibility issues.
Tue Ly [Thu, 8 Jun 2023 17:25:15 +0000 (13:25 -0400)]
[libc] Add Int<> type and fix (U)Int<128> compatibility issues.

Add Int<> and Int128 types to replace the usage of __int128_t in math
functions.  Clean up to make sure that (U)Int128 and __(u)int128_t are
interchangeable in the code base.

Reviewed By: sivachandra, mikhail.ramalho

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

16 months ago[AArch64] Try to combine MULL with uzp1.
Jingu Kang [Wed, 31 May 2023 09:12:37 +0000 (10:12 +0100)]
[AArch64] Try to combine MULL with uzp1.

For example,

 smull(trunc(x), extract_high(y))
 ==>
 smull(extract_high(uzp1(undef,x)), extract_high(y))

 -> It will be matched to smull2

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

16 months ago[clangd] Unify printing policy for type hints
Younan Zhang [Fri, 9 Jun 2023 10:51:47 +0000 (18:51 +0800)]
[clangd] Unify printing policy for type hints

(This patch addresses the comment from https://reviews.llvm.org/D151785#4402460.)

Previously, we used a special printing policy that enabled `PrintCanonicalTypes`
to print type hints for structure bindings. This was intended to
eliminate type aliases like `tuple_element::type`. However, this also
caused TypePrinter to print default template arguments, which could
result in losing the ability to see types like `std::basic_string<char>`
if the fully expanded template-id exceeded the default inlay hint threshold.

Simply getting the canonical type at the call site could help us get rid of
the side effect.

This also merges overloaded `addTypeHint` into one function without
`PrintingPolicy`.

Reviewed By: nridge

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

16 months ago[LoopVectorize][X86] Regenerate slm-no-vectorize.ll
Simon Pilgrim [Tue, 13 Jun 2023 13:12:13 +0000 (14:12 +0100)]
[LoopVectorize][X86] Regenerate slm-no-vectorize.ll

16 months ago[RDF] Add RegisterRef::idx and make toUnitId constexpr
Krzysztof Parzyszek [Fri, 2 Jun 2023 23:17:39 +0000 (16:17 -0700)]
[RDF] Add RegisterRef::idx and make toUnitId constexpr

16 months ago[MISched][scheduleDump] Use stable_sort to prevent test failures.
Francesco Petrogalli [Tue, 13 Jun 2023 12:04:05 +0000 (14:04 +0200)]
[MISched][scheduleDump] Use stable_sort to prevent test failures.

When building the compiler with -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON,
sometimes resources that are dumped in scheduled traces gets reordered
even if they are booked in the same cycle. Using `stable_sort`
guarantees that such occasional reordering does not happen.

This change should fix failures like the one seen in
https://lab.llvm.org/buildbot/#/builders/16/builds/49592.

Reviewed By: RKSimon

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

16 months agoUse SelectionDAGBuiler::getRoot instead of SelectionDAG::getRoot
Serge Pavlov [Tue, 13 Jun 2023 10:50:03 +0000 (17:50 +0700)]
Use SelectionDAGBuiler::getRoot instead of SelectionDAG::getRoot

16 months ago[compiler-rt] Disable interceptor trampoline for SPARC
Marco Elver [Tue, 13 Jun 2023 11:46:19 +0000 (13:46 +0200)]
[compiler-rt] Disable interceptor trampoline for SPARC

SPARC jmp requires a delay slot after, and without it will likely result
in a crash. For now, just disable interceptor trampolines on SPARC,
because the specific usecase for them (3 interceptors) does not exist on
SPARC (yet). We can revisit, and carefully implement the support for
SPARC when required.

Reported-by: ro
16 months agoReapply D146987 "[Assignment Tracking] Enable by default"
OCHyams [Tue, 13 Jun 2023 11:42:36 +0000 (12:42 +0100)]
Reapply D146987 "[Assignment Tracking] Enable by default"

See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the -Xclang -fexperimental-assignment-tracking flag to the value
enabled which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

This reverts commit 9e7f14a8211c82dca64bd6b22d1c450d4c6d3e5b which reverts
https://reviews.llvm.org/D146987

16 months ago[Tooling/Inclusion] Add missing PRI family macros.
Haojian Wu [Tue, 13 Jun 2023 09:22:16 +0000 (11:22 +0200)]
[Tooling/Inclusion] Add missing PRI family macros.

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

16 months ago[NFC][BlockFrequency] Move operator definitions into header
Dhruv Chawla [Sun, 11 Jun 2023 08:01:39 +0000 (13:31 +0530)]
[NFC][BlockFrequency] Move operator definitions into header

While BlockFrequency::operator+= is a very simple operation, it's
definition is present in another TU which means that it doesn't get
inlined in non-LTO builds. This means that there is some performance
left on the table in those builds, as this operator is called many
times.

This patch moves that operator (and a few others) into the
BlockFrequency.h header which gives a small speedup (~0.1%):
https://llvm-compile-time-tracker.com/compare.php?from=6ee594be53e7efaa12086ad20f0d0268092a4c73&to=6ac6cd99e211fae5ae5de41ad608604aa22f1882&stat=instructions%3Au

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

16 months ago[NFC] Combine several DW_AT_const_value tests
OCHyams [Tue, 13 Jun 2023 10:07:37 +0000 (11:07 +0100)]
[NFC] Combine several DW_AT_const_value tests

Split from D151795. I'm not sure it's conclusive, but these are all the related
tests I could find easily.

Reviewed By: MaskRay

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

16 months ago[clangd] Desugar template parameter aliases in type hints
Younan Zhang [Wed, 31 May 2023 06:49:32 +0000 (14:49 +0800)]
[clangd] Desugar template parameter aliases in type hints

This patch alleviates https://github.com/clangd/clangd/issues/1298.

Containers in C++ such as `std::vector` or `llvm::SmallVector`,
introduce a series of type aliases to adapt to generic algorithms.

Currently, If we write an declarator involving expressions with
these containers and `auto` placeholder, we probably obtain opaque
type alias like following:

```
std::vector<int> v = {1, 2, 3};
auto value = v[1]; // hint for `value`: value_type
auto *ptr = &v[0]; // hint for `ptr`: value_type *
```

These hints are useless for most of the time. It would be nice if we
desugar the type of `value_type` and print `int`, `int *` respectively
in this situation. But note we can't always prefer desugared type
since user might introduce type-aliases for brevity, where printing
sugared types makes more sense.

This patch introduces a heuristic method that displays the desugared
type that is an alias of template parameter. It merges
analogous method `shouldPrintCanonicalType` into `maybeDesugar` as well.

Previous commit for shouldPrintCanonicalType: dde8a0fe91cc

Reviewed By: nridge

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

16 months ago[X86] X86FixupVectorConstantsPass - attempt to replace full width fp vector constant...
Simon Pilgrim [Tue, 13 Jun 2023 10:55:41 +0000 (11:55 +0100)]
[X86] X86FixupVectorConstantsPass - attempt to replace full width fp vector constant loads with broadcasts on AVX+ targets (REAPPLIED)

lowerBuildVectorAsBroadcast will not broadcast splat constants in all cases, resulting in a lot of situations where a full width vector load that has failed to fold but is loading splat constant values could use a broadcast load instruction just as cheaply, and save constant pool space.

NOTE: SSE3 targets can use MOVDDUP but not all SSE era CPUs can perform this as cheaply as a vector load, we will need to add scheduler model checks if we want to pursue this.

This is an updated commit of 98061013e01207444cfd3980cde17b5e75764fbe after being reverted at a279a09ab9524d1d74ef29b34618102d4b202e2f

16 months agoRevert "[Driver] Mark m_x86_Features_Group options as TargetSpecific"
Hans Wennborg [Tue, 13 Jun 2023 10:50:51 +0000 (12:50 +0200)]
Revert "[Driver] Mark m_x86_Features_Group options as TargetSpecific"

This broke cross-builds of llvm from x86_64 to arm64 mac, see
comment on
https://github.com/llvm/llvm-project/commit/1d6c3e29f6aa45914faa7be00a939b8f550f38e9

> so that they get an error on non-x86 targets.
> Follow-up to D151590.
>
> As a workaround for https://github.com/llvm/llvm-project/issues/63270, we don't
> report an error for -msse4.2.

This reverts commit 1d6c3e29f6aa45914faa7be00a939b8f550f38e9.

16 months agoRemove unused functions in X86LegalizerInfo.cpp (NFC)
Jie Fu [Tue, 13 Jun 2023 10:33:49 +0000 (18:33 +0800)]
Remove unused functions in X86LegalizerInfo.cpp (NFC)

/home/jiefu/llvm-project/llvm/lib/Target/X86/X86LegalizerInfo.cpp:48:1: error: unused function 'widen_1' [-Werror,-Wunused-function]
widen_1(const LegacyLegalizerInfo::SizeAndActionsVec &v) {
^
1 error generated.

16 months ago[AArch64][SVE] Extra patterns for predicated and/or/xor
David Green [Tue, 13 Jun 2023 10:21:18 +0000 (11:21 +0100)]
[AArch64][SVE] Extra patterns for predicated and/or/xor

Similar to the other patterns, this adds predicated and/xor/xor patterns.

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

16 months ago[llvm] Fix include guards
Elliot Goodrich [Tue, 13 Jun 2023 09:00:41 +0000 (10:00 +0100)]
[llvm] Fix include guards

Add missing include guards to LLVM header files that did not previously
have them and update existing include guards to ensure that they enclose
all non-whitespace, non-comment text to enable these headers for the
multiple-include optimization.

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

16 months agoMachineConstantPool::getConstantPoolIndex - don't reuse mismatched constants containe...
Simon Pilgrim [Tue, 13 Jun 2023 09:15:02 +0000 (10:15 +0100)]
MachineConstantPool::getConstantPoolIndex - don't reuse mismatched constants contained undef/poison (Issue #63108)

This patch fixes an issue where we were reusing constant pool entries that contained undef elements, despite the additional uses of the 'equivalent constant' requiring some/all of the elements to be zero.

The CanShareConstantPoolEntry helper function uses ConstantFoldCastOperand to bitcast the type mismatching constants to integer representations to allow comparison, but unfortunately this treats undef elements as zero (which they will be written out as in the final asm). This caused an issue where the original constant pool entry contained undef elements, which was shared with a later constant that required the elements to be zero. This then caused a later analysis pass to incorrectly discard these undef elements.

Ideally we need a more thorough analysis/merging of the constant pool entries so the elements are forced to real zero elements, but for now we just prevent reuse of the constant pool entry entirely if the constants don't have matching undef/poison elements.

Fixes #63108

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

16 months ago[GlobalIsel][X86] Update legalization of G_PHI/G_BRCOND
Simon Pilgrim [Tue, 13 Jun 2023 08:57:23 +0000 (09:57 +0100)]
[GlobalIsel][X86] Update legalization of G_PHI/G_BRCOND

Replace the legacy legalizer versions - still WIP but matches existing features, plus handles legal vector types.

16 months ago[GlobalIsel][X86] Regenerate legalize-phi.mir
Simon Pilgrim [Mon, 12 Jun 2023 19:05:20 +0000 (20:05 +0100)]
[GlobalIsel][X86] Regenerate legalize-phi.mir

16 months ago[CMake] Enable building with UBSAN + clang-cl on windows.
Pierre Gousseau [Tue, 13 Jun 2023 09:14:40 +0000 (10:14 +0100)]
[CMake] Enable building with UBSAN + clang-cl on windows.

Currently both ASAN and UBSAN are supported on Windows but only ASAN is enabled in LLVM build system. This patch enables the option to build LLVM with UBSAN on windows.

Tested with clang-cl released in LLVM16.

Submitting on behalf of @dwang.

Reviewed by: andrewng, pgousseau

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

16 months ago[DAGCombine] Make sure combined nodes are added back to the worklist in topological...
Amaury Séchet [Wed, 7 Jun 2023 11:24:38 +0000 (11:24 +0000)]
[DAGCombine] Make sure combined nodes are added back to the worklist in topological order.

Currently, a node and its users are added back to the worklist in reverse topological order after it is combined. This diff changes that order to be topological. This is part of a larger migration to get the DAGCombiner to process nodes in topological order.

Reviewed By: RKSimon

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

16 months ago[test][SLPVectorizer] Precommit testcase showing debug info affects codegen
Mikael Holmen [Mon, 12 Jun 2023 12:06:35 +0000 (14:06 +0200)]
[test][SLPVectorizer] Precommit testcase showing debug info affects codegen

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

16 months ago[C++20] Claim full support for consteval again
Mariya Podchishchaeva [Tue, 13 Jun 2023 07:50:10 +0000 (03:50 -0400)]
[C++20] Claim full support for consteval again

After resolving several outstanding issues now is the time to mark it as
fully supported.

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

Reviewed By: aaron.ballman, cor3ntin, #clang-language-wg

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

16 months ago[VPlan] Replace versioned stride with constant during VPlan opts.
Florian Hahn [Tue, 13 Jun 2023 07:26:55 +0000 (08:26 +0100)]
[VPlan] Replace versioned stride with constant during VPlan opts.

After constructing the initial VPlan, replace VPValues for versioned
strides with their constant counterparts.

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

16 months ago[MLIR][Doc] Also print `summary`s for passes on a newline
rikhuijzer [Tue, 13 Jun 2023 07:05:28 +0000 (09:05 +0200)]
[MLIR][Doc] Also print `summary`s for passes on a newline

This patch is improves upon https://reviews.llvm.org/D152621. There, I pointed out some issues with D152621, which I'll repeat here.

> Passes use a different logic for generating the documentation; which I didn't update to be in-line with this change.

Fixed by defining and using `mlir::tblgen::emitSummary`. This is now used in `OpDocGen.cpp` and `PassDocGen.cpp`.

Note that the passes documentation currently prints the summary behind the pass argument. For example:

```
#### -arm-neon-2d-to-intr: Convert Arm NEON structured ops to intrinsics
```
at https://mlir.llvm.org/docs/Passes/#-promote-buffers-to-stack-promotes-heap-based-allocations-to-automatically-managed-stack-based-allocations.

This currently differs from how the summary is printed for Ops. For example:

```
#### amdgpu.lds_barrier (::mlir::amdgpu::LDSBarrierOp) ¶

**Summary:** _Barrier that includes a wait for LDS memory operations._
```

at https://mlir.llvm.org/docs/Dialects/AMDGPU/#amdgpulds_barrier-mliramdgpuldsbarrierop.

The changes in this patch ensure that:

1. The summary is always printed on a new line.
2. The summary is always printed in italic.
3. The summary always starts with a capital letter.

I've dropped the `**Summary:**`, which was introduced in D152621, because only italicization should be already clear enough.

> `amx.tdpbssd` shows **Summary:** __ meaning that apparently hasSummary does not guarantee a non-empty summary.

This is fixed by double-checking `!summary.empty()`, because the following code

```cpp
void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) {
  if (!summary.empty()) {
    char first = std::toupper(summary.front());
    llvm::StringRef rest = summary.drop_front();
    os << "\n_" << first << rest << "_\n\n";
  } else {
    os << "\n_" << "foo" << "_\n\n";
  }
}
```
generates the following Markdown:
```
### `amx.tdpbssd` (::mlir::amx::x86_amx_tdpbssd)

_foo_
```
in `tools/mlir/docs/Dialects/AMX.md`.

> Summary fields containing * cancel the italicization, so the * should probably be escaped to solve this. EDIT: Nope. This is because mlir-www runs Hugo 0.80 whereas 0.111 correctly parses _Raw Buffer Floating-point Atomic Add (MI-* only)_ as an italicized string.

This will be fixed by https://github.com/llvm/mlir-www/pull/152.

Reviewed By: jpienaar

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

16 months ago[Sema] Remove unused member variable MSVCGuidDecl
Kazu Hirata [Tue, 13 Jun 2023 07:24:49 +0000 (00:24 -0700)]
[Sema] Remove unused member variable MSVCGuidDecl

The last use was removed by:

  commit bab6df86aefc5ea4aa3895da7cf46be37add676d
  Author: Richard Smith <richard@metafoo.co.uk>
  Date:   Sat Apr 11 22:15:29 2020 -0700

16 months ago[StaticAnalyzer] Remove unused function hasGlobalsOrParametersStorage
Kazu Hirata [Tue, 13 Jun 2023 07:24:47 +0000 (00:24 -0700)]
[StaticAnalyzer] Remove unused function hasGlobalsOrParametersStorage

The last use was removed by:

  commit e2e37b9afc0a0a66a1594377a88221e115d95348
  Author: Ted Kremenek <kremenek@apple.com>
  Date:   Thu Jul 28 23:08:02 2011 +0000

16 months ago[Driver] Remove unused declaration addTranslatorArgs
Kazu Hirata [Tue, 13 Jun 2023 07:24:46 +0000 (00:24 -0700)]
[Driver] Remove unused declaration addTranslatorArgs

The declaration was added without a use by:

  commit 49682f14bf3fb8db5e2721d9896b27bb4c2bd635
  Author: Henry Linjamäki <henry.linjamaki@parmance.com>
  Date:   Wed Nov 17 11:23:49 2021 +0300

16 months ago[StaticAnalyzer] Remove several unused declarations
Kazu Hirata [Tue, 13 Jun 2023 07:24:44 +0000 (00:24 -0700)]
[StaticAnalyzer] Remove several unused declarations

The function definition of GenerateAutoTransition was removed by:

  commit b1d3d968725baf28a00b12aad760434036cbe704
  Author: Anna Zaks <ganna@apple.com>
  Date:   Thu Oct 27 00:59:23 2011 +0000

The function definitions of enqueueEndOfPath and GenerateCallExitNode
were removed by:

  commit 0ec04bf73885df3e10bd7fcd5c8ce901cad7d76c
  Author: Anna Zaks <ganna@apple.com>
  Date:   Thu Oct 27 00:59:28 2011 +0000

16 months ago[clang] Use DenseMapBase::lookup (NFC)
Kazu Hirata [Tue, 13 Jun 2023 07:24:43 +0000 (00:24 -0700)]
[clang] Use DenseMapBase::lookup (NFC)

16 months ago[ADT] Remove deprecated functions in APInt
Kazu Hirata [Tue, 13 Jun 2023 07:24:41 +0000 (00:24 -0700)]
[ADT] Remove deprecated functions in APInt

This patch removes functions deprecated by:

  commit 462b29019b20cf7b25c68ec952b1f92930f5035d
  Author: Kazu Hirata <kazu@google.com>
  Date:   Sun Mar 5 22:48:28 2023 -0800

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

16 months ago[Sema] Remove unused isNonTypeNestedNameSpecifier
Kazu Hirata [Tue, 13 Jun 2023 07:24:40 +0000 (00:24 -0700)]
[Sema] Remove unused isNonTypeNestedNameSpecifier

The last use was removed by:

  commit 04f131da0b19abff611773c03be9bafb53c753ce
  Author: Richard Smith <richard@metafoo.co.uk>
  Date:   Fri Jan 24 15:14:25 2020 -0800

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

16 months ago[ExecutionEngine] Remove unused functions
Kazu Hirata [Tue, 13 Jun 2023 07:24:38 +0000 (00:24 -0700)]
[ExecutionEngine] Remove unused functions

This patch removes:

  cloneModuleFlagsMetadata
  moveFunctionBody
  moveGlobalVariableInitializer

Their last uses were removed by:

  commit 6154c4115cd4b78d0171892aac21e340e72e32bd
  Author: Lang Hames <lhames@gmail.com>
  Date:   Mon Sep 7 21:21:28 2020 -0700

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

16 months agoRevert "[scudo] Fix MallocIterateBoundary on 32 bit."
Christopher Ferris [Tue, 13 Jun 2023 06:55:26 +0000 (23:55 -0700)]
Revert "[scudo] Fix MallocIterateBoundary on 32 bit."

This reverts commit 5e691a1c9b0ad22689d4a434ddf4fed940e58dec.

Reviewed By: cferris

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

16 months agoRevert "[FunctionAttrs] Propagate some func/arg/ret attributes from caller to callsit...
Noah Goldstein [Tue, 13 Jun 2023 05:53:31 +0000 (00:53 -0500)]
Revert "[FunctionAttrs] Propagate some func/arg/ret attributes from caller to callsite (WIP)"

Accidental commit/push!

This reverts commit 4fa971ff62c3c48c606b792c572c03bd4d5906ee.

16 months agoRevert "100 checks"
Noah Goldstein [Tue, 13 Jun 2023 05:53:19 +0000 (00:53 -0500)]
Revert "100 checks"

Accidental commit/push!

This reverts commit b76bd2db65b4890f1ec494fa95286533dd6b09e5.

16 months ago100 checks
Noah Goldstein [Tue, 13 Jun 2023 05:51:37 +0000 (00:51 -0500)]
100 checks

16 months ago[FunctionAttrs] Propagate some func/arg/ret attributes from caller to callsite (WIP)
Noah Goldstein [Tue, 13 Jun 2023 05:43:22 +0000 (00:43 -0500)]
[FunctionAttrs] Propagate some func/arg/ret attributes from caller to callsite (WIP)

This is the consolidation of D151644 and D151943 moved from
InstCombine to FunctionAttrs. This is based on discussion in the above
patches as well as D152081 (Attributor). This patch was written in a
way so it can have an immediate impact in currently active passes
(FunctionAttrs), but should be easy to port elsewhere (Attributor or
Inliner) if that makes more sense later on.

Some function attributes imply the attribute for all/some instructions
in the function. These attributes can be safely propagated to
callsites within the function that are missing the attribute. This can
be useful when 1) analyzing individual instructions in a function
and 2) if the original caller is later inlined, as if the attributes are
not propagated, they will be lost.

This patch implements propagation in a new class/file
`InferCallsiteAttrs` which can hypothetically be included elsewhere.

At the moment this patch infers the following:

Function Attributes:
    - mustprogress
    - nofree
    - willreturn
    - All memory attributes (readnone, readonly, writeonly, argmem,
      etc...)
        - The memory attributes are only propagated IFF the set of
          pointers available to the callsite is the same as the set
          available outside the caller (i.e no local memory arguments
          from alloca or local malloc like functions).

Argument Attributes:
    - noundef
    - nonnull
    - nofree
    - readnone
    - readonly
    - writeonly
    - nocapture
        - nocapture is only propagated IFF the set of pointers
          available to the callsite is the same as the set available
          outside the caller and its guranteed that between the
          callsite and function return, the state of any capture
          pointers will not change (so the nocaptured gurantee of the
          caller has been met by the instruction preceding the
          callsite and will not changed).

Argument are only propagated to callsite arguments that are also function
arguments, but not derived values.

Return Attributes:
    - noundef
    - nonnull

Return attributes are only propagated if the callsite's return value
is used as the caller's return and execution is guranteed to pass from
callsite to return.

The compile time hit of this for -O3 and -O3+thinLTO is ~[.02, .37]%
regression. Proper LTO, however, has more significant regressions (up
to 3.92%):
https://llvm-compile-time-tracker.com/compare.php?from=94407e1bba9807193afde61c56b6125c0fc0b1d1&to=79feb6e78b818e33ec69abdc58c5f713d691554f&stat=instructions:u

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

16 months ago[scudo] Fix MallocIterateBoundary on 32 bit.
Christopher Ferris [Tue, 13 Jun 2023 01:59:01 +0000 (18:59 -0700)]
[scudo] Fix MallocIterateBoundary on 32 bit.

On Android, the 32 bit value of 8 for BlockDelta results in a
failure because a valid pointer can never be found.

Change the code to always use 16 which passes on both 32 bit
and 64 bit.

Verified that re-introducing the old bug causes the test to fail
on both 32 bit and 64 with the new BlockDelta value.

Reviewed By: Chia-hungDuan

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

16 months ago[libc++][spaceship] P1612R2: Removed `operator!=` from `locale`
Hristo Hristov [Sun, 11 Jun 2023 19:17:19 +0000 (22:17 +0300)]
[libc++][spaceship] P1612R2: Removed `operator!=` from `locale`

Implemented parts of P1612R2:
- Removed `operator!=` from `locale`

Reviewed By: #libc, Mordante

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

16 months ago[libc++][spaceship][NFC] P1612R2: Mark some items "remove `operator!=` from `*_iterat...
Hristo Hristov [Sun, 11 Jun 2023 19:45:16 +0000 (22:45 +0300)]
[libc++][spaceship][NFC] P1612R2: Mark some items "remove `operator!=` from `*_iterator`" as "Complete"

Several parts of P1612R2 are already implemented:
- `common_iterator` (new in C++20) https://reviews.llvm.org/D103335
- `unreachable_sentinel_t` (new in C++20) https://reviews.llvm.org/D107920
- `istream_iterator` (removed) https://reviews.llvm.org/D119620
- `istreambuf_iterator` (removed) https://reviews.llvm.org/D119620

Reviewed By: #libc, Mordante

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

16 months ago[mlir][docgen] Enable custom prefix strip for op name.
Jacques Pienaar [Wed, 7 Jun 2023 22:42:03 +0000 (15:42 -0700)]
[mlir][docgen] Enable custom prefix strip for op name.

The fully qualified name gets long in the TOC (especially on mobile),
enable specifying a prefix to be stripped.

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

16 months ago[libc++] Android temp dir is /data/local/tmp, enable Windows test
Ryan Prichard [Tue, 13 Jun 2023 03:43:00 +0000 (20:43 -0700)]
[libc++] Android temp dir is /data/local/tmp, enable Windows test

[libc++] Android temp dir is /data/local/tmp, enable Windows test

On Android, std::filesystem::temp_directory_path() should fall back to
/data/local/tmp when no environment variable is set. There is no /tmp
directory. Most apps can't access /data/local/tmp, but they do have a
"cache dir" (Context#getCacheDir()) that is usable for temporary files.
However, there is no obvious and reliable way for libc++ to query this
directory in contexts where it is available. The global fallback
/data/local/tmp is available for "adb shell", making it useful for test
suites.

On Windows, temp_directory_path falls back to the Windows directory
(e.g. "C:\Windows"), so call GetWindowsDirectoryW to do the test.

Reviewed By: ldionne, #libc, enh

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

16 months ago[mlir][sparse][GPU] add 2:4 integration test
Kun Wu [Tue, 13 Jun 2023 02:10:16 +0000 (02:10 +0000)]
[mlir][sparse][GPU] add 2:4 integration test

Reviewed By: aartbik

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

16 months agoAMDGPU: Correct constants used in fast math log expansion
Matt Arsenault [Mon, 12 Jun 2023 20:25:51 +0000 (16:25 -0400)]
AMDGPU: Correct constants used in fast math log expansion

The division between float constants was done with less
precision. Performing the divide in double and truncating to float
provides the same value as used in the library fast math expansion.

16 months agoAMDGPU: Modernize log codegen tests
Matt Arsenault [Sat, 10 Jun 2023 20:39:32 +0000 (16:39 -0400)]
AMDGPU: Modernize log codegen tests

16 months agoAMDGPU: Add basic folds for llvm.amdgcn.log
Matt Arsenault [Sun, 11 Jun 2023 00:03:16 +0000 (20:03 -0400)]
AMDGPU: Add basic folds for llvm.amdgcn.log

16 months agoAMDGPU: Add baseline instcombine test for llvm.amdgcn.log
Matt Arsenault [Sun, 11 Jun 2023 16:35:28 +0000 (12:35 -0400)]
AMDGPU: Add baseline instcombine test for llvm.amdgcn.log

16 months agoAMDGPU: Add llvm.amdgcn.log intrinsic
Matt Arsenault [Sun, 11 Jun 2023 16:25:30 +0000 (12:25 -0400)]
AMDGPU: Add llvm.amdgcn.log intrinsic

This will map directly to the hardware instruction which does not
handle denormals for f32. This will allow moving the generic intrinsic
to be lowered correctly. Also handles selecting the f16 version, but
there's no reason to use it over the generic intrinsic.

16 months agoLowerMemIntrinsics: Handle inserting addrspacecast for memmove lowering
Matt Arsenault [Sat, 10 Jun 2023 16:20:43 +0000 (12:20 -0400)]
LowerMemIntrinsics: Handle inserting addrspacecast for memmove lowering

We're missing a trivial non-AA way to check for non-aliasing address
spaces.

16 months ago[Driver] Default -fsanitize-address-globals-dead-stripping to true for ELF
Fangrui Song [Tue, 13 Jun 2023 00:58:40 +0000 (17:58 -0700)]
[Driver] Default -fsanitize-address-globals-dead-stripping to true for ELF

-fsanitize-address-globals-dead-stripping is the default for non-ELF
platforms. For ELF, we disabled it to work around an ancient gold 2.26
bug. However, some platforms (Fuchsia and PS) default the option to
true.

This patch changes -fsanitize-address-globals-dead-stripping to true for all ELF
platforms. Without specifying -fdata-sections (non-default for most ELF
platforms), `asan_globals` can only be GCed if the monolithic .data/.bss section
is GCed, which makes it less effective.
However, I think this simplified rule is better than making the
-fsanitize-address-globals-dead-stripping default dependent on another option.

Related: D120394
Close https://github.com/llvm/llvm-project/issues/63127

Reviewed By: #sanitizers, eugenis, phosek

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

16 months ago[scudo] Check support for pvalloc/valloc tests.
Christopher Ferris [Mon, 12 Jun 2023 23:21:24 +0000 (16:21 -0700)]
[scudo] Check support for pvalloc/valloc tests.

Some platforms do not support pvalloc/valloc so add checks so
that these tests are only run on the appropriate platforms.

Reviewed By: Chia-hungDuan

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

16 months ago[RDF] Define short type names: NodeAddr<XyzNode*> -> Xyz, NFC
Krzysztof Parzyszek [Fri, 2 Jun 2023 16:07:49 +0000 (09:07 -0700)]
[RDF] Define short type names: NodeAddr<XyzNode*> -> Xyz, NFC

Remove all instances of 'using namespace rdf' from files in CodeGen,
all implementation code is explicitly enclosed in 'namespace rdf'.

16 months ago[tsan] Check for nullptr on user_alloc_usable_size_fast
Jin Xin Ng [Mon, 12 Jun 2023 22:33:34 +0000 (22:33 +0000)]
[tsan] Check for nullptr on user_alloc_usable_size_fast

MBlock could be null (in the context of a call from RunFreeHooks)
if a static object was runtime initialized before tsan finished
initializing and that object later did a free().

While having the check isn't strictly required by
__sanitizer_get_allocated_size_fast's contract, a user's static object
would expect ptrs returned from malloc to be valid inputs.

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

16 months ago[BOLT] Fix --max-funcs=<N> option
Maksim Panchenko [Mon, 12 Jun 2023 20:16:09 +0000 (13:16 -0700)]
[BOLT] Fix --max-funcs=<N> option

Fix off-by-one error while handling of the --max-funcs=<N> option.
We used to process N+1 functions when N was requested.

Reviewed By: Amir

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

16 months ago[mlir][sparse][gpu] guard matvec COO AoS
Aart Bik [Mon, 12 Jun 2023 18:43:27 +0000 (11:43 -0700)]
[mlir][sparse][gpu] guard matvec COO AoS

Reviewed By: K-Wu

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

16 months ago[mlir][sparse][gpu]fix various cusparseLt bugs
Kun Wu [Mon, 12 Jun 2023 23:24:08 +0000 (23:24 +0000)]
[mlir][sparse][gpu]fix various cusparseLt bugs

Reviewed By: aartbik

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

16 months ago[libc++][PSTL] Update papers and add a status page for the algorithms
Nikolas Klauser [Fri, 9 Jun 2023 19:34:07 +0000 (12:34 -0700)]
[libc++][PSTL] Update papers and add a status page for the algorithms

Reviewed By: #libc, ldionne

Spies: libcxx-commits, mgrang, arphaman

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

16 months ago[lldb] Change return type of UnixSignals::GetShortName
Alex Langford [Fri, 9 Jun 2023 20:47:32 +0000 (13:47 -0700)]
[lldb] Change return type of UnixSignals::GetShortName

The short names of each signal name and alias only exist as ConstStrings
in this one scenario. For example, GetShortName("SIGHUP") will just give
you "HUP". There's not a good reason the string "HUP" needs to be in the
ConstString StringPool, and that's true for just about every signal
name.

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

16 months ago[Driver] Remove misused NoXarchOption from some Windows options
Fangrui Song [Mon, 12 Jun 2023 22:50:29 +0000 (15:50 -0700)]
[Driver] Remove misused NoXarchOption from some Windows options

If an option has the `NoXarchOption` flag, ClangDriver will emit an error if the
option is used after `-Xarch_*` (originally for universal macOS binary, reused
by `-Xarch_host`/etc). The error checking only applies to a small set of options
(e.g. `-o`) and is not very useful for most options, but `NoXarchOption` was
traditionally named `DriverOption` (commit
aabb0b11a3c1d8a6bb859db80400cffdcc9b336f) and lured some contributors to add
`NoXarchOption` to options that should not have the flag.

16 months ago[Fuchsia] Pass CursesAndPanel_ROOT through to stage2
Daniel Thornburgh [Mon, 12 Jun 2023 22:43:27 +0000 (15:43 -0700)]
[Fuchsia] Pass CursesAndPanel_ROOT through to stage2

16 months ago [RISC-V] Zvk update to 0.9.7, Zvknc/Zvksc
Eric Gouriou [Mon, 12 Jun 2023 22:31:18 +0000 (15:31 -0700)]
 [RISC-V] Zvk update to 0.9.7, Zvknc/Zvksc

Update the RISC-V Zvk (vector cryptography) extension support from 0.5
to version 0.9.7 (2023-05-31), per
    <https://github.com/riscv/riscv-crypto/releases/download/v20230531/riscv-crypto-spec-vector.pdf>

Differences:
     - Zvbc is dropped from Zvkn and Zvks, and by extension
       from Zvkng and Zvksg;
     - new combo extensions Zvknc and Zvksc are introduced,
      adding Zvbc to Zvkn and Zvks;
     - the experimentatl extensions are tagged as "0.9",
       from the earlier "0.5".

Reviewed By: 4vtomat

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

16 months ago[NFC][sanitizer] Move ArrayRef into own header
Vitaly Buka [Mon, 12 Jun 2023 22:35:24 +0000 (15:35 -0700)]
[NFC][sanitizer] Move ArrayRef into own header

16 months ago[NFC][sanitizer] Rename sanitizer_common_range -> sanitizer_range
Vitaly Buka [Mon, 12 Jun 2023 22:32:47 +0000 (15:32 -0700)]
[NFC][sanitizer] Rename sanitizer_common_range -> sanitizer_range

16 months ago[RISCV] Prevent overflowing the small size of InstSeq in generateInstSeq.
Craig Topper [Mon, 12 Jun 2023 22:29:03 +0000 (15:29 -0700)]
[RISCV] Prevent overflowing the small size of InstSeq in generateInstSeq.

The small size is 8 which is the worst case of the core recursive
algorithm.

The special cases use the core algorithm and append additonal
instructions. We were pushing the extra instructions before checking
the profitability. This could lead to 9 and maybe 10 instructions
in the sequence which overflows the small size.

This patch does the profitability check before inserting the
extra instructions so that we don't create 9 or 10 insruction
sequences.

Alternative we could bump the small size to 9 or 10, but then
we're pushing things that are never going be used.

Reviewed By: asb

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

16 months ago[NFC][sanitizer] Move ArrayRef into own header
Vitaly Buka [Mon, 12 Jun 2023 22:23:30 +0000 (15:23 -0700)]
[NFC][sanitizer] Move ArrayRef into own header

16 months ago[AMDGPU] Remove integer division in VOPD checks
Stanislav Mekhanoshin [Sat, 10 Jun 2023 08:10:16 +0000 (01:10 -0700)]
[AMDGPU] Remove integer division in VOPD checks

There is no way any compiler can simplify this division, while
the check is done rather often.

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

16 months ago[lldb] Remove lldb's DWARFAbbreviationDeclarationSet in favor of llvm's
Alex Langford [Wed, 24 May 2023 21:08:33 +0000 (14:08 -0700)]
[lldb] Remove lldb's DWARFAbbreviationDeclarationSet in favor of llvm's

lldb's and llvm's implementations of DWARFAbbreviationDeclarationSet are
now close enough (almost the same, actually) to replace lldb's with
llvm's wholesale. llvm's is also tested against the same kinds of
scenarios that lldb's is tested against so we can remove lldb's tests
here. (see: llvm/unittests/DebugInfo/DWARF/DWARFDebugAbbrevTest.cpp).

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

16 months agoSpeculative fix for windows test
Adrian Prantl [Mon, 12 Jun 2023 21:51:10 +0000 (14:51 -0700)]
Speculative fix for windows test

16 months ago[mlir][sparse][gpu] fixed whitespace in tbgen
Aart Bik [Mon, 12 Jun 2023 18:50:48 +0000 (11:50 -0700)]
[mlir][sparse][gpu] fixed whitespace in tbgen

Reviewed By: K-Wu

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

16 months agoCodeGen: hand two tests to the care of update_cc_test_checks
Augie Fackler [Wed, 5 Apr 2023 22:03:14 +0000 (18:03 -0400)]
CodeGen: hand two tests to the care of update_cc_test_checks

These two tests were pretty challenging to manage by hand, and in
rebasing the next change in my stack I finally ran out of patience and
decided to just embrace automation. This change _only_ changes the tests
so that it's obvious what's new in the next change.

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

16 months ago[Sanitizer] Add munmap interceptor in sanitizer_common
Kirill Stoimenov [Sat, 10 Jun 2023 00:07:53 +0000 (00:07 +0000)]
[Sanitizer] Add munmap interceptor in sanitizer_common

Reviewed By: vitalybuka

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

16 months ago[NFC][SLP] Fix a few minor formatting issues
Ivan Kelarev [Mon, 12 Jun 2023 21:21:43 +0000 (14:21 -0700)]
[NFC][SLP] Fix a few minor formatting issues

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

16 months ago[sanitizer][test] Remove no-op REQUIRES:
Fangrui Song [Mon, 12 Jun 2023 21:15:03 +0000 (14:15 -0700)]
[sanitizer][test] Remove no-op REQUIRES:

Some patches around D109843 added `REQUIRES: freebsd` but they have no effects
due to sanitizer_common/TestCases/Linux/lit.local.cfg.py . I informed the author
but don't plan to move the tests.

16 months ago[RDF] Allow RegisterRef to contain register unit
Krzysztof Parzyszek [Thu, 1 Jun 2023 19:00:47 +0000 (12:00 -0700)]
[RDF] Allow RegisterRef to contain register unit

Recommit with the fix for incorrect `constexpr` with `hash` from a later
commit, and a fix for "std::swap(std::less<RegisterRef>...)" issue with
MSVC's `std::map`.

16 months ago[bazel] Repair clang_headers_gen when run on macOS.
James Knight [Mon, 12 Jun 2023 20:05:35 +0000 (16:05 -0400)]
[bazel] Repair clang_headers_gen when run on macOS.

The antique version of bash (3.2.57, from 2007) which is available on
macOS cannot deal with quoted slashes in a `${x/...}`
substitution. Since only prefix-removal is required here, switch to a
`${x#...}` substitution instead.

(E.g. `src="foo/bar/baz.h"; echo ${src/"foo/bar"}` echos `bar/bar/baz.h`
instead of `/baz.h` on old bash versions).

Originally broken by 459420c33a2c80525bc73ad1ff89fdf4dd079d6c.
Fixes #63222

16 months ago[RISCV] Use TU vmv.v.v instead of vslideup.vi N,M,0 for insert vector_shuffles
Luke Lau [Mon, 12 Jun 2023 16:12:28 +0000 (16:12 +0000)]
[RISCV] Use TU vmv.v.v instead of vslideup.vi N,M,0 for insert vector_shuffles

This applies the same technique in https://reviews.llvm.org/D152565 to
vslideups when lowering vector_shuffles that have an insert pattern in
their mask.

Reviewed By: reames

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

16 months ago[libc] Fix floating point test failing to build on the GPU
Joseph Huber [Mon, 12 Jun 2023 19:17:56 +0000 (14:17 -0500)]
[libc] Fix floating point test failing to build on the GPU

A patch enabled this test which uses that `add_fp_unittest`.
Unfortunately we do not support these on the GPU because it attempts to
link in the floating point utils which are not built supporting
hermetic tests. This was attempted to be fixed in D151123 but that had
to be reverted. For now disable these so the tests pass.

Reviewed By: tra

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

16 months ago[docs] Improve UndefinedBehaviorSanitizer.rst
Fangrui Song [Mon, 12 Jun 2023 20:04:29 +0000 (13:04 -0700)]
[docs] Improve UndefinedBehaviorSanitizer.rst

* Mention that -fsanitize= and -fno-sanitize= apply to check groups.
* Mention "all" can be used as a check group.
* Mention that -fsanitize-trap= and -fsanitize-recover= lead to no unused command line option warning.
* Mention that trap mode typically causes the program to terminate due to a `SIGILL` or `SIGTRAP` signal.

Reviewed By: #sanitizers, vitalybuka

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

16 months ago[Driver] Mark m_x86_Features_Group options as TargetSpecific
Fangrui Song [Mon, 12 Jun 2023 19:47:33 +0000 (12:47 -0700)]
[Driver] Mark m_x86_Features_Group options as TargetSpecific

so that they get an error on non-x86 targets.
Follow-up to D151590.

As a workaround for https://github.com/llvm/llvm-project/issues/63270, we don't
report an error for -msse4.2.

16 months ago[KCFI] Fix hash offset calculation in Thumb mode
Sami Tolvanen [Mon, 12 Jun 2023 16:24:54 +0000 (16:24 +0000)]
[KCFI] Fix hash offset calculation in Thumb mode

ARM stores the Thumb state in the least significant bit of the
function pointers. When compiling for ARM or Thumb, as all
instructions are at least 16-bit aligned, ignore the LSB when
computing the prefix hash location, so we can support both
pure Thumb and mixed ARM/Thumb binaries.

Fixes #62936

Reviewed By: MaskRay, simon_tatham

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

16 months ago[libc++][NFC] Refactor filesystem namespace test
Louis Dionne [Mon, 12 Jun 2023 19:43:04 +0000 (12:43 -0700)]
[libc++][NFC] Refactor filesystem namespace test

16 months ago[Driver] Mark many target-specific driver-only options as TargetSpecific
Fangrui Song [Mon, 12 Jun 2023 19:34:08 +0000 (12:34 -0700)]
[Driver] Mark many target-specific driver-only options as TargetSpecific

so that they get an error on other targets. This change uses let statements to
apply `Flags = [TargetSpecific]` to options (mostly -m*) without specifying `Flags`.
Follow-up to D151590.

For some options, e.g. -mdefault-build-attributes (D31813), -mbranch-likely
(D38168), -mfpu=/-mabi= (6890b9b71e525020ab58d436336664beede71575), a warning
seems desired in at least certain cases. This is not the best practice, but this
change works around them by not applying `Flags = [TargetSpecific]`.

Some m_x86_Features_Group options are popular. We make them TargetSpecific in a
future patch.

(
For Intel CPU errata -malign-branch= family options, we also drop the unneeded
NotXarchOption flag (was confuslingly named DriverOption). This flag reports an
error if the option is used with -Xarch_*. This error reporting does not seem
correct/useful.
)

16 months ago[libc++][spaceship] P1614R2: Removed `operator!=` from `weekday`s
Hristo Hristov [Mon, 12 Jun 2023 11:29:12 +0000 (14:29 +0300)]
[libc++][spaceship] P1614R2: Removed `operator!=` from `weekday`s

Implements parts of P1614R2. Removed `operator!=` from:
- `weekday`
- `weekday_indexed`
- `weekday_last`
- `month_weekday`
- `month_weekday_last`
- `year_month_weekday`
- `year_month_weekday_last`

Note these operators were added and removed in C++20.

Reviewed By: #libc, Mordante

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

16 months ago[RISCV] Fix an unused variable warning
Kazu Hirata [Mon, 12 Jun 2023 19:21:05 +0000 (12:21 -0700)]
[RISCV] Fix an unused variable warning

This patch fixes:

  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:3214:12: error: unused
  variable 'TSFlags' [-Werror,-Wunused-variable]

16 months ago[RISCV] Remove HasDummyMask from tablegen files.
Craig Topper [Mon, 12 Jun 2023 18:57:44 +0000 (11:57 -0700)]
[RISCV] Remove HasDummyMask from tablegen files.

This isn't needed after D152050.

Reviewed By: reames

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

16 months ago[RISCV] Begin removing hasDummyMask.
Craig Topper [Mon, 12 Jun 2023 18:57:40 +0000 (11:57 -0700)]
[RISCV] Begin removing hasDummyMask.

This was used to know if we need to insert a dummy operand during
MCInstLowering. We can use the operand info from MCInstrDesc to
figure this out without needing a separate flag.

I'll remove the tablegen bits if there is consensus this is a good
idea.

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