Changes

Summary

  1. [MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC). (details)
  2. Fix typos in FPUtil README (details)
  3. [Clang] Mutate bulitin names under IEEE128 on PPC64 (details)
  4. [PowerPC] [Clang] Fix alignment adjustment of single-elemented float128 (details)
  5. [llvm-dwarfdump] Do not print preceding :: for local types (details)
  6. [fir] Add fircg.ext_embox conversion (details)
  7. [mlir][linalg][bufferize][NFC] Move BufferizationOptions to op interface (details)
  8. [fir] TargetRewrite: Rewrite fir.address_of(func) (details)
  9. [flang] Add missing LABEL in test. NFC (details)
  10. [RISCV][VP] Add RVV codegen for vp.select (details)
  11. [mlir][linalg][bufferize] Allow unbufferizable ops in input (details)
  12. [mlir][linalg][bufferize][NFC] Move FuncOp boundary bufferization to ModuleBufferization (details)
  13. [mlir] support recursive type conversion of named LLVM structs (details)
  14. AMDGPU/GlobalISel: Do not fcanonicalize const splat padded with undef (details)
  15. AMDGPU/GlobalISel: Add floating point med3 combine (details)
  16. AMDGPU/GlobalISel: Add clamp combine (details)
  17. [PowerPC] Add non-constant fcopysign f128 test coverage (details)
Commit f078536f46598b1a1e363aad6893fe9c3f90f5e5 by flo
[MemoryLocation] Move DSE's logic to new MemLoc::getForDest helper (NFC).

DSE has some extra logic to determine the write location of library
calls like str*cpy and str*cat. This patch moves the logic to a new
MemoryLocation:getForDest variant, which takes a call and TLI.

This patch should be NFC, because no other places take advantage of the
new helper yet.

Suggested by @reames post-commit 7eec832def571.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D114872
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
The file was modifiedllvm/include/llvm/Analysis/MemoryLocation.h
The file was modifiedllvm/lib/Analysis/MemoryLocation.cpp
Commit 1479a211d2c72c949620889f0398ecd63aa4facb by github
Fix typos in FPUtil README
The file was modifiedlibc/src/__support/FPUtil/generic/README.md
Commit 4f94c02616025ace168899b6fbdc8c3ba240062b by qiucofan
[Clang] Mutate bulitin names under IEEE128 on PPC64

Glibc 2.32 and newer uses these symbol names to support IEEE-754 128-bit
float. GCC transforms name of these builtins to align with Glibc header
behavior.

Since Clang doesn't have all GCC-compatible builtins implemented, this
patch only mutates the implemented part.

Note nexttoward is a special case (no nexttowardf128) so it's also
handled here.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D112401
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedclang/test/CodeGen/math-builtins-long.c
The file was addedclang/test/CodeGen/ppc64-f128-builtins.c
Commit b9adaa1782db727df08b8138e12c1e60964885d3 by qiucofan
[PowerPC] [Clang] Fix alignment adjustment of single-elemented float128

This does similar thing to 6b1341e, but fixes single element 128-bit
float type: `struct { long double x; }`.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D114937
The file was modifiedclang/lib/CodeGen/TargetInfo.cpp
The file was modifiedclang/test/CodeGen/ppc64le-varargs-f128.c
Commit 0bf2c87785f3943452d56dc069100b68d56d3447 by kbessonova
[llvm-dwarfdump] Do not print preceding :: for local types

Reviewed By: dblaikie, jhenderson

Differential Revision: https://reviews.llvm.org/D114892
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
The file was addedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_local_types.s
Commit 1f5510326375cb9a7c747aab26080699f7952d74 by clementval
[fir] Add fircg.ext_embox conversion

Convert a fircg.ext_embox operation to LLVM IR dialect.
A fircg.ext_embox is converted to a sequence of operation that
create, allocate if needed, and populate a descriptor.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
The file was modifiedflang/include/flang/Optimizer/Dialect/FIRType.h
The file was modifiedflang/lib/Optimizer/CodeGen/CodeGen.cpp
The file was modifiedflang/lib/Optimizer/CodeGen/TypeConverter.h
The file was modifiedflang/test/Fir/convert-to-llvm.fir
Commit 867cd948ace18c5eba8625005a62ea07f619a936 by springerm
[mlir][linalg][bufferize][NFC] Move BufferizationOptions to op interface

Also store a reference to BufferizationOptions in BufferizationState. This is in preparation of adding support for partial bufferization.

