Page MenuHomePhabricator

intrinsics attribute opt-out list proposal.
Needs ReviewPublic

Authored by sstefan1 on Nov 17 2019, 2:40 PM.

Details

Reviewers
jdoerfert
arsenm
Summary

This patch introduces an opt-out attribute list for intrinsics, discussed in D65377.
This should make it easier to annotate intrinsics with attributes that apply to most of them.
Right now I added NoFree and NoSync. If this looks ok, I'll also replace "Throws" IntrinsicProperty with IntrNoUnwind
and make it default.

Note: This is just an attempt, I also intend to send a RFC on the list.

Event Timeline

sstefan1 created this revision.Nov 17 2019, 2:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2019, 2:40 PM
arsenm added inline comments.Nov 17 2019, 9:08 PM
llvm/utils/TableGen/CodeGenTarget.cpp
754–755

I think you could avoid touching tablegen by implementing a filter in the tablegen source

sstefan1 marked an inline comment as done.Nov 18 2019, 11:51 AM
sstefan1 added inline comments.
llvm/utils/TableGen/CodeGenTarget.cpp
754–755

I'm not really sure how to do that in tablegen source. Not really used beyond adding properties to intrinsics.

Is there a reason for avoiding current approach?

arsenm added inline comments.Nov 18 2019, 8:37 PM
llvm/utils/TableGen/CodeGenTarget.cpp
754–755

You could do something like:

class Intrinsic {
  IntrProperties
  OutOutIntrProperties
   IntrPropertiesImpl = !foldl(something overly complicated to filter out OutIntrProperties)

}

I'm pretty confident we have all the necessary mechanics in tablegen to implement this, but it would be ugly. We probably don't have a nice way to test if an element is in a list, but it's possible.

I think just generally avoiding hardcoded things in tablegen is a good idea.