[PATCH] D33562: MachineLICM: Add new condition for hoisting of caller preserved registers

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 16:34:51 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.

LGTM with nitpicks.



================
Comment at: include/llvm/Target/TargetRegisterInfo.h:505
+  /// after the call. 
+  /// Used by MachineRegisterInfo::isCallerPreservedPhysReg().
+  virtual bool isCallerPreservedPhysReg(unsigned PhysReg,
----------------
The last sentence is not true anymore.


================
Comment at: lib/CodeGen/MachineLICM.cpp:895-898
+        // If the physreg is known to always be caller saved/restored then
+        // this use is safe to hoist
+        if (TRI->isCallerPreservedPhysReg(Reg, *I.getParent()->getParent()))
+          continue;
----------------
Could you move this check below the !isConstantPhysReg check as I expect this to be a rare case.


https://reviews.llvm.org/D33562





More information about the llvm-commits mailing list