1. Aug 30, 2022
    • Utkarsh Saxena's avatar
      FoldingRanges: Handle LineFoldingsOnly clients. · a11ec00a
      Utkarsh Saxena authored
      Do not fold the endline which contains tokens after the end of range.
      
      Differential Revision: https://reviews.llvm.org/D131154
      a11ec00a
    • Quentin Colombet's avatar
      [mlir][MemRef] Canonicalize reinterpret_cast(extract_strided_metadata) · ba916c0c
      Quentin Colombet authored
      Add a canonicalizetion step for
      reinterpret_cast(extract_strided_metadata).
      This step replaces this sequence of operations by either:
      - A noop, i.e., the original memref is directly used, or
      - A plain cast of the original memref
      
      The choice is ultimately made based on whether the original memref type
      is equal to what the reinterpret_cast iss producing. For instance, the
      reinterpret_cast could be changing some dimensions from static to
      dynamic and in such case, we need to keep a cast.
      
      The transformation is currently only performed when the reinterpret_cast
      uses exactly the same arguments as what the extract_strided_metadata
      produces. It may be possible to be more aggressive here but I wanted to
      start with a relatively simple MLIR patch for my first one!
      
      Differential Revision: https://reviews.llvm.org/D132776
      ba916c0c
    • Nathan Ridge's avatar
      [clangd] Fail more gracefully if QueryDriverDatabase cannot determine file type · 9af0a142
      Nathan Ridge authored
      Currently, QueryDriverDatabase returns an empty compile command
      if it could not determine the file type.
      
      This failure mode is unnecessarily destructive; it's better to
      just return the incoming compiler command, which is still more
      likely to be useful than an empty command.
      
      Differential Revision: https://reviews.llvm.org/D132833
      9af0a142
    • Aart Bik's avatar
      [mlir][sparse] start a sparse codegen conversion pass · 86b22d31
      Aart Bik authored
      This new pass provides an alternative to the current conversion pass
      that converts sparse tensor types and sparse primitives to opaque pointers
      and calls into a runtime support library. This pass will map sparse tensor
      types to actual data structures and primitives to actual code. In the long
      run, this new pass will remove our dependence on the support library, avoid
      the need to link in fully templated and expanded code, and provide much better
      opportunities for optimization on the generated code.
      
      Reviewed By: Peiming
      
      Differential Revision: https://reviews.llvm.org/D132766
      86b22d31
    • Craig Topper's avatar
      [VP][RISCV] Add vp.fabs intrinsic and RISC-V support. · 2f811a6c
      Craig Topper authored
      Mostly just modeled after vp.fneg except there is a
      "functional instruction" for fneg while fabs is always an
      intrinsic.
      
      Reviewed By: fakepaper56
      
      Differential Revision: https://reviews.llvm.org/D132793
      2f811a6c
    • Jeff Niu's avatar
      [mlir][ods] OpFormat: fix type inference issues · 12d2f75a
      Jeff Niu authored
      This patch fixes issues with generating assembly format parsers for
      operations that use the `operands` directive or which have unnamed
      arguments or results.
      
      This patch also fixes a function in `OpAsmParser` that always produced
      an error when trying to resolve variadic operands with the same type.
      
      Fixes #51841
      
      Reviewed By: rriddle
      
      Differential Revision: https://reviews.llvm.org/D131627
      12d2f75a
    • Craig Topper's avatar
      [RISCV] Add Uses=[FRM] and mayRaiseFPException to VF(N/W)CVT instructions. · e0a9da25
      Craig Topper authored
      Reviewed By: arcbbb, kito-cheng
      
      Differential Revision: https://reviews.llvm.org/D132792
      e0a9da25
    • Mark de Wever's avatar
      [NFC][libc++][format] Use ranges in the output. · a6ce0d08
      Mark de Wever authored
      This should avoid some copies of the output iterator.
      
      Reviewed By: #libc, Mordante
      
      Differential Revision: https://reviews.llvm.org/D132812
      a6ce0d08
    • Craig Topper's avatar
      [RISCV] Use analyzeBranch in RISCVRedundantCopyElimination. · 6732896b
      Craig Topper authored
      The existing code was incorrect if we had more than one conditional
      branch instruction in a basic block. Though I don't think that will
      occur, using analyzeBranch detects that as an unsupported case.
      
      Overall this results in simpler code in RISCVRedundantCopyElimination.
      
      Reviewed By: reames, kito-cheng
      
      Differential Revision: https://reviews.llvm.org/D132347
      6732896b
    • Zhixun Tan's avatar
      [mlir][dataflow] Consolidate AbstractSparseLattice::markPessimisticFixpoint()... · de0ebc52
      Zhixun Tan authored
      [mlir][dataflow] Consolidate AbstractSparseLattice::markPessimisticFixpoint() and AbstractDenseLattice::reset() into Abstract{Sparse,Dense}DataFlowAnalysis::setToEntryState().
      
      ### Rationale
      
      For a program point where we cannot reason about incoming dataflow (e.g. an argument of an entry block), the framework needs to initialize the state.
      
      Currently, `AbstractSparseDataFlowAnalysis` initializes such state to the "pessimistic fixpoint", and `AbstractDenseDataFlowAnalysis` calls the state's `reset()` function.
      
      However, entry states aren't necessarily the pessimistic fixpoint. Example: in reaching definition, the pessimistic fixpoint is `{all definitions}`, but the entry state is `{}`.
      
      This awkwardness might be why the dense analysis API currently uses `reset()` instead of `markPessimisticFixpoint()`.
      
      This patch consolidates entry point initialization into a single function `setToEntryState()`.
      
      ### API Location
      
      Note that `setToEntryState()` is defined in the analysis rather than the lattice, so that we allow different analyses to use the same lattice but different entry states.
      
      ### Removal of the concept of optimistic/known value
      
      The concept of optimistic/known value is too specific to SCCP.
      
      Furthermore, the known value is not really used: In the current SCCP implementation, the known value (pessimistic fixpoint) is always `Attribute{}` (non-constant). This means there's no point storing a `knownValue` in each state.
      
      If we do need to re-introduce optimistic/known value, we should put it in the SCCP analysis, not the sparse analysis API.
      
      ### Terminology
      
      Please let me know if "entry state" is a good terminology.
      
      I chose "entry" from Wikipedia (https://en.wikipedia.org/wiki/Data-flow_analysis#Basic_principles).
      
      Another term I can think of is "boundary" (https://suif.stanford.edu/~courses/cs243/lectures/L3-DFA2-revised.pdf) which might be better since it also makes sense for backward analysis.
      
      Reviewed By: Mogball
      
      Differential Revision: https://reviews.llvm.org/D132086
      de0ebc52
    • Florian Hahn's avatar
      [DSE] Add extra test for loop invariant store in loop, update comments. · 197332a1
      Florian Hahn authored
      Add extra test coverage and updates some slightly stale comments as
      pointed out in D132365.
      197332a1
  2. Aug 29, 2022