[PATCH] D78785: Fix x86/x86_64 calling convention for _ExtInt

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 26 21:46:54 PDT 2020


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:2980
 
-    return (Ty->isPromotableIntegerType() ? ABIArgInfo::getExtend(Ty)
-                                          : ABIArgInfo::getDirect());
+    if (!Ty->isExtIntType())
+      return (Ty->isPromotableIntegerType() ? ABIArgInfo::getExtend(Ty)
----------------
erichkeane wrote:
> rjmccall wrote:
> > Presumably *some* `ExtInt` types should be returned directly.
> Right, and they are.  This is only for cases where we request an 'indirect result', so cases where we've already decided that it cannot be passed direct.
> 
> At this point, the 'classify' step has already been done, which would have decided that <=128 bit values are passed 'direct', and we've requested an indirect.  At least as far as I can tell from this code/debugging.
Oh, I see.  So the current code is intentionally using a direct IR return in some cases and then allowing LLVM to lower it as an indirect return?  I didn't think we ever did that, and I'm really not sure it's a good idea, so I definitely agree with not doing it for ExtInt types.


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

https://reviews.llvm.org/D78785





More information about the cfe-commits mailing list