[llvm-commits] [llvm] r84194 - in /llvm/trunk: include/llvm/Intrinsics.td include/llvm/IntrinsicsBlackfin.td lib/Target/Blackfin/Blackfin.td lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp lib/Target/Blackfin/BlackfinIntrinsicInfo.h lib/Target/Blackfin/BlackfinIntrinsics.td lib/Target/Blackfin/BlackfinTargetMachine.h lib/Target/Blackfin/CMakeLists.txt lib/Target/Blackfin/Makefile test/CodeGen/Blackfin/sync-intr.ll
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Oct 15 11:50:53 PDT 2009
Author: stoklund
Date: Thu Oct 15 13:50:52 2009
New Revision: 84194
URL: http://llvm.org/viewvc/llvm-project?rev=84194&view=rev
Log:
Move Blackfin intrinsics into the Target/Blackfin directory.
Added:
llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.h
llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsics.td
- copied, changed from r84193, llvm/trunk/include/llvm/IntrinsicsBlackfin.td
Removed:
llvm/trunk/include/llvm/IntrinsicsBlackfin.td
Modified:
llvm/trunk/include/llvm/Intrinsics.td
llvm/trunk/lib/Target/Blackfin/Blackfin.td
llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h
llvm/trunk/lib/Target/Blackfin/CMakeLists.txt
llvm/trunk/lib/Target/Blackfin/Makefile
llvm/trunk/test/CodeGen/Blackfin/sync-intr.ll
Modified: llvm/trunk/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.td?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/Intrinsics.td Thu Oct 15 13:50:52 2009
@@ -474,4 +474,3 @@
include "llvm/IntrinsicsCellSPU.td"
include "llvm/IntrinsicsAlpha.td"
include "llvm/IntrinsicsXCore.td"
-include "llvm/IntrinsicsBlackfin.td"
Removed: llvm/trunk/include/llvm/IntrinsicsBlackfin.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicsBlackfin.td?rev=84193&view=auto
==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsBlackfin.td (original)
+++ llvm/trunk/include/llvm/IntrinsicsBlackfin.td (removed)
@@ -1,34 +0,0 @@
-//===- IntrinsicsBlackfin.td - Defines Blackfin intrinsics -*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines all of the blackfin-specific intrinsics.
-//
-//===----------------------------------------------------------------------===//
-
-//===----------------------------------------------------------------------===//
-// Core synchronisation etc.
-//
-// These intrinsics have sideeffects. Each represent a single instruction, but
-// workarounds are sometimes required depending on the cpu.
-
-let TargetPrefix = "bfin" in {
-
- // Execute csync instruction with workarounds
- def int_bfin_csync : GCCBuiltin<"__builtin_bfin_csync">,
- Intrinsic<[llvm_void_ty]>;
-
- // Execute ssync instruction with workarounds
- def int_bfin_ssync : GCCBuiltin<"__builtin_bfin_ssync">,
- Intrinsic<[llvm_void_ty]>;
-
- // Execute idle instruction with workarounds
- def int_bfin_idle : GCCBuiltin<"__builtin_bfin_idle">,
- Intrinsic<[llvm_void_ty]>;
-
-}
Modified: llvm/trunk/lib/Target/Blackfin/Blackfin.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/Blackfin.td?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/Blackfin.td (original)
+++ llvm/trunk/lib/Target/Blackfin/Blackfin.td Thu Oct 15 13:50:52 2009
@@ -74,6 +74,7 @@
include "BlackfinRegisterInfo.td"
include "BlackfinCallingConv.td"
+include "BlackfinIntrinsics.td"
include "BlackfinInstrInfo.td"
def BlackfinInstrInfo : InstrInfo {}
Added: llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp?rev=84194&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp (added)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp Thu Oct 15 13:50:52 2009
@@ -0,0 +1,53 @@
+//===- BlackfinIntrinsicInfo.cpp - Intrinsic Information --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the Blackfin implementation of TargetIntrinsicInfo.
+//
+//===----------------------------------------------------------------------===//
+
+#include "BlackfinIntrinsicInfo.h"
+#include "llvm/Intrinsics.h"
+#include "llvm/Support/raw_ostream.h"
+#include <cstring>
+
+using namespace llvm;
+
+namespace bfinIntrinsic {
+
+ enum ID {
+ last_non_bfin_intrinsic = Intrinsic::num_intrinsics-1,
+#define GET_INTRINSIC_ENUM_VALUES
+#include "BlackfinGenIntrinsics.inc"
+#undef GET_INTRINSIC_ENUM_VALUES
+ , num_bfin_intrinsics
+ };
+
+}
+
+const char *BlackfinIntrinsicInfo::getName(unsigned IntrID) const {
+ static const char *const names[] = {
+#define GET_INTRINSIC_NAME_TABLE
+#include "BlackfinGenIntrinsics.inc"
+#undef GET_INTRINSIC_NAME_TABLE
+ };
+
+ if (IntrID < Intrinsic::num_intrinsics)
+ return 0;
+ assert(IntrID < bfinIntrinsic::num_bfin_intrinsics && "Invalid intrinsic ID");
+
+ return names[IntrID - Intrinsic::num_intrinsics];
+}
+
+unsigned
+BlackfinIntrinsicInfo::lookupName(const char *Name, unsigned Len) const {
+#define GET_FUNCTION_RECOGNIZER
+#include "BlackfinGenIntrinsics.inc"
+#undef GET_FUNCTION_RECOGNIZER
+ return 0;
+}
Added: llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.h?rev=84194&view=auto
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.h (added)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsicInfo.h Thu Oct 15 13:50:52 2009
@@ -0,0 +1,28 @@
+//===- BlackfinIntrinsicInfo.h - Blackfin Intrinsic Information -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains the Blackfin implementation of TargetIntrinsicInfo.
+//
+//===----------------------------------------------------------------------===//
+#ifndef BLACKFININTRINSICS_H
+#define BLACKFININTRINSICS_H
+
+#include "llvm/Target/TargetIntrinsicInfo.h"
+
+namespace llvm {
+
+ class BlackfinIntrinsicInfo : public TargetIntrinsicInfo {
+ public:
+ const char *getName(unsigned IntrID) const;
+ unsigned lookupName(const char *Name, unsigned Len) const;
+ };
+
+}
+
+#endif
Copied: llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsics.td (from r84193, llvm/trunk/include/llvm/IntrinsicsBlackfin.td)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsics.td?p2=llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsics.td&p1=llvm/trunk/include/llvm/IntrinsicsBlackfin.td&r1=84193&r2=84194&rev=84194&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IntrinsicsBlackfin.td (original)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinIntrinsics.td Thu Oct 15 13:50:52 2009
@@ -1,4 +1,4 @@
-//===- IntrinsicsBlackfin.td - Defines Blackfin intrinsics -*- tablegen -*-===//
+//===- BlackfinIntrinsics.td - Defines Blackfin intrinsics -*- tablegen -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -11,24 +11,24 @@
//
//===----------------------------------------------------------------------===//
+let TargetPrefix = "bfin", isTarget = 1 in {
+
//===----------------------------------------------------------------------===//
// Core synchronisation etc.
//
// These intrinsics have sideeffects. Each represent a single instruction, but
// workarounds are sometimes required depending on the cpu.
-let TargetPrefix = "bfin" in {
-
- // Execute csync instruction with workarounds
- def int_bfin_csync : GCCBuiltin<"__builtin_bfin_csync">,
- Intrinsic<[llvm_void_ty]>;
-
- // Execute ssync instruction with workarounds
- def int_bfin_ssync : GCCBuiltin<"__builtin_bfin_ssync">,
- Intrinsic<[llvm_void_ty]>;
-
- // Execute idle instruction with workarounds
- def int_bfin_idle : GCCBuiltin<"__builtin_bfin_idle">,
- Intrinsic<[llvm_void_ty]>;
+// Execute csync instruction with workarounds
+def int_bfin_csync : GCCBuiltin<"__builtin_bfin_csync">,
+ Intrinsic<[llvm_void_ty]>;
+
+// Execute ssync instruction with workarounds
+def int_bfin_ssync : GCCBuiltin<"__builtin_bfin_ssync">,
+ Intrinsic<[llvm_void_ty]>;
+
+// Execute idle instruction with workarounds
+def int_bfin_idle : GCCBuiltin<"__builtin_bfin_idle">,
+ Intrinsic<[llvm_void_ty]>;
}
Modified: llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h (original)
+++ llvm/trunk/lib/Target/Blackfin/BlackfinTargetMachine.h Thu Oct 15 13:50:52 2009
@@ -20,6 +20,7 @@
#include "BlackfinInstrInfo.h"
#include "BlackfinSubtarget.h"
#include "BlackfinISelLowering.h"
+#include "BlackfinIntrinsicInfo.h"
namespace llvm {
@@ -29,6 +30,7 @@
BlackfinTargetLowering TLInfo;
BlackfinInstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
+ BlackfinIntrinsicInfo IntrinsicInfo;
public:
BlackfinTargetMachine(const Target &T, const std::string &TT,
const std::string &FS);
@@ -47,6 +49,9 @@
virtual const TargetData *getTargetData() const { return &DataLayout; }
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
+ const TargetIntrinsicInfo *getIntrinsicInfo() const {
+ return &IntrinsicInfo;
+ }
};
} // end namespace llvm
Modified: llvm/trunk/lib/Target/Blackfin/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/CMakeLists.txt?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/Blackfin/CMakeLists.txt Thu Oct 15 13:50:52 2009
@@ -9,9 +9,11 @@
tablegen(BlackfinGenDAGISel.inc -gen-dag-isel)
tablegen(BlackfinGenSubtarget.inc -gen-subtarget)
tablegen(BlackfinGenCallingConv.inc -gen-callingconv)
+tablegen(BlackfinGenIntrinsics.inc -gen-tgt-intrinsic)
add_llvm_target(BlackfinCodeGen
BlackfinInstrInfo.cpp
+ BlackfinIntrinsicInfo.cpp
BlackfinISelDAGToDAG.cpp
BlackfinISelLowering.cpp
BlackfinMCAsmInfo.cpp
Modified: llvm/trunk/lib/Target/Blackfin/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Blackfin/Makefile?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Blackfin/Makefile (original)
+++ llvm/trunk/lib/Target/Blackfin/Makefile Thu Oct 15 13:50:52 2009
@@ -15,7 +15,7 @@
BlackfinGenRegisterInfo.inc BlackfinGenInstrNames.inc \
BlackfinGenInstrInfo.inc BlackfinGenAsmWriter.inc \
BlackfinGenDAGISel.inc BlackfinGenSubtarget.inc \
- BlackfinGenCallingConv.inc
+ BlackfinGenCallingConv.inc BlackfinGenIntrinsics.inc
DIRS = AsmPrinter TargetInfo
Modified: llvm/trunk/test/CodeGen/Blackfin/sync-intr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Blackfin/sync-intr.ll?rev=84194&r1=84193&r2=84194&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Blackfin/sync-intr.ll (original)
+++ llvm/trunk/test/CodeGen/Blackfin/sync-intr.ll Thu Oct 15 13:50:52 2009
@@ -2,8 +2,11 @@
define void @f() nounwind {
entry:
+ ; CHECK-NOT: llvm.bfin
; CHECK: csync;
call void @llvm.bfin.csync()
+
+ ; CHECK-NOT: llvm.bfin
; CHECK: ssync;
call void @llvm.bfin.ssync()
ret void
More information about the llvm-commits
mailing list