[PATCH] D98247: [X86][AMX] Prevent transforming load pointer from <256 x i32>* to x86_amx*.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 22:30:24 PST 2021


LuoYuanke added a comment.

In D98247#2615789 <https://reviews.llvm.org/D98247#2615789>, @lebedev.ri wrote:

> I do not understand how `load x86_amx` can cause trouble while `load <256 x i32>` works.
> More generally, if this proceeds, what will happen if i directly feed the current (bad) IR to llc?
> It will still have issues, will it not?
> If they are interchangeable like that, why the lowering can not be extended to be agnostic of the actual type?

It is a long story, but let me try to explain.

1. We have dedicate x86_amx type for AMX hardware.
2. LLVM provide several intrinsics for AMX, and Clang have corresponding builtin that map to those intrinsics.
3. We don't have a new type in C language for AMX, we use vector type instead.
4. When Clang front-end create LLVM AMX intrinsics from AMX buildin, it cast the vector type <256 x i32> to x86_amx and feed x86_amx to AMX intrinsics. However there are still load/store <256 x i32> instructions generated in O0 build. So we create a pass to transform load/store <256 x i32> if the input or output of load/store is propagated from AMX intrinsics. We do the transform start from bitcast of <256 x i32> or x86_amx. The bitcast of <256 x i32>* to x86_amx is unexpected. And it cause much work to support it. So we want to prevent generating x86_amx* in our IR.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98247/new/

https://reviews.llvm.org/D98247



More information about the llvm-commits mailing list