1. Apr 12, 2023
  2. Apr 11, 2023
    • Quinn Dawkins's avatar
      [mlir][linalg] Enable propagation of pack/unpack ops through non-elementwise · b4563ee1
      Quinn Dawkins authored
      Allows pack propagation through non-elementwise generics as long as all
      tiled dimensions have parallel iterator types and are only indexed with
      affine dim expressions by any of the operands.
      
      This enables unpack propagation cases where the result type is different
      from the current unpack destination tensor and thus motivates a similar
      helper as the for pack for creating a destination tensor based on
      pack information.
      
      Outer dim permutations are allowed to permute reduction dims, however
      remains unsupported for non-affine dim indexing map results.
      Additionally ops with gather semantics now explicitly prohibit propagation.
      
      Pack/unpack propagation through reductions may not always be beneficial
      so user control over propagation decisions is made available through
      a control function similar to the one for fusion.
      
      Differential Revision: https://reviews.llvm.org/D147508
      b4563ee1
    • Michael Liao's avatar
      [InstCombine] Teach alloca replacement to handle `addrspacecast` · 72fc08a5
      Michael Liao authored
      - As the address space cast may not be valid on a specific target,
        `addrspacecast` is not handled when an `alloca` is able to be replaced
        with the source of memcpy/memmove. This patch addresses that by
        querying a target hook on whether that address space cast is valid.
        For example, on most GPU targets, the cast from a global pointer to a
        generic pointer is valid.
      - If that cast is allowedd (by querying `isValidAddrSpaceCast`), the
        replacement is enhanced to handle that `addrspacecast` as well.
      
      Reviewed By: yaxunl
      
      Differential Revision: https://reviews.llvm.org/D147025
      72fc08a5
    • Felix Schneider's avatar
      [mlir][MemRef] fix error message in ReinterpretCastOp::verify · 2a0c0849
      Felix Schneider authored
      The error message that is displayed when the offset in the MemRefType of
      the Op's result is unexpected was the wrong way around, mixing up
      expected and actual offset.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D148009
      2a0c0849
    • Akash Banerjee's avatar
      [MLIR][OpenMP] Add conversion support from FIR to LLVM Dialect for OMP Target · dc26a3d9
      Akash Banerjee authored
      This enables conversion of OpenMP Target op with region from FIR Dialect to LLVM IR Dialect.
      
      Differential Revision: https://reviews.llvm.org/D147439
      dc26a3d9
    • Alex Zinenko's avatar
      [mlir] fix a crash in linalg.generic parser · 07b52b52
      Alex Zinenko authored
      Report an error when the `iterator_types` attribute is missing.
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D148015
      07b52b52
    • Akash Banerjee's avatar
      [Flang][OpenMP] Add Fortran lowering support for Target directive · 2cfbbfc0
      Akash Banerjee authored
      This patch adds Fortran lowering support for OMP Target directive along with tests.
      
      Differential Revision: https://reviews.llvm.org/D147339
      2cfbbfc0
    • Alex Zinenko's avatar
      [mlir] make transform interpreter debug spew less verbose · 74aec6b4
      Alex Zinenko authored
      In particular, move the printing of the top-level payload after each
      transform under the "full output" debug flag, it is rarely useful and
      excessively long. Also don't print the regions of the transform
      operation being applied as each individual operation in the region is
      likely going to be applied later by itself and therefore printed.
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D148014
      74aec6b4
    • Akash Banerjee's avatar
      [MLIR][OpenMP] Added map clause support for Target · 81bcc62d
      Akash Banerjee authored
      Added map clause support for the OMP Target directive with test.
      
      Differential Revision: https://reviews.llvm.org/D147247
      81bcc62d
    • Ellis Hoag's avatar
      [InstrProf] Temporal Profiling · 244be0b0
      Ellis Hoag authored
      As described in [0], this extends IRPGO to support //Temporal Profiling//.
      
      When `-pgo-temporal-instrumentation` is used we add the `llvm.instrprof.timestamp()` intrinsic to the entry of functions which in turn gets lowered to a call to the compiler-rt function `INSTR_PROF_PROFILE_SET_TIMESTAMP()`. A new field in the `llvm_prf_cnts` section stores each function's timestamp. Then in `llvm-profdata merge` we convert these function timestamps into a //trace// and add it to the indexed profile.
      
      Since these traces could significantly increase the profile size, we've added `-max-temporal-profile-trace-length` and `-temporal-profile-trace-reservoir-size` to limit the length of a trace and the number of traces in a profile, respectively.
      
      In a future diff we plan to use these traces to construct an optimized function order to reduce the number of page faults during startup.
      
      Special thanks to Julian Mestre for helping with reservoir sampling.
      
      [0] https://discourse.llvm.org/t/rfc-t...
      244be0b0
    • Nikita Popov's avatar
      d288411c
    • Anna Thomas's avatar
      [GuardUtils] Add asserts about loop varying widenable conditions · 5675757f
      Anna Thomas authored
      We have now seen two miscompiles because of widening widenable
      conditions at incorrect IR points and thereby changing a branch's loop
      invariant condition to a loop-varying one (see PR60234 and PR61963).
      
      This patch adds asserts in common guard utilities that we use for
      widening to proactively catch these bugs in future.
      Note that these asserts will not fire if we were to sink a widenable
      condition from out of a loop into a loop (that's also incorrect for the
      same reason as above).
      
      Tested this without the fix for PR60234 (guard widening miscompile) and
      confirmed the assert fires.
      
      WARNING: Sometimes, the assert can fire if we failed to hoist the
      invariant condition out of the loop. This is a pass-ordering issue or a
      limitation in LICM, which would need an investigation. See details in
      review.
      
      Differential Revision: https://reviews.llvm.org/D147752
      5675757f
    • Nikita Popov's avatar
      e7f4ad13