platform/upstream/llvm.git
13 months ago[clang][Diagnostics] Use llvm::raw_ostream::indent()
Timm Bäder [Mon, 22 May 2023 11:06:56 +0000 (13:06 +0200)]
[clang][Diagnostics] Use llvm::raw_ostream::indent()

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

13 months ago[clang][Diagnostics] Simplify emitSnippet()
Timm Bäder [Mon, 22 May 2023 11:06:25 +0000 (13:06 +0200)]
[clang][Diagnostics] Simplify emitSnippet()

Don't try to minimize the times we invoke operator<< on the output
stream by keeping a ToPrint string around. Instead, just print the
characters as we iterate over them.

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

13 months ago[mlir][Transforms] GreedyPatternRewriteDriver: Worklist randomizer
Matthias Springer [Wed, 31 May 2023 07:26:48 +0000 (09:26 +0200)]
[mlir][Transforms] GreedyPatternRewriteDriver: Worklist randomizer

Instead of always taking the last op from the worklist, take a random one. For testing/debugging purposes only. This feature can be used to ensure that lowering pipelines work correctly regardless of the order in which ops are processed by the GreedyPatternRewriteDriver.

The randomizer can be enabled by setting a numeric `MLIR_GREEDY_REWRITE_RANDOMIZER_SEED` option.

Note: When enabled, 27 tests are currently failing. Partly because FileCheck tests are looking for exact IR.

Discussion: https://discourse.llvm.org/t/discussion-fuzzing-pattern-application/67911

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

13 months ago[libc++][spaceship] Additional tests for `operator<=>` `map` and `multimap`
Hristo Hristov [Tue, 23 May 2023 12:06:41 +0000 (15:06 +0300)]
[libc++][spaceship] Additional tests for `operator<=>` `map` and `multimap`

- Added additional tests
- Improved existing tests
- Moved misplaced test files to the correct location

Reviewed By: #libc, philnik

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

13 months ago[clang][NFC] Refactor emitSnippet()
Timm Bäder [Wed, 17 May 2023 18:23:06 +0000 (20:23 +0200)]
[clang][NFC] Refactor emitSnippet()

Rename parameters and local variables and reorder things a bit to be
closer to their first point of use.

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

13 months ago[RISCV] Add special case for (select cc, 1.0, 0.0) to lowerSELECT
LiaoChunyu [Wed, 31 May 2023 07:04:39 +0000 (15:04 +0800)]
[RISCV] Add special case for (select cc, 1.0, 0.0) to lowerSELECT

Use sint_to_fp instead of select.
Reduce the number of branch instructions and
avoid generating TargetConstantPool for double.

(select cc, 1.0, 0.0) -> (sint_to_fp (zext cc))
https://alive2.llvm.org/ce/z/aoEcd9
https://godbolt.org/z/n543Y9v3e

(select cc, 0.0, 1.0) -> (sint_to_fp (zext (xor cc, 1)))
https://alive2.llvm.org/ce/z/zngvSB

Reviewed By: craig.topper

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

13 months ago[clang] Add test for CWG873
Vlad Serebrennikov [Wed, 31 May 2023 07:16:51 +0000 (10:16 +0300)]
[clang] Add test for CWG873

Also add missing marking to the test of related issue 621.

https://cplusplus.github.io/CWG/issues/621.html
https://cplusplus.github.io/CWG/issues/873.html

Reviewed By: #clang-language-wg, shafik

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

13 months ago[clang] Fix 39f4bd214f1be248283fb7e35bc2610c19169252 on win builders
Timm Bäder [Wed, 31 May 2023 07:13:19 +0000 (09:13 +0200)]
[clang] Fix 39f4bd214f1be248283fb7e35bc2610c19169252 on win builders

13 months ago[clang][Interp][NFC] Make InterpFrame::describe() more const-correct
Timm Bäder [Wed, 31 May 2023 06:56:19 +0000 (08:56 +0200)]
[clang][Interp][NFC] Make InterpFrame::describe() more const-correct

13 months ago[clang][Interp][NFC] Simplify dump() indentation
Timm Bäder [Wed, 31 May 2023 06:50:38 +0000 (08:50 +0200)]
[clang][Interp][NFC] Simplify dump() indentation

Use llvm::raw_ostream::indent().

13 months ago[mlir][llvm] Add alias and access group info to call.
Tobias Gysi [Wed, 31 May 2023 06:48:49 +0000 (06:48 +0000)]
[mlir][llvm] Add alias and access group info to call.

The revision adds the alias analysis and access group
interfaces to the call operation.

Reviewed By: Dinistro

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

13 months ago[RISCV] Add Zvfhmin extension for clang.
Jianjian GUAN [Thu, 25 May 2023 06:24:22 +0000 (14:24 +0800)]
[RISCV] Add Zvfhmin extension for clang.

This patch adds the Zvfhmin extension for clang.

Reviewed By: craig.topper, michaelmaitland

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

13 months ago[VLIWMachineScheduler] Disable default copy ctor and copy assignment operator for...
Bing1 Yu [Wed, 31 May 2023 06:13:48 +0000 (14:13 +0800)]
[VLIWMachineScheduler] Disable default copy ctor and copy assignment operator for VLIWSchedBoundary

class VLIWSchedBoundary manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one.

Reviewed By: JamesNagurne

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

13 months ago[NFC][HWASAN] make variables names for callback functions more consistent
Enna1 [Wed, 31 May 2023 06:03:53 +0000 (14:03 +0800)]
[NFC][HWASAN] make variables names for callback functions more consistent

This patch makes the variables names for callback functions more consistent. Changes no functionality.

Reviewed By: vitalybuka

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

13 months ago[libc++][CI] Escape quoting.
Mark de Wever [Wed, 31 May 2023 05:55:05 +0000 (07:55 +0200)]
[libc++][CI] Escape quoting.

This should fix the Clang CI.

13 months ago[RISCV] Merge emitDirectiveOptionArchPlus and emitDirectiveOptionArchMinus into a...
Craig Topper [Wed, 31 May 2023 05:45:42 +0000 (22:45 -0700)]
[RISCV] Merge emitDirectiveOptionArchPlus and emitDirectiveOptionArchMinus into a single interface. NFC

