diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-07-03 20:40:04 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-07-03 20:40:04 +0000 |
commit | 4bbb8b7d1f44b60efad19aa84d1fbfd7b2b2ec99 (patch) | |
tree | 83223c98c9046583005c5678e0c7fe66d77e019f | |
parent | dee3b3b081b8c925cf6cf9844f0c4ee8d3b8169e (diff) |
[NVPTX] Expand v2f16 INSERT_VECTOR_ELT
Vectorization can create them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336227 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/NVPTX/NVPTXISelLowering.cpp | 1 | ||||
-rw-r--r-- | test/CodeGen/NVPTX/f16x2-instructions.ll | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index 19842b958a7..2536623fb85 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -375,6 +375,7 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM, setOperationAction(ISD::FP_TO_SINT, MVT::f16, Legal); setOperationAction(ISD::BUILD_VECTOR, MVT::v2f16, Custom); setOperationAction(ISD::EXTRACT_VECTOR_ELT, MVT::v2f16, Custom); + setOperationAction(ISD::INSERT_VECTOR_ELT, MVT::v2f16, Expand); setOperationAction(ISD::VECTOR_SHUFFLE, MVT::v2f16, Expand); setFP16OperationAction(ISD::SETCC, MVT::f16, Legal, Promote); diff --git a/test/CodeGen/NVPTX/f16x2-instructions.ll b/test/CodeGen/NVPTX/f16x2-instructions.ll index 3d58cfa3595..bd945b9e400 100644 --- a/test/CodeGen/NVPTX/f16x2-instructions.ll +++ b/test/CodeGen/NVPTX/f16x2-instructions.ll @@ -1431,5 +1431,13 @@ define <2 x half> @test_shufflevector(<2 x half> %a) #0 { ret <2 x half> %s
}
+; CHECK-LABEL: test_insertelement(
+; CHECK: mov.b32 {%h2, %tmp_hi}, %hh1;
+; CHECK: mov.b32 %hh2, {%h2, %h1};
+define <2 x half> @test_insertelement(<2 x half> %a, half %x) #0 {
+ %i = insertelement <2 x half> %a, half %x, i64 1
+ ret <2 x half> %i
+}
+
attributes #0 = { nounwind }
attributes #1 = { "unsafe-fp-math" = "true" }
|