[PATCH] D41131: [AArch64] Implement stack probing for windows

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 13:57:06 PST 2017


compnerd added inline comments.


================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:597
+      break;
+    }
+
----------------
Is this something that Visual Studio supports?  Or the code model an extension like the ARMv7 case?


================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:1224-1226
+  unsigned BasePointerReg = AArch64::NoRegister;
+  if (RegInfo->hasBasePointer(MF))
+    BasePointerReg = RegInfo->getBaseRegister();
----------------
Id just use a ternary:

    unsigned BP = RegInfo->hasBasePointer(MF) ? RegInfo->getBaseRegister() : AArch64::NoRegister;


================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:1229
+  unsigned SpillEstimate = 0;
+  for (unsigned i = 0; CSRegs[i]; ++i)
+    if (CSRegs[i] == BasePointerReg)
----------------
Why not use a range based loop?

    for (const auto &CSR : RegInfo->getCalleeSavedRegs(&MF))
      if (CSR == BasePointerReg)
        ++SpillEstimate;


https://reviews.llvm.org/D41131





More information about the llvm-commits mailing list