This is an archive of the discontinued LLVM Phabricator instance.

[X86][AMX] Replace LDTILECFG with PLDTILECFGV on auto-config.
ClosedPublic

Authored by LuoYuanke on May 26 2022, 8:02 PM.

Details

Summary

There is intrinsic @llvm.x86.ldtilecfg which is lowered to LDTILECFG.
This intrinsic is open for user to configure tile registers by
themselves. There is a chance that @llvm.x86.ldtilecfg would be mixed
with the new AMX intrinsics which depend on compiler to configure tile
registers. Separate pusedo instruction PLDTILECFGV would avoid
unexpected behavious when @llvm.x86.ldtilecfg is mixed with new AMX
intrinsics. Though user should not mix the two programming model,
compiler should avoid crash or UB when they are mixed.

Diff Detail

Event Timeline

LuoYuanke created this revision.May 26 2022, 8:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 8:02 PM
LuoYuanke requested review of this revision.May 26 2022, 8:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 8:02 PM
LuoYuanke updated this revision to Diff 432454.May 26 2022, 8:13 PM

Add attribute for PLDTILECFGV

llvm/lib/Target/X86/X86InstrInfo.cpp
7363

I think the old one should also keep in isSchedulingBoundary

LuoYuanke added inline comments.May 26 2022, 11:09 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
7363

This is to prevent shape def instruction be scheduled after PLDTILECFGV. The old one (LDTILECFG) is only generated from user's intrinsic, there is no shape dependency issue. I prefer to adding LDTILECFG as schedule boudary when it is really necessary.

LuoYuanke added inline comments.May 26 2022, 11:14 PM
llvm/test/CodeGen/X86/AMX/amx-tile-intrinsics.ll
3

This the new test case that expose the issue.

This revision is now accepted and ready to land.May 27 2022, 1:04 AM
This revision was landed with ongoing or failed builds.May 27 2022, 1:38 AM
This revision was automatically updated to reflect the committed changes.