Probably going to do some other refactors after this, but this one
was easy and clearly reduces duplicate code.

Reviewed By: StephenFan

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

13 months ago[NFC][sanitizer] Change ArrayRef constructor
Vitaly Buka [Wed, 31 May 2023 05:40:45 +0000 (22:40 -0700)]
[NFC][sanitizer] Change ArrayRef constructor

13 months ago[mlir] Add the missing non-member operator decl in the same namesapce. NFC
Michael Liao [Wed, 31 May 2023 05:30:56 +0000 (01:30 -0400)]
[mlir] Add the missing non-member operator decl in the same namesapce. NFC

13 months ago[clang] Show line numbers in diagnostic code snippets
Timm Bäder [Wed, 17 May 2023 12:04:30 +0000 (14:04 +0200)]
[clang] Show line numbers in diagnostic code snippets

Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.

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

13 months ago[clang] Add test for -ftabstop diagnostics
Jan Svoboda [Wed, 31 May 2023 04:58:00 +0000 (21:58 -0700)]
[clang] Add test for -ftabstop diagnostics

I forgot to request a regression test in review of D151429, so adding one myself.

13 months agoRevert "Fix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the...
Shubham Sandeep Rastogi [Wed, 31 May 2023 04:46:10 +0000 (21:46 -0700)]
Revert "Fix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the original line table was empty"

This reverts commit 9bd3ff8bf9e05e7bf95a4a068aa3b50813a93975.

Reverting because of test failures:

TEST 'LLVM :: tools/dsymutil/ARM/fat-dylib-update.test' FAILED

Command Output (stderr):
--
+ : 'RUN: at line 2'
+ /b/ml-opt-rel-x86-64-b1/build/bin/dsymutil -oso-prepend-path /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/tools/dsymutil/ARM/.. /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/tools/dsymutil/ARM/../Inputs/fat-test.arm.dylib -o /b/ml-opt-rel-x86-64-b1/build/test/tools/dsymutil/ARM/Output/fat-dylib-update.test.tmp.dSYM
warning: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/tools/dsymutil/ARM/../Inputs/fat-test.arm.o: timestamp mismatch between object file (2023-05-24 23:42:39.442778779) and debug map (2015-08-05 21:31:26.000000000)
warning: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/tools/dsymutil/ARM/../Inputs/fat-test.arm.o: timestamp mismatch between object file (2023-05-24 23:42:39.442778779) and debug map (2015-08-05 21:31:26.000000000)
error: lipo: No such file or directory

13 months agoprint user provide value in tabstop diagnostic
csmoe [Wed, 31 May 2023 04:43:11 +0000 (21:43 -0700)]
print user provide value in tabstop diagnostic

github issue: https://github.com/llvm/llvm-project/issues/62912

Reviewed By: jansvoboda11

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

