I have noticed that logics of generating TypeSig
in IntrinsicEmitter
can be migrated to Intrinsics.td, with a few enhancements in TableGen, while working on TableGen.
My motivation is to let IntrinsicEmitter
free from MachineValueType.h
and migrate other CodeGen emitters to another TableGen like llvm-cg-tblgen
. I have noticed that MVT
is mostly used in the logic of TypeSig
in IntrinsicEmitter
.
I would like to propose changes along steps below.
- Preparations
- Split out
CodeGenIntrinsics
fromCodeGenTarget
. ⚙ D143844 llvm-tblgen: Split out CodeGenIntrinsics.cpp from CodeGenTarget.cpp - Change sort order of TableGen’s
getAllDerivedDefinitions()
as numeric order. Character order causes instability when anonymous records are increased or decreased due to wrapping-around issue. ⚙ D145874 TableGen: Let getAllDerivedDefinitions() numeric order. - Enhance TableGen to be able of index accessing of
list
.- Introduce
!range
list generator. ⚙ D145871 TableGen: Introduce `!range` operator for half-opened interval - Let expressions available to list subscriptions. ⚙ D145872 TableGen: Let expressions available to list subscriptions and list slices
- Introduce
- Split out
- Enhance
ValueTypes.td
to have more information likeisVector
andElementType
etc.- [Future plan] Let TableGen emit
MachineValueType.h
withValueTypes.td
.
- [Future plan] Let TableGen emit
- Move constants to
Intrinsics.td
and emit them to generated headers.-
ArgKind
– It is defined inIntrinsics.h
and used in IntrinsicEmitter as naked constants. ⚙ D145873 Move definitions of ArgKind from Intrinsics.h to Intrinsics.td -
IIT_Info
– It is defined in bothIntrinsicEmitter.cpp
andFunction.cpp
-
- Implement the generator of TypeSig
- Prune TypeSig stuff in
IntrinsicEmitter.cpp
- Prune TypeSig stuff in
Each differential is expected to be applicable to main
. Feel free to revise my English sentences in comments and documents.
The prototype is Commits · chapuni/llvm-project · GitHub This includes my differentials above.
See also the squashed differential, ⚙ D145937 TableGen: Let Intrinsics.td emit TypeSig
Although I haven’t chosen reviewers to my differentials yet, I am happy if guys would nominate reviews for them.
Thank you.