This is an archive of the discontinued LLVM Phabricator instance.

[FuncSpec] Don't specialize functions with attribute NoDuplicate.
ClosedPublic

Authored by SjoerdMeijer on Jun 16 2021, 6:30 AM.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Jun 16 2021, 6:30 AM
SjoerdMeijer requested review of this revision.Jun 16 2021, 6:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2021, 6:30 AM

Fixed typo in test.

ormris removed a subscriber: ormris.Jun 16 2021, 11:44 AM

It makes sense to me. If a function is marked with NoDuplicate, we shouldn't clone it. Everything is fine.
But I want to ask, in what situations, generally a function would be marked with NoDuplicate attribute? I didn't find it in docs or codes.

It makes sense to me. If a function is marked with NoDuplicate, we shouldn't clone it. Everything is fine.
But I want to ask, in what situations, generally a function would be marked with NoDuplicate attribute? I didn't find it in docs or codes.

In Clang, there's a no duplicate function attribute, see https://clang.llvm.org/docs/AttributeReference.html#noduplicate.
And that can translate to LLVM IR function attribute no duplicate, see also https://llvm.org/docs/LangRef.html#function-attributes.

ChuanqiXu accepted this revision.Jun 17 2021, 1:16 AM

It makes sense to me. If a function is marked with NoDuplicate, we shouldn't clone it. Everything is fine.
But I want to ask, in what situations, generally a function would be marked with NoDuplicate attribute? I didn't find it in docs or codes.

In Clang, there's a no duplicate function attribute, see https://clang.llvm.org/docs/AttributeReference.html#noduplicate.
And that can translate to LLVM IR function attribute no duplicate, see also https://llvm.org/docs/LangRef.html#function-attributes.

I see. Got it.

This revision is now accepted and ready to land.Jun 17 2021, 1:16 AM