[PATCH] D79770: [RISCV] Fix passing two floating-point values in complex separately by two GPRs on RV64

Alex Bradbury via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 14 03:10:17 PDT 2020


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

Good catch, thanks for the fix! The logic was incorrectly written assuming `isFloatingType` would return false for complex values which is of course incorrect.



================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:10241-10242
   // Pass floating point values via FPRs if possible.
-  if (IsFixed && Ty->isFloatingType() && FLen >= Size && ArgFPRsLeft) {
+  if (IsFixed && Ty->isFloatingType() && !Ty->isComplexType() &&
+      FLen >= Size && ArgFPRsLeft) {
     ArgFPRsLeft--;
----------------
luismarques wrote:
> Do you have tests that show the impact of the added `FLen >= Size && ArgFPRsLeft` conditions for other values besides complex floats?
That's actually not an added clause - it's just been clang-formatted onto a new line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79770





More information about the cfe-commits mailing list