Reapply "[X86][AMX] Try to hoist AMX shapes' def"
authorWang, Pengfei <pengfei.wang@intel.com>
Tue, 27 Apr 2021 01:51:46 +0000 (09:51 +0800)
committerWang, Pengfei <pengfei.wang@intel.com>
Tue, 27 Apr 2021 02:27:59 +0000 (10:27 +0800)
commit016092d786f226f403fce5b5d0888dfa939b3f21
tree9a1f23c9d51d14abbae2bebde5a5aa807530f2bf
parent93604305bb72201641f31cc50a6e7b2fe65d3af3
Reapply "[X86][AMX] Try to hoist AMX shapes' def"

We request no intersections between AMX instructions and their shapes'
def when we insert ldtilecfg. However, this is not always ture resulting
from not only users don't follow AMX API model, but also optimizations.

This patch adds a mechanism that tries to hoist AMX shapes' def as well.
It only hoists shapes inside a BB, we can improve it for cases across
BBs in future. Currently, it only hoists shapes of which all sources' def
above the first AMX instruction. We can improve for the case that only
source that moves an immediate value to a register below AMX instruction.

Reviewed By: xiangzhangllvm

Differential Revision: https://reviews.llvm.org/D101067
llvm/lib/Target/X86/X86PreTileConfig.cpp
llvm/test/CodeGen/X86/AMX/amx-sched.ll