13 months ago[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile
Jan Svoboda [Wed, 31 May 2023 04:24:51 +0000 (21:24 -0700)]
[clang][lex] NFCI: Use DirectoryEntryRef in HeaderSearch::LookupFile

This patch changes the argument type to `HeaderSearch::LookupFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove some calls to the deprecated `DirectoryEntry::getName()`.

Depends on D127660.

Reviewed By: bnbarham, benlangmuir

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

13 months agoFix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the original...
Shubham Sandeep Rastogi [Fri, 26 May 2023 19:05:09 +0000 (12:05 -0700)]
Fix -u option in dsymutil, to not emit an extra DW_LNE_set_address if the original line table was empty

With dsymutil's -u option, only the accelerator tables should be
updated, but with https://reviews.llvm.org/D150554 the -u option will
still re-generate the line table. If the line table was empty, that is,
it was a dummy line table, with no entries in it, dsymutil will always
generate a line table with a DW_LNE_end_sequence, a funky side effect of
this is that when the line table is re-generated, it will always emit a
DW_LNE_set_address first, which will change the line table total size.
This patch addresses this by making sure that if all the line table has
in it is a DW_LNE_end_sequence, it is the same as a dummy entry.

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

13 months ago[RISCV] Strengthen some SDTypeProfiles to reduce isel table size.
Craig Topper [Wed, 31 May 2023 04:27:36 +0000 (21:27 -0700)]
[RISCV] Strengthen some SDTypeProfiles to reduce isel table size.

13 months ago[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`
Jan Svoboda [Wed, 31 May 2023 04:06:50 +0000 (21:06 -0700)]
[clang][modules] NFCI: Extract optionality out of `Module::{Header,DirectoryName}`

Most users of `Module::Header` already assume its `Entry` is populated. Enforce this assumption in the type system and handle the only case where this is not the case by wrapping the whole struct in `std::optional`. Do the same for `Module::DirectoryName`.

Depends on D151584.

Reviewed By: benlangmuir

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

13 months ago[clang][Sema] Improve diagnostics for auto return type
Yaxun (Sam) Liu [Tue, 9 May 2023 18:05:55 +0000 (14:05 -0400)]
[clang][Sema] Improve diagnostics for auto return type

Currently when clang fails to deduce auto return type of a function,
it does not emit any notes about why it fails. This causes difficulty
for users to fix such errors.

Actually, clang already generates the information for emitting notes
about the failed deduction. There is a TODO for actually emitting
them.

This patch tries to implement the TODO. Basically it passes the
failed template specialization candidate set from the point of
specialization failure back to the point where the deduction starts.

It is not comprehensive but would be a start for further improvement.

Reviewed by: Richard Smith, Matheus Izvekov

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

Fixes: SWDEV-354278

13 months ago[MC] Disable default copy ctor and copy assignment operator for CodeViewContext
Bing1 Yu [Wed, 31 May 2023 02:34:55 +0000 (10:34 +0800)]
[MC] Disable default copy ctor and copy assignment operator for CodeViewContext

class CodeViewContext manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one.

Reviewed By: skan

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

13 months ago[MachineScheduler] Disable default copy ctor and copy assignment operator for SchedBo...
Bing1 Yu [Wed, 31 May 2023 02:33:52 +0000 (10:33 +0800)]
[MachineScheduler] Disable default copy ctor and copy assignment operator for SchedBoundary

class SchedBoundary manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one.

Reviewed By: pengfei

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

13 months ago[MachO] Add comments to explain the semantics of chained fixups structures.
Davide Italiano [Wed, 31 May 2023 02:24:24 +0000 (19:24 -0700)]
[MachO] Add comments to explain the semantics of chained fixups structures.

13 months ago[NFC][sanitizer] Extend ArrayRef
Vitaly Buka [Wed, 31 May 2023 02:19:04 +0000 (19:19 -0700)]
[NFC][sanitizer] Extend ArrayRef

13 months ago[NFC][OpenMP] Remove unused variable `new_iv_saved` in `openmp/runtime/src/kmp_collap...
Shilei Tian [Wed, 31 May 2023 02:16:29 +0000 (22:16 -0400)]
[NFC][OpenMP] Remove unused variable `new_iv_saved` in `openmp/runtime/src/kmp_collapse.cpp`

13 months agoRevert "[NFC][ASAN] Remove redundant fields of AsanThread"
Vitaly Buka [Wed, 31 May 2023 02:16:29 +0000 (19:16 -0700)]
Revert "[NFC][ASAN] Remove redundant fields of AsanThread"

Breaks Windows.

This reverts commit 8ac084728daf5b666624621562afb6d63cc01ae3.

13 months ago[MachO] Add the relocation types for auth pointers (chained fixups).
Davide Italiano [Wed, 31 May 2023 02:15:41 +0000 (19:15 -0700)]
[MachO] Add the relocation types for auth pointers (chained fixups).

13 months ago[NFC][CLANG] Fix nullptr dereference issue in DeduceTemplateArgumentsByTypeMatch()
Manna, Soumi [Wed, 31 May 2023 01:58:44 +0000 (18:58 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in DeduceTemplateArgumentsByTypeMatch()

DeduceTemplateArgumentsByTypeMatch() returns null value which is dereferenced without checking since getAsIncompleteArrayType() returns nullptr and we are dereferencing null pointer value for S.Context->getAsIncompleteArrayType(P) when calling getElementType().

This patch adds an assert.

Reviewed By: erichkeane

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

13 months ago[RISCV] Fix selection for some unmasked vp SDNode.
Jianjian GUAN [Tue, 30 May 2023 04:31:36 +0000 (12:31 +0800)]
[RISCV] Fix selection for some unmasked vp SDNode.

Make unmasked vp_ftrunc, vp_fceil, vp_floor and vp_fround select to unmasked instruction.

Reviewed By: frasercrmck

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

13 months ago[NFC][CLANG] Fix nullptr dereference issue in Type::getRVVEltType()
Manna, Soumi [Wed, 31 May 2023 01:46:40 +0000 (18:46 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in Type::getRVVEltType()

This patch uses castAs instead of getAs which will assert if the type
doesn't match in clang::Type::getRVVEltType(clang::ASTContext const &)

Reviewed By: erichkeane

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

13 months agoadd missing dependency for TosaToLinalg
yijia1212 [Wed, 31 May 2023 01:37:14 +0000 (01:37 +0000)]
add missing dependency for TosaToLinalg

13 months ago[NFC][ASAN] Remove redundant fields of AsanThread
Vitaly Buka [Mon, 8 May 2023 17:55:52 +0000 (10:55 -0700)]
[NFC][ASAN] Remove redundant fields of AsanThread

13 months ago[BOLT] Align BranchInfo and FuncBranchData in DataAggregator::recordTrace
Amir Ayupov [Wed, 31 May 2023 00:28:22 +0000 (17:28 -0700)]
[BOLT] Align BranchInfo and FuncBranchData in DataAggregator::recordTrace

`DataAggregator::recordTrace` serves two purposes:
  - Attaching LBR fallthrough ("trace") information to CFG (`getBranchInfo`),
    which eventually gets emitted as YAML profile.
  - Populating vector of offsets that gets added to `FuncBranchData`, which
    eventually gets emitted as fdata profile.

`recordTrace` is invoked from `getFallthroughsInTrace` which checks its return
status and passes on the collected vector of offsets to `doTrace`.

However, if a malformed trace is passed to `recordTrace` it might partially
attach the profile to CFG and exit with false, not propagating the vector of
offsets to `doTrace`. This leads to a difference between fdata and yaml profile
collected from the same binary and the same perf file.

(Skylake LBR errata might produce such malformed traces where the last entry
is duplicated, resulting in invalid fallthrough path between the last two
entries).

There are two ways to handle this mismatch: conservative (aligned with fdata),
or aggressive (aligned with yaml). Conservative approach would discard the
trace entirely, buffering the CFG updates until all fallthroughs are confirmed.
Aggressive approach would apply CFG updates and return the matching
fallthroughs in the vector even if the trace is invalid (doesn't correspond to
a valid fallthrough path). I chose to go with the former (conservative/fdata)
approach which produces more accurate profile.

We can't rely on pre-filtering such traces early (in LBR sample processing) as
DataAggregator is used for both perf samples and pre-aggregated perf information
which loses branch stack information.

Test Plan: https://github.com/rafaelauler/bolt-tests/pull/22

Reviewed By: #bolt, rafauler

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

13 months ago[libc++] Include "bits/alltypes.h" to provide mbstate_t when using musl libc
Pengxuan Zheng [Tue, 30 May 2023 17:44:15 +0000 (10:44 -0700)]
[libc++] Include "bits/alltypes.h" to provide mbstate_t when using musl libc

With D148542, we ran into the following libc++ build error when using musl libc.

```
.../musl/include/bits/alltypes.h:354:16:
error: definition of type '__mbstate_t' conflicts with typedef of the same name
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
               ^
.../sysroot/usr/include/bits/types/__mbstate_t.h:21:3: note: '__mbstate_t' declared here
} __mbstate_t;
  ^
1 error generated.
```
This is because the mbstate_t definition in musl libc conflicts with the one
from "bits/types/mbstate_t.h", and this patch attempts to fix this build issue
when musl libc is used.

Reviewed By: iana

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

13 months ago[mlir][sparse] Improving SparseTensorDimSliceAttr methods
wren romano [Tue, 30 May 2023 20:31:49 +0000 (13:31 -0700)]
[mlir][sparse] Improving SparseTensorDimSliceAttr methods

This patch makes the following changes to `SparseTensorDimSliceAttr` methods:
* Mark `isDynamic` constexpr.
* Add new helpers `getStatic` and `getStaticString` to avoid repetition.
* Moved the definitions for `getStatic{Offset,Stride,Size}` and `isCompletelyDynamic` out of the class declaration; because there's no benefit to inlining them.
* Changed `parse` to use `kDynamic` rather than literals.
* Changed `verify` to use the `isDynamic` helper.

Reviewed By: aartbik

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

13 months ago[lldb] Remove commented out code/logging in BreakpointSiteList (NFC)
Jonas Devlieghere [Tue, 30 May 2023 22:54:04 +0000 (15:54 -0700)]
[lldb] Remove commented out code/logging in BreakpointSiteList (NFC)

13 months agoFix SBValue::FindValue for file static variables
Jim Ingham [Wed, 31 May 2023 00:12:35 +0000 (17:12 -0700)]
Fix SBValue::FindValue for file static variables

This was just a thinko. The API StackFrame::GetVariableList takes a
bool for "get_file_globals" which if true will also find file statics
and file globals. But we only were passing that as true if the
ValueType was eValueTypeVariableGlobal, which meant that we never find
file statics. It's okay if we cast too wide a net when we do
GetVariableList as later on we check against the ValueType to filter
globals from statics.

There was a test that had a whole bunch of globals and tested
FindValue on all of them, but had no statics. So I just made one of
the globals a file static, which verifies the fix.

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

13 months agoFix assert "DeclRefExpr for Decl not entered in LocalDeclMap?"
Jennifer Yu [Tue, 30 May 2023 17:20:31 +0000 (10:20 -0700)]
Fix assert "DeclRefExpr for Decl not entered in LocalDeclMap?"

Currently compiler assert when passing variable "memspace" in
omp_init_allocator.

omp_allocator_handle_t alloc=omp_init_allocator(memspace,1,traits)

The problem is memspace is not mapping to the target region.  During
the call to emitAllocatorInit, calls to EmitVarDecl for "alloc", then
emit initialization of "alloc" that cause to assert.

If I understant correct, it is not necessary to emit variable
initialization, since "allocator" is private to target region.

To fix this call CGF.EmitAutoVarAlloca(allocator) instead
CGF.EmitVarDecl(allocator).

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

13 months ago[gn build] Port bf63b15bd4bf
LLVM GN Syncbot [Tue, 30 May 2023 23:31:47 +0000 (23:31 +0000)]
[gn build] Port bf63b15bd4bf

13 months ago[gn] port 48e5f704c55f (no more LLVM_HAVE_LIBXAR in ld64.lld)
Nico Weber [Tue, 30 May 2023 23:31:27 +0000 (19:31 -0400)]
[gn] port 48e5f704c55f (no more LLVM_HAVE_LIBXAR in ld64.lld)

13 months ago[ExtractAPI] clang-format DeclarationFragments::insert
Kazu Hirata [Tue, 30 May 2023 23:28:22 +0000 (16:28 -0700)]
[ExtractAPI] clang-format DeclarationFragments::insert

13 months ago[clang][ExtractAPI] Fix -Wpessimizing-move in DeclarationFragments.h (NFC)
Jie Fu [Tue, 30 May 2023 23:20:24 +0000 (07:20 +0800)]
[clang][ExtractAPI] Fix -Wpessimizing-move in DeclarationFragments.h (NFC)

/Users/jiefu/llvm-project/clang/include/clang/ExtractAPI/DeclarationFragments.h:118:26: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    Fragments.insert(It, std::move(Fragment(Spelling, Kind, PreciseIdentifier,
                         ^
/Users/jiefu/llvm-project/clang/include/clang/ExtractAPI/DeclarationFragments.h:118:26: note: remove std::move call here
    Fragments.insert(It, std::move(Fragment(Spelling, Kind, PreciseIdentifier,
                         ^~~~~~~~~~
1 error generated.

13 months ago[mlir][tosa] Implement lowering for tosa.rfft2d
Spenser Bauman [Tue, 30 May 2023 21:45:19 +0000 (14:45 -0700)]
[mlir][tosa] Implement lowering for tosa.rfft2d

Implement a lowering for tosa.rfft2d to linalg.generic in the
TosaToLinalg transform.

Reviewed By: eric-k256

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

13 months ago[llvm-debuginfod][NFC] Switch to OptTable
Andrés Villegas [Tue, 30 May 2023 23:03:37 +0000 (16:03 -0700)]
[llvm-debuginfod][NFC] Switch to OptTable

Reviewed By: mysterymath

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

13 months ago[CMake] Remove BOLT from Fuchsia toolchain
Petr Hosek [Fri, 19 May 2023 07:35:08 +0000 (07:35 +0000)]
[CMake] Remove BOLT from Fuchsia toolchain

Fuchsia toolchain is currently broken due to
https://reviews.llvm.org/D151595. While we wait for it to be resolved,
remove BOLT to unbreak the Fuchsia toolchain build.

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

13 months ago[mlir][sparse] Removing unused helper function
wren romano [Tue, 30 May 2023 20:47:22 +0000 (13:47 -0700)]
[mlir][sparse] Removing unused helper function

Depends On D151505

Reviewed By: aartbik, Peiming

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

13 months ago[mlir][sparse] Adding new STEA::{with,without}DimSlices factories
wren romano [Tue, 30 May 2023 21:16:17 +0000 (14:16 -0700)]
[mlir][sparse] Adding new STEA::{with,without}DimSlices factories

(These factories are used in downstream code, despite not being used within the MLIR codebase.)

Depends On D151513

Reviewed By: Peiming

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

13 months ago[mlir][sparse] Updating STEA parser/printer to use the name "dimSlices"
wren romano [Tue, 30 May 2023 20:53:27 +0000 (13:53 -0700)]
[mlir][sparse] Updating STEA parser/printer to use the name "dimSlices"

Depends On D151505

Reviewed By: Peiming

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

13 months ago[lldb] Prevent dwim-print from showing kNoResult error
Dave Lee [Wed, 24 May 2023 17:30:49 +0000 (10:30 -0700)]
[lldb] Prevent dwim-print from showing kNoResult error

Expression evaluation for `void` valued expressions sets an error using the `kNoResult`
code. Like the `expression` command, `dwim-print` should also not print such errors.

Before:

```
(lldb) dwim-print (void)printf("hi\n")
hi
Error: 'unknown error'
```

After:

```
(lldb) dwim-print (void)printf("hi\n")
hi
```

rdar://109746544

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

13 months agoFix a few bugs with Mach-O corefile loading, plus perf
Jason Molenda [Tue, 30 May 2023 22:13:36 +0000 (15:13 -0700)]
Fix a few bugs with Mach-O corefile loading, plus perf

In ProcessMachCore::LoadBinariesViaMetadata(), if we did
load some binaries via metadata in the core file, don't
then search for a userland dyld in the corefile / kernel
and throw away that binary list.  Also fix a little bug
with correctly recognizing corefiles using a `main bin spec`
LC_NOTE that explicitly declare that this is a userland
corefile.

LocateSymbolFileMacOSX.cpp's Symbols::DownloadObjectAndSymbolFile
clarify the comments on how the force_lookup and how the
dbgshell_command local both have the same effect.

In PlatformDarwinKernel::LoadPlatformBinaryAndSetup, don't
log a message unless we actually found a kernel fileset.

Reorganize ObjectFileMachO::LoadCoreFileImages so that it delegates
binary searching to DynamicLoader::LoadBinaryWithUUIDAndAddress and
doesn't duplicate those searches.  For searches that fail, we would
perform them multiple times in both methods.  When we have the
mach-o segment vmaddrs for a binary, don't let LoadBinaryWithUUIDAndAddress
load the binary first at its mach-o header address in the Target;
we'll load the segments at the correct addresses individually later
in this method.

DynamicLoaderDarwin::ImageInfo::PutToLog fix a LLDB_LOG logging
formatter.

In DynamicLoader::LoadBinaryWithUUIDAndAddress, instead of using
Target::GetOrCreateModule as a way to find a binary already registered
in lldb's global module cache (and implicitly add it to the Target
image list), use ModuleList::GetSharedModule() which only searches
the global module cache, don't add it to the Target.  We may not
want to add an unstripped binary to the Target.

Add a call to Symbols::DownloadObjectAndSymbolFile() even if
"force_symbol_search" isn't set -- this will turn into a
DebugSymbols call / Spotlight search on a macOS system, which
we want.

Only set the Module's LoadAddress if the caller asked us to do that.

Differential Revision: https://reviews.llvm.org/D150928
rdar://109186357

13 months ago[lldb] Consult summary provider before printing children of root references
Dave Lee [Tue, 30 May 2023 17:31:44 +0000 (10:31 -0700)]
[lldb] Consult summary provider before printing children of root references

When printing the root of a value, if it's a reference its children are unconditionally
printed - in contrast to pointers whose children are only printed if a sufficient
pointer depth is given.

However, the children are printed even when there's a summary provider that says not to.
If a summary provider exists, this change consults it to determine if children should be
printed.

For example, given a variable of type `std::string &`, this change has the following
effect:

Before:

```
(lldb) p string_ref
(std::string &) string_ref = "one two three four five six seven eight nine ten": {
  __r_ = {
    std::__1::__compressed_pair_elem<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, 0, false> = {
      __value_ = {
         = {
          __l = (__data_ = "one two three four five six seven eight nine ten", __size_ = 48, __cap_ = 64, __is_long_ = 1)
          __s = (__data_ = "@\0p\U00000001\0`\0\00\0\0\0\0\0\0\0@", __padding_ = "\x80t<", __size_ = '\0', __is_long_ = '\x01')
          __r = {
            __words ={...}
          }
        }
      }
    }
  }
}
```

After:

```
(lldb) p string_ref
(std::string &) string_ref = "one two three four five six seven eight nine ten"
```

rdar://73248786

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

13 months agoRemove llvm::Optional
Kazu Hirata [Tue, 30 May 2023 22:32:43 +0000 (15:32 -0700)]
Remove llvm::Optional

This is part of an effort to migrate from llvm::Optional to std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

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

13 months ago[clang][ExtractAPI] Modify declaration fragment methods to add a new fragment at...
ruturaj4 [Sat, 27 May 2023 23:54:56 +0000 (18:54 -0500)]
[clang][ExtractAPI] Modify declaration fragment methods to add a new fragment at an arbitrary offset.

13 months ago[clang][ExtractAPI] Modify declaration fragment methods to add a new fragment at...
ruturaj4 [Sun, 21 May 2023 17:34:56 +0000 (12:34 -0500)]
[clang][ExtractAPI] Modify declaration fragment methods to add a new fragment at an arbitrary offset.

The current implementation doesn't support merging declaration fragments at arbitrary offsets. This patch adds that support
by modifying declaration fragment methods.

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

13 months ago[BOLT] Add skip-non-simple for boltdiff
Amir Ayupov [Tue, 30 May 2023 21:47:14 +0000 (14:47 -0700)]
[BOLT] Add skip-non-simple for boltdiff

Extra filtering for boltdiff, excluding non-simple functions from comparison.

Reviewed By: #bolt, maksfb

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

13 months ago[mlir][sparse] Combining `dimOrdering`+`higherOrdering` fields into `dimToLvl`
wren romano [Tue, 30 May 2023 20:16:29 +0000 (13:16 -0700)]
[mlir][sparse] Combining `dimOrdering`+`higherOrdering` fields into `dimToLvl`

This is a major step along the way towards the new STEA design.  While a great deal of this patch is simple renaming, there are several significant changes as well.  I've done my best to ensure that this patch retains the previous behavior and error-conditions, even though those are at odds with the eventual intended semantics of the `dimToLvl` mapping.  Since the majority of the compiler does not yet support non-permutations, I've also added explicit assertions in places that previously had implicitly assumed it was dealing with permutations.

Reviewed By: aartbik

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

13 months ago[RISCV] Add some tail undisturbed vwmacc tests. NFC
Craig Topper [Tue, 30 May 2023 22:16:00 +0000 (15:16 -0700)]
[RISCV] Add some tail undisturbed vwmacc tests. NFC

These are additional tests for D151596.

13 months ago[lldb] Introduce FileSpec::GetComponents
Alex Langford [Thu, 25 May 2023 02:42:15 +0000 (19:42 -0700)]
[lldb] Introduce FileSpec::GetComponents

This patch introduces FileSpec::GetComponents, a method that splits a
FileSpec's path into its individual components. For example, given
/foo/bar/baz, you'll get back a vector of strings {"foo", "bar", baz"}.

The motivation here is to reduce the use of
`FileSpec::RemoveLastPathComponent`. Mutating a FileSpec is expensive,
so providing a way of doing this without mutation is useful.

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

13 months ago[RISCV] Allow FWMUL formation for an FP extend used twice by the same multiply.
Craig Topper [Tue, 30 May 2023 22:08:08 +0000 (15:08 -0700)]
[RISCV] Allow FWMUL formation for an FP extend used twice by the same multiply.

13 months ago[libc++][PSTL] Implement std::merge
Nikolas Klauser [Tue, 30 May 2023 16:27:10 +0000 (09:27 -0700)]
[libc++][PSTL] Implement std::merge

Reviewed By: ldionne, #libc

Spies: pcwang-thead, libcxx-commits

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

13 months ago[lld-macho] Remove linking bitcode support
Keith Smiley [Tue, 16 May 2023 18:01:13 +0000 (11:01 -0700)]
[lld-macho] Remove linking bitcode support

Apple deprecated bitcode in the deployment process in Xcode 14.0. Last
month Apple started requiring Xcode 14.1+ to submit apps to the App
Store. Since there isn't a use for bundling bitcode outside of
submitting to the App Store we should be safe to delete this handling
entirely from LLD.

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

13 months ago[LLVM Utils] Update Certifi to 2023.5.7
Yuanfang Chen [Tue, 30 May 2023 21:40:30 +0000 (14:40 -0700)]
[LLVM Utils] Update Certifi to 2023.5.7

Certifi 2022.12.07 removes root certificates from "TrustCor" from the
root store. These are in the process of being removed from Mozilla's
trust store.

https://groups.google.com/a/mozilla.org/g/dev-security-policy/c/oxX69KFvsm4/m/yLohoVqtCgAJ

13 months ago[AMDGPU][IGLP] Parameterize the SchedGroup processing / linking order in Solver
Jeffrey Byrnes [Thu, 27 Apr 2023 21:43:32 +0000 (14:43 -0700)]
[AMDGPU][IGLP] Parameterize the SchedGroup processing / linking order in Solver

Currently the PipelineSolver processes SchedGroups in bottom up manner. However, there is no compelling reason to require this. Providing the option to toggle this affords greater experimentation capability, and make usage a bit more intuitive. Importantly, it makes designing rules much easier.

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

Change-Id: Ic4abd3408f9faa105c0eef72eab7873d46083ee4

13 months ago[RISCV] Add RISCVISD::VFWMUL_VL. Use it to replace isel patterns with a DAG combine.
Craig Topper [Tue, 30 May 2023 21:38:16 +0000 (14:38 -0700)]
[RISCV] Add RISCVISD::VFWMUL_VL. Use it to replace isel patterns with a DAG combine.

This is more consistent with how we handle integer widening multiply.

A follow up patch will add support for matching vfwmul when the
multiplicand is being squared.

13 months agoLowering for 'tosa.scatter'
Rafael Ubal Tena [Tue, 30 May 2023 17:43:24 +0000 (10:43 -0700)]
Lowering for 'tosa.scatter'

This patch adds support for `tosa.scatter` lowering in the `--tosa-to-scf` pass. Here's an example for this lowering:

```
func.func @tosa(
                %valuesIn : tensor<3x7x5xi32>,
                %indices : tensor<3x6xi32>,
                %input : tensor<3x6x5xi32>) ->
                tensor<3x7x5xi32> {
        %0 = "tosa.scatter"(%valuesIn, %indices, %input) :
                        (tensor<3x7x5xi32>,
                        tensor<3x6xi32>,
                        tensor<3x6x5xi32>) ->
                        (tensor<3x7x5xi32>)
        return %0 : tensor<3x7x5xi32>
}
```

translates to
  func.func @tosa(%arg0: tensor<3x7x5xi32>, %arg1: tensor<3x6xi32>, %arg2: tensor<3x6x5xi32>) -> tensor<3x7x5xi32> {
    %c0 = arith.constant 0 : index
    %c3 = arith.constant 3 : index
    %c1 = arith.constant 1 : index
    %c6 = arith.constant 6 : index
    %c2 = arith.constant 2 : index
    %c5 = arith.constant 5 : index
    %c0_0 = arith.constant 0 : index
    %c1_1 = arith.constant 1 : index
    %0 = scf.for %arg3 = %c0_0 to %c3 step %c1_1 iter_args(%arg4 = %arg0) -> (tensor<3x7x5xi32>) {
      %1 = scf.for %arg5 = %c0_0 to %c6 step %c1_1 iter_args(%arg6 = %arg4) -> (tensor<3x7x5xi32>) {
        %extracted = tensor.extract %arg1[%arg3, %arg5] : tensor<3x6xi32>
        %2 = arith.index_cast %extracted : i32 to index
        %extracted_slice = tensor.extract_slice %arg2[%arg3, %arg5, %c0_0] [%c1_1, %c1_1, %c5] [%c1_1, %c1_1, %c1_1] : tensor<3x6x5xi32> to tensor<?x?x?xi32>
        %inserted_slice = tensor.insert_slice %extracted_slice into %arg6[%arg3, %2, %c0_0] [%c1_1, %c1_1, %c5] [%c1_1, %c1_1, %c1_1] : tensor<?x?x?xi32> into tensor<3x7x5xi32>
        scf.yield %inserted_slice : tensor<3x7x5xi32>
      }
      scf.yield %1 : tensor<3x7x5xi32>
    }
    return %0 : tensor<3x7x5xi32>
  }
```

