Changes from Git (git http://labmaster3.local/git/llvm-project.git)


  1. [NFC][Test] Add a test to verify the DAGCombine of fma (details)
  2. [mlir][Linalg] Add a linalg.reshape op (details)
  3. AMDGPU/GlobalISel: Fix unused variable warning in release (details)
Commit d877229b5b21c833e2344eda7c07f9c49d4dc453 by qshanz
[NFC][Test] Add a test to verify the DAGCombine of fma
The file was addedllvm/test/CodeGen/PowerPC/fma-combine.ll
Commit e3750cafdb17f5b7431f18c0229bfb597dde4c88 by ntv
[mlir][Linalg] Add a linalg.reshape op
Summary: This diff adds a new operation to linalg to allow reshaping of
an existing view into a new view in the same buffer at the same offset.
More specifically: The `linalg.reshape` op produces a new view whose
sizes are a reassociation of the original `view`. Depending on whether
or not the reassociated MemRefType is contiguous, the resulting memref
may require explicit alloc and copies.
A reassociation is defined as a continous grouping of dimensions and is
represented with a affine map array attribute. In the future,
non-continous groupings may be allowed (i.e. permutations, reindexings
For now, it is assumed that either:
1. a reassociation produces and consumes contiguous MemRefType or,
2. the reshape op will be folded into its consumers (by changing the
    of the computations). All other cases are undefined behavior and a
reshape op may not lower to LLVM if it cannot be proven statically that
it does not require alloc+copy.
A reshape may either collapse or expand dimensions, depending on the
relationship between source and target memref ranks. The verification
rule is that the reassociation maps are applied to the memref with the
larger rank to obtain the memref with the smaller rank. In the case of a
dimension expansion, the reassociation maps can be interpreted as
inverse maps.
  // Dimension collapse (i, j) -> i' and k -> k'
  %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                          (i, j, k) -> (k)] :
    memref<?x?x?xf32, stride_spec> into memref<?x?xf32, stride_spec_2>
  // Dimension expansion i -> (i', j') and (k) -> (k')
  %1 = linalg.reshape %0 [(i, j, k) -> (i, j),
                          (i, j, k) -> (k)] :
    memref<?x?xf32, stride_spec> into memref<?x?x?xf32, stride_spec_2>
The relevant invalid and roundtripping tests are added.
Reviewers: AlexEichenberger, ftynse, rriddle, asaadaldien, yangjunpro
Subscribers: kiszk, merge_guards_bot, mehdi_amini, jpienaar, burmako,
shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
Tags: #llvm
Differential Revision:
The file was modifiedmlir/include/mlir/Dialect/Linalg/EDSC/Intrinsics.h
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/
The file was modifiedmlir/test/Dialect/Linalg/invalid.mlir
The file was modifiedmlir/include/mlir/IR/AffineExpr.h
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/test/Dialect/Linalg/roundtrip.mlir
Commit dc7b84c66c10f47adf22baab0103eb9f6593cd72 by arsenm2
AMDGPU/GlobalISel: Fix unused variable warning in release
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp