platform/upstream/llvm.git
16 months ago[mlir][sparse] Improve sort operation by generating inlined code to compare values.
bixia1 [Thu, 9 Mar 2023 17:38:09 +0000 (09:38 -0800)]
[mlir][sparse] Improve sort operation by generating inlined code to compare values.

Previously, we generate function calls to compare values for sorting. It turns
out that the compiler doesn't inline those function calls. We now directly
generate inlined code. Also, modify the code for comparing values to use less
number of branches.

This improves all sort implementation in general. For arabic-2005.mtx CSR, the
improvement is around 25%.

Reviewed By: aartbik

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

16 months ago[MLIR] : Add integer mul in scf to openmp conversion
Kiran Chandramohan [Tue, 14 Mar 2023 21:51:02 +0000 (21:51 +0000)]
[MLIR] : Add integer mul in scf to openmp conversion

Add conversion for integer multiplication in scf reductions in the
SCF to OpenMP dialect conversion.

Reviewed By: ftynse

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

16 months ago[Flang][OpenMP] Add support for OpenMP max reduction
Kiran Chandramohan [Tue, 14 Mar 2023 19:08:34 +0000 (19:08 +0000)]
[Flang][OpenMP] Add support for OpenMP max reduction

This patch adds support for reduction of max-intrinsic for scalar
types. Max is lowered as a compare-select in the default lowering
flow for Flang. This pattern is matched and replaced with the
OpenMP dialect reduction operation.

Note: This is a temporary flow. The plan is to move to a flow where
the OpenMP reduction operation is inserted during lowering.

Reviewed By: do

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

16 months ago[AArch64] Add FP16 broadcast and transpose costs
David Green [Tue, 14 Mar 2023 21:25:18 +0000 (21:25 +0000)]
[AArch64] Add FP16 broadcast and transpose costs

The FP16 broadcast and transpose can always use the same instructions as are
used for i16 vectors, with or without +fullfp16. This fills in some extra costs
to make sure we get them right.

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

16 months agoRemove -lower-global-dtors-via-cxa-atexit flag
Julian Lettner [Thu, 9 Mar 2023 19:32:17 +0000 (11:32 -0800)]
Remove -lower-global-dtors-via-cxa-atexit flag

Remove the `-lower-global-dtors-via-cxa-atexit` escape hatch introduced
in D121736 [1], which switched the default lowering of global
destructors on MachO to use `__cxa_atexit()` to avoid emitting
deprecated `__mod_term_func` sections.

I added this flag as an escape hatch in case the switch causes any
problems.  We didn't discover any problems so now we can remove it.

[1] https://reviews.llvm.org/D121736

rdar://90277838

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

16 months ago[clang-offload-bundler] Standardize TargetID field for bundler
Jacob Lambert [Fri, 10 Mar 2023 08:47:50 +0000 (00:47 -0800)]
[clang-offload-bundler] Standardize TargetID field for bundler

The bundler accepts both of the following for the --target option:
  hip-amdgcn-amd-amdhsa-gfx900    (no env field)
  hip-amdgcn-amd-amdhsa--gfx900   (blank env field)

The environment field is defined as optional for Triples
in Triple.h. However, in this patch we update the bundler to
internally standardize to include the env field. While users
aren't required to specify an env field when listing targets on
the commandline, bundles generated by the offload-bundler will
include the ABI field.

This standardization simplifies things for APIs that deal with
bundles generated by the clang-offload-bundler tool.

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

16 months ago[BasicBlockUtils] Expose an internal utility in API [nfc]
Philip Reames [Tue, 14 Mar 2023 21:05:00 +0000 (14:05 -0700)]
[BasicBlockUtils] Expose an internal utility in API [nfc]

Shrinking a patch about to be posted for review.

16 months ago[SLP] Outline GEP chain cost modeling into new TTI interface - NFCI.
Valery N Dmitriev [Thu, 23 Feb 2023 00:35:38 +0000 (16:35 -0800)]
[SLP] Outline GEP chain cost modeling into new TTI interface - NFCI.

Cost modeling for GEPs should actually be target dependent but is currently
done inside SLP target-independent way.
Sinking it into TTI enables target dependent implementation.
This patch adds new TTI interface and implementation of the basic functionality
trying to retain existing cost modeling.

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

16 months ago[flang] Fixed linaro-flang-aarch64-sharedlibs after D145992.
Slava Zakharin [Tue, 14 Mar 2023 20:58:58 +0000 (13:58 -0700)]
[flang] Fixed linaro-flang-aarch64-sharedlibs after D145992.

16 months agoRevert "[LLVM][OHOS] Clang toolchain and targets"
Daniel Thornburgh [Tue, 14 Mar 2023 20:44:07 +0000 (13:44 -0700)]
Revert "[LLVM][OHOS] Clang toolchain and targets"

This change had tests that break whenever LLVM_ENABLE_LINKER_BUILD_ID is
set, as is the case in the Fuchsia target.

This reverts commits:
f81317a54586dbcef0c14cf512a0770e8ecaab3d
72474afa27570a0a1307f3260f0187b703aa6d84

16 months ago[flang] Load fir.ref<fir.class<T>> instead of creating a wrong box
Valentin Clement [Tue, 14 Mar 2023 20:44:41 +0000 (21:44 +0100)]
[flang] Load fir.ref<fir.class<T>> instead of creating a wrong box

When a subroutine has an entry statement, the non-used argument
will be a fir.alloca and result in a fir.ref<fir.class<T>> for
polymorphic entities. In createBox, just load the box instead of
creating a wrong box.

Reviewed By: PeteSteinfeld

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

16 months ago[Passes] Remove some legacy passes
Arthur Eubanks [Mon, 13 Mar 2023 16:53:50 +0000 (09:53 -0700)]
[Passes] Remove some legacy passes

NewGVN
GVNHoist
GVNSink
MemCpyOpt
Float2Int

These were only used for the optimization pipeline, of which the legacy version was removed.

16 months ago[MSAN] Minor refactor to reduce future diff [nfc]
Philip Reames [Tue, 14 Mar 2023 20:18:05 +0000 (13:18 -0700)]
[MSAN] Minor refactor to reduce future diff [nfc]

16 months ago[libc] Remove leftover debug prints
Joseph Huber [Tue, 14 Mar 2023 20:11:30 +0000 (15:11 -0500)]
[libc] Remove leftover debug prints

