[PATCH] D130919: [MRI] isConstantPhysReg should also check if the register is clobbered by a RegMask

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 13:59:42 PDT 2022


Carrot added inline comments.


================
Comment at: llvm/lib/CodeGen/RegUsageInfoPropagate.cpp:147-149
+  if (Changed)
+    MF.getRegInfo().recollectUsedPhysRegMask();
+
----------------
arsenm wrote:
> Won't this be reflected in the regmask updates (BTW I think this pass needs to be changed to directly modify the regmasks in the instruction instead of the analysis)?
Query register information through MRI is precise through the linked Register operands. But RegMask is different, all RegMask information is cumulated in MRI.UsedPhysRegMask. So usually we can only add new used physical registers into UsedPhysRegMask. This pass is used to reduce used physical registers, we need to reset UsedPhysRegMask and collect RegMask again.


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

https://reviews.llvm.org/D130919



More information about the llvm-commits mailing list