This change is preparation for a change that will allow targets to verify that the instructions
they emit meet the predicates they specify. This is useful to ensure that C++
legalization/lowering/instruction-selection doesn't incorrectly select code for a different
subtarget than intended. Such cases are not caught by the integrated assembler when emitting
instructions directly to an object file.
Details
Diff Detail
- Build Status
Buildable 1217 Build 1217: arc lint + arc unit
Event Timeline
Hi Daniel,
LGTM. Couple of nitpicks below.
Cheers,
-Quentin
utils/TableGen/AsmMatcherEmitter.cpp | ||
---|---|---|
1417–1423 | I would rather stick to the explicit type here. | |
utils/TableGen/SubtargetFeatureInfo.cpp | ||
31 | Just a thought, shouldn't this string be an argument? I'm fine with a comment saying that if we want to extend the reusability we would need to pass an additional parameter. | |
utils/TableGen/SubtargetFeatureInfo.h | ||
43 | Add comments on what TargetName and ClassName are used. |
- explicit type
- std::string->StringRef
- Comment on parameters and AssemblerMatcherPredicate string
utils/TableGen/SubtargetFeatureInfo.cpp | ||
---|---|---|
31 | I agree that the name 'AssemblerMatcherPredicate' doesn't make as much sense as it used to but not because of the 'Assembler' part. The new use is still part of an assembler, it just receives the IR directly instead of parsing it from text. The bit that I think may be dubious is the 'Matcher' part because no matching occurs in the new use. At this point, I think it's really a 'MCPredicate' but I'm not convinced it's worth renaming just yet. I'll add the comment in case someone adds other kinds of predicates in the future. |
I would rather stick to the explicit type here.