This is an archive of the discontinued LLVM Phabricator instance.

Move definitions of ArgKind from Intrinsics.h to Intrinsics.td
ClosedPublic

Authored by chapuni on Mar 12 2023, 7:47 AM.

Details

Summary

Let IntrinsicEnums.inc conditional by GET_INTRINSIC_ENUM_VALUES

Move definitions of ArgKind from Intrinsics.h to Intrinsics.td

Values of ArgKind are used (as naked constants) also in IntrinsicEmitter.
They can be dissolved to move their logic to Intrinsics.td.

Diff Detail

Event Timeline

chapuni created this revision.Mar 12 2023, 7:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2023, 7:47 AM
chapuni requested review of this revision.Mar 12 2023, 7:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2023, 7:47 AM
chapuni retitled this revision from Let IntrinsicEnums.inc conditional by GET_INTRINSIC_ENUM_VALUES to Move definitions of ArgKind from Intrinsics.h to Intrinsics.td.Mar 12 2023, 7:57 AM
chapuni edited the summary of this revision. (Show Details)
chapuni added a reviewer: rnk.
aganea added a subscriber: aganea.Mar 12 2023, 5:13 PM

Reid is out for vacations, I’d suggest perhaps to find another reviewer!

chapuni added a subscriber: craig.topper.

@craig.topper Could you take a look?

Is this the right direction to unify constant definitions?
See also, https://discourse.llvm.org/t/rfc-let-intrinsics-td-emit-iit-info-typesig/69186
I am planning also to move also IIT_Info constants from Function.cpp to Intrinsics.td.

craig.topper added inline comments.Mar 14 2023, 4:05 PM
llvm/utils/TableGen/IntrinsicEmitter.cpp
175

Rec confused me at first. These aren't Records. I think they are RecordVal? RV or Field would be a better name.

chapuni updated this revision to Diff 505326.Mar 14 2023, 4:59 PM
  • EmitArgKind: s/Rec/RV/g
chapuni added inline comments.Mar 14 2023, 5:01 PM
llvm/utils/TableGen/IntrinsicEmitter.cpp
175

Makes sense. I was confused, too.

nikic added a subscriber: nikic.Mar 15 2023, 1:44 AM

I'm having trouble understanding what the point of this change is. Is there some change on top of this that will make use of ArgKind from tablegen?

arsenm accepted this revision.Mar 30 2023, 11:28 AM
arsenm added a subscriber: arsenm.

LGTM. I"m assuming the other diffs somehow make this worthwhile since currently there's only 5 values

This revision is now accepted and ready to land.Mar 30 2023, 11:28 AM

As you knew, this is for D146915.

This revision was landed with ongoing or failed builds.Mar 30 2023, 5:15 PM
This revision was automatically updated to reflect the committed changes.