[PATCH] D79785: [ARM] Register pressure with -mthumb forces register reload before each call

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 01:27:25 PDT 2020


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:2236
+        // FIXME: How to obtain number of available registers ?
+        // Hardcoded for now.
+        if (F.arg_size() + CallInstruction->getNumOperands() >= 7)
----------------
efriedma wrote:
> I wrote a check for the number of arguments in a different way at https://reviews.llvm.org/D49465 ; maybe you can borrow that?  Checking the number of operands in the IR is a very inaccurate approximation.
I would recommend trying to keep this patch small and separating any other changes into a different review. The foldMemoryOperandImpl change seems to improve things on it's own. If we get that in first we can move on to figuring out an appropriate heuristic for this part separately.


================
Comment at: llvm/lib/Target/ARM/Thumb1InstrInfo.cpp:170
+    const MachineConstantPool *MCP = MF.getConstantPool();
+    const MachineConstantPoolEntry &CPE = MCP->getConstants()[CPI];
+    assert(!CPE.isMachineConstantPoolEntry() && "Invalid constpool entry");
----------------
Can you add a check that CPI < MCP->getConstants().size(), to be safe.


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

https://reviews.llvm.org/D79785



More information about the llvm-commits mailing list