This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][GlobalISel] Guarantee stable iteration order for stop-after-parse
ClosedPublic

Authored by Pierre-vh on Jul 20 2023, 5:24 AM.

Details

Summary

Builds on top of 6de2735c2428 to fix remaining issues with iteration order in the MatchTable Combiner backend.
See D155789 as well.

Diff Detail

Event Timeline

Pierre-vh created this revision.Jul 20 2023, 5:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:24 AM
Pierre-vh requested review of this revision.Jul 20 2023, 5:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 5:24 AM
MaskRay accepted this revision.Jul 20 2023, 10:33 AM

thank you!

This revision is now accepted and ready to land.Jul 20 2023, 10:33 AM
This revision was landed with ongoing or failed builds.Jul 24 2023, 12:11 AM
This revision was automatically updated to reflect the committed changes.

FYI, I get this warning building a release llvm-tblgen:

/home/davspi01/work/open_source/llvm-project/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp:672:6: warning: ‘void {anonymous}::CombineRuleBuilder::verify() const’ defined but not used [-Wunused-function]
  672 | void CombineRuleBuilder::verify() const {
      |      ^~~~~~~~~~~~~~~~~~

Presumably because it's called like this:

bool CombineRuleBuilder::parseAll() {
  if (!parseDefs(*RuleDef.getValueAsDag("Defs")))
    return false;
  if (!parseMatch(*RuleDef.getValueAsDag("Match")))
    return false;
  if (!parseApply(*RuleDef.getValueAsDag("Apply")))
    return false;
  if (!buildOperandsTable())
    return false;
  if (!findRoots())
    return false;
  LLVM_DEBUG(verify());
  return true;
}

If you could figure out a way to mark it used in release builds that would be great, as something called verify being unused is always worrying.