llvm/llvm/lib/Target/AMDGPU/AMDGPURemoveIncompatibleFunctions.cpp

//===-- AMDGPURemoveIncompatibleFunctions.cpp -----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// This pass replaces all uses of functions that use GPU features
/// incompatible with the current GPU with null then deletes the function.
//
//===----------------------------------------------------------------------===//

#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"

#define DEBUG_TYPE

usingnamespacellvm;

namespace llvm {
extern const SubtargetFeatureKV
    AMDGPUFeatureKV[AMDGPU::NumSubtargetFeatures - 1];
} // namespace llvm

namespace {

Generation;

class AMDGPURemoveIncompatibleFunctions : public ModulePass {};

StringRef getFeatureName(unsigned Feature) {}

const SubtargetSubTypeKV *getGPUInfo(const GCNSubtarget &ST,
                                     StringRef GPUName) {}

constexpr unsigned FeaturesToCheck[] =;

FeatureBitset expandImpliedFeatures(const FeatureBitset &Features) {}

void reportFunctionRemoved(Function &F, unsigned Feature) {}
} // end anonymous namespace

bool AMDGPURemoveIncompatibleFunctions::checkFunction(Function &F) {}

INITIALIZE_PASS()

char AMDGPURemoveIncompatibleFunctions::ID =;

ModulePass *
llvm::createAMDGPURemoveIncompatibleFunctionsPass(const TargetMachine *TM) {}