Skip to content

Commit f7068c3

Browse files
committed
[NVPTX] expand vector_shuffle, insertelt for v2f32 and lower i64 bitcast
Fixes test/CodeGen/Generic/vector.ll
1 parent 17513c0 commit f7068c3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
621621
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v4i8, Custom);
622622

623623
setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2f32, Custom);
624+
setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v2f32, Expand);
625+
setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2f32, Expand);
624626

625627
// Custom conversions to/from v2i8.
626628
setOperationAction(ISD::BITCAST, MVT::v2i8, Custom);

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,9 @@ foreach ta = [v2f16, v2bf16, v2i16, v4i8, i32] in {
27122712
}
27132713
}
27142714

2715+
def: Pat<(i64 (bitconvert v2f32:$a)),
2716+
(i64 Int64Regs:$a)>;
2717+
27152718
// NOTE: pred->fp are currently sub-optimal due to an issue in TableGen where
27162719
// we cannot specify floating-point literals in isel patterns. Therefore, we
27172720
// use an integer selp to select either 1 (or -1 in case of signed) or 0

0 commit comments

Comments
 (0)