mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
For ARM subtargets with useNEONForSinglePrecisionFP, double count uses
of the floating point types less than 64-bits. It's somewhat of a temporary hack but forces more accurate modeling of register pressure and results in fewer spills. llvm-svn: 123811
This commit is contained in:
parent
cf6999ed86
commit
305613b87a
@ -700,6 +700,16 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
||||
benefitFromCodePlacementOpt = true;
|
||||
}
|
||||
|
||||
// FIXME: It might make sense to define the representative register class as the
|
||||
// nearest super-register that has a non-null superset. For example, DPR_VFP2 is
|
||||
// a super-register of SPR, and DPR is a superset if DPR_VFP2. Consequently,
|
||||
// SPR's representative would be DPR_VFP2. This should work well if register
|
||||
// pressure tracking were modified such that a register use would increment the
|
||||
// pressure of the register class's representative and all of it's super
|
||||
// classes' representatives transitively. We have not implemented this because
|
||||
// of the difficulty prior to coalescing of modeling operand register classes
|
||||
// due to the common occurence of cross class copies and subregister insertions
|
||||
// and extractions.
|
||||
std::pair<const TargetRegisterClass*, uint8_t>
|
||||
ARMTargetLowering::findRepresentativeClass(EVT VT) const{
|
||||
const TargetRegisterClass *RRC = 0;
|
||||
@ -713,6 +723,12 @@ ARMTargetLowering::findRepresentativeClass(EVT VT) const{
|
||||
case MVT::f32: case MVT::f64: case MVT::v8i8: case MVT::v4i16:
|
||||
case MVT::v2i32: case MVT::v1i64: case MVT::v2f32:
|
||||
RRC = ARM::DPRRegisterClass;
|
||||
// When NEON is used for SP, only half of the register file is available
|
||||
// because operations that define both SP and DP results will be constrained
|
||||
// to the VFP2 class (D0-D15). We currently model this constraint prior to
|
||||
// coalescing by double-counting the SP regs. See the FIXME above.
|
||||
if (Subtarget->useNEONForSinglePrecisionFP())
|
||||
Cost = 2;
|
||||
break;
|
||||
case MVT::v16i8: case MVT::v8i16: case MVT::v4i32: case MVT::v2i64:
|
||||
case MVT::v4f32: case MVT::v2f64:
|
||||
|
Loading…
Reference in New Issue
Block a user