Jenkins is going to shut down

SuccessChanges

Summary

  1. [MLIR] Add tiling validity check to loop tiling pass (details)
  2. [ELF] Support .cfi_signal_frame (details)
  3. Revert "[mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects." (details)
  4. Remove unused class member (NFC) (details)
  5. Remove unused static helper getMemRefTypeFromTensorType() (NFC) (details)
  6. [X86] Limit the scope of the min/max canonicalization in combineSelect (details)
  7. [InstCombine] Add tests for select(freeze(icmp x, y), x, y); NFC (details)
  8. [libc] Setup TLS in x86_64 loader. (details)
  9. [InstCombine] Optimize select(freeze(icmp eq/ne x, y), x, y) (details)
  10. Add the inline interface to the shape dialect (details)
  11. [libc][NFC] Add library of floating point test matchers. (details)
  12. [libc][NFC] Disable a loader test as ld.gold fails to link. (details)
  13. [test][DebugInfo] Adapt two tests for Sun assembler syntax on Sparc (details)
Commit 754e09f9cef13fb07328169354e38dd86d94a699 by uday
[MLIR] Add tiling validity check to loop tiling pass

This revision aims to provide a new API, `checkTilingLegality`, to
verify that the loop tiling result still satisifes the dependence
constraints of the original loop nest.

Previously, there was no check for the validity of tiling. For instance:

```
func @diagonal_dependence() {
  %A = alloc() : memref<64x64xf32>

  affine.for %i = 0 to 64 {
    affine.for %j = 0 to 64 {
      %0 = affine.load %A[%j, %i] : memref<64x64xf32>
      %1 = affine.load %A[%i, %j - 1] : memref<64x64xf32>
      %2 = addf %0, %1 : f32
      affine.store %2, %A[%i, %j] : memref<64x64xf32>
    }
  }

  return
}
```

You can find more information about this example from the Section 3.11
of [1].

In general, there are three types of dependences here: two flow
dependences, one in direction `(i, j) = (0, 1)` (notation that depicts a
vector in the 2D iteration space), one in `(i, j) = (1, -1)`; and one
anti dependence in the direction `(-1, 1)`.

Since two of them are along the diagonal in opposite directions, the
default tiling method in `affine`, which tiles the iteration space into
rectangles, will violate the legality condition proposed by Irigoin and
Triolet [2]. [2] implies two tiles cannot depend on each other, while in
the `affine` tiling case, two rectangles along the same diagonal are
indeed dependent, which simply violates the rule.

This diff attempts to put together a validator that checks whether the
rule from [2] is violated or not when applying the default tiling method
in `affine`.

The canonical way to perform such validation is by examining the effect
from adding the constraint from Irigoin and Triolet to the existing
dependence constraints.

Since we already have the prior knowlegde that `affine` tiles in a
hyper-rectangular way, and the resulting tiles will be scheduled in the
same order as their respective loop indices, we can simplify the
solution to just checking whether all dependence components are
non-negative along the tiling dimensions.

We put this algorithm into a new API called `checkTilingLegality` under
`LoopTiling.cpp`. This function iterates every `load`/`store` pair, and
if there is any dependence between them, we get the dependence component
  and check whether it has any negative component. This function returns
  `failure` if the legality condition is violated.

[1]. Bondhugula, Uday. Effective Automatic parallelization and locality optimization using the Polyhedral model. https://dl.acm.org/doi/book/10.5555/1559029
[2]. Irigoin, F. and Triolet, R. Supernode Partitioning. https://dl.acm.org/doi/10.1145/73560.73588

Differential Revision: https://reviews.llvm.org/D84882
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp (diff)
The file was addedmlir/test/Dialect/Affine/loop-tiling-validity.mlir
The file was modifiedmlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp (diff)
Commit d30d46193876102a6bc99b527dfaf79be4b09515 by maskray
[ELF] Support .cfi_signal_frame

