This is an archive of the discontinued LLVM Phabricator instance.

[X86][AMX] Report error when shapes are not pre-defined.
ClosedPublic

Authored by LuoYuanke on Apr 24 2022, 1:47 AM.

Details

Summary

Instead of report fatal error, this patch emit error message and exit
when shapes are not pre-defined.

Diff Detail

Event Timeline

LuoYuanke created this revision.Apr 24 2022, 1:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 1:47 AM
LuoYuanke requested review of this revision.Apr 24 2022, 1:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2022, 1:47 AM
LuoYuanke added inline comments.
llvm/test/CodeGen/X86/AMX/amx_error.ll
1 ↗(On Diff #424773)

Will update the case.

LuoYuanke updated this revision to Diff 424775.Apr 24 2022, 1:59 AM

Update test case.

pengfei added inline comments.Apr 24 2022, 2:42 AM
llvm/lib/Target/X86/X86PreTileConfig.cpp
52

Any benefit to use exit? I found we seldom use it in the code.

llvm/test/CodeGen/X86/AMX/amx-error.ll
9

Doesn't it success without this patch? https://godbolt.org/z/qvKcE3bzK

LuoYuanke added inline comments.Apr 24 2022, 2:47 AM
llvm/test/CodeGen/X86/AMX/amx-error.ll
9

Previously it would crash and remind user to submit a bug report. It is not good experience for user.

LuoYuanke added inline comments.Apr 24 2022, 3:07 AM
llvm/lib/Target/X86/X86PreTileConfig.cpp
52

Ok, let's depend on emitError to handle the error. Let me remove exit.

LuoYuanke updated this revision to Diff 424779.Apr 24 2022, 4:40 AM

Address Phoebe's comments.

xiangzhangllvm added inline comments.Apr 24 2022, 5:38 PM
llvm/lib/Target/X86/X86PreTileConfig.cpp
315–316

I think we should stop compiling or at lest let it not generate out file.
Because the error message may be redirect to a log file. Users may not check it.

LuoYuanke added inline comments.Apr 24 2022, 5:42 PM
llvm/lib/Target/X86/X86PreTileConfig.cpp
315–316

The error handler would indicate compiler not generate out file. If there is no error handler, compiler would exit. Pls try clang or llc.
As Phoebe mentions, exit is not a normal way in backend, so I just let the compiling continue but the tile config doesn't happen. Finally compiler would remove the output file.

xiangzhangllvm accepted this revision.Apr 24 2022, 7:00 PM
This revision is now accepted and ready to land.Apr 24 2022, 7:00 PM
This revision was landed with ongoing or failed builds.Apr 25 2022, 11:58 PM
This revision was automatically updated to reflect the committed changes.