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

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 11:30:55 PST 2017


erichkeane marked 3 inline comments as done.
erichkeane added a comment.

patch incoming



================
Comment at: include/clang/CodeGen/CGFunctionInfo.h:139
+    AI.setInReg(true);
+    AI.setCanBeFlattened(false);
+    return AI;
----------------
rnk wrote:
> In the long run, I think ABIArgInfo::Direct is too overloaded and needs to be split. The implementation of a single direct argument in EmitFunctionPrologue is *174* lines. It would be much cleaner to make some new ABIArgInfo types instead of having these "can be flattened" flags and things.
I think you're right, this was my first run-in with what "direct" means and it took a lot to figure out what it even MEANS.  I definitely think that it is worth a refactoring in the future.  I notice that a lot of the ABIArgInfo /ABIInfo related things could strongly benefit from a refactoring as well.


================
Comment at: lib/CodeGen/TargetInfo.cpp:1507
-       State.CC == llvm::CallingConv::X86_RegCall) &&
-      isHomogeneousAggregate(Ty, Base, NumElts)) {
-    if (State.FreeSSERegs >= NumElts) {
----------------
rnk wrote:
> You don't seem to do anything in this if block if !IsHva, so maybe fold it back into the initial check like it was, and then break out the case for regcall and vectorcall separately.
I did this same thing in 2 places, so I suspect I had SOME /*good*/ reason for splitting it out like this, but I cannot for the life of me remember it.  Changed.


https://reviews.llvm.org/D27529





More information about the cfe-commits mailing list