This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix required features checking with empty string
ClosedPublic

Authored by Jim on Jul 6 2023, 4:31 AM.

Details

Summary

In our downstream, we define some intrinsics that don't require any
extra extension enabled. Such as

TARGET_BUILTIN(__builtin_riscv_xxx, "LiLi", "nc", "")

But split function's KeepEmpty argument is True. Got the error message

error: builtin requires at least one of the following extensions support to be enabled : ''

when we use our customized intrinsic.

Diff Detail

Event Timeline

Jim created this revision.Jul 6 2023, 4:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 4:31 AM
Jim requested review of this revision.Jul 6 2023, 4:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 4:31 AM
Jim edited the summary of this revision. (Show Details)
Jim edited the summary of this revision. (Show Details)Jul 6 2023, 4:36 AM
Jim added a comment.Jul 13 2023, 5:56 PM

Kindly ping.

Can you give an example of intrinsic that doesn't require any extra extension enabled?

This seems reasonable to me.

Jim added a comment.Jul 13 2023, 8:10 PM

Can you give an example of intrinsic that doesn't require any extra extension enabled?

Like read/write csr intrinsics that we add for convenient usage doesn't need any extra extension enabled.

Jim added a reviewer: wangpc.Jul 13 2023, 8:12 PM

Can you give an example of intrinsic that doesn't require any extra extension enabled?

Like read/write csr intrinsics that we add for convenient usage doesn't need any extra extension enabled.

It seems that zicsr is related.
I am not opposed to this change, just out of curiosity. :-)

Jim added a comment.Jul 13 2023, 10:37 PM

Can you give an example of intrinsic that doesn't require any extra extension enabled?

Like read/write csr intrinsics that we add for convenient usage doesn't need any extra extension enabled.

It seems that zicsr is related.
I am not opposed to this change, just out of curiosity. :-)

read/write csr is not a good example for the newest isa spec. In older isa spec 2.2, it is included in base i extension.
Anyway. just want to add some intrinsics and them generate corresponding instruction that is in base i extension.
And it is reasonable if keep required feature string empty should imply no features/extensions required.

This revision is now accepted and ready to land.Jul 13 2023, 10:43 PM
wangpc accepted this revision.Jul 13 2023, 11:21 PM

LGTM as well.

This revision was landed with ongoing or failed builds.Jul 14 2023, 1:14 AM
This revision was automatically updated to reflect the committed changes.