#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 {
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) { … }
}
bool AMDGPURemoveIncompatibleFunctions::checkFunction(Function &F) { … }
INITIALIZE_PASS(…)
char AMDGPURemoveIncompatibleFunctions::ID = …;
ModulePass *
llvm::createAMDGPURemoveIncompatibleFunctionsPass(const TargetMachine *TM) { … }