1 //===- AMDILIntrinsicInfo.cpp - AMDIL Intrinsic Information ------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //==-----------------------------------------------------------------------===//
10 // This file contains the AMDIL Implementation of the IntrinsicInfo class.
12 //===-----------------------------------------------------------------------===//
14 #include "AMDILIntrinsicInfo.h"
16 #include "AMDGPUSubtarget.h"
17 #include "llvm/DerivedTypes.h"
18 #include "llvm/Intrinsics.h"
19 #include "llvm/Module.h"
23 #define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
24 #include "AMDGPUGenIntrinsics.inc"
25 #undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
27 AMDGPUIntrinsicInfo::AMDGPUIntrinsicInfo(TargetMachine
*tm
)
28 : TargetIntrinsicInfo(), mTM(tm
)
33 AMDGPUIntrinsicInfo::getName(unsigned int IntrID
, Type
**Tys
,
34 unsigned int numTys
) const
36 static const char* const names
[] = {
37 #define GET_INTRINSIC_NAME_TABLE
38 #include "AMDGPUGenIntrinsics.inc"
39 #undef GET_INTRINSIC_NAME_TABLE
42 //assert(!isOverloaded(IntrID)
43 //&& "AMDGPU Intrinsics are not overloaded");
44 if (IntrID
< Intrinsic::num_intrinsics
) {
47 assert(IntrID
< AMDGPUIntrinsic::num_AMDGPU_intrinsics
48 && "Invalid intrinsic ID");
50 std::string
Result(names
[IntrID
- Intrinsic::num_intrinsics
]);
55 AMDGPUIntrinsicInfo::lookupName(const char *Name
, unsigned int Len
) const
57 #define GET_FUNCTION_RECOGNIZER
58 #include "AMDGPUGenIntrinsics.inc"
59 #undef GET_FUNCTION_RECOGNIZER
60 AMDGPUIntrinsic::ID IntrinsicID
61 = (AMDGPUIntrinsic::ID
)Intrinsic::not_intrinsic
;
62 IntrinsicID
= getIntrinsicForGCCBuiltin("AMDIL", Name
);
64 if (IntrinsicID
!= (AMDGPUIntrinsic::ID
)Intrinsic::not_intrinsic
) {
71 AMDGPUIntrinsicInfo::isOverloaded(unsigned id
) const
74 #define GET_INTRINSIC_OVERLOAD_TABLE
75 #include "AMDGPUGenIntrinsics.inc"
76 #undef GET_INTRINSIC_OVERLOAD_TABLE
79 /// This defines the "getAttributes(ID id)" method.
80 #define GET_INTRINSIC_ATTRIBUTES
81 #include "AMDGPUGenIntrinsics.inc"
82 #undef GET_INTRINSIC_ATTRIBUTES
85 AMDGPUIntrinsicInfo::getDeclaration(Module
*M
, unsigned IntrID
,
87 unsigned numTys
) const
90 AttrListPtr List
= getAttributes((AMDGPUIntrinsic::ID
)IntrID
);
92 assert(!"Not implemented");