[VE] Add SVOB intrinsic instruction
authorKazushi (Jam) Marukawa <marukawa@nec.com>
Thu, 7 Jan 2021 14:27:39 +0000 (23:27 +0900)
committerKazushi (Jam) Marukawa <marukawa@nec.com>
Fri, 8 Jan 2021 09:49:17 +0000 (18:49 +0900)
Add SVOB intrinsic instruction and a regression test.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D94279

llvm/include/llvm/IR/IntrinsicsVE.td
llvm/lib/Target/VE/VEInstrIntrinsicVL.td
llvm/test/CodeGen/VE/VELIntrinsics/svob.ll [new file with mode: 0644]

index 1cb7a2e..3a8eec6 100644 (file)
@@ -1,4 +1,10 @@
 // Define intrinsics written by hand
 
+// VEL Intrinsic instructions.
+let TargetPrefix = "ve" in {
+  def int_ve_vl_svob : GCCBuiltin<"__builtin_ve_vl_svob">,
+                       Intrinsic<[], [], [IntrHasSideEffects]>;
+}
+
 // Define intrinsics automatically generated
 include "llvm/IR/IntrinsicsVEVL.gen.td"
index 29365b3..b64d241 100644 (file)
@@ -2,6 +2,9 @@
 
 // Define intrinsics written by hand
 
+// SVOB pattern.
+def : Pat<(int_ve_vl_svob), (SVOB)>;
+
 // The lsv and lvs patterns
 def : Pat<(int_ve_vl_lsv_vvss v256f64:$pt, i32:$sy, i64:$sz),
           (LSVrr_v (INSERT_SUBREG (i64 (IMPLICIT_DEF)), i32:$sy, sub_i32),
diff --git a/llvm/test/CodeGen/VE/VELIntrinsics/svob.ll b/llvm/test/CodeGen/VE/VELIntrinsics/svob.ll
new file mode 100644 (file)
index 0000000..b835fae
--- /dev/null
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
+
+;;; Test set vector out-of-order memory access boundary intrinsic instructions
+;;;
+;;; Note:
+;;;   We test SVOB instruction.
+
+; Function Attrs: nounwind
+define fastcc void @svob_svob() {
+; CHECK-LABEL: svob_svob:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    svob
+; CHECK-NEXT:    b.l.t (, %s10)
+  tail call void @llvm.ve.vl.svob()
+  ret void
+}
+
+; Function Attrs: nounwind
+declare void @llvm.ve.vl.svob()