This is an archive of the discontinued LLVM Phabricator instance.

[X86][AMX] Don't emit tilerelease for old AMX instrisic.
ClosedPublic

Authored by LuoYuanke on Nov 17 2021, 12:26 AM.

Details

Summary

We should avoid mixing old AMX instrinsic with new AMX intrinsic. For
old AMX intrinsic, user is responsible for invoking tile release. This
patch is to check if there is any tile config generated by compiler. If
so it emit tilerelease instruction, otherwise it don't emit the
instruction.

Diff Detail

Event Timeline

LuoYuanke created this revision.Nov 17 2021, 12:26 AM
LuoYuanke requested review of this revision.Nov 17 2021, 12:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2021, 12:26 AM
pengfei accepted this revision.Nov 17 2021, 12:35 AM

LGTM.

llvm/lib/Target/X86/X86MachineFunctionInfo.h
215

This can be void, i.e.,
void setHasVirtualTileReg() { HasVirtualTileReg = true; }

This revision is now accepted and ready to land.Nov 17 2021, 12:35 AM
LuoYuanke added inline comments.Nov 17 2021, 12:40 AM
llvm/lib/Target/X86/X86MachineFunctionInfo.h
215

True for current patch. Not sure we may set it to false someday.

xiangzhangllvm added inline comments.Nov 17 2021, 2:25 AM
llvm/lib/Target/X86/X86FastTileConfig.cpp
293–294

Another way to escape add a variable in X86MachineFunctionInfo is

if (Changed)
  add tilerelease at MF.end()
LuoYuanke added inline comments.Nov 17 2021, 3:14 AM
llvm/lib/Target/X86/X86FastTileConfig.cpp
293–294

There may be multi exit, so insert tilerelease to end block is not enough.

xiangzhangllvm added inline comments.Nov 17 2021, 4:37 PM
llvm/lib/Target/X86/X86FastTileConfig.cpp
293–294

Make sense, here not merge the multi exits to one exit yet.

This revision was landed with ongoing or failed builds.Nov 17 2021, 5:28 PM
This revision was automatically updated to reflect the committed changes.