[llvm] r359517 - Add __builtin_dcbf support for PPC

Ahsan Saghir via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 16:25:33 PDT 2019


Author: saghir
Date: Mon Apr 29 16:25:33 2019
New Revision: 359517

URL: http://llvm.org/viewvc/llvm-project?rev=359517&view=rev
Log:
Add __builtin_dcbf support for PPC

Summary:
This patch adds support for __builtin_dcbf for PPC.

__builtin_dcbf copies the contents of a modified block from the data cache
to main memory and flushes the copy from the data cache.

Differential revision: https://reviews.llvm.org/D59843

Added:
    llvm/trunk/test/CodeGen/PowerPC/dcbf.ll
Modified:
    llvm/trunk/include/llvm/IR/IntrinsicsPowerPC.td

Modified: llvm/trunk/include/llvm/IR/IntrinsicsPowerPC.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IntrinsicsPowerPC.td?rev=359517&r1=359516&r2=359517&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IntrinsicsPowerPC.td (original)
+++ llvm/trunk/include/llvm/IR/IntrinsicsPowerPC.td Mon Apr 29 16:25:33 2019
@@ -18,7 +18,8 @@
 let TargetPrefix = "ppc" in {  // All intrinsics start with "llvm.ppc.".
   // dcba/dcbf/dcbi/dcbst/dcbt/dcbz/dcbzl(PPC970) instructions.
   def int_ppc_dcba  : Intrinsic<[], [llvm_ptr_ty], []>;
-  def int_ppc_dcbf  : Intrinsic<[], [llvm_ptr_ty], []>;
+  def int_ppc_dcbf  : GCCBuiltin<"__builtin_dcbf">,
+                      Intrinsic<[], [llvm_ptr_ty], []>;
   def int_ppc_dcbi  : Intrinsic<[], [llvm_ptr_ty], []>;
   def int_ppc_dcbst : Intrinsic<[], [llvm_ptr_ty], []>;
   def int_ppc_dcbt  : Intrinsic<[], [llvm_ptr_ty],

Added: llvm/trunk/test/CodeGen/PowerPC/dcbf.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/dcbf.ll?rev=359517&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/dcbf.ll (added)
+++ llvm/trunk/test/CodeGen/PowerPC/dcbf.ll Mon Apr 29 16:25:33 2019
@@ -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 @dcbf_test(i8* %a) {
+entry:
+  tail call void @llvm.ppc.dcbf(i8* %a)
+; CHECK-LABEL: @dcbf_test
+; CHECK: dcbf 0, r3
+; CHECK-NEXT: blr
+ret void
+}
+
+declare void @llvm.ppc.dcbf(i8*)




More information about the llvm-commits mailing list