16 months ago[InlineOrder] Plugin Inline Order
Kazu Hirata [Tue, 14 Mar 2023 20:13:56 +0000 (13:13 -0700)]
[InlineOrder] Plugin Inline Order

This allows developing and distributing inlining heuristics
outside of tree. And together with the inline advisor plugins
allows for fine grained control of the inliner.

The PluginInlineOrderAnalysis class serves as the entry point
for dynamic advisors. Plugins must register instances of this
class to provide their own InlineOrder.

I'm checking in this patch on behalf of ibricchi
<ibricchi@student.ethz.ch>.

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

16 months ago[RISCV] Merge getLoadFP*Imm into a single function.
Craig Topper [Tue, 14 Mar 2023 20:04:44 +0000 (13:04 -0700)]
[RISCV] Merge getLoadFP*Imm into a single function.

We currently have 3 functions and 3 lookup tables. This was the
most expediant and obvious way to fix several bugs.

This patch uses a single function and single lookup
table. It uses APFloat::convert to convert from the half or double
to single precision. If the conversion doesn't have any errors or
lose any information we use the f32 table to finish the lookup.

Reviewed By: asb

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

16 months ago[RISCV] Pre-commit tests for D145897. NFC
Craig Topper [Tue, 14 Mar 2023 20:01:28 +0000 (13:01 -0700)]
[RISCV] Pre-commit tests for D145897. NFC

16 months ago[flang] Handle Flang examples consistently with LLVM.
Slava Zakharin [Mon, 13 Mar 2023 21:50:13 +0000 (14:50 -0700)]
[flang] Handle Flang examples consistently with LLVM.

Without this change the problem is that flangOmpReport and
flangPrintFunctionNames libraries are not built under 'all',
but they are imported targets via LLVMExports.cmake so that
any out-of-tree build that configures upon LLVM+Flang package
will get this CMake error:
```
  The imported target "flangPrintFunctionNames" references the file

     ".../lib/flangPrintFunctionNames.so"

  but this file does not exist.
```

