SuccessChanges

Summary

  1. [BuildLibCalls] Add more noundef to library functions (details)
  2. [UnifyFunctionExitNodes] Fix Modified status for unreachable blocks (details)
  3. [mlir][Linalg] Integration tests for convolutions added. (details)
  4. [cmake] Use absolute paths for modules search (details)
  5. [elf2yaml] Fix dumping a debug section whose name is not recognized. (details)
  6. APInt.h - return directly from clearUnusedBits in single word cases. NFCI. (details)
  7. [KnownBits] Move SelectionDAG::computeKnownBits ISD::ABS handling to KnownBits::abs (details)
  8. Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors" (details)
  9. CommandLine.h - use auto const reference in ValuesClass::apply for range loop. NFCI. (details)
  10. [Statepoints] Update DAG root after emitting statepoint. (details)
  11. [MachinePipeliner] Fix II_setByPragma initialization (details)
  12. [AMDGPU][MC] Improved diagnostic messages for invalid registers (details)
Commit 36c8621638d18c830efe2c6a2a6d0a0338b0f79d by aqjune
[BuildLibCalls] Add more noundef to library functions

This patch follows D85345 and adds more noundef attributes to return values/arguments of library functions
that are mostly about accessing the file system or processes.

A few functions like `chmod` or `times` use typedef `mode_t` and `clock_t`.
They are neither struct nor union, so they cannot contain undef even if they're lowered to iN in IR. So, it is fine to add noundef to them.

- clock_t's actual type is size_t (C17, 7.27.1.3), so it isn't struct or union.

- For mode_t, either int or long is used in practice because programmers use bit manipulation. So, I think it is okay that it's never aggregate in practice.

After this patch, the remaining library functions are those that eagerly participate in optimizations: they can be removed, reordered, or
introduced by a transformation from primitive IR operations.
For them, a few testings is needed, since it may not be valid to add noundef anymore even if C standard says it's okay.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D85894
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll
The file was modifiedllvm/lib/Transforms/Utils/BuildLibCalls.cpp
Commit 48fc781438767bd8337facf2e232c695b0426fb4 by david.stenberg
[UnifyFunctionExitNodes] Fix Modified status for unreachable blocks

If a function had at most one return block, the pass would return false
regardless if an unified unreachable block was created.

This patch fixes that by refactoring runOnFunction into two separate
helper functions for handling the unreachable blocks respectively the
return blocks, as suggested by @bjope in a review comment.

This was caught using the check introduced by D80916.

Reviewed By: serge-sans-paille

Differential Revision: https://reviews.llvm.org/D85818
The file was addedllvm/test/Transforms/UnifyFunctionExitNodes/unreachable-blocks-status.ll
The file was modifiedllvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
The file was modifiedllvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
Commit edf244217a48b91c8e9c860848885106fbcc5c4b by limo
[mlir][Linalg] Integration tests for convolutions added.

This commit introduces end-to-end integration tests for
convolutions that test multiple ways of ConvOps lowering.

Differential Revision: https://reviews.llvm.org/D87277
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-2d-nhwc-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-1d-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-2d-nchw-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-3d-ncdhw-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-3d-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-1d-nwc-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-2d-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-1d-ncw-call.mlir
The file was addedmlir/integration_test/Dialect/Linalg/Conv/test-conv-3d-ndhwc-call.mlir
Commit d4b88ac1658d681e143482336cac27c6a74b8b24 by diana.picus
[cmake] Use absolute paths for modules search

For out of tree builds, the user generally needs to specify LLVM_DIR and
MLIR_DIR on the command line so that the correct LLVM and MLIR
installations are picked up.

If the provided paths are absolute, everything works fine, however for
buildbots it is customary to work with relative paths, and that makes it
difficult for CMake to find the right modules to include.

This patch changes CMakeLists.txt to convert LLVM_DIR and MLIR_DIR to
absolute paths before adding them to CMAKE_MODULE_PATH. The inputs are
assumed to be relative to the source directory (llvm-project/flang).

Differential Revision: https://reviews.llvm.org/D87083
The file was modifiedflang/CMakeLists.txt
Commit 25f3cc0ced1759af1911c2446ac40fab4f5e5571 by Xing
[elf2yaml] Fix dumping a debug section whose name is not recognized.

If the debug section's name isn't recognized, it should be
dumped as a raw content section.

Reviewed By: jhenderson, grimar

Differential Revision: https://reviews.llvm.org/D87346
The file was addedllvm/test/tools/obj2yaml/ELF/DWARF/unrecognized-debug-section.yaml
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
Commit 1eaf7babf2dcc3ab8fb429171c991556ffa98291 by llvm-dev
APInt.h - return directly from clearUnusedBits in single word cases. NFCI.

