[llvm-commits] [llvm] r77917 - in /llvm/trunk: include/llvm/IntrinsicsBlackfin.td lib/Target/Blackfin/BlackfinInstrInfo.td test/CodeGen/Blackfin/load-intr.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Aug 2 14:49:06 PDT 2009


Author: stoklund
Date: Sun Aug  2 16:49:05 2009
New Revision: 77917

URL: http://llvm.org/viewvc/llvm-project?rev=77917&view=rev
Log:
Remove unneeded intrinsics from Blackfin backend.

__builtin_bfin_ones does the same as ctpop, so it can be implemented in the front-end.

__builtin_bfin_loadbytes loads from an unaligned pointer with the disalignexcpt instruction. It does the same as loading from a pointer with the low bits masked. It is better if the front-end creates a masked load. We can always instruction select the masked to disalignexcpt+load.

We keep csync/ssync/idle. These intrinsics represent instructions that need workarounds for some silicon revisions. We may even want to convert inline assembler to intrinsics to enable the workarounds.

Removed:
    llvm/trunk/test/CodeGen/Blackfin/load-intr.ll
Modified:
    llvm/trunk/include/llvm/IntrinsicsBlackfin.td
    llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td

Modified: llvm/trunk/include/llvm/IntrinsicsBlackfin.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsBlackfin.td?rev=77917&r1=77916&r2=77917&view=diff

==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsBlackfin.td (original)
+++ llvm/trunk/include/llvm/IntrinsicsBlackfin.td Sun Aug  2 16:49:05 2009
@@ -32,20 +32,3 @@
           Intrinsic<[llvm_void_ty]>;
 
 }
-
-//===----------------------------------------------------------------------===//
-// Miscellaneous GCC-compatible builtins.
-//
-
-let TargetPrefix = "bfin" in {
-
-  // Almost identical to ctpop except for the type signature
-  def int_bfin_ones : GCCBuiltin<"__builtin_bfin_ones">,
-          Intrinsic<[llvm_i16_ty], [llvm_i32_ty], [IntrNoMem]>;
-
-  // Load unaligned pointer, ignoring the low bits. Like *(p&~3).
-  // This uses the disalignexcpt instruction
-  def int_bfin_loadbytes : GCCBuiltin<"__builtin_bfin_loadbytes">,
-          Intrinsic<[llvm_i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
-
-}

Modified: llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td?rev=77917&r1=77916&r2=77917&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinInstrInfo.td Sun Aug  2 16:49:05 2009
@@ -672,9 +672,8 @@
 
 def ONES: F2<(outs D16L:$dst), (ins D:$src),
               "$dst = ones $src;",
-              [(set D16L:$dst, (int_bfin_ones D:$src))]>;
+              [(set D16L:$dst, (trunc (ctpop D:$src)))]>;
 
-def : Pat<(i16 (trunc (ctpop D:$src))), (ONES D:$src)>;
 def : Pat<(ctpop D:$src), (MOVEzext (ONES D:$src))>;
 
 //===----------------------------------------------------------------------===//
@@ -848,11 +847,6 @@
 
 def DISALGNEXCPT : F2<(outs), (ins), "disalignexcpt;", []>;
 
-// This is really two instructions in parallel, but we don't support vliw yet
-def DISALGNEXCPT_LOAD : F2<(outs D:$dst), (ins I:$ptr),
-                           "disalignexcpt \\|\\| $dst = [$ptr];",
-                           [(set D:$dst, (int_bfin_loadbytes I:$ptr))]>;
-
 // TODO: BYTEOP3P, BYTEOP16P, BYTEOP1P, BYTEOP2P, BYTEOP16M, SAA,
 //       BYTEPACK, BYTEUNPACK
 

Removed: llvm/trunk/test/CodeGen/Blackfin/load-intr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Blackfin/load-intr.ll?rev=77916&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/Blackfin/load-intr.ll (original)
+++ llvm/trunk/test/CodeGen/Blackfin/load-intr.ll (removed)
@@ -1,13 +0,0 @@
-; RUN: llvm-as < %s | llc -march=bfin -verify-machineinstrs | FileCheck %s
-
-define i16 @f(i32* %p) nounwind {
-entry:
-        ; CHECK: disalignexcpt || r0 = [i0];
-        %b = call i32 @llvm.bfin.loadbytes(i32* %p)
-        ; CHECK: r0.l = ones r0;
-        %c = call i16 @llvm.bfin.ones(i32 %b)
-	ret i16 %c
-}
-
-declare void @llvm.bfin.ones() nounwind
-declare void @llvm.bfin.loadbytes() nounwind





More information about the llvm-commits mailing list