@@ -1076,10 +1076,10 @@ class TargetLoweringBase {
1076
1076
// / This method returns the number of registers needed, and the VT for each
1077
1077
// / register. It also returns the VT and quantity of the intermediate values
1078
1078
// / before they are promoted/expanded.
1079
- unsigned getVectorTypeBreakdown (LLVMContext &Context, EVT VT,
1080
- EVT &IntermediateVT,
1081
- unsigned &NumIntermediates,
1082
- MVT &RegisterVT) const ;
1079
+ virtual unsigned getVectorTypeBreakdown (LLVMContext &Context, EVT VT,
1080
+ EVT &IntermediateVT,
1081
+ unsigned &NumIntermediates,
1082
+ MVT &RegisterVT) const ;
1083
1083
1084
1084
// / Certain targets such as MIPS require that some types such as vectors are
1085
1085
// / always broken down into scalars in some contexts. This occurs even if the
@@ -1091,6 +1091,16 @@ class TargetLoweringBase {
1091
1091
RegisterVT);
1092
1092
}
1093
1093
1094
+ // / Certain targets, such as AMDGPU, may coerce vectors of one type to another
1095
+ // / to produce optimal code for CopyToReg / CopyFromReg pairs when dealing
1096
+ // / with non-legal types -- e.g. v7i8 -> v2i32. This gives targets an
1097
+ // / opportunity to do custom lowering in such cases.
1098
+ virtual SDValue lowerVectorCopyReg (bool ISABIRegCopy, SelectionDAG &DAG,
1099
+ const SDLoc &DL, SDValue &Val, EVT Source,
1100
+ EVT Dest, bool IsCopyTo = true ) const {
1101
+ return SDValue ();
1102
+ };
1103
+
1094
1104
struct IntrinsicInfo {
1095
1105
unsigned opc = 0 ; // target opcode
1096
1106
EVT memVT; // memory VT
@@ -1598,7 +1608,7 @@ class TargetLoweringBase {
1598
1608
}
1599
1609
1600
1610
// / Return the type of registers that this ValueType will eventually require.
1601
- MVT getRegisterType (LLVMContext &Context, EVT VT) const {
1611
+ virtual MVT getRegisterType (LLVMContext &Context, EVT VT) const {
1602
1612
if (VT.isSimple ())
1603
1613
return getRegisterType (VT.getSimpleVT ());
1604
1614
if (VT.isVector ()) {
0 commit comments