[PATCH] D69066: Add support for intrinsic llvm.ppc.eieio

Anil Mahmud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 12:59:55 PDT 2019


anil9 created this revision.
anil9 added reviewers: PowerPC, rzurob, stefanp, hfinkel, nemanjai.
Herald added subscribers: jsji, MaskRay, kbarton, hiraditya.
Herald added a project: LLVM.

Add support for the intrinsic llvm.ppc.eieio to emit the instruction eieio.


https://reviews.llvm.org/D69066

Files:
  llvm/include/llvm/IR/IntrinsicsPowerPC.td
  llvm/lib/Target/PowerPC/PPCInstrInfo.td
  llvm/test/CodeGen/PowerPC/eieio.ll


Index: llvm/test/CodeGen/PowerPC/eieio.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/eieio.ll
@@ -0,0 +1,15 @@
+; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu < %s \
+; RUN:     -verify-machineinstrs -ppc-asm-full-reg-names \
+; RUN:     -ppc-vsr-nums-as-vr | FileCheck %s
+
+; Function Attrs: nounwind
+define void @eieio_test() {
+entry:
+  tail call void @llvm.ppc.eieio()
+; CHECK-LABEL: @eieio_test
+; CHECK: eieio
+; CHECK-NEXT: blr
+ret void
+}
+
+declare void @llvm.ppc.eieio()
Index: llvm/lib/Target/PowerPC/PPCInstrInfo.td
===================================================================
--- llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -2201,10 +2201,15 @@
   }
 }
 
+// We used to have EIEIO as value but E[0-9A-Z] is a reserved name
+def EnforceIEIO : XForm_24_eieio<31, 854, (outs), (ins),
+                           "eieio", IIC_LdStLoad, []>;
+
 def : Pat<(int_ppc_sync),   (SYNC 0)>, Requires<[HasSYNC]>;
 def : Pat<(int_ppc_lwsync), (SYNC 1)>, Requires<[HasSYNC]>;
 def : Pat<(int_ppc_sync),   (MSYNC)>, Requires<[HasOnlyMSYNC]>;
 def : Pat<(int_ppc_lwsync), (MSYNC)>, Requires<[HasOnlyMSYNC]>;
+def : Pat<(int_ppc_eieio),  (EnforceIEIO)>;
 
 //===----------------------------------------------------------------------===//
 // PPC32 Arithmetic Instructions.
@@ -4051,10 +4056,6 @@
 def ICBI : XForm_1a<31, 982, (outs), (ins memrr:$src),
                     "icbi $src", IIC_LdStICBI, []>;
 
-// We used to have EIEIO as value but E[0-9A-Z] is a reserved name
-def EnforceIEIO : XForm_24_eieio<31, 854, (outs), (ins),
-                           "eieio", IIC_LdStLoad, []>;
-
 def WAIT : XForm_24_sync<31, 30, (outs), (ins i32imm:$L),
                          "wait $L", IIC_LdStLoad, []>;
 
Index: llvm/include/llvm/IR/IntrinsicsPowerPC.td
===================================================================
--- llvm/include/llvm/IR/IntrinsicsPowerPC.td
+++ llvm/include/llvm/IR/IntrinsicsPowerPC.td
@@ -33,6 +33,8 @@
   def int_ppc_sync : Intrinsic<[], [], []>;
   // lwsync is sync 1
   def int_ppc_lwsync : Intrinsic<[], [], []>;
+  // eieio instruction
+  def int_ppc_eieio : Intrinsic<[],[],[]>;
 
   // Intrinsics used to generate ctr-based loops. These should only be
   // generated by the PowerPC backend!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69066.225294.patch
Type: text/x-patch
Size: 2354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191016/80a173cb/attachment.bin>


More information about the llvm-commits mailing list