Differential Revision: https://reviews.llvm.org/D114661
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/TensorInterfaceImpl.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
Commit 3fd250d25858c38cd83c71be47c95e4b20a38171 by diana.picus
[fir] TargetRewrite: Rewrite fir.address_of(func)

Rewrite AddrOfOp if taking the address of a function.

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
The file was modifiedflang/lib/Optimizer/CodeGen/TargetRewrite.cpp
The file was modifiedflang/test/Fir/target-rewrite-boxchar.fir
The file was modifiedflang/test/Fir/target-rewrite-complex.fir
Commit 919738739a23f3e7a4106c34f0e9aaedd1eb8ecf by diana.picus
[flang] Add missing LABEL in test. NFC
The file was modifiedflang/test/Fir/target-rewrite-complex.fir
Commit 9eb7322748cf138fea0a2c98ab1e6430735a15ba by fraser
[RISCV][VP] Add RVV codegen for vp.select

Lower vp.select instrinsic to VSELECT_VL.

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D114629
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/include/llvm/IR/VPIntrinsics.def
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect-vp.ll
The file was addedllvm/test/CodeGen/RISCV/rvv/vselect-vp.ll
Commit ad1ba42f687fdb772e9bccf2011f52e11feacda5 by springerm
[mlir][linalg][bufferize] Allow unbufferizable ops in input

Allow ops that are not bufferizable in the input IR. (Deactivated by default.)

bufferization::ToMemrefOp and bufferization::ToTensorOp are generated at the bufferization boundaries.

Differential Revision: https://reviews.llvm.org/D114669
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
The file was addedmlir/test/Dialect/Linalg/comprehensive-module-bufferize-partial.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferizePass.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/Passes.td
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
Commit 5e1c038f7da50f09e4f39a66d5e10aa06f9546c3 by springerm
[mlir][linalg][bufferize][NFC] Move FuncOp boundary bufferization to ModuleBufferization

Differential Revision: https://reviews.llvm.org/D114670
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.cpp
Commit 9dd1f8dfdd1a041ab48149de93b7f4a868ac4858 by zinenko
[mlir] support recursive type conversion of named LLVM structs

A previous commit added support for converting elemental types contained in
LLVM dialect types in case they were not compatible with the LLVM dialect. It
was missing support for named structs as they could be recursive, which was not
supported by the conversion infra. Now that it is, add support for converting
such named structs.

Depends On D113579

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D113580
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-types.mlir
The file was modifiedmlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
Commit ab01f4d26400f13f71a57b15f3f6c336c24606e8 by petar.avramovic
AMDGPU/GlobalISel: Do not fcanonicalize const splat padded with undef

Recognize constant splat padded with undef in isCanonicalized.
Fcanonicalize will be removed by RemoveFcanonicalize in post-legalizer
combiner. We will treat undef as value that will result in a splat
in clamp combine after regbankselect.

Differential Revision: https://reviews.llvm.org/D104408
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/combine-fcanonicalize.mir
Commit ec54867d750bd6c095697d089d9ad5a7440974a8 by petar.avramovic
AMDGPU/GlobalISel: Add floating point med3 combine

Add floating point version of med3 combine.
Source is fminnum(fmaxnum(Val, K0), K1) or fmaxnum(fminnum(Val, K1), K0)
where K0 and K1 are constants and K0 <= K1.

Differential Revision: https://reviews.llvm.org/D90051
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/fmed3-min-max-const-combine.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUGISel.td
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-fmed3-minmax-const.mir
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCombine.td
Commit 0b34ffe4a61eab708b594f23a7781c90ec22423d by petar.avramovic
AMDGPU/GlobalISel: Add clamp combine

Add clamp combine. Source is fminnum(fmaxnum(Val, 0.0), 1.0) or
fmaxnum(fminnum(Val, 1.0), 0.0) or fmed3 intrinsic with 0.0 and
1.0 as two out of three operands.

Differential Revision: https://reviews.llvm.org/D90052
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCombine.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUGISel.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-clamp-fmed3-const.mir
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-clamp-minmax-const.mir
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/clamp-fmed3-const-combine.ll
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/clamp-minmax-const-combine.ll
Commit e85667a2fbaf916c49000144b413caf0d26b0365 by llvm-dev
[PowerPC] Add non-constant fcopysign f128 test coverage

As discussed on D114589 as the constant case gets affected by SimplifyDemandedBits a lot - the non-constant case currently falls back to copysignl libcalls
The file was modifiedllvm/test/CodeGen/PowerPC/fp128-bitcast-after-operation.ll