glibc/sysdeps/unix/sysv/linux/x86_64/sigaction.c libc.a(sigaction.o) has a CIE
with the augmentation string "zRS". Support 'S' to allow --icf={safe,all}.
The file was modifiedlld/ELF/EhFrame.cpp (diff)
The file was modifiedlld/test/ELF/eh-frame-value-format7.s (diff)
The file was modifiedlld/test/ELF/icf-eh-frame.s (diff)
Commit 58acda1c16a9359c0b8c37e17a2df58c56250ed0 by joker.eph
Revert "[mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects."

This reverts commit 9f24640b7e6e61b0f293c724155a90a5e446dd7a.

We hit some dead-locks on thread exit in some configurations: TLS exit handler is taking a lock.
Temporarily reverting this change as we're debugging what is going on.
The file was modifiedmlir/lib/IR/MLIRContext.cpp (diff)
The file was modifiedmlir/test/EDSC/builder-api-test.cpp (diff)
The file was modifiedmlir/lib/Support/StorageUniquer.cpp (diff)
The file was removedmlir/include/mlir/Support/ThreadLocalCache.h
Commit eebd0a57fc9387689af393a28cd00105ae9549e8 by joker.eph
Remove unused class member (NFC)

Fix include/mlir/Reducer/ReductionNode.h:79:18: warning: private field 'parent' is not used [-Wunused-private-field]
The file was modifiedmlir/include/mlir/Reducer/ReductionNode.h (diff)
The file was modifiedmlir/tools/mlir-reduce/ReductionNode.cpp (diff)
Commit 872bdc0be7dd38a3c41965cdeca876e03ac3fd6c by joker.eph
Remove unused static helper getMemRefTypeFromTensorType() (NFC)
The file was modifiedmlir/lib/Dialect/StandardOps/IR/Ops.cpp (diff)
Commit 514b00c43996221b90ce581bfb18b6af7caed5f6 by craig.topper
[X86] Limit the scope of the min/max canonicalization in combineSelect

Previously the transform was doing these two canonicalizations
(x > y) ? x : y -> (x >= y) ? x : y
(x < y) ? x : y -> (x <= y) ? x : y

But those don't seem to be useful generally. And they actively
pessimize the cases in PR47049.

This patch limits it to
(x > 0) ? x : 0 -> (x >= 0) ? x : 0
(x < -1) ? x : -1 -> (x <= -1) ? x : -1

These are the cases mentioned in the comments as the motivation
for the canonicalization. These allow the CMOV to use the S
flag from the compare thus improving opportunities to use a TEST
or the flags from an arithmetic instruction.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp (diff)
The file was modifiedllvm/test/CodeGen/X86/cmov.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/atomic-minmax-i6432.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/atomic32.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/atomic128.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/pr5145.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/8bit_cmov_of_trunc_promotion.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/atomic64.ll (diff)
The file was modifiedllvm/test/CodeGen/X86/atomic6432.ll (diff)
Commit 595d3b5ecc59d1c89a8eefbfc37083b0d45f502f by aqjune
[InstCombine] Add tests for select(freeze(icmp x, y), x, y); NFC
The file was modifiedllvm/test/Transforms/InstCombine/select.ll (diff)
Commit 5d59385ba67ec20dc4a3e13b9a7088ace970df4d by sivachandra
[libc] Setup TLS in x86_64 loader.

The new code added is still very x86_64 specific. AArch64 support will
be added very soon and refactoring of the loader code will be done as
part of the patches adding it.

Reviewed By: asteinhauser

Differential Revision: https://reviews.llvm.org/D82700
The file was modifiedlibc/test/loader/CMakeLists.txt (diff)
The file was modifiedlibc/loader/linux/x86_64/CMakeLists.txt (diff)
The file was modifiedlibc/loader/linux/x86_64/start.cpp (diff)
The file was addedlibc/test/loader/linux/tls_test.cpp
The file was modifiedlibc/config/linux/CMakeLists.txt (diff)
The file was modifiedlibc/test/loader/linux/CMakeLists.txt (diff)
The file was addedlibc/config/linux/app.h
Commit b6d9add71b1a7bc77ce504ed09a43288ca67c0cd by aqjune
[InstCombine] Optimize select(freeze(icmp eq/ne x, y), x, y)

