platform/upstream/llvm.git
20 months ago[clang][Interp][NFC] Add Record::getName()
Timm Bäder [Wed, 26 Oct 2022 09:24:41 +0000 (11:24 +0200)]
[clang][Interp][NFC] Add Record::getName()

Useful for debugging.

20 months ago[DAG] visitFSUBForFMACombine - pass callbacks by reference in isContractableAndReasso...
Simon Pilgrim [Fri, 28 Oct 2022 10:48:33 +0000 (11:48 +0100)]
[DAG] visitFSUBForFMACombine - pass callbacks by reference in isContractableAndReassociableFMUL lambda capture. NFC.

Fixes a coverity remark about large copies by value

20 months ago[LLD] [COFF] Include "rust_eh_personality" among the known personality functions
Martin Storsjö [Thu, 27 Oct 2022 19:48:24 +0000 (22:48 +0300)]
[LLD] [COFF] Include "rust_eh_personality" among the known personality functions

These need to have special treatment wrt to .eh_frame sections
and GC - as long as we don't have a full parser of the .eh_frame
section in the COFF linker.

This fixes Rust unwind issues on i686 mingw as discussed in
https://github.com/msys2/MINGW-packages/issues/9091.

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

20 months ago[lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docs
Michael Buch [Wed, 26 Oct 2022 13:40:34 +0000 (14:40 +0100)]
[lldb][Docs][NFC] Fix sphinx warnings/errors for LLDB docs

Ran `ninja docs-lldb-html` and made sure the docs are fixed.

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

20 months agoRecommit: [FuncSpec][NFC] Refactor finding specialisation opportunities
Momchil Velikov [Fri, 28 Oct 2022 09:36:47 +0000 (10:36 +0100)]
Recommit: [FuncSpec][NFC] Refactor finding specialisation opportunities

[recommitting after recommitting a dependency]

This patch reorders the traversal of function call sites and function
formal parameters to:

* do various argument feasibility checks (`isArgumentInteresting` )
  only once per argument, i.e. doing N-args checks instead of
  N-calls x  N-args checks.

* do hash table lookups only once per call site, i.e. N-calls
  lookups/inserts instead of N-call x N-args lookups/inserts.

Reviewed By: ChuanqiXu, labrinea

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

Change-Id: I7d21081a2479cbdb62deac15f903d6da4f3b8529

20 months agoConstraintElimination - pass const DataLayout by reference in (recursive) MergeResult...
Simon Pilgrim [Fri, 28 Oct 2022 10:19:53 +0000 (11:19 +0100)]
ConstraintElimination - pass const DataLayout by reference in (recursive) MergeResults lambda capture. NFC.

There's no need to copy this and fixes a coverity remark about large copy by value

20 months ago[AMDGPU] Regenerate checks in waitcnt-overflow.mir. NFC.
Jay Foad [Fri, 28 Oct 2022 10:17:21 +0000 (11:17 +0100)]
[AMDGPU] Regenerate checks in waitcnt-overflow.mir. NFC.

20 months agoIndirectBrExpandPass - remove unused DL from lambda capture. NFC.
Simon Pilgrim [Fri, 28 Oct 2022 10:05:26 +0000 (11:05 +0100)]
IndirectBrExpandPass - remove unused DL from lambda capture. NFC.

Oddly I wasn't seeing an unused variable warning - this came up in a coverity remark about large copy by values!

20 months ago[AMDGPU] Small cleanups in wait counter code
Stephen Thomas [Fri, 28 Oct 2022 09:59:03 +0000 (10:59 +0100)]
[AMDGPU] Small cleanups in wait counter code

A small number of cleanups and refactors intended to enhance readability in
two passes that deal with s_waitcnt instructions.

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

20 months ago[mlir][aarch64] XFAIL correctness.mlir
Andrzej Warzynski [Fri, 21 Oct 2022 15:27:57 +0000 (15:27 +0000)]
[mlir][aarch64] XFAIL correctness.mlir

There are some discrepancies between the expected and the generated
output on AArch64 for this test. I reported these on GitHub:
  * https://github.com/llvm/llvm-project/issues/58531
I'm XFAILing this test as a temporary measure while this is being
investigated.

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

20 months agoRevert "[clang] Instantiate NTTPs and template default arguments with sugar"
Haojian Wu [Fri, 28 Oct 2022 09:36:02 +0000 (11:36 +0200)]
Revert "[clang] Instantiate NTTPs and template default arguments with sugar"

This patch reverts
- commit d4b1964f0554046b1e64908e5c1cd701b25f4c9e
- commit 59f0827e2cf3755834620e7e0b6d946832440f80([clang] Instantiate alias templates with sugar)

As it makes clang fail to pass some code it used to compile.
See comments: https://reviews.llvm.org/D136564#3891065

20 months ago[LoongArch] Add emergency spill slot for GPR for large frames
wanglei [Fri, 28 Oct 2022 09:49:47 +0000 (17:49 +0800)]
[LoongArch] Add emergency spill slot for GPR for large frames

An emergency spill slot is created when the stack size cannot be
represented by an 11-bit signed number.

This patch also modifies how the `sp` is adjusted in the prologue.

`RegScavenger` will place the spill instruction before the prologue
if a VReg is created in the prologue. This will pollute the caller's
stack data. Therefore, until there is better way, we just use the
`addi.w/d` instruction for stack adjustment to ensure that VReg will
not be created. (RISCV has the same issue #58286)

Due to the addition of emergency spill slot, some test cases that use
exact stacksize need to be updated.

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

20 months ago[AMDGPU] Clean up calls to MachineOperand::setIsDead and friends. NFC.
Jay Foad [Thu, 27 Oct 2022 14:05:35 +0000 (15:05 +0100)]
[AMDGPU] Clean up calls to MachineOperand::setIsDead and friends. NFC.

20 months agoRevert "Revert "[mlir][linalg] Add nicer builders for `map` and `reduce`.""
Oleg Shyshkov [Fri, 28 Oct 2022 09:31:58 +0000 (11:31 +0200)]
Revert "Revert "[mlir][linalg] Add nicer builders for `map` and `reduce`.""

This reverts commit 7eef3ea5f4fe4f4cc461b191bac031e3962d0347.

20 months ago[mlir][linalg] Fix linalg.transpose region builder.
Oleg Shyshkov [Fri, 28 Oct 2022 08:29:01 +0000 (10:29 +0200)]
[mlir][linalg] Fix linalg.transpose region builder.

The region should yield the first argument (input) not the last argument
(output). Also fix a few tests that were affected by this bug.

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

20 months ago[InstCombine] Don't change switch table from desirable to illegal types
David Green [Fri, 28 Oct 2022 09:15:41 +0000 (10:15 +0100)]
[InstCombine] Don't change switch table from desirable to illegal types

In InstCombine we treat i8/i16 as desirable, even if they are not legal.
The current logic in shouldChangeType will decide to convert from an
illegal but desirable type (such as an i8) to an illegal and undesirable
type (such as i3). This patch prevents changing the switch conditions to
an irregular type on like Arm/AArch64 where i8/i16 are not legal.

This is the same issue as https://reviews.llvm.org/D54115. In the case I
was looking it is was converting an i32 switch to an i8 switch, which
then became a i3 switch.

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

20 months ago[Clang] Improve diagnostic message for loop hint pragma
eopXD [Thu, 27 Oct 2022 07:42:46 +0000 (00:42 -0700)]
[Clang] Improve diagnostic message for loop hint pragma

Originally the loop hint is not displayed correctly in the diagnostic.
This patch fixes it.

Reviewed By: Meinersbur

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

20 months ago[LoongArch] Split SP adjustment
wanglei [Fri, 28 Oct 2022 08:18:40 +0000 (16:18 +0800)]
[LoongArch] Split SP adjustment

This patch split the SP adjustment to reduce the instructions in
prologue and epilogue. In this way, the offset of the callee saved
register could fit in a single store.

Similar to D68011(RISCV).

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

20 months ago[mlir][gpu] Unroll ops on vectors which map to intrinsic calls
Christian Sigg [Thu, 27 Oct 2022 08:08:52 +0000 (10:08 +0200)]
[mlir][gpu] Unroll ops on vectors which map to intrinsic calls

Unroll ops that map to intrinsics when lowering to LLVM, because intrinsics don't support vector operands/results.

Reviewed By: herhut

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

20 months agoRevert "[AArch64] Adjust operand sequence for Add+Sub to combine more inline shift"
chenglin.bi [Fri, 28 Oct 2022 08:30:14 +0000 (16:30 +0800)]
Revert "[AArch64] Adjust operand sequence for Add+Sub to combine more inline shift"

This reverts commit ada9ab610727917561370e976eaea26dbbc20cce.

20 months ago[ARM] Use DefaultAttrsIntrinsics
Nikita Popov [Wed, 26 Oct 2022 11:05:20 +0000 (13:05 +0200)]
[ARM] Use DefaultAttrsIntrinsics

Use DefaultAttrsIntrinsics for most ARM intrinsics. This adds the
WillReturn, NoSync, NoFree and NoCallback attributes and is needed
to avoid regressions in the future.

I've switched to DefaultAttrIntrinsics for everything doing arithmetic
and load/store. I've left some TODOs in cases where all DefaultsAttrs
are not correct (e.g. ldrex etc are clearly not nosync) or it wasn't
entirely obvious to me (e.g. stuff interacting with a coprocessor).

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

20 months agoRevert "[mlir][linalg] Add nicer builders for `map` and `reduce`."
Oleg Shyshkov [Fri, 28 Oct 2022 07:56:59 +0000 (09:56 +0200)]
Revert "[mlir][linalg] Add nicer builders for `map` and `reduce`."

This reverts commit aebde280476943e58f5bcd9993fdd7e36cdbe47e.

20 months ago[StructurizeCFG][DebugInfo] Maintain DILocations in the branches created by Structuri...
Juan Manuel MARTINEZ CAAMAÑO [Wed, 26 Oct 2022 08:57:36 +0000 (03:57 -0500)]
[StructurizeCFG][DebugInfo] Maintain DILocations in the branches created by StructurizeCFG

Make StructurizeCFG preserve the debug locations of the branch instructions it introduces.

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

20 months ago[flang] Fix building against clang dylib
Michał Górny [Mon, 24 Oct 2022 13:50:41 +0000 (15:50 +0200)]
[flang] Fix building against clang dylib

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

20 months ago[AArch64][SME] Set fn attributes correctly on __arm_tpidr2_save call.
Sander de Smalen [Fri, 28 Oct 2022 07:08:08 +0000 (07:08 +0000)]
[AArch64][SME] Set fn attributes correctly on __arm_tpidr2_save call.

Changing the way the attribute is created changes the way the attribute
is added. Now it seems to be correctly added as a function attribute, whereas
before it was not. This led ISel ignoring attributes and setting up a lazy-save
buffer for the call to __arm_tpidr2_save.

This patch also marks the intrinsic call as 'preserves_za' which together with the
above prevents the code-generator from setting up a lazy-save buffer.

Reviewed By: kmclaughlin

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

20 months ago[lldb/qemu] Stub out process info functions
Pavel Labath [Fri, 28 Oct 2022 07:04:14 +0000 (09:04 +0200)]
[lldb/qemu] Stub out process info functions

These functions return the information about the host process (so they
show the executable as "qemu" and have the "wrong" architecture), which
isn't useful and can confuse lldb.

We could theoretically try to identify which host processes are running
an emulator, and translate the process information, but that would be
tricky to implement, and the usefulness of it would be fairly limited as
qemu does not support attaching to a running process.

20 months agoRevert "[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset"
Valery Pykhtin [Fri, 28 Oct 2022 07:15:37 +0000 (09:15 +0200)]
Revert "[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset"

This reverts commit fecf067db40ffa1a6d5d665769c90cd29547f502.

The change introduces 420 test failures with EXPENSIVE_CHECK in AMDGPU which I don't want to disable.
Going to fix the failures and recommit the check.

20 months ago[AArch64][SVE2] Add the SVE2.1 extract-and-narrow instructions
David Sherwood [Wed, 19 Oct 2022 14:29:51 +0000 (14:29 +0000)]
[AArch64][SVE2] Add the SVE2.1 extract-and-narrow instructions

This patch adds the assembly/disassembly for the following instructions:

sqcvtn  : Signed saturating extract narrow and interleave
sqcvtun : Signed saturating unsigned extract narrow and interleave
uqcvtn  : Unsigned saturating extract narrow and interleave

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

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

20 months ago[mlir][linalg] Add nicer builders for `map` and `reduce`.
Oleg Shyshkov [Thu, 27 Oct 2022 18:48:04 +0000 (20:48 +0200)]
[mlir][linalg] Add nicer builders for `map` and `reduce`.

The new builders get a list of additional attrs, a lambda to build the region
body and infer return types from `init`.

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

20 months ago[llvm] [cmake] Silence GNUInstallDirs warning in LLVMInstallSymlink
Michał Górny [Mon, 24 Oct 2022 04:58:55 +0000 (06:58 +0200)]
[llvm] [cmake] Silence GNUInstallDirs warning in LLVMInstallSymlink

Set a dummy CMAKE_INSTALL_LIBDIR in order to silence the following CMake
warning when executing LLVMInstallSymlink.cmake script:

    CMake Warning (dev) at /usr/share/cmake/Modules/GNUInstallDirs.cmake:243 (message):
      Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
      target architecture is known.  Please enable at least one language before
      including GNUInstallDirs.
    Call Stack (most recent call first):
      /usr/lib/llvm/16/lib64/cmake/llvm/LLVMInstallSymlink.cmake:5 (include)
      tools/lld/cmake_install.cmake:66 (include)
      cmake_install.cmake:52 (include)

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

20 months agoHarmonize cmake_policy() across standalone builds of all projects
Michał Górny [Mon, 24 Oct 2022 04:31:37 +0000 (06:31 +0200)]
Harmonize cmake_policy() across standalone builds of all projects

Move `cmake_policy()` settings from `llvm/CMakeLists.txt` into a shared
`cmake/modules/CMakePolicy.cmake`.  Include it from all relevant
projects that support standalone builds, in order to ensure that
the policies are consistently set whether they are built in-tree
or stand-alone.

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

20 months ago[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset
Valery Pykhtin [Thu, 27 Oct 2022 07:06:27 +0000 (09:06 +0200)]
[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset

This would check if passed in live-ins registers match those calculated using LIS.

This check currently breaks 420 lit tests when enabled.

Reviewed By: arsenm

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

20 months ago[DAGCombiner] Use `getAnyExtOrTrunc` instead of TRUNCATE in ExtractVectorElt combine
Pierre van Houtryve [Fri, 28 Oct 2022 06:28:35 +0000 (06:28 +0000)]
[DAGCombiner] Use `getAnyExtOrTrunc` instead of TRUNCATE in ExtractVectorElt combine

ScalarVT isn't guaranteed to be smaller than the BCSrc.

Reviewed By: arsenm

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

20 months ago[flang] Carry polymoprhic dynamic type when using coordinate_of polymoprhic array
Valentin Clement [Fri, 28 Oct 2022 06:30:53 +0000 (08:30 +0200)]
[flang] Carry polymoprhic dynamic type when using coordinate_of polymoprhic array

Dynamic type of a polymorphic array element was retrieved by finding the
coordinate operation and use the base array. This patch remove this hack and use
the newly PolymorphicValue to carray the dynamic type together with the element.
The patch also rearrange some tests in the `allocatable-polymorphic.f90`.

Depends on D136824

Reviewed By: PeteSteinfeld

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

20 months ago[1b/3][ASan][compiler-rt] API for annotating objects memory
Advenam Tacet [Fri, 28 Oct 2022 05:14:14 +0000 (22:14 -0700)]
[1b/3][ASan][compiler-rt] API for annotating objects memory

This revision is a part of a series of patches extending AddressSanitizer C++ container overflow detection capabilities by adding annotations, similar to those existing in std::vector, to std::string and std::deque collections. These changes allow ASan to detect cases when the instrumented program accesses memory which is internally allocated by the collection but is still not in-use (accesses before or after the stored elements for std::deque, or between the size and capacity bounds for std::string).

The motivation for the research and those changes was a bug, found by Trail of Bits, in a real code where an out-of-bounds read could happen as two strings were compared via a std::equals function that took iter1_begin, iter1_end, iter2_begin iterators (with a custom comparison function). When object iter1 was longer than iter2, read out-of-bounds on iter2 could happen. Container sanitization would detect it.

This revision extends a compiler-rt ASan sanitization API function sanitizer_annotate_contiguous_container used to sanitize/annotate containers like std::vector to support different allocators and situations when granules are shared between objects. Those changes are necessary to support annotating objects' self memory (in contrast to annotating memory allocated by an object) like short std::basic_string (with short string optimization). That also allows use of non-standard memory allocators, as alignment requirement is no longer necessary.

This also updates an API function to verify if a double ended contiguous container is correctly annotated (__sanitizer_verify_contiguous_container).

If you have any questions, please email:
advenam.tacet@trailofbits.com
disconnect3d@trailofbits.com

Reviewed By: #sanitizers, vitalybuka

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

20 months ago[llvm-debuginfo-analyzer] (08/09) - ELF Reader - Disable test.
Carlos Alberto Enciso [Fri, 28 Oct 2022 06:20:15 +0000 (07:20 +0100)]
[llvm-debuginfo-analyzer] (08/09) - ELF Reader - Disable test.

Disable the test case: 06-dwarf-full-logical-view.test

It produces incorrect data on ARM:

  https://lab.llvm.org/buildbot/#/builders/182/builds/4232
  https://lab.llvm.org/buildbot/#/builders/187/builds/9483

Expected:
   189 (100.00%) : [0x000000000b][001]    {CompileUnit}
   110 ( 58.20%) : [0x000000002a][002] 2    {Function}
    27 ( 14.29%) : [0x0000000071][003]        {Block}

Generated:
  3432 (  0.00%) : [0x000000000b][001]    {CompileUnit}
  3351 (  0.00%) : [0x000000002a][002] 2    {Function}
  3234 (  0.00%) : [0x0000000071][003]        {Block}

20 months ago[clang-tidy] Skip template ctors in modernize-use-equals-default
Alexander Shaposhnikov [Fri, 28 Oct 2022 05:30:19 +0000 (05:30 +0000)]
[clang-tidy] Skip template ctors in modernize-use-equals-default

Skip template ctors in modernize-use-equals-default,
such constructors may be enabled/disabled via SFINAE,
it is not safe to make them "= default".

Test plan: ninja check-all

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

20 months ago[PGO] Simplify InstrProfilingRuntime.cpp
Wael Yehia [Thu, 27 Oct 2022 18:37:26 +0000 (14:37 -0400)]
[PGO] Simplify InstrProfilingRuntime.cpp

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

20 months ago[test] Disable the test with asan
Vitaly Buka [Fri, 28 Oct 2022 04:35:08 +0000 (21:35 -0700)]
[test] Disable the test with asan

There is a memory leak.
See comments in https://reviews.llvm.org/D125783

20 months ago[DeviceRTL] Fix incremental build
Ye Luo [Thu, 27 Oct 2022 19:01:18 +0000 (14:01 -0500)]
[DeviceRTL] Fix incremental build

Need both add_custom_command to resolve file-level dependency and add_custom_target to resolve target-level dependency.
From CMake add_custom_command doc:
Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use the add_custom_target() command to drive the command and make the other targets depend on that one).

${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} is used by multiple targets and thus requires a custom target to avoid racing.

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

20 months ago[gn build] Port 23f02693ec58
LLVM GN Syncbot [Fri, 28 Oct 2022 02:40:48 +0000 (02:40 +0000)]
[gn build] Port 23f02693ec58

20 months ago[X86] Add AVX-VNNI-INT8 instructions.
Freddy Ye [Fri, 28 Oct 2022 01:43:38 +0000 (09:43 +0800)]
[X86] Add AVX-VNNI-INT8 instructions.

For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

Reviewed By: pengfei, skan

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

20 months ago[AMDGPU] Refactor debug printing routines for GCNRPTracker
Valery Pykhtin [Tue, 25 Oct 2022 18:07:13 +0000 (20:07 +0200)]
[AMDGPU] Refactor debug printing routines for GCNRPTracker

Use Printable to enhance syntax, remove duplication, unify.

Reviewed By: arsenm, rampitec

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

20 months ago[gn build] Port 0e720e6adad1
LLVM GN Syncbot [Fri, 28 Oct 2022 01:53:34 +0000 (01:53 +0000)]
[gn build] Port 0e720e6adad1

20 months ago[mlir][spirv] fix Bazel build of Passes.h
Emilio Cota [Fri, 28 Oct 2022 01:40:33 +0000 (21:40 -0400)]
[mlir][spirv] fix Bazel build of Passes.h

I cannot repro this with CMake, but on Bazel this is failing with
```
error: incomplete result type 'mlir::spirv::TargetEnvAttr' in function definition
[...]
note: in instantiation of member function 'std::function<mlir::spirv::TargetEnvAttr (mlir::spirv::ModuleOp)>::function' requested here
createUnifyAliasedResourcePass(GetTargetEnvFn getTargetEnv = nullptr);
```

Reviewed By: antiagainst

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

20 months ago[X86] Add AVX-IFMA instructions.
Freddy Ye [Fri, 28 Oct 2022 01:11:29 +0000 (09:11 +0800)]
[X86] Add AVX-IFMA instructions.

For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

Reviewed By: pengfei, skan

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

20 months ago[AMDGPU] Add pseudo wavemode to optimize strict_wqm
Carl Ritson [Fri, 28 Oct 2022 00:26:50 +0000 (09:26 +0900)]
[AMDGPU] Add pseudo wavemode to optimize strict_wqm

Strict WQM does not require a WQM transistion if it occurs within
an existing WQM section.
This occurs heavily in GFX11 pixel shaders with LDS_PARAM_LOAD.
Which leads to unnecessary EXEC mask manipulation.

To avoid these transitions, detect WQM -> Strict WQM -> WQM
and substitute new ENTER_PSEUDO_WM/EXIT_PSEUDO_WM markers instead.
These are treat similarly by WWM register pre-allocation pass,
but do not manipulate EXEC or use registers to save EXEC state.

Reviewed By: piotr

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

20 months ago[flang] Add atomic_fetch_xor to list of intrinsics
Katherine Rasmussen [Thu, 27 Oct 2022 00:15:08 +0000 (17:15 -0700)]
[flang] Add atomic_fetch_xor to list of intrinsics

Add the atomic subroutine, atomic_fetch_xor, to the list of
intrinsic subroutines, add its last dummy argument to a check
for coindexed-object, and update test.

Reviewed By: PeteSteinfeld

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

20 months ago[mlir][arith] Fix -Wunused-but-set-variable
Fangrui Song [Thu, 27 Oct 2022 23:58:22 +0000 (23:58 +0000)]
[mlir][arith] Fix -Wunused-but-set-variable

20 months agoRemove compile-time and runtime checks for SPI in HostInfoMacOSX
Jason Molenda [Thu, 27 Oct 2022 23:46:55 +0000 (16:46 -0700)]
Remove compile-time and runtime checks for SPI in HostInfoMacOSX

There are conditionalized calls to an SPI in HostInfoMacOSX.mm
to test if lldb is being built against a pre-macOS 10.12 SDK,
or being run on a pre-macOS 10.12 system.  macOS 10.12 was released
six years ago, and I don't know of any active users of this system
so let's remove the checks.

Differential Revision: https://reviews.llvm.org/D136900
rdar://101652340

20 months ago[AArch64] Optimize memcmp when the result is tested for [in]equality with 0
zhongyunde [Thu, 27 Oct 2022 23:52:24 +0000 (07:52 +0800)]
[AArch64] Optimize memcmp when the result is tested for [in]equality with 0

Fixes 1st issue of https://github.com/llvm/llvm-project/issues/58061

Reviewed By: dmgreen, efriedma
Differential Revision: https://reviews.llvm.org/D136244

20 months ago[LLDB][NativePDB] Fix parameter size for member functions LF_MFUNCTION
Zequan Wu [Tue, 18 Oct 2022 22:58:07 +0000 (15:58 -0700)]
[LLDB][NativePDB] Fix parameter size for member functions LF_MFUNCTION

Fix the problem that it was treating member functions as non-member functions
when trying to get the parameter size. This causes some non-parameter variables
showing up in function signature. Suprisingly,
`cantFail(TypeDeserializer::deserializeAs<ProcedureRecord>(...))` just sliently
parse it without error and gave the wrong result.

It's hard to test it. This only causes problem when `params_remaining`
is larger than the real parameter size. If it's smaller, we also check
individual local variable's attribute to see it's a parameter. When I trying to
come up with a test, the parameter size is always 0 if we parse LF_MFUNCTION as
LF_PROCEDURE.

Reviewed By: labath

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

20 months ago[SLP]Improve analysis of same/alternate code ops and scheduling.
Alexey Bataev [Tue, 28 Dec 2021 13:23:10 +0000 (05:23 -0800)]
[SLP]Improve analysis of same/alternate code ops and scheduling.

Should improve compile time for analysis and vectorization.

Metric: SLP.NumVectorInstructions

Program                                                                                       SLP.NumVectorInstructions
test-suite :: External/SPEC/CINT2017speed/623.xalancbmk_s/623.xalancbmk_s.test  6380.00                   6378.00 -0.0%
test-suite :: External/SPEC/CINT2017rate/523.xalancbmk_r/523.xalancbmk_r.test   6380.00                   6378.00 -0.0%
test-suite :: External/SPEC/CINT2006/483.xalancbmk/483.xalancbmk.test           2023.00                   2022.00 -0.0%
test-suite :: External/SPEC/CINT2006/471.omnetpp/471.omnetpp.test               148.00                    146.00 -1.4%

Generated more vector instructions.

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

20 months ago[libc++][math.h] Remove unnecessary uses of __promote
Nikolas Klauser [Thu, 27 Oct 2022 18:01:13 +0000 (20:01 +0200)]
[libc++][math.h] Remove unnecessary uses of __promote

Removes __promote when it's just the identity.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, michaelplatings

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

20 months ago[mlir][Vector] Introduce the `vector.mask` operation lowering
Diego Caballero [Wed, 26 Oct 2022 01:18:15 +0000 (01:18 +0000)]
[mlir][Vector] Introduce the `vector.mask` operation lowering

This patch introduces the lowering for xfer ops masked with `vector.mask`.
Vector reductions are not lowered yet because new LLVM intrinsics are needed
in the LLVM dialect.

Reviewed By: nicolasvasilache

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

20 months ago[mlir][Vector] Introduce the MaskingOpInterface
Diego Caballero [Wed, 26 Oct 2022 00:58:56 +0000 (00:58 +0000)]
[mlir][Vector] Introduce the MaskingOpInterface

This MaskingOpInterface provides masking cababilitites to those
operations that implement it. For only is only implemented by the `vector.mask`
operation and it's used to break the dependency between the Vector
dialect (where the `vector.mask` op lives) and operations implementing
the MaskableOpInterface.

Reviewed By: nicolasvasilache

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

20 months ago[mlir] ODS: emit interface model method at the end of the header
Alex Zinenko [Fri, 21 Oct 2022 00:53:05 +0000 (00:53 +0000)]
[mlir] ODS: emit interface model method at the end of the header

Previously, ODS interface generator was placing implementations of the
interface's internal "Model" class template immediately after the class
definitions in the header. This doesn't allow this implementation, and
consequently the interface itself, to return an instance of another
interface if its class definition is emitted below. This creates
undesired ordering effects and makes it impossible for two or more
interfaces to return instances of each other. Change the interface
generator to place the implementations of these methods after all
interface classes.

Reviewed By: dcaballe

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

20 months agoFix documentation error in e8433a2b06d5
Amy Huang [Thu, 27 Oct 2022 22:41:49 +0000 (22:41 +0000)]
Fix documentation error in e8433a2b06d5

20 months agoUpdate docs for -fuse-ctor-homing
Amy Huang [Tue, 18 Oct 2022 17:56:41 +0000 (17:56 +0000)]
Update docs for -fuse-ctor-homing

Update docs to reflect the fact that this flag is on by default now.

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

20 months agoRevert "[SLP]Improve analysis of same/alternate code ops and scheduling."
Alexey Bataev [Thu, 27 Oct 2022 21:42:07 +0000 (14:42 -0700)]
Revert "[SLP]Improve analysis of same/alternate code ops and scheduling."

This reverts commit dad64448c66975054d3d968232652a56eb93b451 to fix
a crash in https://lab.llvm.org/buildbot/#/builders/74/builds/14584

20 months ago[lldb-vscode] Don't call SBValue.GetError after generating a summary.
Jorge Gorbe Moya [Thu, 27 Oct 2022 21:48:44 +0000 (14:48 -0700)]
[lldb-vscode] Don't call SBValue.GetError after generating a summary.

In some occasions, SBValue::GetError can invalidate its cached
`m_summary_str` member. This in turn invalidates any StringRef variables
pointing to it.

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

20 months ago[Bazel] Add missing C++ style Clang headers and modulemap
Aaron Siddhartha Mondal [Wed, 26 Oct 2022 17:10:07 +0000 (19:10 +0200)]
[Bazel] Add missing C++ style Clang headers and modulemap

Reviewed By: chapuni

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

20 months ago[mlir] Fix typo s/utilties/utilities/ (including in file name)
Emilio Cota [Thu, 27 Oct 2022 20:45:14 +0000 (16:45 -0400)]
[mlir] Fix typo s/utilties/utilities/ (including in file name)

Reviewed By: rriddle

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

20 months ago[libc++abi][AIX] Use reserved slot in stack to pass the address of exception object
Xing Xue [Thu, 27 Oct 2022 21:06:18 +0000 (17:06 -0400)]
[libc++abi][AIX] Use reserved slot in stack to pass the address of exception object

Summary:
The existing implementation of the personality for legacy IBM xlclang++ compiler generated code passes the address of exception object in r14 for the landing pad to retrieve with a call to __xlc_exception_handle(). This clobbers the content of r14 in user code (and potentially, when running cleanup actions, the address of another exception object being passed). This patch changes to use the stack slot reserved for compilers to pass the address. It has been confirmed that xlclang++-generated code does not use this slot.

This is a follow-on of the origibal patch below with a change in comments.
   https://reviews.llvm.org/rGa499051f10a2d0150b60c14493558476039f701a

Reviewed by: hubert.reinterpretcast, cebowleratibm

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

20 months ago[mlir][sparse] code refactoring, move <tid, loop id> -> dim map to Merger.
Peiming Liu [Wed, 26 Oct 2022 19:07:25 +0000 (19:07 +0000)]
[mlir][sparse] code refactoring, move <tid, loop id> -> dim map to Merger.

To address unresolved comments in D136185

Reviewed By: aartbik

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

20 months agoRevert "[OpenMP] [OMPIRBuilder] Create a new datatype to hold the unique target regio...
Kevin Athey [Thu, 27 Oct 2022 20:57:25 +0000 (13:57 -0700)]
Revert "[OpenMP] [OMPIRBuilder] Create a new datatype to hold the unique target region info"

This reverts commit 3d0e9edd8e53fb72e85084f4170513159212839a.

Breaking HWASAN buildbot:
https://lab.llvm.org/buildbot/#/builders/236/builds/786

Shown by targetted builds breaking at this patch:
Built at this patch: https://lab.llvm.org/buildbot/#/builders/236/builds/803
Built at prior patch: https://lab.llvm.org/buildbot/#/builders/236/builds/804

20 months ago[mlir][sparse] fix typo "admissable" -> "admissible"
Aart Bik [Thu, 27 Oct 2022 19:43:39 +0000 (12:43 -0700)]
[mlir][sparse] fix typo "admissable" -> "admissible"

Reviewed By: wrengr, Peiming

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

20 months agoClang: Add release note for defaulted-special-members-POD GCC ABI fix
David Blaikie [Thu, 27 Oct 2022 20:41:22 +0000 (20:41 +0000)]
Clang: Add release note for defaulted-special-members-POD GCC ABI fix

Follow-up to 7846d590033e8d661198f4c00f56f46a4993c526

20 months ago[BinaryFormat:Dwarf] Add a couple of DW_IDX_GCC extensions
David Blaikie [Thu, 27 Oct 2022 19:35:04 +0000 (19:35 +0000)]
[BinaryFormat:Dwarf] Add a couple of DW_IDX_GCC extensions

Seen here:
https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/include/dwarf2.def#L805-L806

20 months ago[PseudoProbe] Replace relocation with offset for entry probe.
Hongtao Yu [Mon, 17 Oct 2022 17:07:18 +0000 (10:07 -0700)]
[PseudoProbe] Replace relocation with offset for entry probe.

Currently pseudo probe encoding for a function is like:
- For the first probe, a relocation from it to its physical position in the code body
- For subsequent probes, an incremental offset from the current probe to the previous probe

The relocation could potentially cause relocation overflow during link time. I'm now replacing it with an offset from the first probe to the function start address.

A source function could be lowered into multiple binary functions due to outlining (e.g, coro-split). Since those binary function have independent link-time layout, to really avoid relocations from .pseudo_probe sections to .text sections, the offset to replace with should really be the offset from the probe's enclosing binary function, rather than from the entry of the source function. This requires some changes to previous section-based emission scheme which now switches to be function-based. The assembly form of pseudo probe directive is also changed correspondingly, i.e, reflecting the binary function name.

Most of the source functions end up with only one binary function. For those don't, a sentinel probe is emitted for each of the binary functions with a different name from the source. The sentinel probe indicates the binary function name to differentiate subsequent probes from the ones from a different binary function. For examples, given source function

```
Foo() {
  …
  Probe 1
  …
  Probe 2
}
```

If it is transformed into two binary functions:

```
Foo:
   …

Foo.outlined:
   …
```

The encoding for the two binary functions will be separate:

```

GUID of Foo
  Probe 1

GUID of Foo
  Sentinel probe of Foo.outlined
  Probe 2
```

Then probe1 will be decoded against binary `Foo`'s address, and Probe 2 will be decoded against `Foo.outlined`. The sentinel probe of `Foo.outlined` makes sure there's not accidental relocation from `Foo.outlined`'s probes to `Foo`'s entry address.

On the BOLT side, to be minimal intrusive, the pseudo probe re-encoding sticks with the old encoding format. This is fine since unlike linker, Bolt processes the pseudo probe section as a whole and it is free from relocation overflow issues.

The change is downwards compatible as long as there's no mixed use of the old encoding and the new encoding.

Reviewed By: wenlei, maksfb

Differential Revision: https://reviews.llvm.org/D135912
Differential Revision: https://reviews.llvm.org/D135914
Differential Revision: https://reviews.llvm.org/D136394

20 months ago[flang] Remove debug flag added in D136824
Valentin Clement [Thu, 27 Oct 2022 20:23:40 +0000 (22:23 +0200)]
[flang] Remove debug flag added in D136824

20 months agoUse getCanonicalFnName for callee name
wlei [Thu, 27 Oct 2022 20:13:04 +0000 (13:13 -0700)]
Use getCanonicalFnName for callee name

20 months ago[docs] Fix old path for clang-format
Ji, Jinsong [Thu, 27 Oct 2022 19:56:49 +0000 (12:56 -0700)]
[docs] Fix old path for clang-format

The path in vimrc was old, replace it with <path-to-this-file> to be
consistent with above.

20 months agoHandle an unknown binary platform type in debugserver
Jason Molenda [Thu, 27 Oct 2022 20:11:20 +0000 (13:11 -0700)]
Handle an unknown binary platform type in debugserver

debugserver parses the Mach-O header & load commands of
binaries; if it does this with a binary whose LC_BUILD
platform enum it does not recognize, it will currently crash.
This patch changes MachProcss::GetPlatformString to return
an optional platform string, and updates the callers to
do the right thing when this optional could not be
provided.

Differential Revision: https://reviews.llvm.org/D136719
rdar://100452994

20 months ago[clang][Sema][NFC] Remove redundant isTypeValid
Troy Johnson [Thu, 27 Oct 2022 19:31:34 +0000 (12:31 -0700)]
[clang][Sema][NFC] Remove redundant isTypeValid

These isTypeValid calls are redundant because the isDerivedFrom call performs the same checks.

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

20 months ago[ADT] Simplify hashing for tuples
Joe Loser [Thu, 27 Oct 2022 15:05:08 +0000 (09:05 -0600)]
[ADT] Simplify hashing for tuples

Instead of using `std::index_sequence` with a helper function template to access
each element in the tuple, leverage `std::apply` from C++17 to do the heavy
lifting for us.

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

20 months ago[InstCombine] improve efficiency of sub demanded bits; NFC
Sanjay Patel [Thu, 27 Oct 2022 19:24:02 +0000 (15:24 -0400)]
[InstCombine] improve efficiency of sub demanded bits; NFC

There's no reason to shrink a constant or simplify
an operand in 2 steps.

This matches what we currently do for 'add' (although that
seems like it should be altered to handle the commutative
case).

20 months ago[IR] Allow typed pointers to be used in vector types
Dmitry Sidorov [Thu, 27 Oct 2022 18:06:22 +0000 (14:06 -0400)]
[IR] Allow typed pointers to be used in vector types

Reviewed By: nikic, jcranmer-intel

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

20 months ago[NFC] Remove unused variables
Jordan Rupprecht [Thu, 27 Oct 2022 19:23:22 +0000 (12:23 -0700)]
[NFC] Remove unused variables

20 months agoCommunity calendar: more clearly document how to add events
Kristof Beyls [Thu, 27 Oct 2022 19:14:32 +0000 (21:14 +0200)]
Community calendar: more clearly document how to add events

20 months ago[libc++abi][AIX] Use reserved slot in stack to pass the address of exception object
Xing Xue [Thu, 27 Oct 2022 19:11:06 +0000 (15:11 -0400)]
[libc++abi][AIX] Use reserved slot in stack to pass the address of exception object

Summary:
The existing implementation of the personality for legacy IBM xlclang++ compiler generated code passes the address of exception object in r14 for the landing pad to retrieve with a call to __xlc_exception_handle(). This clobbers the content of r14 in user code (and potentially, when running cleanup actions, the address of another exception object being passed). This patch changes to use the stack slot reserved for compilers to pass the address. It has been confirmed that xlclang++-generated code does not use this slot.

Reviewed by: hubert.reinterpretcast, cebowleratibm

20 months ago[mlir] Add `parseSymbolName` that doesn't take an attribute list
Jeff Niu [Tue, 25 Oct 2022 16:28:53 +0000 (09:28 -0700)]
[mlir] Add `parseSymbolName` that doesn't take an attribute list

This patch adds a version of `parseSymbolName` and
`parseOptionalSymbolName` to AsmParser that don't take an attribute name
and attribute list.

Reviewed By: rriddle

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

20 months ago[flang] Carry dynamic type when emboxing polymorphic pointer
Valentin Clement [Thu, 27 Oct 2022 18:56:39 +0000 (20:56 +0200)]
[flang] Carry dynamic type when emboxing polymorphic pointer

In order to be passed as passed-object in the dynamic dispatch, the
polymorphic pointer entity are emboxed. In this process, the dynamic
type must be preserve and pass to fir.embox as the tdesc operand. This
patch introduce a new ExtendedValue that allow to carry over the
dynamic type when the value is unboxed.

Depends on D136820

Reviewed By: PeteSteinfeld

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

20 months ago[flang] Lower allocate for polymorphic pointer
Valentin Clement [Thu, 27 Oct 2022 18:55:43 +0000 (20:55 +0200)]
[flang] Lower allocate for polymorphic pointer

Lowering of allocate statement for polymoprhic pointers is a bit
different than for allocatables. A call to `PointerNullifyDerived`
runtime function is done instead of `AllocatableInitDerived`.

Reviewed By: PeteSteinfeld

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

20 months ago[mlir][spirv] Add target control to UnifyAliasedResourcePass
Lei Zhang [Thu, 27 Oct 2022 18:31:21 +0000 (14:31 -0400)]
[mlir][spirv] Add target control to UnifyAliasedResourcePass

The UnifyAliasedResourcePass is actually only necessary for
targeting Apple GPUs via MoltenVK, where we need to translate
SPIR-V into MSL. The translation has limitations--no support
of aliased resources. So introducing a control to disable
this pass if targeting other platforms.

Reviewed By: kuhar

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

20 months ago[SLP]Improve analysis of same/alternate code ops and scheduling.
Alexey Bataev [Tue, 28 Dec 2021 13:23:10 +0000 (05:23 -0800)]
[SLP]Improve analysis of same/alternate code ops and scheduling.

Should improve compile time for analysis and vectorization.

Metric: SLP.NumVectorInstructions

Program                                                                                       SLP.NumVectorInstructions
test-suite :: External/SPEC/CINT2017speed/623.xalancbmk_s/623.xalancbmk_s.test  6380.00                   6378.00 -0.0%
test-suite :: External/SPEC/CINT2017rate/523.xalancbmk_r/523.xalancbmk_r.test   6380.00                   6378.00 -0.0%
test-suite :: External/SPEC/CINT2006/483.xalancbmk/483.xalancbmk.test           2023.00                   2022.00 -0.0%
test-suite :: External/SPEC/CINT2006/471.omnetpp/471.omnetpp.test               148.00                    146.00 -1.4%

Generated more vector instructions.

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

20 months agoFix whitespace introduced by 891aaff9a8a9997582eac1bb1edb8d4b4e117ef1
David Sherwood [Thu, 27 Oct 2022 18:24:51 +0000 (18:24 +0000)]
Fix whitespace introduced by 891aaff9a8a9997582eac1bb1edb8d4b4e117ef1

20 months ago[AArch64][SVE2] Add the SVE2.1 pext and ptrue predicate-as-counter instructions
David Sherwood [Tue, 25 Oct 2022 11:06:51 +0000 (11:06 +0000)]
[AArch64][SVE2] Add the SVE2.1 pext and ptrue predicate-as-counter instructions

This patch adds the assembly/disassembly for the following instructions:

pext (predicate) : Set predicate from predicate-as-counter
ptrue (predicate-as-counter) : Initialise predicate-as-counter to all active

This patch also introduces the predicate-as-counter registers pn8, etc.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

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

20 months ago[mlir][sparse] add a cursor to sparse storage scheme
Aart Bik [Wed, 26 Oct 2022 22:07:18 +0000 (15:07 -0700)]
[mlir][sparse] add a cursor to sparse storage scheme

This prepare a subsequent revision that will generalize
the insertion code generation. Similar to the support lib,
insertions become much easier to perform with some "cursor"
bookkeeping. Note that we, in the long run, could perhaps
avoid storing the "cursor" permanently and use some
retricted-scope solution (alloca?) instead. However,
that puts harder restrictions on insertion-chain operations,
so for now we follow the more straightforward approach.

Reviewed By: Peiming

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

20 months ago[OpenMP][libomptarget] New plugin infrastructure and new CUDA plugin
Kevin Sala [Thu, 27 Oct 2022 18:01:16 +0000 (18:01 +0000)]
[OpenMP][libomptarget] New plugin infrastructure and new CUDA plugin

This patch adds a new infrastructure for OpenMP target plugins. It also implements the CUDA and GenericELF64bit plugins under this new infrastructure. We place the sources in a separate directory named plugins-nextgen, and we build the new plugins as different plugin libraries. The original plugins, which remain untouched, will be used by default. However, the user can change this behavior at run-time through the boolean envar LIBOMPTARGET_NEXTGEN_PLUGINS. If enabled, the libomptarget will try to load the NextGen version of each plugin, falling back to the original if they are not present or valid.

The idea of this new plugin infrastructure is to implement the common parts of target plugins in generic classes (defined in files inside plugins-next/common/PluginInterface folder), and then, each specific plugin defines its own specific classes inheriting from the common ones. In this way, most logic remains on the common interface while reducing the plugin-specific source code. It is also beneficial in the sense that now most code and behavior are the same across the different plugins. As an example, we define classes for a plugin, a device, a device image, a stream manager, etc. The plugin object (a single instance per plugin library) holds different device objects (i.e., one per available device), while these latter are the responsible for managing its own resources.

Most code on this patch is based on the changes made by @jdoerfert (Johannes Doerfert)

Reviewed By: jhuber6, jdoerfert

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

20 months ago[clang] Implement -fstrict-flex-arrays=3
Bill Wendling [Thu, 20 Oct 2022 23:10:31 +0000 (16:10 -0700)]
[clang] Implement -fstrict-flex-arrays=3

The -fstrict-flex-arrays=3 is the most restrictive type of flex arrays.
No number, including 0, is allowed in the FAM. In the cases where a "0"
is used, the resulting size is the same as if a zero-sized object were
substituted.

This is needed for proper _FORTIFY_SOURCE coverage in the Linux kernel,
among other reasons. So while the only reason for specifying a
zero-length array at the end of a structure is for specify a FAM,
treating it as such will cause _FORTIFY_SOURCE not to work correctly;
__builtin_object_size will report -1 instead of 0 for a destination
buffer size to keep any kernel internals from using the deprecated
members as fake FAMs.

For example:

  struct broken {
      int foo;
      int fake_fam[0];
      struct something oops;
  };

There have been bugs where the above struct was created because "oops"
was added after "fake_fam" by someone not realizing. Under
__FORTIFY_SOURCE, doing:

  memcpy(p->fake_fam, src, len);

raises no warnings when __builtin_object_size(p->fake_fam, 1) returns -1
and may stomp on "oops."

Omitting a warning when using the (invalid) zero-length array is how GCC
treats -fstrict-flex-arrays=3. A warning in that situation is likely an
irritant, because requesting this option level is explicitly requesting
this behavior.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
Differential Revision: https://reviews.llvm.org/D134902

20 months ago[mlir][sparse] fix crash when sparsifying broadcast operations.
Peiming Liu [Thu, 27 Oct 2022 17:12:20 +0000 (17:12 +0000)]
[mlir][sparse] fix crash when sparsifying broadcast operations.

Reviewed By: aartbik

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

20 months ago[RISCV] Fix an obvious CSE opportunity in LSR test case. NFC
Craig Topper [Thu, 27 Oct 2022 17:24:35 +0000 (10:24 -0700)]
[RISCV] Fix an obvious CSE opportunity in LSR test case. NFC

20 months ago[mlir][CAPI] Allow specifying pass manager anchor
rkayaith [Thu, 20 Oct 2022 04:51:06 +0000 (00:51 -0400)]
[mlir][CAPI] Allow specifying pass manager anchor

This adds a new function for creating pass managers that takes an
argument for the anchor string.

Reviewed By: mehdi_amini

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

20 months ago[ObjectYAML] Add support for DXContainer HASH
Chris Bieneman [Wed, 26 Oct 2022 17:25:19 +0000 (12:25 -0500)]
[ObjectYAML] Add support for DXContainer HASH

DXContainer files contain a part that has an MD5 of the generated
shader. This adds support to the ObjectYAML tooling to expand the hash
part data and hash iteself in preparation for adding hashing support to
DirectX code generation.

Reviewed By: python3kgae

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

20 months ago[libc] add fgets
Michael Jones [Wed, 26 Oct 2022 20:42:39 +0000 (13:42 -0700)]
[libc] add fgets

This adds the fgets function and its unit tests.

Reviewed By: sivachandra

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

20 months ago[LSR] Drop LSR solution if it is less profitable than baseline
eopXD [Wed, 28 Sep 2022 18:01:23 +0000 (11:01 -0700)]
[LSR] Drop LSR solution if it is less profitable than baseline

The LSR may suggest less profitable transformation to the loop. This
patch adds check to prevent LSR from generating worse code than what
we already have.

Since LSR affects nearly all targets, the patch is guarded by the
option 'lsr-drop-solution' and default as disable for now.

The next step should be extending an TTI interface to allow target(s)
to enable this enhancememnt.

Debug log is added to remind user of such choice to skip the LSR
solution.

Reviewed By: Meinersbur, #loopoptwg

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

20 months ago[mlir][python] Include pipeline parse errors in exception message
rkayaith [Thu, 20 Oct 2022 20:40:32 +0000 (16:40 -0400)]
[mlir][python] Include pipeline parse errors in exception message

Currently any errors during pipeline parsing are reported to stderr.
This adds a new pipeline parsing function to the C api that reports
errors through a callback, and updates the python bindings to use it.

Reviewed By: mehdi_amini

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

20 months ago[llvm-readelf] --section-details: display SHF_COMPRESSED headers
Fangrui Song [Thu, 27 Oct 2022 16:25:21 +0000 (09:25 -0700)]
[llvm-readelf] --section-details: display SHF_COMPRESSED headers

readelf --section-details displays ch_type/ch_size/ch_addralign for
a SHF_COMPRESSED section. Port the feature. There is a small difference
that readelf doesn't display `[<corrupt>]` for an empty section while
we do.

Reviewed By: jhenderson

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

20 months ago[mlir] Fix asan issue in Vectorization.cpp of Linalg.
Alexander Belyaev [Thu, 27 Oct 2022 16:02:32 +0000 (18:02 +0200)]
[mlir] Fix asan issue in Vectorization.cpp of Linalg.

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