flang-aarch64-out-of-tree buildbot (https://lab.llvm.org/buildbot/#/builders/175)
does not catch this issue, because it does not enable Flang on the first stage.

This change gets rid of FLANG_BUILD_EXAMPLES in favor of LLVM_BUILD_EXAMPLES
and uses available LLVM CMake macros to add example executables/libraries.

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

16 months ago[BOLT] Add writable segment for allocatable sections
Vladislav Khmelevsky [Mon, 6 Feb 2023 13:13:46 +0000 (17:13 +0400)]
[BOLT] Add writable segment for allocatable sections

The golang support creates 2 new data segments, one of them contains
relocations in PIC binaries, so the section must have writable rights.
Currently BOLT creates only one new segment that contains new sections
with RX rights, now also create RW segment if there are any new writable
sections were allocated during BOLT binary processing.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

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

16 months ago[libc] Fix CMake deduplication `-Xclang` arguments
Joseph Huber [Tue, 14 Mar 2023 20:03:22 +0000 (15:03 -0500)]
[libc] Fix CMake deduplication `-Xclang` arguments

Summary:
We use `-Xclang` to pass the GPU binary to be embedded. In the case of
multi-source objects this will be passed more than once, but CMake
implicitly deduplicates arguments. Use the special generator to prevent
this from happening.

16 months ago[libc] Fix GPU fatbinary dependencies for multi-source object libraries
Joseph Huber [Tue, 14 Mar 2023 19:59:27 +0000 (14:59 -0500)]
[libc] Fix GPU fatbinary dependencies for multi-source object libraries

Summary:
Multi-source object libraries require some additional handling, this
logic wasn't correctly settending the dependency on each filename
individually and was instead using the last one. This meant that only
the last file was built for multi-object libraries.

16 months ago[TableGen][RISCV][Hexagon][LoongArch] Add a list of Predicates to HwMode.
Craig Topper [Tue, 14 Mar 2023 20:00:38 +0000 (13:00 -0700)]
[TableGen][RISCV][Hexagon][LoongArch] Add a list of Predicates to HwMode.

Use the predicate condition instead of checkFeatures in *GenDAGISel.inc.

This makes the code similar to isel pattern predicates.

checkFeatures is still used by code created by SubtargetEmitter so
we can't remove the string. Backends need to be careful to keep
the string and predicates in sync, but I don't think that's a big issue.

I haven't measured it, but this should be a compile time improvement
for isel since we don't have to do any of the string processing that's
inside checkFeatures.

Reviewed By: kparzysz

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

16 months ago[clang][docs] Clarify the semantics of -fexceptions
Alex Bradbury [Tue, 14 Mar 2023 19:52:32 +0000 (19:52 +0000)]
[clang][docs] Clarify the semantics of -fexceptions

As noted in <https://github.com/llvm/llvm-project/issues/61216>, the
documentation for -fexceptions appears to imply that unwind information
is always generated, which isn't the case.

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

16 months ago[AutoUpgrade] Add flag to disable autoupgrading debug info
Arthur Eubanks [Thu, 2 Feb 2023 23:29:20 +0000 (15:29 -0800)]
[AutoUpgrade] Add flag to disable autoupgrading debug info

Auto-upgrade can be expensive, especially UpgradeDebugInfo() since it runs the verifier.

With this patch, we can specify that the imported bitcode is built with the same revision of LLVM, meaning there's no need to run any auto-upgrading. For now, limit this to just debug info since projects like Rust want to support multiple versions of LLVM at the same time (at compiler build time, not at Rust source code build time) and run a subset of the autoupgrade functionality for simplicity.

Reviewed By: nikic

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

16 months ago[RISCV] Consistently error for arch strings with trailing _
Alex Bradbury [Tue, 14 Mar 2023 19:12:07 +0000 (19:12 +0000)]
[RISCV] Consistently error for arch strings with trailing _

RISCVISAInfo::parseArchString would sometimes error for arch strings
with a trailing _ and sometimes accept them. This patch makes it
consistently error.

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

16 months ago[mlir][tosa] Add FFT2d operation
Luke Hutton [Tue, 14 Mar 2023 18:55:39 +0000 (18:55 +0000)]
[mlir][tosa] Add FFT2d operation

Adds the FFT2d TOSA operation and supporting
shape inference function.

Signed-off-by: Luke Hutton <luke.hutton@arm.com>
Reviewed By: rsuderman, eric-k256

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

16 months ago[FuncSpec] Do not run pre-link when doing LTO.
Alexandros Lamprineas [Mon, 6 Mar 2023 16:43:22 +0000 (16:43 +0000)]
[FuncSpec] Do not run pre-link when doing LTO.

Saves time. Post link will cover most cases anyway.

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

16 months ago[mlir][tosa] Swap reshape at end of reduce op with expand_shape
Ramiro Leal-Cavazos [Tue, 14 Mar 2023 18:34:06 +0000 (18:34 +0000)]
[mlir][tosa] Swap reshape at end of reduce op with expand_shape

This commit swaps back the `tosa.reshape` op used at the end of the
lowering for reduce ops with the op `tensor.expand_shape`. This is
needed to properly support dynamically-sized tensors. In such cases,
lowering directly to `tensor.expand_shape` allows us to control which
dimension gets expanded at the end using the knowledge of the
reduction. This would not be possible when using `tosa.reshape`, since
the op does not have a way of knowing that we are only unsqueezing a
single dimension.

Note: this change had previously been performed in
https://reviews.llvm.org/D133877.

Reviewed By: rsuderman

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

16 months ago[mlir][sparse] Cleaning up names in {Merger,LoopEmitter,CodegenEnv}.{h,cpp}
wren romano [Fri, 10 Mar 2023 01:00:27 +0000 (17:00 -0800)]
[mlir][sparse] Cleaning up names in {Merger,LoopEmitter,CodegenEnv}.{h,cpp}

This change does a bunch of renaming to clear up confusions in these files.  In particular, this change:

* Renames variables and methods to clarify the "dim"/"lvl" distinction, and changes them to use the `Dimension`/`Level` types as appropriate.
* Introduces new typedefs
  * `ExprId`, `LatPointId`, `LatSetId`: to clarify the interning design of the Merger.
  * `LoopId`, `LoopOrd`: to clarify the distinction between arbitrary names for loop-variables, vs numeric identifiers based on the actual order of loop generation.
  * `TensorId`
  * (Future CLs will change these from typedefs to structs/classes, so that the typechecker can help avoid mixups.)
* Updates documentation to match the new terminology
* Adds additional assertions
* Adds `const` to local variables along the way

Reviewed By: aartbik

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

16 months ago[SystemZ] Clear NW flags on an ISD::SUB when reused as comparison.
Jonas Paulsson [Thu, 9 Mar 2023 18:19:09 +0000 (19:19 +0100)]
[SystemZ] Clear NW flags on an ISD::SUB when reused as comparison.

The SystemZ backend will try to reuse an existing subtraction of two values
whenever they are to be compared for equality. This depends on the SystemZ
subtraction instruction setting the condition code, which can also signal
overflow.

A later pass will remove the compare and reuse the CC from the subtraction
directly. However, if that subtraction has the NSW flag set it will not
include the overflow bit in the updated CC user. That was a bug which can
lead to wrong results, as shown by a csmith program.

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

Reviewed By: nikic, uweigand

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

16 months ago[libc][NFC] add an atof test for a fuzz failure
Michael Jones [Fri, 10 Mar 2023 19:53:50 +0000 (11:53 -0800)]
[libc][NFC] add an atof test for a fuzz failure

The differential fuzzer found that glibc and our libc disagree on the
result for "0x30000002222225p-1077", with ours being rounded up and
theirs rounded down. Ours is more correct for the nearest rounding mode,
so only a test is added.

Reviewed By: lntue, sivachandra

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

16 months ago[mlir][vector] Add bazel dependency to TestVector
Anlun Xu [Tue, 14 Mar 2023 18:36:25 +0000 (11:36 -0700)]
[mlir][vector] Add bazel dependency to TestVector

Dependency was introduced in https://reviews.llvm.org/D145942

Reviewed By: cota

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

16 months ago[libc++] Use __verbose_abort instead of std::abort in __throw_ functions
Nikolas Klauser [Sun, 8 Jan 2023 13:07:44 +0000 (14:07 +0100)]
[libc++] Use __verbose_abort instead of std::abort in __throw_ functions

This results in proper error messages instead of just an abort.

Reviewed By: ldionne, Mordante, #libc

Spies: #libc_vendors, smeenai, libcxx-commits

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

16 months ago[MSAN] Add (fixed) vector load/store test coverage [nfc]
Philip Reames [Tue, 14 Mar 2023 18:11:27 +0000 (11:11 -0700)]
[MSAN] Add (fixed) vector load/store test coverage [nfc]

16 months ago[Clang][CodeGen] Fix linkage and visibility of template parameter objects
Alexander Shaposhnikov [Tue, 14 Mar 2023 18:12:19 +0000 (18:12 +0000)]
[Clang][CodeGen] Fix linkage and visibility of template parameter objects

This diff fixes linkage and visibility of template parameter objects.
The associated GitHub issue: https://github.com/llvm/llvm-project/issues/51571#

Test plan:
1/ ninja check-all
2/ bootstrapped Clang passes tests

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

16 months ago[memprof] Record BuildIDs in the raw profile.
Snehasish Kumar [Mon, 13 Mar 2023 20:11:58 +0000 (20:11 +0000)]
[memprof] Record BuildIDs in the raw profile.

This patch adds support for recording BuildIds usng the sanitizer
ListOfModules API. We add another entry to the SegmentEntry struct and
change the memprof raw version.

Reviewed By: tejohnson

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

16 months ago[Clang] Always use --no-undefined when linking AMDGPU images
Joseph Huber [Mon, 13 Mar 2023 14:33:08 +0000 (09:33 -0500)]
[Clang] Always use --no-undefined when linking AMDGPU images

AMDGPU uses ELF shared libraries to implement their executable device
images. One downside to this method is that it disables regular warnings
on undefined symbols. This is because shared libraries expect these to
be resolves by later loads. However, the GPU images do not support
dynamic linking so any undefined symbol is going to cause a runtime
error. This patch adds `--no-undefined` to the `ld.lld` invocation to guarantee
that undefined symbols are always caught as linking errors rather than
runtime errors.

Reviewed By: arsenm, MaskRay, #amdgpu

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

16 months ago[docs] Document MemProf metadata in LangRef
Teresa Johnson [Tue, 14 Mar 2023 03:29:02 +0000 (20:29 -0700)]
[docs] Document MemProf metadata in LangRef

Add documentation for memprof and callsite metadata in LangRef.

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

16 months ago[RISCV] Fix regression due to interaction of MachineOutliner and MachineCopyPropagation
Alex Bradbury [Tue, 14 Mar 2023 17:55:11 +0000 (17:55 +0000)]
[RISCV] Fix regression due to interaction of MachineOutliner and MachineCopyPropagation

D144535 enabled machine copy propagation for RISC-V and added it to the
pass pipeline in addPreEmitPass2 (after the MachineOutliner).
Unfortunately, the MachineCopyPropagation pass is unable to correctly
analyse outlined functions, and will delete copy instructions where a
register is set that is intended to be live-out.
RISCVInstrInfo::buildOutlinedFrame will directly insert a JALR, while a
similar function going through the normal codegen path would have a
PseudoRet with operands indicating registers that are live-out.

This patch does the simplest fix, which is to run MachineCopyPropagation
before the MachineOutliner.

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

16 months ago[NFC][libc++][format] Improves diagnostics.
Mark de Wever [Fri, 17 Feb 2023 20:27:08 +0000 (21:27 +0100)]
[NFC][libc++][format] Improves diagnostics.

While implementing the tests for LWG3720 I noticed the std::format
errors for non-formattable types are not user friendly (and thus hard to
write a .verify test too).

The issue stems from using a deleted function for invalid types. By
using a function that returns an invalid value the diagnostics become a
lot better. Before this change the existing "invalid value"
static_assert could never trigger. Now it can be triggered by user
code, therefore a diagnostic message has been added.

Before this change using a non-formattable type resulted in list of
error messages along the line of

    .../include/c++/v1/__format/format_arg_store.h:167:29: error: call to deleted function '__determine_arg_t'
      constexpr __arg_t __arg = __determine_arg_t<_Context, remove_cvref_t<_Tp>>();
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    .../include/c++/v1/__format/format_arg_store.h:210:54: note: in instantiation of function template specialization 'std::__format::__create_format_arg<std::format_context, char16_t &>' requested here
            basic_format_arg<_Context> __arg = __format::__create_format_arg<_Context>(__args);
                                                         ^
    .../include/c++/v1/__format/format_arg_store.h:246:19: note: in instantiation of function template specialization 'std::__format::__create_packed_storage<std::format_context, int &, char16_t &>' requested here
            __format::__create_packed_storage(__storage.__types_, __storage.__values_, __args...);
                      ^
    .../include/c++/v1/__format/format_functions.h:73:10: note: in instantiation of member function 'std::__format_arg_store<std::format_context, int &, char16_t &>::__format_arg_store' requested here
      return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
             ^
    .../include/c++/v1/__config:664:17: note: expanded from macro '_VSTD'
    #  define _VSTD std
                    ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:46:50: note: in instantiation of function template specialization 'std::make_format_args<std::format_context, int &, char16_t &>' requested here
        TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
                                                     ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:69:3: note: in instantiation of function template specialization 'test_exception<char, int, char16_t>' requested here
      test_exception(SV("{:{}}"), 42, u'0');
      ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:97:3: note: in instantiation of function template specialization 'test<char>' requested here
      test<char>();
      ^
    .../include/c++/v1/__format/format_arg_store.h:154:19: note: candidate function [with _Context = std::format_context, _Tp = char16_t] has been explicitly deleted
    consteval __arg_t __determine_arg_t()
                      ^
    .../include/c++/v1/__format/format_arg_store.h:148:19: note: candidate function [with _Context = std::format_context, _Tp = char16_t]
    consteval __arg_t __determine_arg_t() {

    <more errors omitted>

    .../include/c++/v1/__format/format_arg_store.h:185:22: note: initializer of '__arg' is not a constant expression
    .../include/c++/v1/__format/format_arg_store.h:167:21: note: declared here
      constexpr __arg_t __arg = __determine_arg_t<_Context, remove_cvref_t<_Tp>>();
                        ^
    .../build/include/c++/v1/__format/format_arg_store.h:194:73: error: member reference base type 'char16_t' is not a structure or union
              __arg, basic_string_view<typename _Context::char_type>{__value.data(), __value.size()}};
                                                                     ~~~~~~~^~~~~
    11 errors generated.

After the change using the same non-formmatable type gives the following
diagnostics

    .../include/c++/v1/__format/format_arg_store.h:168:3: error: static assertion failed due to requirement '__arg != __arg_t::__none': the supplied type is not formattable
      static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~
    .../include/c++/v1/__format/format_arg_store.h:210:54: note: in instantiation of function template specialization 'std::__format::__create_format_arg<std::format_context, char16_t &>' requested here
            basic_format_arg<_Context> __arg = __format::__create_format_arg<_Context>(__args);
                                                         ^
    .../include/c++/v1/__format/format_arg_store.h:246:19: note: in instantiation of function template specialization 'std::__format::__create_packed_storage<std::format_context, int &, char16_t &>' requested here
            __format::__create_packed_storage(__storage.__types_, __storage.__values_, __args...);
                      ^
    .../include/c++/v1/__format/format_functions.h:73:10: note: in instantiation of member function 'std::__format_arg_store<std::format_context, int &, char16_t &>::__format_arg_store' requested here
      return _VSTD::__format_arg_store<_Context, _Args...>(__args...);
             ^
    .../include/c++/v1/__config:664:17: note: expanded from macro '_VSTD'
    #  define _VSTD std
                    ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:46:50: note: in instantiation of function template specialization 'std::make_format_args<std::format_context, int &, char16_t &>' requested here
        TEST_IGNORE_NODISCARD std::vformat(fmt, std::make_format_args<context_t<CharT>>(args...));
                                                     ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:69:3: note: in instantiation of function template specialization 'test_exception<char, int, char16_t>' requested here
      test_exception(SV("{:{}}"), 42, u'0');
      ^
    .../libcxx/test/std/utilities/format/format.string/format.string.std/lwg3720_arg_id_width_precision_allowed_types.pass.cpp:97:3: note: in instantiation of function template specialization 'test<char>' requested here
      test<char>();
      ^
    .../include/c++/v1/__format/format_arg_store.h:168:23: note: expression evaluates to '0 != 0'
      static_assert(__arg != __arg_t::__none, "the supplied type is not formattable");
                    ~~~~~~^~~~~~~~~~~~~~~~~~
    1 error generated.

Reviewed By: #libc, ldionne

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

16 months ago[StructuralHash][NFC] Use anonymous namespace
Arthur Eubanks [Tue, 14 Mar 2023 17:48:10 +0000 (10:48 -0700)]
[StructuralHash][NFC] Use anonymous namespace

16 months agoMove utility for acting on each lane of ElementCount to common code [nfc]
Philip Reames [Tue, 14 Mar 2023 15:39:19 +0000 (08:39 -0700)]
Move utility for acting on each lane of ElementCount to common code [nfc]

This was first written for AddressSanitizer, but I'm about to reuse it for MemorySanitizer as well.

16 months ago[gn] reformat all gn files
Nico Weber [Tue, 14 Mar 2023 17:35:02 +0000 (18:35 +0100)]
[gn] reformat all gn files

I ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format

16 months ago[gn] minor cleanup after 33a55c3d8c73
Nico Weber [Tue, 14 Mar 2023 17:34:25 +0000 (18:34 +0100)]
[gn] minor cleanup after 33a55c3d8c73

16 months ago[libc++][format] Addresses LWG3825.
Mark de Wever [Sat, 18 Feb 2023 12:30:14 +0000 (13:30 +0100)]
[libc++][format] Addresses LWG3825.

  LWG3825 Missing compile-time argument id check in
  basic_format_parse_context::next_arg_id

Reviewed By: #libc, ldionne

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

16 months ago[SLP]Remove CreateShuffle lambda and reuse ShuffleBuilder functions.
Alexey Bataev [Mon, 13 Mar 2023 21:40:54 +0000 (14:40 -0700)]
[SLP]Remove CreateShuffle lambda and reuse ShuffleBuilder functions.

After merging main part of the gather/buildvector code, CreateShuffle
lambda can removed and ShuffleBuilder add functions can be used instead.
Also, part of the code from CreateShuffle migrated to createShuffle of
the BaseShuffleAnalysis::createShuffle function for better code emission.

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

16 months ago[SemaCXX]use CorrectDelayedTyposInExpr in ActOnCXXFoldExpr only when Diag
Congcong Cai [Tue, 14 Mar 2023 17:07:55 +0000 (01:07 +0800)]
[SemaCXX]use CorrectDelayedTyposInExpr in ActOnCXXFoldExpr only when Diag

PR #61326

- fix clang crash when fold expression contains a delayed typos correction.

code snippet in `ActOnCXXFoldExpr`
```  if (!LHS || !RHS) {
    Expr *Pack = LHS ? LHS : RHS;
    assert(Pack && "fold expression with neither LHS nor RHS");
    DiscardOperands();
    if (!Pack->containsUnexpandedParameterPack())
      return Diag(EllipsisLoc, diag::err_pack_expansion_without_parameter_packs)
             << Pack->getSourceRange();
  }
```
`DiscardOperands` will be triggered when LHS/RHS is delayed typo correction expression.
It will output and clean all diagnose but still return a valid expression. (in else branch)
valid expression will be handled in caller function. When caller wants to output the diagnose, the diagnose in delayed typo correction expression has been consumed in `ActOnCXXFoldExpr`. It causes clang crash.

Reviewed By: erichkeane

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

16 months ago[StandardInstrumentations][NFC] Minor code cleanup
Arthur Eubanks [Tue, 14 Mar 2023 17:04:16 +0000 (10:04 -0700)]
[StandardInstrumentations][NFC] Minor code cleanup

16 months ago[LLVM] Remove support for constant scalable vector GEPs.
Paul Walker [Mon, 27 Feb 2023 20:16:07 +0000 (20:16 +0000)]
[LLVM] Remove support for constant scalable vector GEPs.

This work has fallen out from D134648 as a requirement to loosen
the "constness" of vscale.

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

16 months agoRevert "[InstCombine] Return instruction from replaceUse()"
Nikita Popov [Tue, 14 Mar 2023 16:45:38 +0000 (17:45 +0100)]
Revert "[InstCombine] Return instruction from replaceUse()"

This reverts commit 27c4e233104ba765cd986b3f8b0dcd3a6c3a9f89.

I think I made a mistake with the use in RemoveConditionFromAssume(),
because the instruction being changed is not the current one, but
the next assume. Revert the change for now.

16 months ago[RISCV][NFC] Small refactor in RISCVISAInfo::parseArchString
Alex Bradbury [Tue, 14 Mar 2023 16:36:16 +0000 (16:36 +0000)]
[RISCV][NFC] Small refactor in RISCVISAInfo::parseArchString

Slightly refactor handling of version extraction for the 'baseline' ISA,
to make an upcoming patch easier to review.

16 months ago[CoroCleanup] Invalidate analyses on changed functions before running SimplifyCFG
Arthur Eubanks [Tue, 14 Mar 2023 16:32:49 +0000 (09:32 -0700)]
[CoroCleanup] Invalidate analyses on changed functions before running SimplifyCFG

Or else the sub-FunctionPassManager may see out of date analyses.

16 months ago[libc++][CI] Improves Dockerfile
Mark de Wever [Wed, 22 Feb 2023 18:48:01 +0000 (19:48 +0100)]
[libc++][CI] Improves Dockerfile

- Remove temporary apt files
- Removes LLVM16 TODO

Reviewed By: #libc, ldionne

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

16 months ago[libc++] Qualifies uint32_t and friends.
Mark de Wever [Sun, 12 Mar 2023 16:11:29 +0000 (17:11 +0100)]
[libc++] Qualifies uint32_t and friends.

This has been done using the following command
  find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)(?<!::u)u?int(_[a-z]+)?[0-9]{1,2}_t)|\1std::\2|' \{} \;

