[PATCH] D79316: [CodeGen] Make logic of resultsCompatible clearer

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 02:39:17 PDT 2020


DavidSpickett updated this revision to Diff 262034.
DavidSpickett added a comment.

- Use getExtraInfo after checking we have two registers or two memory offsets.


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

https://reviews.llvm.org/D79316

Files:
  llvm/lib/CodeGen/CallingConvLower.cpp


Index: llvm/lib/CodeGen/CallingConvLower.cpp
===================================================================
--- llvm/lib/CodeGen/CallingConvLower.cpp
+++ llvm/lib/CodeGen/CallingConvLower.cpp
@@ -276,18 +276,14 @@
   for (unsigned I = 0, E = RVLocs1.size(); I != E; ++I) {
     const CCValAssign &Loc1 = RVLocs1[I];
     const CCValAssign &Loc2 = RVLocs2[I];
-    if (Loc1.getLocInfo() != Loc2.getLocInfo())
-      return false;
-    bool RegLoc1 = Loc1.isRegLoc();
-    if (RegLoc1 != Loc2.isRegLoc())
+
+    if ( // Must both be in registers, or both in memory
+        (Loc1.isRegLoc() != Loc2.isRegLoc()) ||
+        // Must fill the same part of their locations
+        (Loc1.getLocInfo() != Loc2.getLocInfo()) ||
+        // Memory offset/register number must be the same
+        (Loc1.getExtraInfo() != Loc1.getExtraInfo()))
       return false;
-    if (RegLoc1) {
-      if (Loc1.getLocReg() != Loc2.getLocReg())
-        return false;
-    } else {
-      if (Loc1.getLocMemOffset() != Loc2.getLocMemOffset())
-        return false;
-    }
   }
   return true;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79316.262034.patch
Type: text/x-patch
Size: 1081 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200505/b21011f6/attachment-0001.bin>


More information about the llvm-commits mailing list