platform/upstream/llvm.git
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

13 months ago[clang][ExtractAPI] Refactor serializer to the CRTP
Erick Velez [Tue, 30 May 2023 17:58:13 +0000 (18:58 +0100)]
[clang][ExtractAPI] Refactor serializer to the CRTP

Refactor SerializerBase and SymbolGraphSerializer to use a visitor pattern described by the CRTP.

Reviewed By: dang

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

13 months ago[Driver][test] Properly test -mdefault-visibility-export-mapping=
Fangrui Song [Tue, 30 May 2023 17:58:06 +0000 (10:58 -0700)]
[Driver][test] Properly test -mdefault-visibility-export-mapping=

13 months ago[FLANG] Support all arrays for LoopVersioning
Mats Petersson [Mon, 22 May 2023 14:48:01 +0000 (15:48 +0100)]
[FLANG] Support all arrays for LoopVersioning

This patch makes more than 2D arrays work, with a fix for the way that
loop index is calculated. Removing the restriction of number of
dimensions.

This also changes the way that the actual index is calculated, such that
the stride is used rather than the extent of the previous dimension. Some
tests failed without fixing this - this was likely a latent bug in the
2D version too, but found in a test using 3D arrays, so wouldn't
have been found with 2D only. This introduces a division on the index
calculation - however it should be a nice and constant value allowing
a shift to be used to actually divide - or otherwise removed by using
other methods to calculate the result. In analysing code generated with
optimisation at -O3, there are no divides produced.

Some minor refactoring to avoid repeatedly asking for the "rank" of the
array being worked on.

This improves some of the SPEC-2017 ROMS code, in the same way as the
limited 2D array improvements - less overhead spent calculating array
indices in the inner-most loop and better use of vector-instructions.

Reviewed By: kiranchandramohan

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

13 months ago[RISCV] Add additional vslide1up test coverage
Philip Reames [Tue, 30 May 2023 17:49:28 +0000 (10:49 -0700)]
[RISCV] Add additional vslide1up test coverage

Add another form of the same pattern (as_rotate tests), and add coverage for a couple corner cases I got wrong at first in an upcoming rewrite.

