[PATCH] D70365: intrinsics attribute opt-out list proposal.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 20:42:43 PST 2019


arsenm added inline comments.


================
Comment at: llvm/utils/TableGen/CodeGenTarget.cpp:754-755
+  // Parse the opt-out intrinsic properties.
+  ListInit *OptOutPropList = R->getValueAsListInit("OptOutIntrProperties");
+  for (unsigned i = 0, e = OptOutPropList->size(); i != e; ++i) {
+    Record *Property = OptOutPropList->getElementAsRecord(i);
----------------
sstefan1 wrote:
> arsenm wrote:
> > I think you could avoid touching tablegen by implementing a filter in the tablegen source
> 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?
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70365/new/

https://reviews.llvm.org/D70365





More information about the llvm-commits mailing list