Skip to content

Commit 0c20751

Browse files
committed
[NVPTX] expand trunc v2i32->v2i16
llvm#153478 made v2i32 legal on newer GPUs, but we can not lower all operations yet. Expand the `trunc` operation until we implement efficient lowering.
1 parent 44d471e commit 0c20751

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
638638
// No support for these operations with v2f32/v2i32
639639
setOperationAction(ISD::INSERT_VECTOR_ELT, {MVT::v2f32, MVT::v2i32}, Expand);
640640
setOperationAction(ISD::VECTOR_SHUFFLE, {MVT::v2f32, MVT::v2i32}, Expand);
641+
642+
setOperationAction(ISD::TRUNCATE, MVT::v2i16, Expand);
643+
641644
// Need custom lowering in case the index is dynamic.
642645
if (STI.hasF32x2Instructions())
643646
setOperationAction(ISD::EXTRACT_VECTOR_ELT, {MVT::v2f32, MVT::v2i32},

0 commit comments

Comments
 (0)