1. Aug 09, 2020
  2. Aug 08, 2020
    • Sanjay Patel's avatar
      [DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division, part 2 · f22ac1d1
      Sanjay Patel authored
      Follow-up to D82716 / rGea71ba11
      We do not have the fabs removal fold in IR yet for the case
      where the sqrt operand is repeated, so that's another potential
      improvement.
      f22ac1d1
    • Sanjay Patel's avatar
      ba4c2141
    • Benjamin Kramer's avatar
      38537307
    • Rainer Orth's avatar
      [test][DebugInfo] Adapt two tests for Sun assembler syntax on Sparc · 0b90a08f
      Rainer Orth authored
      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
      0b90a08f
    • Siva Chandra Reddy's avatar
      [libc][NFC] Disable a loader test as ld.gold fails to link. · f6d74b29
      Siva Chandra Reddy authored
      Will be reenabled after investigating and fixing the problem.
      f6d74b29
    • Siva Chandra Reddy's avatar
      [libc][NFC] Add library of floating point test matchers. · db936e0e
      Siva Chandra Reddy authored
      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
      db936e0e
    • Feng Liu's avatar
      Add the inline interface to the shape dialect · 5c9c4ade
      Feng Liu authored
      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
      5c9c4ade
    • Juneyoung Lee's avatar
      [InstCombine] Optimize select(freeze(icmp eq/ne x, y), x, y) · b6d9add7
      Juneyoung Lee authored
      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
      b6d9add7
    • Siva Chandra Reddy's avatar
      [libc] Setup TLS in x86_64 loader. · 5d59385b
      Siva Chandra Reddy authored
      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
      5d59385b
    • Juneyoung Lee's avatar
    • Craig Topper's avatar
      [X86] Limit the scope of the min/max canonicalization in combineSelect · 514b00c4
      Craig Topper authored
      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.
      514b00c4
    • Mehdi Amini's avatar
    • Mehdi Amini's avatar
      Remove unused class member (NFC) · eebd0a57
      Mehdi Amini authored
      Fix include/mlir/Reducer/ReductionNode.h:79:18: warning: private field 'parent' is not used [-Wunused-private-field]
      eebd0a57
    • Mehdi Amini's avatar
      Revert "[mlir] Add a utility class, ThreadLocalCache, for storing non static thread local objects." · 58acda1c
      Mehdi Amini authored
      This reverts commit 9f24640b.
      
      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.
      58acda1c
    • Fangrui Song's avatar
      [ELF] Support .cfi_signal_frame · d30d4619
      Fangrui Song authored
      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}.
      d30d4619
    • Vincent Zhao's avatar
      [MLIR] Add tiling validity check to loop tiling pass · 754e09f9
      Vincent Zhao authored
      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
      754e09f9
    • Richard Smith's avatar
      PR47025, PR47043: Diagnose unexpanded parameter packs in concept · fb943696
      Richard Smith authored
      declarations and requires-expressions.
      fb943696
    • Keno Fischer's avatar
      [X86] Don't produce bad x86andp nodes for i1 vectors · c58674df
      Keno Fischer authored
      In D85499, I attempted to fix this same issue by canonicalizing
      andnp for i1 vectors, but since there was some opposition to such
      a change, this commit just fixes the bug by using two different
      forms depending on which kind of vector type is in use. We can
      then always decide to switch the canonical forms later.
      
      Description of the original bug:
      We have a DAG combine that tries to fold (vselect cond, 0000..., X) -> (andnp cond, x).
      However, it does so by attempting to create an i64 vector with the number
      of elements obtained by truncating division by 64 from the bitwidth. This is
      bad for mask vectors like v8i1, since that division is just zero. Besides,
      we don't want i64 vectors anyway. For i1 vectors, switch the pattern
      to (andnp (not cond), x), which is the canonical form for `kandn`
      on mask registers.
      
      Fixes https://github.com/JuliaLang/julia/issues/36955.
      
      Differential Revision: https://reviews.llvm.org/D85553
      c58674df
    • LLVM GN Syncbot's avatar
      [gn build] Port f5b5ccf2 · ca4bcfbf
      LLVM GN Syncbot authored
      ca4bcfbf
    • Yuanfang Chen's avatar
      Reland "Revert "[NewPM][CodeGen] Introduce machine pass and machine pass manager"" · f5b5ccf2
      Yuanfang Chen authored
      This relands commit 320eab2d.
      
      The test failed because it was looking for x86-linux target
      unconditionally. Now it gets the default target.
      f5b5ccf2
    • peter klausler's avatar
      [flang] Handle DATA initialization of EQUIVALENCE'd objects · 4ac617f4
      peter klausler authored
      Objects that are storage associated by EQUIVALENCE and
      initialized with DATA are initialized by creating a
      compiler temporary data object in the same scope,
      assigning it an offset, type, and size that covers the
      transitive closure of the associated initialized original
      symbols, and combining their initializers into one common
      initializer for the temporary.
      
      Some problems with offset assignment of EQUIVALENCE'd objects
      in COMMON were exposed and corrected, and some more error
      cases are checked.
      
      Remove obsolete function.
      Small bugfix (nested implied dos).
      Add a test.
      Fix struct/class warning.
      
      Differential Revision: https://reviews.llvm.org/D85560
      4ac617f4
    • Matt Arsenault's avatar
      3c0597a9
    • Vitaly Buka's avatar
      [NFC][StackSafety] Fix statistics · 648228bc
      Vitaly Buka authored
      648228bc
    • Teresa Johnson's avatar
      [sanitizer] Fix comment (NFC) · bb1456de
      Teresa Johnson authored
      As pointed out in D85387, part of the comment for MapDynamicShadow
      refactored to sanitizer_common in D83247 was incorrect for non-Linux
      versions. Update the comment to reflect that.
      bb1456de
    • Mauricio Sifontes's avatar
      Create Reduction Tree Pass · 27d0e14d
      Mauricio Sifontes authored
      Implement the Reduction Tree Pass framework as part of the MLIR Reduce tool. This is a parametarizable pass that allows for the implementation of custom reductions passes in the tool.
      Implement the FunctionReducer class as an example of a Reducer class parameter for the instantiation of a Reduction Tree Pass.
      Create a pass pipeline with a Reduction Tree Pass with the FunctionReducer class specified as parameter.
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D83969
      27d0e14d
    • Nick Desaulniers's avatar
      Revert "[Clang] implement -fno-eliminate-unused-debug-types" · abb9bf4b
      Nick Desaulniers authored
      This reverts commit e486921f.
      
      Breaks windows builds and osx builds.
      abb9bf4b
    • Nick Desaulniers's avatar
      Revert "fix windows build for D80242" · 73413d26
      Nick Desaulniers authored
      This reverts commit cbd8ec93.
      73413d26