Some .td files have instrs/instregex items which are not necessary. Sometimes we have overridding of an instruction but there are no changes; sometimes we completly override Sched Class and it means we should use the new specific class instead of the current one; etc. For example see PR35548. This patch fixes some of such issues.
The source code is almost completely prepared by Simon Pilgrim - I only adopted it for publishing. The patch does not have any tests but if aply it and launch TableGen you'll see warnings like here:
warning:Model 'ThunderX2T99Model' completely overrides class 'WriteSTIdx_ReadAdrBase' for instrs:
warning: STRBBroW
warning: STRBBroX
warning: STRBroW
or
warning:Class 'IIC_VecFPCompare' never uses instruction 'VCMPNEZB' on model: 'P9Model'
warning:Class 'IIC_VecFPCompare' never uses instruction 'VCMPNEZBo' on model: 'P9Model'
warning:Class 'IIC_VecFPCompare' never uses instruction 'VCMPNEZH' on model: 'P9Model'
or
warning:Model 'SandyBridgeModel' unnecessarily overrides instruction 'LOOP' from 'WriteJump'
warning:Model 'SandyBridgeModel' unnecessarily overrides instruction 'LOOPE' from 'WriteJump'
warning:Model 'SandyBridgeModel' unnecessarily overrides instruction 'LOOPNE' from 'WriteJump'
This is conspiciously similar to the operator== of MCSchedClassDesc.
And is subtly different. This does not look at ReadAdvanceIdx, NumWriteLatencyEntries.
I would strongly suggest to: