[PATCH] D88667: [GlobalISel] Change asserting conditions when initializing call site info

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 12:08:53 PST 2021


arsenm added inline comments.
Herald added a subscriber: pengfei.


================
Comment at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:372-373
+    unsigned BlockNum = MILoc.BlockNum;
+    // In case of using GlobalISel, entry block enumeration doesn't start
+    // from 0, but from 1.
+    if (YamlMF.Body.Value.Value.find("bb.0") == std::string::npos)
----------------
matejam wrote:
> djtodoro wrote:
> > arsenm wrote:
> > > I think treating this as some difference to tolerate is the wrong approach. There's no reason the block numbers should change based on the selector
> > Hi @arsenm, do you think the entry bb number should start from 0 in the case of GlobalIsel as well? If that is the case, is the D87902 right solution?
> I agree with @djtodoro , entry bb number in GlobalISel start from 1 by default, unlike in other selectors where they start from 0. In case of a machine function which has only one entry bb it's number will be 1 and the MF.size() will also be 1 which will result in an error "if (BlockNum >= MF.size())".
It's the same MIR. The numbering doesn't change. There's something pointlessly inconsistent if the block numbering ends up different


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88667/new/

https://reviews.llvm.org/D88667



More information about the llvm-commits mailing list