[PATCH] D150671: RISCV/InstrInfo: model register pressure for MICombiner

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 03:27:58 PDT 2023


kito-cheng added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:1381
+  auto GetMBBPressure =
+      [&](const MachineBasicBlock *MBB) -> std::vector<unsigned> {
+    RegionPressure Pressure;
----------------
Captured all variable but shadowed `MBB` from argument of `shouldReduceRegisterPressure`, this could be a separated static function rather than lambda function I think?


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:1573-1595
 bool RISCVInstrInfo::getMachineCombinerPatterns(
     MachineInstr &Root, SmallVectorImpl<MachineCombinerPattern> &Patterns,
     bool DoRegPressureReduce) const {
+  unsigned Opc = Root.getOpcode();
+  bool IsFAdd = isFADD(Opc);
 
+  if (IsFAdd || isFSUB(Opc)) {
----------------
It seems like just a NFC refactor? if so this should split into a separated patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150671



More information about the llvm-commits mailing list