reg_alloc: Only exchange GPRs
This commit is contained in:
parent
9df3793af0
commit
84f1c9b7f4
1 changed files with 3 additions and 5 deletions
|
@ -34,10 +34,8 @@ static u64 ImmediateToU64(const IR::Value& imm) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsSameHostLocClass(HostLoc a, HostLoc b) {
|
static bool CanExchange(HostLoc a, HostLoc b) {
|
||||||
return (HostLocIsGPR(a) && HostLocIsGPR(b))
|
return HostLocIsGPR(a) && HostLocIsGPR(b);
|
||||||
|| (HostLocIsXMM(a) && HostLocIsXMM(b))
|
|
||||||
|| (HostLocIsSpill(a) && HostLocIsSpill(b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimum number of bits required to represent a type
|
// Minimum number of bits required to represent a type
|
||||||
|
@ -302,7 +300,7 @@ HostLoc RegAlloc::UseImpl(IR::Value use_value, HostLocList desired_locations) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const HostLoc destination_location = SelectARegister(desired_locations);
|
const HostLoc destination_location = SelectARegister(desired_locations);
|
||||||
if (IsSameHostLocClass(destination_location, current_location)) {
|
if (CanExchange(destination_location, current_location)) {
|
||||||
Exchange(destination_location, current_location);
|
Exchange(destination_location, current_location);
|
||||||
} else {
|
} else {
|
||||||
MoveOutOfTheWay(destination_location);
|
MoveOutOfTheWay(destination_location);
|
||||||
|
|
Loading…
Reference in a new issue