This is an archive of the discontinued LLVM Phabricator instance.

[Target][NFC] Simplify `AssemblerPredicate`.
Needs ReviewPublic

Authored by courbet on May 30 2018, 12:19 AM.

Details

Summary

AssemblerPredicate details are currently leaking in Predicate.
TableGen objects can derive from multiple classes, and tablegen supports
querying for the exact type, so there is no need for this boolean.

Also add a check that SubtargetFeatureInfo records have the right
type (Predicate or AssemblerPredicate) when generating the code.

Diff Detail

Event Timeline

courbet created this revision.May 30 2018, 12:19 AM
dsanders added inline comments.May 30 2018, 8:10 AM
lib/Target/Mips/MipsInstrInfo.td
238–239 ↗(On Diff #149051)

UseTCCInDiv is purely an assembler feature. It controls the expansion of the div macro and has no bearing on CodeGen. It doesn't make sense to implement it for CodeGen.

The reason it has a variable in MipsSubtarget is because tablegen incorrectly generates an assignment to it in MipsSubtarget::ParseSubtargetFeatures() and it didn't seem worth it to stop it from doing that.

courbet updated this revision to Diff 149408.Jun 1 2018, 1:29 AM

Revert Mips change.

courbet added inline comments.Jun 1 2018, 1:29 AM
lib/Target/Mips/MipsInstrInfo.td
238–239 ↗(On Diff #149051)

OK, I've moved the type checking from SubtargetFeatureInfo::SubtargetFeatureInfo to the emitter function, and reverted the Mips change.

courbet edited the summary of this revision. (Show Details)Jun 1 2018, 1:30 AM