We have attempted an alternative lowering pass that uses `tensor.scatter` as an intermediate step. However, we opted to aim straight at the `scf` dialect for the following reasons:

- The `tensor.scatter` op doesn't seem to be used anywhere. There is no available lowering pass for this op (although we have one that we'll upstream soon).
- The `tosa.scatter` and `tensor.scatter` op have different indexing semantics. The `indices` argument of `tosa.scatter` must be non-trivially modified and restructured (e.g. with a `linalg.generic` op) to adapt to the needs of `tensor.scatter`. While this overhead may be simplified and fused after a subsequent `tensor.scatter` lowering, it adds complex logic and an obscure intermediate state. Unless there is a good reason to go through the `tensor` dialect that we're missing, this additional complexity may not be justified.

Reviewed By: eric-k256

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

13 months ago[HIP] Add missing __hip_atomic_fetch_sub support
Luke Drummond [Tue, 30 May 2023 09:37:47 +0000 (10:37 +0100)]
[HIP] Add missing __hip_atomic_fetch_sub support

The rest of the fetch/op intrinsics were added in e13246a2ec3 but sub
was conspicuous by its absence.

Reviewed By: yaxunl

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

13 months ago[lldb] Fix build after Clang API change at rev 769d282d7292
Jorge Gorbe Moya [Tue, 30 May 2023 21:19:40 +0000 (14:19 -0700)]
[lldb] Fix build after Clang API change at rev 769d282d7292

