Skip to content

Commit b73eeb7

Browse files
committed
[RISCV] Lower fixed-length {insert,extract}_vector_elt on zvfhmin/zvfbfmin
RISCVTargetLowering::lower{INSERT,EXTRACT}_VECTOR_ELT already handles f16 and bf16 scalable vectors after llvm#110221, so we can reuse it for fixed-length vectors.
1 parent e99472b commit b73eeb7

6 files changed

+1611
-1367
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,8 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
13331333
// expansion to a build_vector of 0s.
13341334
setOperationAction(ISD::UNDEF, VT, Custom);
13351335

1336-
setOperationAction({ISD::CONCAT_VECTORS, ISD::INSERT_SUBVECTOR,
1336+
setOperationAction({ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT,
1337+
ISD::CONCAT_VECTORS, ISD::INSERT_SUBVECTOR,
13371338
ISD::EXTRACT_SUBVECTOR, ISD::VECTOR_REVERSE,
13381339
ISD::VECTOR_SHUFFLE, ISD::VECTOR_COMPRESS},
13391340
VT, Custom);
@@ -1404,10 +1405,8 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM,
14041405
continue;
14051406
}
14061407

1407-
setOperationAction({ISD::BUILD_VECTOR,
1408-
ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT,
1409-
ISD::SCALAR_TO_VECTOR},
1410-
VT, Custom);
1408+
setOperationAction({ISD::BUILD_VECTOR, ISD::SCALAR_TO_VECTOR}, VT,
1409+
Custom);
14111410

14121411
setOperationAction(
14131412
{ISD::MLOAD, ISD::MSTORE, ISD::MGATHER, ISD::MSCATTER}, VT, Custom);

0 commit comments

Comments
 (0)