[PATCH] D30324: [ARM] Thumb2: favor R4-R7 over R12/LR in allocation order when opt for minsize

James Molloy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 02:23:17 PDT 2019


jmolloy added inline comments.


================
Comment at: llvm/lib/CodeGen/RegisterClassInfo.cpp:118
 
-    if (CalleeSavedAliases[PhysReg])
+    if (CalleeSavedAliases[PhysReg] && !STI.ignoreCSRForAllocationOrder(*MF))
       // PhysReg aliases a CSR, save it for later.
----------------
ostannard wrote:
> jmolloy wrote:
> > Although you're not using it here, it seems to me very natural for such a callback to take the PhysReg too.
> I'd rather not add extra code which we don't currently have a use for. That can easily be done later if it does turn out to be useful.
I agree with the principle and would usually advocate for it. But in this case the SubtargetInfo API is a public API that is used by out-of-tree targets. Having a sensible API that isn't overfit to the current in-tree targets when it's ~zero cost is something we should aim for, IMO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D30324





More information about the llvm-commits mailing list