13 months ago[AMDGPU][LoadStoreVectorizer] Pre-commit test for addrspace 7 crash
Krzysztof Drewniak [Tue, 30 May 2023 21:13:49 +0000 (21:13 +0000)]
[AMDGPU][LoadStoreVectorizer] Pre-commit test for addrspace 7 crash

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

13 months agoRemove HAVE_STRERROR
Fangrui Song [Tue, 30 May 2023 21:12:20 +0000 (14:12 -0700)]
Remove HAVE_STRERROR

Most systems support strerror_r. For the remaining systems (e.g. MSVC) strerror_s and
strerror can be used as fallbacks. We don't have a supported operating
system/compiler that doesn't provide `strerror`.

Close https://github.com/llvm/llvm-project/issues/62804

https://github.com/flang-compiler/f18/pull/1068 added a fallback
when strerror is unavailable, but I think the code path is dead.

Reviewed By: serge-sans-paille, vzakhari

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

13 months ago[lldb] Fix build after Clang API change
Jan Svoboda [Tue, 30 May 2023 21:08:04 +0000 (14:08 -0700)]
[lldb] Fix build after Clang API change

This fixes breakage introduced by 769d282d.

13 months ago[clang][lex] NFCI: Use DirectoryEntryRef in Preprocessor::MainFileDir
Jan Svoboda [Thu, 25 May 2023 21:47:57 +0000 (14:47 -0700)]
[clang][lex] NFCI: Use DirectoryEntryRef in Preprocessor::MainFileDir