And manually removed some false positives in std/depr/depr.c.headers.

Reviewed By: ldionne, #libc

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

16 months ago[AssumeBundleBuilder] Fix PreservedAnalyses reporting
Arthur Eubanks [Tue, 14 Mar 2023 16:22:38 +0000 (09:22 -0700)]
[AssumeBundleBuilder] Fix PreservedAnalyses reporting

These weren't properly reporting changes.

16 months agoRevert "[Flang][OpenMP] Add support for OpenMP max reduction"
Kiran Chandramohan [Tue, 14 Mar 2023 16:26:58 +0000 (16:26 +0000)]
Revert "[Flang][OpenMP] Add support for OpenMP max reduction"

Reverting to fix a buildbot failure.

This reverts commit a7d80f43cb8d3a2deb09f57d0904732d40020752.

16 months ago[gn build] Fix gn build
Arthur Eubanks [Tue, 14 Mar 2023 16:21:20 +0000 (09:21 -0700)]
[gn build] Fix gn build

16 months ago[OpenMP]Skip generating this[:1] map info for non-member variable.
Jennifer Yu [Mon, 13 Mar 2023 21:12:06 +0000 (14:12 -0700)]
[OpenMP]Skip generating this[:1] map info for non-member variable.

My change of D14093 is only fixed problem for "pragma target data".

