[PATCH] D137923: [X86][AMX] Fix the shape dependency issue.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 19:45:19 PST 2022


LuoYuanke created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
LuoYuanke requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137923

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137923.475045.patch
Type: text/x-patch
Size: 11073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221114/0e6b1db6/attachment.bin>


More information about the llvm-commits mailing list