[PATCH] D12681: Calling conventions for HHVM

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 11:40:43 PDT 2015


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

Hi Maksim,

LGTM with a couple of nitpicks.

Cheers,
-Quentin


================
Comment at: include/llvm/Support/MathExtras.h:621
@@ +620,3 @@
+                                   uint64_t Skew = 0) {
+  Skew %= Align;
+  return (Value + Align - 1 - Skew) / Align * Align + Skew;
----------------
In the comment you said that Skew must be less than Align.
So, this line of code seems useless.
Either keep that line and change the comment to actually reflect what is happening or change that into an assert Skew < Align.

================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:574
@@ +573,3 @@
+  unsigned Skew = 0;
+  if (LLVM_UNLIKELY(Fn.getFunction()->getCallingConv() == CallingConv::HHVM))
+    Skew = 8;
----------------
I would rather have a target hook for that: getSkew, so that we do not expose (more) target code in the generic part.


http://reviews.llvm.org/D12681





More information about the llvm-commits mailing list