1 //===- AMDILIntrinsicInfo.cpp - AMDGPU 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 //==-----------------------------------------------------------------------===//
11 /// \brief AMDGPU Implementation of the IntrinsicInfo class.
13 //===-----------------------------------------------------------------------===//
15 #include "AMDILIntrinsicInfo.h"
16 #include "AMDGPUSubtarget.h"
18 #include "llvm/IR/DerivedTypes.h"
19 #include "llvm/IR/Intrinsics.h"
20 #include "llvm/IR/Module.h"
24 #define GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
25 #include "AMDGPUGenIntrinsics.inc"
26 #undef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
28 AMDGPUIntrinsicInfo::AMDGPUIntrinsicInfo(TargetMachine *tm)
29 : TargetIntrinsicInfo() {
33 AMDGPUIntrinsicInfo::getName(unsigned int IntrID, Type **Tys,
34 unsigned int numTys) const {
35 static const char* const names[] = {
36 #define GET_INTRINSIC_NAME_TABLE
37 #include "AMDGPUGenIntrinsics.inc"
38 #undef GET_INTRINSIC_NAME_TABLE
41 if (IntrID < Intrinsic::num_intrinsics) {
44 assert(IntrID < AMDGPUIntrinsic::num_AMDGPU_intrinsics
45 && "Invalid intrinsic ID");
47 std::string Result(names[IntrID - Intrinsic::num_intrinsics]);
52 AMDGPUIntrinsicInfo::lookupName(const char *Name, unsigned int Len) const {
53 #define GET_FUNCTION_RECOGNIZER
54 #include "AMDGPUGenIntrinsics.inc"
55 #undef GET_FUNCTION_RECOGNIZER
56 AMDGPUIntrinsic::ID IntrinsicID
57 = (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
58 IntrinsicID = getIntrinsicForGCCBuiltin("AMDGPU", Name);
60 if (IntrinsicID != (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic) {
67 AMDGPUIntrinsicInfo::isOverloaded(unsigned id) const {
69 #define GET_INTRINSIC_OVERLOAD_TABLE
70 #include "AMDGPUGenIntrinsics.inc"
71 #undef GET_INTRINSIC_OVERLOAD_TABLE
75 AMDGPUIntrinsicInfo::getDeclaration(Module *M, unsigned IntrID,
77 unsigned numTys) const {
78 llvm_unreachable("Not implemented");