[RFC] Let Intrinsics.td emit IIT_Info TypeSig

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.

  1. Preparations
  2. Enhance ValueTypes.td to have more information like isVector and ElementType etc.
    • [Future plan] Let TableGen emit MachineValueType.h with ValueTypes.td.
  3. Move constants to Intrinsics.td and emit them to generated headers.
  4. Implement the generator of TypeSig
    • Prune TypeSig stuff in IntrinsicEmitter.cpp

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 Replace `IntrinsicEmitter::ComputeFixedEncoding()` and cleanup

Although I haven’t chosen reviewers to my differentials yet, I am happy if guys would nominate reviews for them.

Thank you.

FYI, I have created a squashed differential as ⚙ D145937 TableGen: Let Intrinsics.td emit TypeSig
It includes prestage commits, ValueTypes and IIT_Info.

I think we should move towards using LLT as the base machine type. We do need to add some features, like the ability to represent different FP types with the same size.

I was focusing to IntrinsicEmitter, that uses MVT. I think we could restore llvm/CodeGen/MachineValueType.h at the first step.

I will look around LLT later. Thank you.

I have made this as the last point of the series. ⚙ D145937 Replace `IntrinsicEmitter::ComputeFixedEncoding()` and cleanup

(I didn’t know I could create series of patches in the phab)

D145937 has landed as llvmorg-17-init-9368-g24706aff15c1
Thanks to @arsenm for your reviews!