This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Add intrinsics for ibar, break and syscall
ClosedPublic

Authored by gonglingqin on Nov 15 2022, 11:08 PM.

Details

Summary

Diagnostics for intrinsic input parameters have also been added.

Diff Detail

Event Timeline

gonglingqin created this revision.Nov 15 2022, 11:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 11:08 PM
gonglingqin requested review of this revision.Nov 15 2022, 11:08 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 15 2022, 11:08 PM
arsenm added a subscriber: arsenm.Nov 15 2022, 11:10 PM
arsenm added inline comments.
clang/include/clang/Basic/BuiltinsLoongArch.def
20–24

These all have I parameters but the underlying intrinsic wasn't marked with immarg

clang/test/CodeGen/LoongArch/intrinsic-error.c
37

Should also test non-constant cases

gonglingqin added inline comments.Nov 16 2022, 12:37 AM
clang/include/clang/Basic/BuiltinsLoongArch.def
20–24

Thanks for checking, I'll add constraints.

clang/test/CodeGen/LoongArch/intrinsic-error.c
37

Thanks, I'll add the test cases.

Address @arsenm's comments.

SixWeining added inline comments.Nov 16 2022, 6:49 PM
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
603–604

This string can be inlined into line 606. Then line 595 can be removed.

gonglingqin added inline comments.Nov 16 2022, 7:10 PM
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
603–604

Thanks, I will modify it.

Address @SixWeining's comments.

SixWeining accepted this revision.Nov 16 2022, 9:16 PM

LGTM but let's wait for others.

This revision is now accepted and ready to land.Nov 16 2022, 9:16 PM