This is an archive of the discontinued LLVM Phabricator instance.

[Clang][LoongArch] Implement __builtin_loongarch_crc_w_d_w builtin and add diagnostics
ClosedPublic

Authored by gonglingqin on Nov 3 2022, 12:43 AM.

Details

Summary

This patch adds support to prevent __builtin_loongarch_crc_w_d_w from compiling
on loongarch32 in the front end and adds diagnostics accordingly.

Reference: https://github.com/gcc-mirror/gcc/blob/master/gcc/config/loongarch/larchintrin.h#L175-L184

Depends on D136906

Diff Detail

Event Timeline

gonglingqin created this revision.Nov 3 2022, 12:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 12:43 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
gonglingqin requested review of this revision.Nov 3 2022, 12:43 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2022, 12:43 AM
SixWeining added inline comments.Nov 6 2022, 7:59 PM
llvm/include/llvm/IR/IntrinsicsLoongArch.td
54

Unnecessary.

gonglingqin added inline comments.Nov 6 2022, 10:39 PM
llvm/include/llvm/IR/IntrinsicsLoongArch.td
54

Thanks, I will modify it.

Address @SixWeining's comments.

SixWeining accepted this revision.Nov 7 2022, 3:33 AM

LGTM except 2 nits. And let's wait others.

clang/lib/Basic/Targets/LoongArch.cpp
174

Delete blank line.

clang/lib/Sema/SemaChecking.cpp
3677

Delete blank line.

This revision is now accepted and ready to land.Nov 7 2022, 3:33 AM
gonglingqin added inline comments.Nov 7 2022, 4:16 AM
clang/lib/Basic/Targets/LoongArch.cpp
174

Thanks, I will delete it.

clang/lib/Sema/SemaChecking.cpp
3677

Thanks, I will delete it.

Delete blank line.

This revision was landed with ongoing or failed builds.Nov 10 2022, 5:24 PM
This revision was automatically updated to reflect the committed changes.