The problem still here for "pragma target"
what I am missing is:
When processing "pragma target data", the VD is passed when call to
emitCombinedEntry, so check VD is null as map for this pointer.

But when processing "pragma target" the VD is passed as nullptr, so
check VD is null is not working.

To fix this I add a new parameter IsMapThis. During the call to
emitCombinedEntry passes true if it is capturing this pointer and use
that instead check of "!VD".

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

16 months ago[RISCV][test][llvm-objdump] Add test cases for objdump's handling of RISCV arch attri...
Alex Bradbury [Tue, 14 Mar 2023 16:05:14 +0000 (16:05 +0000)]
[RISCV][test][llvm-objdump] Add test cases for objdump's handling of RISCV arch attributes

In preparation for a follow-up patch to adjust the policy. The error for
an unrecognized version of the base ISA is particularly problematic, as
binaries produced from a current GCC are rejected.

The testing approach is modeled on the riscv-attributes.s file in
lld/test/ELF.

16 months ago[Flang][OpenMP] Add support for OpenMP max reduction
Kiran Chandramohan [Tue, 14 Mar 2023 15:26:24 +0000 (15:26 +0000)]
[Flang][OpenMP] Add support for OpenMP max reduction

This patch adds support for reduction of max-intrinsic for scalar
types. Max is lowered as a compare-select in the default lowering
flow for Flang. This pattern is matched and replaced with the
OpenMP dialect reduction operation.

