This is an archive of the discontinued LLVM Phabricator instance.

[clang] Change AMX macros to match names from GCC
ClosedPublic

Authored by jloser on Feb 1 2023, 10:34 AM.

Details

Summary

The current behavior for AMX macros is:

gcc -march=native -dM -E - < /dev/null | grep TILE
#define __AMX_TILE__ 1

clang -march=native -dM -E - < /dev/null | grep TILE
#define __AMXTILE__ 1

which is not ideal. Change __AMXTILE__ and friends to __AMX_TILE__ (i.e.
have an underscore in them). This makes GCC and Clang agree on the naming of
these AMX macros to simplify downstream user code.

Fix this for __AMXTILE__, __AMX_INT8__, __AMX_BF16__, and __AMX_FP16__.

Diff Detail

Event Timeline

jloser created this revision.Feb 1 2023, 10:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 10:34 AM
jloser requested review of this revision.Feb 1 2023, 10:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2023, 10:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jloser updated this revision to Diff 494008.Feb 1 2023, 10:35 AM

Update commit message to properly display the #define

jloser edited the summary of this revision. (Show Details)Feb 1 2023, 10:36 AM
LuoYuanke accepted this revision.Feb 1 2023, 5:08 PM

LGTM, thanks

This revision is now accepted and ready to land.Feb 1 2023, 5:08 PM
jloser added a comment.Feb 2 2023, 7:09 AM

LGTM, thanks

Thanks for the review. Do I need to wait for another approver before landing this? I mostly work on libc++, so not too familiar with expectations on Clang reviews, or whether one approver who's familiar/knowledgable in the area is sufficient.

I'm hoping to land this soon and request to cherry-pick it into LLVM 16 to avoid the macro value changing across 16/17 releases.

@pengfei, would you take a look to double confirm?

pengfei accepted this revision.Feb 2 2023, 9:36 PM

The change makes sense. LGTM.

This revision was automatically updated to reflect the committed changes.