[all-commits] [llvm/llvm-project] 7d59b3: [X86][AMX] Fix the shape dependency issue.

Luo, Yuanke via All-commits all-commits at lists.llvm.org
Tue Nov 15 18:50:27 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d59b337f6dbeac3b0c655d52b7ce2edc4a2d364
      https://github.com/llvm/llvm-project/commit/7d59b337f6dbeac3b0c655d52b7ce2edc4a2d364
  Author: Luo, Yuanke <yuanke.luo at intel.com>
  Date:   2022-11-16 (Wed, 16 Nov 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86LowerAMXType.cpp
    M llvm/test/CodeGen/X86/AMX/amx-combine.ll

  Log Message:
  -----------
  [X86][AMX] Fix the shape dependency issue.

AMX shape should be defined before AMX intrinsics. However for below
case, the shape a.row is defined after tile load of b. If we transform
`load b` to `@llvm.x86.tileloadd64 intrinsic`, the shape dependency
doesn't meet.
```
void test_tile_dpbsud(__tile1024i a, __tile1024i b, __tile1024i c) {
  __tile_dpbsud(&c, a, b);
}
```
This patch is to store the tile b to stack and reloaded it after the
def of b.row. It would cause redundant store/load, but it is simple
to avoid generating invalid IR.
The better way may hoist `def b.row` before tile load instruction,
but it seems more complicated to recursively hoist its operands.

Differential Revision: https://reviews.llvm.org/D137923




More information about the All-commits mailing list