Consistently use the same pattern of returning *this from the clearUnusedBits() call to allow us to early out from the isSingleWord() path and avoid an else statement.
The file was modifiedllvm/include/llvm/ADT/APInt.h
Commit d816499f95d673bbad297d0231cbeaf5efbbc5de by llvm-dev
[KnownBits] Move SelectionDAG::computeKnownBits ISD::ABS handling to KnownBits::abs

Move the ISD::ABS handling to a KnownBits::abs handler, to simplify future implementations in ValueTracking/GlobalISel.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/include/llvm/Support/KnownBits.h
The file was modifiedllvm/lib/Support/KnownBits.cpp
Commit f078577f31cc96b6e8a064f628f81a376f21e2e2 by RonakNilesh.Chauhan
Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors"

This reverts commit 487a80531006add8102d50dbcce4b6fd729ab1f6.

Tests fail on big endian machines.
The file was modifiedllvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-sgpr.s
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-failure.s
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-zeroed-raw.s
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-zeroed-gfx10.s
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-vgpr.s
The file was modifiedllvm/test/CodeGen/AMDGPU/nop-data.ll
The file was modifiedllvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
The file was modifiedllvm/include/llvm/Support/AMDHSAKernelDescriptor.h
The file was removedllvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-zeroed-gfx9.s
Commit b29bdab8c76dbeda7786ef8e0d1bf58376955795 by llvm-dev
CommandLine.h - use auto const reference in ValuesClass::apply for range loop. NFCI.
The file was modifiedllvm/include/llvm/Support/CommandLine.h
Commit 4358fa782e3def5176f6e70c72de8e65702aeb0f by dantrushin
[Statepoints] Update DAG root after emitting statepoint.

Since we always generate CopyToRegs for statepoint results,
we must update DAG root after emitting statepoint, so that
these copies are scheduled before any possible local uses.
Note: getControlRoot() flushes all PendingExports, not only
those we generates for relocates. If that'll become a problem,
we can change it to flushing relocate exports only.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D87251
The file was modifiedllvm/test/CodeGen/X86/statepoint-vreg.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
Commit 818cf30b83305fa4a2f75821349210b0f7aff4a4 by Jinsong Ji
[MachinePipeliner] Fix II_setByPragma initialization

II_setByPragma was not reset between 2 calls of the MachinePipleiner pass

Reviewed By: bcahoon

Differential Revision: https://reviews.llvm.org/D87088
The file was modifiedllvm/lib/CodeGen/MachinePipeliner.cpp
The file was addedllvm/test/CodeGen/Hexagon/swp-pragma-initiation-interval-reset.ii
Commit 95b7040e43841802e1ccba59b46e7773c47c4ad6 by dmitry.preobrazhensky
[AMDGPU][MC] Improved diagnostic messages for invalid registers

Corrected parser to issue meaningful error messages for invalid and malformed registers.

See bug 41303: https://bugs.llvm.org/show_bug.cgi?id=41303

Reviewers: arsenm, rampitec

Differential Revision: https://reviews.llvm.org/D87234
The file was modifiedllvm/test/MC/AMDGPU/reg-syntax-err.s
The file was modifiedllvm/test/MC/AMDGPU/literals.s
The file was modifiedllvm/test/MC/AMDGPU/sop1.s
The file was modifiedllvm/test/MC/AMDGPU/vop_sdwa.s
The file was modifiedllvm/test/MC/AMDGPU/reg-syntax-extra.s
The file was modifiedllvm/test/MC/AMDGPU/sop1-err.s
The file was modifiedllvm/test/MC/AMDGPU/sopk.s
The file was modifiedllvm/test/MC/AMDGPU/flat-scratch.s
The file was modifiedllvm/test/MC/AMDGPU/smrd-err.s
The file was modifiedllvm/test/MC/AMDGPU/smem.s
The file was modifiedllvm/test/MC/AMDGPU/sop2.s
The file was modifiedllvm/test/MC/AMDGPU/trap.s
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/test/MC/AMDGPU/mtbuf.s
The file was modifiedllvm/test/MC/AMDGPU/expressions.s
The file was modifiedllvm/test/MC/AMDGPU/vop3.s
The file was modifiedllvm/test/MC/AMDGPU/smrd.s
The file was modifiedllvm/test/MC/AMDGPU/xnack-mask.s
The file was modifiedllvm/test/MC/AMDGPU/out-of-range-registers.s