Note: This is a temporary flow. The plan is to move to a flow where
the OpenMP reduction operation is inserted during lowering.

Reviewed By: do

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

16 months ago[Pipeline] Move some GlobalOpt/GlobalDCE runs into simplification pipeline
Arthur Eubanks [Mon, 13 Mar 2023 17:45:32 +0000 (10:45 -0700)]
[Pipeline] Move some GlobalOpt/GlobalDCE runs into simplification pipeline

These are very clearly more simplification than optimization.

Mostly NFC, except for some ordering around passes that don't really matter.

Reviewed By: nikic

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

16 months ago[Pipelines] Restore old DAE position in LTO pipeline
Nikita Popov [Tue, 14 Mar 2023 14:26:41 +0000 (15:26 +0100)]
[Pipelines] Restore old DAE position in LTO pipeline

This is a partial revert of D128830, restoring the previous
position of DeadArgElim in the fat LTO pipeline. The motivation
for this is a major code size regression observed in Rust and
illustrated in the PhaseOrdering test.

This is a conservative fix restoring the previous pipeline order.
The real problem is that the LTO pipeline is conceptually broken:
It doesn't have a CGSCC function simplification pipeline. The
inliner is just being run by itself. This wouldn't be a problem
if fat LTO used a standard design where ArgPromotion and DAE are
only run after functions have already been simplified by the
CGSCC inliner pipeline.

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

16 months ago[mlir] relax value handle updates when operation is replaced
Alex Zinenko [Fri, 3 Mar 2023 17:23:00 +0000 (17:23 +0000)]
[mlir] relax value handle updates when operation is replaced

The initial implementaiton of value handle update when the payload
operation defining the values associated with value handles was being
replaced required the replacement operation to have the same number of
results. This is not strictly necessary. The replacement operation may
have more results, or less results provided that there are no handles to
the results that have no equivalent in the replacement op.

Reviewed By: springerm

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

16 months ago[InstCombine] Return instruction from replaceUse()
Nikita Popov [Tue, 14 Mar 2023 15:50:31 +0000 (16:50 +0100)]
[InstCombine] Return instruction from replaceUse()

Same as with other replacement methods, it's generally necessary
to report a change on the instruction itself, e.g. by returning
it from the visit method (or possibly explicitly adding it to the
worklist).

Return Instruction * from replaceUse() to encourage the usual
"return replaceXYZ" pattern.

16 months ago[AIX] change "llvm-ar" to "env OBJECT_MODE=any llvm-ar" in clang/test for AIX OS
zhijian [Tue, 14 Mar 2023 15:50:20 +0000 (11:50 -0400)]
[AIX] change "llvm-ar" to "env OBJECT_MODE=any llvm-ar" in clang/test for AIX OS

Summary:

In patch https://reviews.llvm.org/D127864. we add a new option -X for AIX OS, and default value is -X32. In order not effect the test cases in clang/test. we need to change "llvm-ar" to "env OBJECT_MODE=any llvm-ar" in clang/test for AIX OS

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

16 months ago[InstCombine] Fix infinite combine loop (PR61361)
Nikita Popov [Tue, 14 Mar 2023 15:41:36 +0000 (16:41 +0100)]
[InstCombine] Fix infinite combine loop (PR61361)

In the degenerate case where the select is fed by an unsimplified
icmp with two constant operands, don't try to replace one constant
with another. Wait for the icmp to be simplified first instead.

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

16 months agoRemove an unused private data member; NFC
Aaron Ballman [Tue, 14 Mar 2023 15:31:45 +0000 (11:31 -0400)]
Remove an unused private data member; NFC

16 months ago[libc] Set the stub filename to the target name instead of the source
Joseph Huber [Tue, 14 Mar 2023 15:27:09 +0000 (10:27 -0500)]
[libc] Set the stub filename to the target name instead of the source

The GPU target requires some weird special case handling to create fat
binaries. CMake offers no way to set the name of an object library. The
only way to do this is to create a file with the desired name and use
that. Currently we name it after the source filename. However, this
breaks if there is more than a single source. This patch changes the
logic to instead look up the object target name and use that. E.g.
`src.__support.OSUtil.osutil` will be `osutil.cpp`.

Reviewed By: sivachandra

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

16 months ago[X86] Add test coverage for D137388
Simon Pilgrim [Tue, 14 Mar 2023 15:26:35 +0000 (15:26 +0000)]
[X86] Add test coverage for D137388

Issue #58914 reported an example of the TwoAddressInstruction crash that was fixed (without test case) in D137388

16 months ago[Docs] Added llvm-reduce docs in CommandGuide
aabhinavg [Tue, 14 Mar 2023 08:19:24 +0000 (13:49 +0530)]
[Docs] Added llvm-reduce docs in CommandGuide

[Docs] Added llvm-reduce docs in CommandGuide

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

