[PATCH] D138359: [TableGen] CheckSchedClassTables - check for unnecessary scheduler overrides

Haohai, Wen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 01:12:02 PST 2022


HaohaiWen added inline comments.


================
Comment at: llvm/utils/TableGen/CodeGenSchedule.cpp:972
 CodeGenSchedModels::getSchedClassIdx(const CodeGenInstruction &Inst) const {
-  return InstrClassMap.lookup(Inst.TheDef);
 }
----------------
pengfei wrote:
> Not familiar with it, does the old function returns `0` too when fail to loopup?
DenseMap returns new constructed value if not existed. In this case, it should be uninitialized unsigned.
Looks like return 0 is better.

```
  SchedClasses.emplace_back(0, "NoInstrModel",
                            Records.getDef("NoItinerary"));
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138359



More information about the llvm-commits mailing list