13 months ago[clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines
Deniz Evrenci [Tue, 30 May 2023 16:48:28 +0000 (16:48 +0000)]
[clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines

All exceptions thrown in coroutine bodies are caught and
unhandled_exception member of the coroutine promise type is called.
In accordance with the existing rules of diagnostics related to
exceptions thrown in functions marked noexcept, even if the promise
type's constructor, get_return_object, or unhandled_exception
throws, diagnostics should not be emitted.

Fixes #61905.

Reviewed By: PiotrZSL, ChuanqiXu

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

13 months ago[CUDA] correctly install cuda_wrappers/bits/shared_ptr_base.h
Artem Belevich [Thu, 25 May 2023 21:17:32 +0000 (14:17 -0700)]
[CUDA] correctly install cuda_wrappers/bits/shared_ptr_base.h

The file must go under cuda_wrappers/bits/ directly, but was by mistake copied
directly into cuda_wrappers/ during installation.

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

13 months agoRe-enable MLIR test-contraction.mlir integration test after LLVM backend crash was...
Mehdi Amini [Tue, 30 May 2023 17:38:16 +0000 (10:38 -0700)]
Re-enable MLIR test-contraction.mlir integration test after LLVM backend crash was fixed

13 months ago[RISCV] Rename vslide1down tests (should have been part of 24172de)
Philip Reames [Tue, 30 May 2023 17:32:24 +0000 (10:32 -0700)]
[RISCV] Rename vslide1down tests (should have been part of 24172de)

13 months ago[RISCV] Add tests for vslide1down shuffle/insert idiom
Philip Reames [Tue, 30 May 2023 17:21:15 +0000 (10:21 -0700)]
[RISCV] Add tests for vslide1down shuffle/insert idiom

13 months ago[Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h
Paul Robinson [Tue, 30 May 2023 17:13:46 +0000 (10:13 -0700)]
[Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h

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

13 months ago[Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language...
Ben Hamilton [Fri, 26 May 2023 18:44:21 +0000 (12:44 -0600)]
[Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser

This adds to the ObjC language guesser a few more common macros used
in ObjC headers. These can help distinguish ObjC headers which
otherwise lack ObjC types from C++ headers.

Contributed by danblakemore.

Tested: New tests included. Ran unit tests with:
  ```
  % cmake -S llvm -B build -G Ninja && \
    ninja -C build FormatTests && \
    ./build/tools/clang/unittests/Format/FormatTests --gtest_filter="*FormatTestObjC*"

  (snip)
  [----------] 24 tests from FormatTestObjC (265 ms total)

  [----------] Global test environment tear-down
  [==========] 26 tests from 2 test suites ran. (270 ms total)
  [  PASSED  ] 26 tests.
  ```

Reviewed By: MyDeveloperDay

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

13 months ago[flang] [NFC] Remove an unneeded include.
Peter Steinfeld [Tue, 30 May 2023 14:48:51 +0000 (07:48 -0700)]
[flang] [NFC] Remove an unneeded include.

The title says it all.

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

13 months ago[RISCV] Add copyright header to IntrinsicsRISCVXTHead.td and IntrinsicsRISCVXsf.td...
Craig Topper [Tue, 30 May 2023 17:07:14 +0000 (10:07 -0700)]
[RISCV] Add copyright header to IntrinsicsRISCVXTHead.td and IntrinsicsRISCVXsf.td. NFC

13 months ago[MLIR][CAPI] Move `DenseMapInfo<MlirTypeID>`
max [Tue, 30 May 2023 15:46:55 +0000 (10:46 -0500)]
[MLIR][CAPI] Move `DenseMapInfo<MlirTypeID>`

I mistakenly put this in `mlir/CAPI/Support.h` at some point during the flurry of refactoring of `TypeCaster`s but as @jpienaar rightly pointed out, it doesn't belong there.

Reviewed By: ftynse

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

13 months ago[libc++][format] Fixes year formatter on Windows.
Mark de Wever [Sat, 27 May 2023 14:52:37 +0000 (16:52 +0200)]
[libc++][format] Fixes year formatter on Windows.

Windows' libc, like some other libc implementations do not work as
specified for %Y and %y. This uses the fixes used for other libc
implementations.

The work was part of D150593.

Reviewed By: #libc, ldionne

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

13 months ago[libc++] Deprecate the classes in strstream.
Mark de Wever [Thu, 25 May 2023 18:02:50 +0000 (20:02 +0200)]
[libc++] Deprecate the classes in strstream.

These have been deprecated since their initial version in libc++. It
seems they were never properly marked as deprecated.

Discovered while working on D151223.

Reviewed By: #libc, ldionne, philnik

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

13 months agoFix "[compiler-rt] Refactor memintrinsic interceptors"
Marco Elver [Tue, 30 May 2023 16:52:16 +0000 (18:52 +0200)]
Fix "[compiler-rt] Refactor memintrinsic interceptors"

Fix the Fuchsia build. asan_interceptors_memintrinsics.cpp should not
include any interceptors on Fuchsia.

Reported-by: haowei
Link: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8779679021892159153/+/u/clang/build/stdout
13 months ago[RISCV] Correct capitalization of SiFive in a comment. NFC
Craig Topper [Tue, 30 May 2023 16:51:49 +0000 (09:51 -0700)]
[RISCV] Correct capitalization of SiFive in a comment. NFC

13 months ago[AArch64] Add i1 insert/extract cost tests. NFC
David Green [Tue, 30 May 2023 16:45:16 +0000 (17:45 +0100)]
[AArch64] Add i1 insert/extract cost tests. NFC

See D151189. The existing files check lines have also been adjusted whilst
here.

13 months ago[libc++][CI] Installs libomp.
Mark de Wever [Thu, 25 May 2023 19:38:07 +0000 (21:38 +0200)]
[libc++][CI] Installs libomp.

This is needed to build clang-tidy plugins using clang-tidy 17.

Reviewed By: #libc, ldionne

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

13 months ago[clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace
Dmitri Gribenko [Tue, 30 May 2023 16:23:11 +0000 (18:23 +0200)]
[clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace

MemRegion::getMemorySpace() is annotated with
LLVM_ATTRIBUTE_RETURNS_NONNULL (which triggers instant UB if a null
pointer is returned), and callers indeed don't check the return value
for null. Thus, even though llvm::dyn_cast is called, it can never
return null in this context. Therefore, we can safely call llvm::cast.

Reviewed By: steakhal

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

13 months ago[clang][analyzer][NFC] Move dyn_cast's into if statements for readability
Dmitri Gribenko [Tue, 30 May 2023 16:17:10 +0000 (18:17 +0200)]
[clang][analyzer][NFC] Move dyn_cast's into if statements for readability

Reviewed By: steakhal

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

13 months ago[X86] Regenerate sqrt-fastmath-mir.ll
Simon Pilgrim [Tue, 30 May 2023 16:21:44 +0000 (17:21 +0100)]
[X86] Regenerate sqrt-fastmath-mir.ll

13 months agoMark header as textual
Adrian Prantl [Tue, 30 May 2023 16:21:16 +0000 (09:21 -0700)]
Mark header as textual

13 months ago[CodeGen] Refactor IR generation functions to use IRBuilder in ComplexDeinterleaving...
Igor Kirillov [Wed, 19 Apr 2023 10:11:33 +0000 (10:11 +0000)]
[CodeGen] Refactor IR generation functions to use IRBuilder in ComplexDeinterleaving pass

This patch updates several functions in LLVM's IR generation code to accept
an IRBuilder object as an argument, rather than an Instruction that indicates
the insertion point for new instructions.
This change is necessary to handle sophisticated -Ofast optimization cases
from D148558 where it's unclear which instructions should be used as the
insertion point for new operations.

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

13 months ago[clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markers
Dmitri Gribenko [Tue, 30 May 2023 16:10:58 +0000 (18:10 +0200)]
[clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markers

They are redundant with the [[fallthrough]]; attribute that follows.

Reviewed By: steakhal

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

13 months ago[clang][analyzer][NFC] Remove unnecessary casts around Allocate function calls
Dmitri Gribenko [Tue, 30 May 2023 16:02:10 +0000 (18:02 +0200)]
[clang][analyzer][NFC] Remove unnecessary casts around Allocate function calls

Reviewed By: steakhal

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

13 months ago[mlir] silence msvc warning
Alex Zinenko [Tue, 30 May 2023 15:58:45 +0000 (15:58 +0000)]
[mlir] silence msvc warning

13 months ago[mlir][llvm] Add LLVM TargetExtType
Lukas Sommer [Tue, 30 May 2023 15:45:54 +0000 (15:45 +0000)]
[mlir][llvm] Add LLVM TargetExtType

Add support for the `llvm::TargetExtType` to the MLIR LLVM dialect.

Target extension types were introduced to represent target-specific types, which are opaque to the compiler and optimizations.

The patch also enforces some of the constraints defined for the target extension type in the LLVM language reference manual.

Signed-off-by: Lukas Sommer <lukas.sommer@codeplay.com>
Reviewed By: ftynse, gysit, Dinistro

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

13 months ago[mlir][transform] Add op for adding attributes to payload IR
Quinn Dawkins [Tue, 30 May 2023 06:18:32 +0000 (02:18 -0400)]
[mlir][transform] Add op for adding attributes to payload IR

The ability to add attributes to payload IR is useful functionality
independent of any dialect. This is added here through `transform.annotate`
by enabling attributes tied to a `TransformParamTypeInterface` (which
internally refers to an Attribute) to be added to a target operation by
name.

The AnnotateOp does not produce a new handle as no existing handles
should be affected by adding an attribute. Existing attributes on
the payload with the same name will be overwritten.

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

13 months ago[LV] Use Legal::isUniform to detect uniform pointers.
Florian Hahn [Tue, 30 May 2023 15:42:55 +0000 (16:42 +0100)]
[LV] Use Legal::isUniform to detect uniform pointers.

Update collectLoopUniforms to identify uniform pointers using
Legal::isUniform. This is more powerful and  brings pointer
classification here in sync with setCostBasedWideningDecision
which uses isUniformMemOp. The existing mis-match in reasoning
can causes crashes due to D134460, which is fixed by this patch.

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

Reviewed By: Ayal

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

13 months ago[clang] Extend __is_trivially_equality_comparable to check for hidden friends
Nikolas Klauser [Tue, 30 May 2023 15:33:13 +0000 (08:33 -0700)]
[clang] Extend __is_trivially_equality_comparable to check for hidden friends

This allows types to be considered trivially equality comparable if a defaulted hidden friend is used.

Reviewed By: erichkeane

Spies: cfe-commits

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

13 months ago[mlir] add initial chapters of the transform dialect tutorial
Alex Zinenko [Thu, 25 May 2023 20:26:27 +0000 (20:26 +0000)]
[mlir] add initial chapters of the transform dialect tutorial

The transform dialect has been around for a while and is sufficiently
stable at this point. Add the first three chapters of the tutorial
describing its usage and extension.

Reviewed By: springerm

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

13 months ago[NFC][CLANG] Fix nullptr dereference issue in Type::getSveEltType()
Manna, Soumi [Tue, 30 May 2023 14:58:02 +0000 (07:58 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in Type::getSveEltType()

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

Reviewed By: erichkeane

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

13 months ago[VPlan] Handle invariant GEPs in isUniformAfterVectorization.
Florian Hahn [Tue, 30 May 2023 14:53:26 +0000 (15:53 +0100)]
[VPlan] Handle invariant GEPs in isUniformAfterVectorization.

This fixes a crash caused by legal treating a scalable GEP as invariant,
but isUniformAfterVectorization does not handle GEPs.

Partially fixes https://github.com/llvm/llvm-project/issues/60831.

Reviewed By: Ayal

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

13 months ago[flang][hlfir] lower hlfir.all into runtime call
Jacob Crawley [Wed, 24 May 2023 15:38:03 +0000 (15:38 +0000)]
[flang][hlfir] lower hlfir.all into runtime call

Depends on: D151111

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

13 months ago[flang] lower all intrinsic to hlfir.all operation
Jacob Crawley [Mon, 22 May 2023 15:06:49 +0000 (15:06 +0000)]
[flang] lower all intrinsic to hlfir.all operation

Carries out the lowering of the all intrinsic into HLFIR

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

13 months ago[flang] add hlfir.all intrinsic
Jacob Crawley [Mon, 22 May 2023 13:07:28 +0000 (13:07 +0000)]
[flang] add hlfir.all intrinsic

Adds a new HLFIR operation for the ALL intrinsic according to the
design set out in flang/docs/HighLevel.md

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

13 months ago[RISCV] Use v(f)slide1up for shuffle+insert idiom
Philip Reames [Tue, 30 May 2023 14:07:11 +0000 (07:07 -0700)]
[RISCV] Use v(f)slide1up for shuffle+insert idiom

This is pretty straight forward in the basic form. I did need to move the slideup matching earlier, but that looks generally profitable on it's own.

As follow ups, I plan to explore the v(f)slide1down variants, and see what I can do to canonicalize the shuffle then insert pattern (see _inverse tests at the end of the vslide1up.ll test).

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

13 months ago[mlir] [NFC] Add a newline to debug message at inserting of InterfaceMap
Kohei Yamaguchi [Tue, 30 May 2023 14:13:47 +0000 (14:13 +0000)]
[mlir] [NFC] Add a newline to debug message at inserting of InterfaceMap

At inserting of InterfaceMap, a debug message lacked a newline, so it repeatedly displayed this message within a single line.
Clean up the debug log by inserting a newline at the end of the message.

Reviewed By: rriddle

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

13 months ago[RISCV][NFC] Make Reduction scheduler resources SEW aware
Michael Maitland [Thu, 25 May 2023 17:09:37 +0000 (10:09 -0700)]
[RISCV][NFC] Make Reduction scheduler resources SEW aware

Create SchedWrites, WriteRes for reduction instructions that
are SEW specific. Future patches can use these resources
to customize the behavior of these resources depending on SEW.

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

13 months ago[mlir] fix mis-merge
Oleksandr "Alex" Zinenko [Tue, 30 May 2023 14:07:51 +0000 (16:07 +0200)]
[mlir] fix mis-merge

13 months ago[InstCombine] Remove adjustMinMax() fold (PR62088)
Nikita Popov [Tue, 30 May 2023 14:05:06 +0000 (16:05 +0200)]
[InstCombine] Remove adjustMinMax() fold (PR62088)

This fold is buggy if the constant adjustment overflows.
Additionally, since we now canonicalize to min/max intrinsics,
the constants picked here don't actually matter, as long as SPF
still recognizes the pattern.

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

13 months ago[X86] Fix SunnyCove ROB/MicroOpBufferSize
Simon Pilgrim [Tue, 30 May 2023 14:00:49 +0000 (15:00 +0100)]
[X86] Fix SunnyCove ROB/MicroOpBufferSize

As raised on Issue #62602 - the IceLake scheduler model is still mainly a copy of the SkylakeServer model. This initial commit just fixes the ROB/MicroOpBufferSize to match the size reported on WikiChip/Agner, further fixes to follow in later commits.

13 months ago[mlir] clarify transform.foreach_match documentation
Oleksandr "Alex" Zinenko [Tue, 30 May 2023 14:00:59 +0000 (16:00 +0200)]
[mlir] clarify transform.foreach_match documentation

Clarify the restrictions on actions that are implied by the implementation as a post-order walk.

13 months ago[mlir][linalg] Fix bug in FuseIntoContainingOp implementation
Matthias Springer [Tue, 30 May 2023 13:54:43 +0000 (15:54 +0200)]
[mlir][linalg] Fix bug in FuseIntoContainingOp implementation

Do not replace uses inside the body of `scf.forall` ops with results of the same op.

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

13 months ago[mlir][linalg] FuseIntoContainingOp: Always set newContainingOp
Matthias Springer [Tue, 30 May 2023 13:12:54 +0000 (15:12 +0200)]
[mlir][linalg] FuseIntoContainingOp: Always set newContainingOp

All result handles must be set in case of success.

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

13 months ago[gn build] Port 96a14f388b1a
LLVM GN Syncbot [Tue, 30 May 2023 12:49:12 +0000 (12:49 +0000)]
[gn build] Port 96a14f388b1a

13 months agoRevert "[FuncSpec] Replace LoopInfo with BlockFrequencyInfo"
Nikita Popov [Tue, 30 May 2023 12:40:18 +0000 (14:40 +0200)]
Revert "[FuncSpec] Replace LoopInfo with BlockFrequencyInfo"

As reported on https://reviews.llvm.org/D150375#4367861 and
following, this change causes PDT invalidation issues. Revert
it and dependent commits.

This reverts commit 0524534d5220da5ecb2cd424a46520184d2be366.
This reverts commit ced90d1ff64a89a13479a37a3b17a411a3259f9f.
This reverts commit 9f992cc9350a7f7072a6dbf018ea07142ea7a7ed.
This reverts commit 1b1232047e83b69561fd64b9547cb0a0d374473a.

13 months ago[X86] lowerBuildVectorAsBroadcast - remove repeated hasAVX() check. NFC.
Simon Pilgrim [Tue, 30 May 2023 11:36:54 +0000 (12:36 +0100)]
[X86] lowerBuildVectorAsBroadcast - remove repeated hasAVX() check. NFC.

We already early-out at the top of the function.

13 months ago[X86] X86FixupVectorConstantsPass - attempt to replace full width integer vector...
Simon Pilgrim [Mon, 29 May 2023 16:16:05 +0000 (17:16 +0100)]
[X86] X86FixupVectorConstantsPass - attempt to replace full width integer vector constant loads with broadcasts on AVX2+ targets

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.

13 months ago[CodeGen] Add pre-commit tests for D148558
Igor Kirillov [Mon, 17 Apr 2023 18:03:09 +0000 (18:03 +0000)]
[CodeGen] Add pre-commit tests for D148558

This patch adds four new tests for upcoming functionality in LLVM:
* complex-deinterleaving-add-mull-fixed-contract.ll
* complex-deinterleaving-add-mull-scalable-contract.ll
* complex-deinterleaving-add-mull-fixed-fast.ll
* complex-deinterleaving-add-mull-scalable-fast.ll.

These tests were generated from the IR of vectorizable loops, which were
compiled from C++ code using different optimization flags in Clang. Each pair
of tests corresponds to Neon and SVE architectures, respectively, and
each pair contains tests compiled with -Ofast and -O3 -ffp-contract=fast
-ffinite-math-only optimization flags.
The tests were stripped of nnan and ninf flags as they have no impact on the
output.
The primary objective of these tests is to show the various sequences of
complex computations that may be encountered and to demonstrate the ability
of ComplexDeinterleaving to support any ordering.

Depends on D147451

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

13 months ago[libc][NFC] Move the Linux file implementation to a subdirectory
Joseph Huber [Tue, 30 May 2023 11:49:14 +0000 (06:49 -0500)]
[libc][NFC] Move the Linux file implementation to a subdirectory

This patch simply moves the special handling for `linux` files to a
subdirectory. This is done to make it easier in the future to extend
this support to targets (like the GPU) that will have different
dependencies.

Reviewed By: lntue

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

13 months ago[LV] Use early exit for stores storing the ptr operand. (NFC)
Florian Hahn [Tue, 30 May 2023 11:14:11 +0000 (12:14 +0100)]
[LV] Use early exit for stores storing the ptr operand. (NFC)

Cleanup suggested in D150991.

13 months agoReland 2nd attempt: [tsan] Add debugging interfaces into interface header.
Pierre Gousseau [Tue, 30 May 2023 10:12:54 +0000 (10:12 +0000)]
Reland 2nd attempt: [tsan] Add debugging interfaces into interface header.

Change __tsan_get_report_loc 6th argument 'size' to unsigned long *

Reviewers: vitalybuka, dvyukov

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

13 months ago[X86] getTargetConstantBitsFromNode - support extracting fp data from ConstantDataSeq...
Simon Pilgrim [Tue, 30 May 2023 10:38:20 +0000 (11:38 +0100)]
[X86] getTargetConstantBitsFromNode - support extracting fp data from ConstantDataSequential

Fixes issue introduced by 0f8e0f4228805cbecce13dcfadef4c48a4f0f4cd where SimplifyDemandedBits could crash when trying to extract fp data from broadcasted constants

13 months ago[InstCombine] Remove unused function 'isMustTailCall' (NFC)
Jie Fu [Tue, 30 May 2023 10:30:44 +0000 (18:30 +0800)]
[InstCombine] Remove unused function 'isMustTailCall' (NFC)

/data/llvm-project/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2467:13: error: unused function 'isMustTailCall' [-Werror,-Wunused-function]
static bool isMustTailCall(Value *V) {
            ^
1 error generated.

13 months ago[InstCombine] Remove computeKnownBits() fold for returns
Nikita Popov [Mon, 22 May 2023 14:09:51 +0000 (16:09 +0200)]
[InstCombine] Remove computeKnownBits() fold for returns

We try to fold constant computeKnownBits() with context for return
instructions only. Otherwise, we rely on SimplifyDemandedBits() to
fold instructions with constant known bits.

The presence of this special fold for returns is dangerous, because
it makes our tests lie about what works and what doesn't. Tests are
usually written by returning the result we're interested in, but
will go through this separate code path that is not used for anything
else. This patch removes the special fold.

This primarily regresses patterns of the style "assume(x); return x".
The responsibility of handling such patterns lies with passes like
EarlyCSE/GVN anyway, which will do this reliably, and not just for
returns.

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

13 months ago[RISCV] Generalise shouldExtendTypeInLibcall logic to apply to all <XLEN floats on...
Alex Bradbury [Tue, 30 May 2023 09:59:15 +0000 (10:59 +0100)]
[RISCV] Generalise shouldExtendTypeInLibcall logic to apply to all <XLEN floats on soft ABIs

This results in improved codegen for half/bf16 libcalls on soft ABIs

Adds a RISCVSubtarget helper method for determining if a soft FP ABI is
being targeted (future bf16 related patches make use of this).

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

13 months ago[compiler-rt] Refactor memintrinsic interceptors
Marco Elver [Tue, 30 May 2023 09:59:16 +0000 (11:59 +0200)]
[compiler-rt] Refactor memintrinsic interceptors

This moves memintrinsic interceptors (memcpy/memmove/memset) into a new
file sanitizer_common_interceptors_memintrinsics.inc.

This is in preparation of redefining builtins, however, we must be
careful to not redefine builtins in TUs that define interceptors of the
same name.

In all cases except for MSan, memintrinsic interceptors were moved to a
new TU $tool_interceptors_memintrinsics.cpp. In the case of MSan, it
turns out this is not yet necessary (as shown by the later patch
introducing memcpy tests).

NFC.

Reviewed By: vitalybuka

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

13 months ago[compiler-rt] Mark some performance critical buffers uninitialized
Marco Elver [Tue, 30 May 2023 09:59:09 +0000 (11:59 +0200)]
[compiler-rt] Mark some performance critical buffers uninitialized

With -ftrivial-auto-var-init, do not emit memset() calls for performance
critical stack variables.

Reviewed By: vitalybuka, dvyukov, MaskRay

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

13 months agoRevert "[mlir][bazel] Port for 660f714, third attempt"
Benjamin Kramer [Tue, 30 May 2023 09:41:24 +0000 (11:41 +0200)]
Revert "[mlir][bazel] Port for 660f714, third attempt"

This reverts commit 421a7f814fb15dedde1b0b13a9e4ddcf7b502086. Dependency
doesn't seem to be necessary and would pull in all of LLVM's codegen
into mlir users that don't require it.

13 months agoFix "not all control paths return a value" MSVC warning. NFC.
Simon Pilgrim [Tue, 30 May 2023 09:29:47 +0000 (10:29 +0100)]
Fix "not all control paths return a value" MSVC warning. NFC.

13 months ago[StaticAnalyzer] Fix block pointer type nullability check
tripleCC [Tue, 30 May 2023 09:20:05 +0000 (11:20 +0200)]
[StaticAnalyzer] Fix block pointer type nullability check

This patch fixes a false negative when the property type
is an objective-c block pointer.

Patch By tripleCC!

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

13 months ago[clang] Add test for CWG1397
Vlad Serebrennikov [Tue, 30 May 2023 09:03:01 +0000 (12:03 +0300)]
[clang] Add test for CWG1397

Resolution of this CWG breaks potential dependency loop between complete-class context of non-static data member initializer (NSDMI), and defaulted default constructor, which is `noexcept` depending on NSDMIs among other things.

For whatever reason in C++11 mode we issue an additional note and a different line number for the primary error. But I find the message itself even worse than aforementioned issues. It describes what's going on, but doesn't say what's bad about it. I find the previous version of this message more clear: https://github.com/llvm/llvm-project/commit/8dbc6b26171167b8ddf66a5f4b6d6fb9baf28336 . Created an issue for that: #62823

Reviewed By: #clang-language-wg, shafik

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

13 months ago[LLDB] Update AArch64/Windows XFAIl decorators on TestNamespace.py
Muhammad Omair Javaid [Tue, 30 May 2023 09:05:45 +0000 (13:05 +0400)]
[LLDB] Update AArch64/Windows XFAIl decorators on TestNamespace.py

13 months agoUse UNSUPPORTED annotation to disable Integration/Dialect/Vector/CPU/test-contraction...
Mehdi Amini [Tue, 30 May 2023 08:20:22 +0000 (01:20 -0700)]
Use UNSUPPORTED annotation to disable Integration/Dialect/Vector/CPU/test-contraction.mlir

Previous attempt to disable the test didn't seem to work as expected.

13 months ago[mlir][scf] NFC - Add debug information to scf pipelining
Nicolas Vasilache [Tue, 30 May 2023 07:32:32 +0000 (00:32 -0700)]
[mlir][scf] NFC - Add debug information to scf pipelining

13 months ago[builtins][test] Skip scalbn rounding tests on newlib
David Candler [Tue, 30 May 2023 07:57:27 +0000 (08:57 +0100)]
[builtins][test] Skip scalbn rounding tests on newlib

The picolib/newlib implementation of scalbn gives slightly different
results compared to glibc and compiler-rt's inlined
__compiler_rt_scalbn in certain rounding modes. Since these tests
are already disabled for msvc which doesn't respect the mode change,
this patch skips them for newlib as well.

Reviewed By: MaskRay

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