Skip to content

Commit

Permalink
Reland "[CodeGen] Make logic of CCState::resultsCompatible clearer"
Browse files Browse the repository at this point in the history
This relands commit d782d1f.
With a typo fixed, which was causing the x86 test failure.
  • Loading branch information
DavidSpickett committed May 6, 2020
1 parent dee4cbc commit 055ea58
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions llvm/lib/CodeGen/CallingConvLower.cpp
Expand Up @@ -276,18 +276,14 @@ bool CCState::resultsCompatible(CallingConv::ID CalleeCC,
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() != Loc2.getExtraInfo())
return false;
if (RegLoc1) {
if (Loc1.getLocReg() != Loc2.getLocReg())
return false;
} else {
if (Loc1.getLocMemOffset() != Loc2.getLocMemOffset())
return false;
}
}
return true;
}

0 comments on commit 055ea58

Please sign in to comment.