This patch changes the type of `Preprocessor::MainFileDir` from `const DirectoryEntry *` to `Optional<DirectoryEntryRef>` in order to remove some calls to the deprecated `DirectoryEntry::getName()`.

Depends on D127658.

Reviewed By: bnbarham

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

13 months ago[clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile
Jan Svoboda [Thu, 25 May 2023 21:45:31 +0000 (14:45 -0700)]
[clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile

This patch replaces some calls to the deprecated `DirectoryEntry::getName()` with calls to `DirectoryEntryRef::getName()` in SemaCodeComplete.cpp.

Depends on D127654.

Reviewed By: bnbarham

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

13 months ago[clang] NFCI: Use DirectoryEntryRef in Module::Directory
Jan Svoboda [Thu, 25 May 2023 21:37:20 +0000 (14:37 -0700)]
[clang] NFCI: Use DirectoryEntryRef in Module::Directory

This patch changes the type of `Module::Directory` from `const DirectoryEntry *` to (essentially) `Optional<DirectoryEntryRef>` in order to remove uses of the deprecated `DirectoryEntry::getName()`.

Depends on D127651.

Reviewed By: bnbarham

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

13 months ago[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::parseModuleMapFile()
Jan Svoboda [Thu, 25 May 2023 21:13:15 +0000 (14:13 -0700)]
[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::parseModuleMapFile()

This patch changes the argument type of `ModuleMap::parseModuleMapFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove the deprecated uses of `DirectoryEntry::getName()`.

Depends on D127648.

Reviewed By: bnbarham

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

13 months ago[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()
Jan Svoboda [Thu, 25 May 2023 21:02:32 +0000 (14:02 -0700)]
[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()

This patch changes the argument type of `ModuleMap::inferFrameworkModule()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove the deprecated uses of `DirectoryEntry::getName()`.

Depends on D127647.

Reviewed By: bnbarham

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

13 months ago[clang][lex] NFCI: Use FileEntryRef in ModuleMap::{load,lookup}ModuleMap()
Jan Svoboda [Thu, 25 May 2023 19:38:45 +0000 (12:38 -0700)]
[clang][lex] NFCI: Use FileEntryRef in ModuleMap::{load,lookup}ModuleMap()

This patch changes the return/argument types of `ModuleMap::{load,lookup}ModuleMap()` from `const FileEntry *` to `FileEntryRef` in order to remove uses of the deprecated `DirectoryEntry::getName()`.

Reviewed By: bnbarham

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

13 months ago[lldb][NFCI] Remove use of ConstString from StructuredDataDarwinLog static functions
Alex Langford [Fri, 26 May 2023 23:36:13 +0000 (16:36 -0700)]
[lldb][NFCI] Remove use of ConstString from StructuredDataDarwinLog static functions

The strings "DarwinLog" and "log" probably do not need to be in the
ConstString StringPool. We still create ConstStrings from them in some
places (for now) but that's because we don't have an implicit
constructor to convert a StringRef to a ConstString.

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

13 months ago[RISCV][GlobalISel] Add lowerFormalArguments for calling convention
Nitin John Raj [Tue, 30 May 2023 19:54:24 +0000 (12:54 -0700)]
[RISCV][GlobalISel] Add lowerFormalArguments for calling convention

This patch adds an IncomingValueHandler and IncomingValueAssigner, and implements minimal support for lowering formal arguments according to the RISC-V calling convention. Simple non-aggregate integer and pointer types are supported.

In the future, we must correctly handle byval and sret pointer arguments, and instances where the number of arguments exceeds the number of registers.

Coauthored By: lewis-revill

Reviewed By: arsenm

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

13 months ago[lldb][NFCI] Change type of SBDebugger::m_instance_name
Alex Langford [Fri, 26 May 2023 01:19:46 +0000 (18:19 -0700)]
[lldb][NFCI] Change type of SBDebugger::m_instance_name

This doesn't need to be in the ConstString StringPool. There's little
benefit to having these be unique, and we don't need fast comparisons on
them.

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

13 months ago[mlir][sparse] fix a crash when generating sparse convolution with nchw input
Peiming Liu [Tue, 30 May 2023 19:00:53 +0000 (19:00 +0000)]
[mlir][sparse] fix a crash when generating sparse convolution with nchw input

Reviewed By: aartbik

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

13 months ago[Driver] Remove unused class ForceSuccessCommand
Kazu Hirata [Tue, 30 May 2023 20:16:15 +0000 (13:16 -0700)]
[Driver] Remove unused class ForceSuccessCommand

The last use was removed by:

  commit 6625680a581c5e29c53d9f58d864cc6cd3cd05f6
  Author: Hans Wennborg <hans@chromium.org>
  Date:   Tue Feb 2 14:10:26 2021 +0100

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

13 months ago[lldb][NFCI] Refactor Language::GetFormatterPrefixSuffix
Alex Langford [Sat, 27 May 2023 01:26:49 +0000 (18:26 -0700)]
[lldb][NFCI] Refactor Language::GetFormatterPrefixSuffix

- Remove unused parameter `valobj` (I checked downstream, not
  even swift is using it).
- Return a std::pair<StringRef, StringRef> insted of having 2 out
  parameter strings.
- Remove the use of ConstStrings.

This change was primarily mechanical except in
`ObjCLanguage::GetFormatterPrefixSuffix`. To keep this fast, we
construct an llvm::StringMap<std::pair<StringRef, StringRef>> so that we
can look things up quickly. There is some amount of cost to setting up
the map the first time it is called, but subsequent lookups should be
as fast as a hash + string comparison (the cost of looking up something
in an llvm::StringMap).

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

13 months ago[libc++][ci] Use ccache in the jobs that build Clang
Louis Dionne [Thu, 18 May 2023 21:16:24 +0000 (14:16 -0700)]
[libc++][ci] Use ccache in the jobs that build Clang

This is an attempt to reduce the time taken by the Bootstrapping
build job and the Clang CI job that builds the compiler from scratch.

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

13 months ago[ConstraintElim] Add additional tests for and implication handling.
Florian Hahn [Tue, 30 May 2023 20:08:37 +0000 (21:08 +0100)]
[ConstraintElim] Add additional tests for and implication handling.

13 months ago[clang] [test] Narrow down an MSVC specific behaviour to only not covever MinGW
Martin Storsjö [Mon, 29 May 2023 20:08:56 +0000 (20:08 +0000)]
[clang] [test] Narrow down an MSVC specific behaviour to only not covever MinGW

This uses the same logic as in c2b256a990590dc8b69930259650cfeb085add03;
we can't check defined(_MSC_VER) invoked as %clang_cc1, therefore
check for !defined(__MINGW32__) instead.

This fixes the same issue in a new testcase that was added after this
issue was fixed last time in c2b256a990590dc8b69930259650cfeb085add03.

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

13 months ago[Driver] Report error for unsupported -mlarge-endian/-mlittle-endian
Fangrui Song [Tue, 30 May 2023 19:45:21 +0000 (12:45 -0700)]
[Driver] Report error for unsupported -mlarge-endian/-mlittle-endian

13 months agoRevert "[BOLT][CMake] Use LLVM macros for install targets"
Petr Hosek [Tue, 30 May 2023 19:28:14 +0000 (19:28 +0000)]
Revert "[BOLT][CMake] Use LLVM macros for install targets"

This reverts commit 627d5e16127bd8034b893e66ab0c86eacf2d939a.

13 months ago[BOLT][CMake] Use LLVM macros for install targets
Petr Hosek [Fri, 26 May 2023 22:11:24 +0000 (22:11 +0000)]
[BOLT][CMake] Use LLVM macros for install targets

The existing BOLT install targets are broken on Windows becase they
don't properly handle output extension. Rather than reimplementing
this logic in BOLT, reuse the existing LLVM macros which already
handle this aspect correctly.

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

13 months ago[clang-tidy][docs] Fix link to libc style guide
Alex Brachet [Tue, 30 May 2023 18:21:36 +0000 (18:21 +0000)]
[clang-tidy][docs] Fix link to libc style guide

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

13 months ago[Driver] Add ClangFlags::TargetSpecific to simplify err_drv_unsupported_opt_for_targe...
Fangrui Song [Tue, 30 May 2023 18:21:17 +0000 (11:21 -0700)]
[Driver] Add ClangFlags::TargetSpecific to simplify err_drv_unsupported_opt_for_target processing

clang/lib/Driver/ToolChains/Clang.cpp has a lot of fragments like the following:
```
if (const Arg *A = Args.getLastArg(...)) {
  if (Triple is xxx)
    A->render(Args, CmdArgs);
  else
    D.Diag(diag::err_drv_unsupported_opt_for_target) << ...;
}
```

The problem is more apparent with a recent surge of AIX-specific options.

Introduce the TargetSpecific flag so that we can move the target-specific
options to ToolChains/*.cpp and ToolChains/Arch/*.cpp and overload the
warn_drv_unused_argument mechanism to give an err_drv_unsupported_opt_for_target
error.

Migrate -march=/-mcpu= and some AIX-specific options to use this simplified pattern.

Reviewed By: jansvoboda11

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

13 months ago[compiler-rt][bultins] Fix libatomic standalone build
Alex Brachet [Tue, 30 May 2023 18:19:00 +0000 (18:19 +0000)]
[compiler-rt][bultins] Fix libatomic standalone build

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

13 months ago[libc][RISCV] Add log, log2, log1p, log10 for RISC-V64 entrypoints.
Tue Ly [Tue, 30 May 2023 03:08:20 +0000 (23:08 -0400)]
[libc][RISCV] Add log, log2, log1p, log10 for RISC-V64 entrypoints.

Add log, log2, log1p, log10 RISCV64 entrypoints.

Reviewed By: michaelrj, sivachandra

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

13 months ago[gn build] Port 06ff9770477d
LLVM GN Syncbot [Tue, 30 May 2023 18:02:40 +0000 (18:02 +0000)]
[gn build] Port 06ff9770477d