ART: Refactor SIMD slots and regs size processing.
ART vectorizer assumes that there is single size of SIMD
register used for the whole program. Make this assumption explicit
and refactor the code.
Note: This is a base for the future introduction of SIMD slots of
size other than 8 or 16 bytes.
Test: test-art-target, test-art-host.
Change-Id: Id699d5e3590ca8c655ecd9f9ed4e63f49e3c4f9c
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc
index 7b2c3a9..18942a1 100644
--- a/compiler/optimizing/ssa_liveness_analysis.cc
+++ b/compiler/optimizing/ssa_liveness_analysis.cc
@@ -523,12 +523,8 @@
if (defined_by->IsConstant()) {
return defined_by->GetLocations()->Out();
} else if (GetParent()->HasSpillSlot()) {
- switch (NumberOfSpillSlotsNeeded()) {
- case 1: return Location::StackSlot(GetParent()->GetSpillSlot());
- case 2: return Location::DoubleStackSlot(GetParent()->GetSpillSlot());
- case 4: return Location::SIMDStackSlot(GetParent()->GetSpillSlot());
- default: LOG(FATAL) << "Unexpected number of spill slots"; UNREACHABLE();
- }
+ return Location::StackSlotByNumOfSlots(NumberOfSpillSlotsNeeded(),
+ GetParent()->GetSpillSlot());
} else {
return Location();
}