[PATCH] D27529: Correct Vectorcall Register passing and HVA Behavior

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 11:37:06 PST 2017


rnk added a comment.

Last thing, I promise.



================
Comment at: lib/CodeGen/TargetInfo.cpp:1678
   bool UsedInAlloca = false;
-  for (auto &I : FI.arguments()) {
-    I.info = classifyArgumentType(I.type, State);
-    UsedInAlloca |= (I.info.getKind() == ABIArgInfo::InAlloca);
+  if (State.CC == llvm::CallingConv::X86_VectorCall) {
+    // Vectorcall only allows the first 6 parameters to be passed in registers,
----------------
Can we out the body of this if into a separate helper? The much more common case is to do one pass over the arguments, and this two-pass block obscures that.


================
Comment at: lib/CodeGen/TargetInfo.cpp:3882
+  if (IsVectorCall) {
+    unsigned Count = 0;
+    for (auto &I : FI.arguments()) {
----------------
Ditto, can we extract the two-pass code into a helper?


https://reviews.llvm.org/D27529





More information about the cfe-commits mailing list