16 months ago[DAG] Match select(icmp(x,y),sub(x,y),sub(y,x)) -> abd(x,y) patterns
Simon Pilgrim [Tue, 14 Mar 2023 15:10:24 +0000 (15:10 +0000)]
[DAG] Match select(icmp(x,y),sub(x,y),sub(y,x)) -> abd(x,y) patterns

Pulled out of PowerPC, and added ABDS support as well (hence the additional v4i32 PPC matches)

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

16 months agoFix false positive with unreachable C++ catch handlers
Aaron Ballman [Tue, 14 Mar 2023 15:07:14 +0000 (11:07 -0400)]
Fix false positive with unreachable C++ catch handlers

This addresses an issue found by WG21 and tracked by CWG2699 (which is
not yet publicly published). The basic problem is that Clang issues a
diagnostic about not being able to reach a handler, but that handler
*is* reached at runtime. Clang's diagnostic behavior was matching the
standard wording, and our runtime behavior was matching the standard's
intent.

This fixes the diagnostic so that it matches the runtime behavior more
closely, and reduces the number of false positives. This is the
direction of choice taken by Core for CWG2699 and it seems unlikely
that WG21 will change direction here.

Fixes https://github.com/llvm/llvm-project/issues/61177
Differential Revision: https://reviews.llvm.org/D145408

16 months ago[CodeGen] Use *{Set,Map}::contains (NFC)
Kazu Hirata [Tue, 14 Mar 2023 15:07:42 +0000 (08:07 -0700)]
[CodeGen] Use *{Set,Map}::contains (NFC)

16 months ago[mlir][vector] Clarify OOB semantics of remaining load/store ops
Jakub Kuderski [Tue, 14 Mar 2023 15:01:13 +0000 (11:01 -0400)]
[mlir][vector] Clarify OOB semantics of remaining load/store ops

This is a follow up for https://reviews.llvm.org/D145824 that clarifies
the out-of-bounds behavior for other masked load/store ops. It uses the
same wording and informal semantics syntax as `gather` and `scatter`.

Issue: https://github.com/llvm/llvm-project/issues/60905

Reviewed By: aartbik

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

16 months ago[flang] Handle parent component on the LHS of intrinsic assignment
Valentin Clement [Tue, 14 Mar 2023 15:01:36 +0000 (16:01 +0100)]
[flang] Handle parent component on the LHS of intrinsic assignment

When the LHS is referring to a parent component the box need to be
reboxed to the parent component type so the runtime can handle the
assignment correctly.

Reviewed By: PeteSteinfeld

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

16 months ago[OpenMP][libomptarget][NFC] Add documentation regarding NextGen plugins
Kevin Sala [Tue, 28 Feb 2023 16:20:21 +0000 (17:20 +0100)]
[OpenMP][libomptarget][NFC] Add documentation regarding NextGen plugins

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

16 months ago[mlir][vector] Add gather lowering patterns
Jakub Kuderski [Tue, 14 Mar 2023 14:48:13 +0000 (10:48 -0400)]
[mlir][vector] Add gather lowering patterns

This is for targets that do not support gather-like ops, e.g., SPIR-V.

Gather is expanded into lower-level vector ops with memory accesses
guarded with `scf.if`.

I also considered generating `vector.maskedload`s, but decided against
it to keep the `memref` and `tensor` codepath closer together. There's a
good chance that if a target doesn't support gather it does not support
masked loads either.

Issue: https://github.com/llvm/llvm-project/issues/60905

Reviewed By: ThomasRaoux

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

16 months agollvm/test/TableGen/intrinsic-pointer-to-any.td: Rework D125247.
NAKAMURA Takumi [Tue, 14 Mar 2023 13:25:31 +0000 (22:25 +0900)]
llvm/test/TableGen/intrinsic-pointer-to-any.td: Rework D125247.

It should've updated the number of `def i8 : ValueType<8, 3>;` to `5`,
since it renumbered ValueTypes.

FYI, the number 3 is `i2` and `IIT_I2(57)` was chosen in IntrinsicEmitter.

16 months ago[DAG] Fold (bitcast (logicop (bitcast x), (c))) -> (logicop x, (bitcast c)) iff the...
Simon Pilgrim [Tue, 14 Mar 2023 14:41:11 +0000 (14:41 +0000)]
[DAG] Fold (bitcast (logicop (bitcast x), (c))) -> (logicop x, (bitcast c)) iff the current logicop type is illegal

Try to remove extra bitcasts around logicops if we're dealing with illegal types

Fixes the regressions in D145939

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

16 months ago[X86] Fix typo in vXi64 ABDS/ABDU test cases
Simon Pilgrim [Tue, 14 Mar 2023 14:32:05 +0000 (14:32 +0000)]
[X86] Fix typo in vXi64 ABDS/ABDU test cases

The select operands were commuted preventing D144789 from folding

16 months ago[libc] Remove dummy archive and file from integration test
Joseph Huber [Tue, 14 Mar 2023 13:15:20 +0000 (08:15 -0500)]
[libc] Remove dummy archive and file from integration test

This doesn't seem to be used anymore after recent changes that removed
the `--sysroot` method for the integration tests.

Reviewed By: sivachandra, lntue

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

16 months ago[lldb] Fix -Wswitch in TypeSystemClang.cpp ('SveBoolx2' and 'SveBoolx4' not handled...
Jie Fu [Tue, 14 Mar 2023 14:24:37 +0000 (22:24 +0800)]
[lldb] Fix -Wswitch in TypeSystemClang.cpp ('SveBoolx2' and 'SveBoolx4' not handled in switch) (NFC)

/data/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4859:13: error: enumeration values 'SveBoolx2' and 'SveBoolx4' not handled in switch [-Werror,-Wswitch]
    switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind()) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

16 months ago[PhaseOrdering] Add test for DAE/GlobalDCE interaction (NFC)
Nikita Popov [Tue, 14 Mar 2023 14:19:02 +0000 (15:19 +0100)]
[PhaseOrdering] Add test for DAE/GlobalDCE interaction (NFC)

16 months ago[libclang] No longer attempt to get a dependent bit-width
Collin Baker [Tue, 14 Mar 2023 13:57:44 +0000 (09:57 -0400)]
[libclang] No longer attempt to get a dependent bit-width

Handle template parameter-dependent bit field widths in libclang

In a class template, a bit field's width may depend on a template
parameter. In this case the width expression cannot be evaluated.

Previously clang_getFieldDeclBitWidth() would assert, or cause memory
unsafety and return an invalid result if assertions are disabled.

This adds a check for this case which returns an error code.