This patch adds an optimization that folds select(freeze(icmp eq/ne x, y), x, y)
to x or y.
This was needed to resolve slowdown after D84940 is applied.

I tried to bake this logic into foldSelectInstWithICmp, but it wasn't clear.
This patch conservatively writes the pattern in a separate function,
foldSelectWithFrozenICmp.

The output does not need freeze; https://alive2.llvm.org/ce/z/X49hNE (from @nikic)

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D85533
The file was modifiedllvm/test/Transforms/InstCombine/select.ll (diff)
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp (diff)
Commit 5c9c4ade9d1269e83fdf8e5d8f62b376a76da2b0 by liufeng.ee
Add the inline interface to the shape dialect

This patch also fixes a minor issue that shape.rank should allow
returning !shape.size. The dialect doc has such an example for
shape.rank.

Differential Revision: https://reviews.llvm.org/D85556
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp (diff)
The file was modifiedmlir/test/Dialect/Shape/canonicalize.mlir (diff)
Commit db936e0e915377a58032dccc13bedbfccf0a1ca8 by sivachandra
[libc][NFC] Add library of floating point test matchers.

This eliminates UnitTest's dependency on FPUtil and hence prevents
non-math tests from depending indirectly on FPUtil. The patch
essentially moves some of the existing pieces into a library of its own.

Along the way, renamed add_math_unittest to add_fp_unittest.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D85486
The file was modifiedlibc/test/src/math/fmaxf_test.cpp (diff)
The file was modifiedlibc/test/src/math/fminf_test.cpp (diff)
The file was addedlibc/utils/FPUtil/TestHelpers.h
The file was modifiedlibc/test/src/math/CMakeLists.txt (diff)
The file was modifiedlibc/test/src/math/fmaxl_test.cpp (diff)
The file was modifiedlibc/test/src/math/fmin_test.cpp (diff)
The file was modifiedlibc/utils/FPUtil/CMakeLists.txt (diff)
The file was modifiedlibc/test/src/math/fminl_test.cpp (diff)
The file was modifiedlibc/utils/UnitTest/Test.cpp (diff)
The file was modifiedlibc/utils/UnitTest/Test.h (diff)
The file was addedlibc/utils/FPUtil/TestHelpers.cpp
The file was modifiedlibc/test/src/math/fmax_test.cpp (diff)
Commit f6d74b29d6dc437db983aabee0b2b6d6d3c52f56 by sivachandra
[libc][NFC] Disable a loader test as ld.gold fails to link.

Will be reenabled after investigating and fixing the problem.
The file was modifiedlibc/test/loader/linux/CMakeLists.txt (diff)
Commit 0b90a08f7722980f6074c6eada8022242408cdb4 by ro
[test][DebugInfo] Adapt two tests for Sun assembler syntax on Sparc

Two DebugInfo tests currently `FAIL` on Sparc:

  LLVM :: DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll
  LLVM :: DebugInfo/Generic/array.ll

both in a similar way.  E.g.

  : 'RUN: at line 1';   /var/llvm/local-sparcv9-A/bin/llc -O2 /vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll -o - | /var/llvm/local-sparcv9-A/bin/FileCheck /vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll

  /vol/llvm/src/llvm-project/local/llvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll:4:10: error: CHECK: expected string not found in input
  ; CHECK: debug_info,
           ^

On `amd64-pc-solaris2.11`, the corresponding line is

  .section        .debug_info,"",@progbits

while on `sparcv9-sun-solaris2.11` we have only

  .section        .debug_info

This happens because Sparc currently emits `.section` directives using the
style of the Solaris/SPARC assembler (controlled by `SunStyleELFSectionSwitchSyntax`).

This patch takes the easy way out and allows both forms while tightening the
check to only match the `.section` directive.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`,
`x86_64-pc-linux-gnu`, and `x86_64-apple-darwin20.0.0`.

Differential Revision: https://reviews.llvm.org/D85414
The file was modifiedllvm/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll (diff)
The file was modifiedllvm/test/DebugInfo/Generic/array.ll (diff)