This work was largely taken from an earlier patch which was reverted
due to an accidental API duplication
(https://reviews.llvm.org/D130303).

Fixes: https://github.com/llvm/llvm-project/issues/56644
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Differential Revision: https://reviews.llvm.org/D146039

16 months ago[TTI] Treat AND/OR with widenable conditions as free of cost
Max Kazantsev [Tue, 14 Mar 2023 13:26:29 +0000 (20:26 +0700)]
[TTI] Treat AND/OR with widenable conditions as free of cost

Because widenable conditions with eventually lower into a constant, such instructions
as `and`, `or` etc. will also be optimized away. Treat them as free.

This is an important thing to have if we want that guards represented as experimental.guard
calls and in their explicit form (branch by `and` with widenable condition) have the same cost
for unroller and other passes like this.

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

16 months agoReland: [DAG/AMDGPU] Use UniformityAnalysis in DAGISel
pvanhout [Mon, 13 Mar 2023 10:33:15 +0000 (11:33 +0100)]
Reland: [DAG/AMDGPU] Use UniformityAnalysis in DAGISel

Switch DAGISel over to UniformityAnalysis, which was one of the last remaining users of the DivergenceAnalysis.
No explosions seen during internal testing so this looks like a smooth transition.

Reviewed By: sameerds

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

16 months ago[SLP]Fix PR61395: need to adjust vector factor after emitting shuffle
Alexey Bataev [Tue, 14 Mar 2023 12:29:01 +0000 (05:29 -0700)]
[SLP]Fix PR61395: need to adjust vector factor after emitting shuffle
operation for combined entries.

The vector factor after combining of the shuffle entries is defined by
the size of the mask, not by the vector factors  of the original
entries. So, need to adjust it to emit correct code.

16 months ago[libc] Correctly pass the compile options to the internal GPU compilation
Joseph Huber [Tue, 14 Mar 2023 13:18:22 +0000 (08:18 -0500)]
[libc] Correctly pass the compile options to the internal GPU compilation

Summary:
We use an internal option to create the GPU binary used for testing.
This wasn't getting the proper flags passed to it due to a missing
variable name.

16 months ago[NFC][OHOS] Temporarily switch off tests for windows
Pavel Kosov [Tue, 14 Mar 2023 13:14:47 +0000 (16:14 +0300)]
[NFC][OHOS] Temporarily switch off tests for windows

16 months ago[AMDGPU] Don't run `llc-pipeline.ll` when expensive_checks are enabled
pvanhout [Tue, 14 Mar 2023 12:49:29 +0000 (13:49 +0100)]
[AMDGPU] Don't run `llc-pipeline.ll` when expensive_checks are enabled

AMDGPU ISel can add extra passes when expensive checks are enabled. This means the pipeline can be reordered and the checks may fail.

Reviewed By: arsenm

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

16 months ago[reland][libc][NFC] Move memcmp implementations in subfolders
Guillaume Chatelet [Tue, 14 Mar 2023 12:46:21 +0000 (12:46 +0000)]
[reland][libc][NFC] Move memcmp implementations in subfolders

16 months agoRevert "[libc][NFC] Move memcmp implementations in subfolders"
Guillaume Chatelet [Tue, 14 Mar 2023 13:00:07 +0000 (13:00 +0000)]
Revert "[libc][NFC] Move memcmp implementations in subfolders"

this broke arm32 build bots
This reverts commit 7f20e2a8d2ba73a8b05742903f4ae42afec82bff.

16 months agoRevert "Fix include order in CXType.cpp"
Aaron Ballman [Tue, 14 Mar 2023 12:57:25 +0000 (08:57 -0400)]
Revert "Fix include order in CXType.cpp"

This reverts commit 4d55a0b512a17dfaa2461b8803d37b79f6c9691d.

The addition of clang_isBitFieldDecl is not needed because
clang_Cursor_isBitField already exists.

16 months ago[mlir][Bazel] Adjust build after aafb52d7c9226cd9925bd5135309bd02b6e3b59d
Adrian Kuegel [Tue, 14 Mar 2023 12:54:01 +0000 (13:54 +0100)]
[mlir][Bazel] Adjust build after aafb52d7c9226cd9925bd5135309bd02b6e3b59d

16 months ago[flang] Handle mismatches of procedure type args
Leandro Lupori [Fri, 3 Mar 2023 12:49:23 +0000 (12:49 +0000)]
[flang] Handle mismatches of procedure type args

Fortran allows type mismatch when passing actual arguments to
procedures and most cases were already being handled correctly by
Flang. However, conversion of data types to and from procedures and
conversion between procedures and char procedures were not always
handled properly. The missing cases were added and these
conversions are supported now.

Fixes #60550

Reviewed By: jeanPerier

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

16 months ago[clang][sema][NFC] Make a few functions const
Timm Bäder [Thu, 9 Mar 2023 17:55:25 +0000 (18:55 +0100)]
[clang][sema][NFC] Make a few functions const

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

16 months ago[mlir][Bazel] Adjust build after 0fa20ecafe0c3c7ffde413800eb4b1551b432273
Adrian Kuegel [Tue, 14 Mar 2023 12:45:53 +0000 (13:45 +0100)]
[mlir][Bazel] Adjust build after 0fa20ecafe0c3c7ffde413800eb4b1551b432273

16 months ago[libc][NFC] Move memcmp implementations in subfolders
Guillaume Chatelet [Tue, 14 Mar 2023 12:46:21 +0000 (12:46 +0000)]
[libc][NFC] Move memcmp implementations in subfolders

16 months ago[RISCV] Reject 'g' with explicit version in parseArchString
Alex Bradbury [Tue, 14 Mar 2023 12:46:13 +0000 (12:46 +0000)]
[RISCV] Reject 'g' with explicit version in parseArchString

There is no versioning scheme for the 'g' shorthand for imafd (or in
current ISA specs, imafd_zifencei_zicsr). As such, the only sensible
behaviour to me seems to be to reject a version for it.

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

16 months ago[clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute
Takuya Shimizu [Tue, 14 Mar 2023 12:43:35 +0000 (08:43 -0400)]
[clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

This patch checks whether -Wunreachable-code-fallthrough is enabled
when clang encounters unreachable fallthrough attributes and, if so,
suppresses code will never be executed warning to avoid duplicate
warnings.

Fixes https://github.com/llvm/llvm-project/issues/60416
Differential Revision: https://reviews.llvm.org/D145842