[AMDGPU] Fix unittest linking error with LLVM_LINK_LLVM_DYLIB (#91727)
Follow-up to https://github.com/llvm/llvm-project/pull/88257
This commit is contained in:
parent
1351aabf54
commit
52c5a81001
@ -18,6 +18,7 @@
|
||||
#include "llvm/BinaryFormat/MsgPackDocument.h"
|
||||
#include "llvm/Support/AMDGPUMetadata.h"
|
||||
#include "llvm/Support/Alignment.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@ -61,7 +62,8 @@ protected:
|
||||
msgpack::MapDocNode Kern) = 0;
|
||||
};
|
||||
|
||||
class MetadataStreamerMsgPackV4 : public MetadataStreamer {
|
||||
class LLVM_EXTERNAL_VISIBILITY MetadataStreamerMsgPackV4
|
||||
: public MetadataStreamer {
|
||||
protected:
|
||||
std::unique_ptr<msgpack::Document> HSAMetadataDoc =
|
||||
std::make_unique<msgpack::Document>();
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#define LLVM_LIB_TARGET_AMDGPU_SIPROGRAMINFO_H
|
||||
|
||||
#include "llvm/IR/CallingConv.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include <cstdint>
|
||||
|
||||
namespace llvm {
|
||||
@ -27,7 +28,7 @@ class MCExpr;
|
||||
class MachineFunction;
|
||||
|
||||
/// Track resource usage for kernels / entry functions.
|
||||
struct SIProgramInfo {
|
||||
struct LLVM_EXTERNAL_VISIBILITY SIProgramInfo {
|
||||
// Fields set in PGM_RSRC1 pm4 packet.
|
||||
const MCExpr *VGPRBlocks = nullptr;
|
||||
const MCExpr *SGPRBlocks = nullptr;
|
||||
|
||||
@ -7,9 +7,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "AMDGPUHSAMetadataStreamer.h"
|
||||
#include "AMDGPUTargetMachine.h"
|
||||
#include "GCNSubtarget.h"
|
||||
#include "SIProgramInfo.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineModuleInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
@ -25,9 +24,8 @@ using namespace llvm;
|
||||
|
||||
class SIProgramInfoMCExprsTest : public testing::Test {
|
||||
protected:
|
||||
std::unique_ptr<GCNTargetMachine> TM;
|
||||
std::unique_ptr<LLVMTargetMachine> TM;
|
||||
std::unique_ptr<LLVMContext> Ctx;
|
||||
std::unique_ptr<GCNSubtarget> ST;
|
||||
std::unique_ptr<MachineModuleInfo> MMI;
|
||||
std::unique_ptr<MachineFunction> MF;
|
||||
std::unique_ptr<Module> M;
|
||||
@ -49,7 +47,7 @@ protected:
|
||||
const Target *TheTarget = TargetRegistry::lookupTarget(Triple, Error);
|
||||
TargetOptions Options;
|
||||
|
||||
TM.reset(static_cast<GCNTargetMachine *>(TheTarget->createTargetMachine(
|
||||
TM.reset(static_cast<LLVMTargetMachine *>(TheTarget->createTargetMachine(
|
||||
Triple, CPU, FS, Options, std::nullopt, std::nullopt)));
|
||||
|
||||
Ctx = std::make_unique<LLVMContext>();
|
||||
@ -59,9 +57,7 @@ protected:
|
||||
auto *F = Function::Create(FType, GlobalValue::ExternalLinkage, "Test", *M);
|
||||
MMI = std::make_unique<MachineModuleInfo>(TM.get());
|
||||
|
||||
ST = std::make_unique<GCNSubtarget>(TM->getTargetTriple(),
|
||||
TM->getTargetCPU(),
|
||||
TM->getTargetFeatureString(), *TM);
|
||||
auto *ST = TM->getSubtargetImpl(*F);
|
||||
|
||||
MF = std::make_unique<MachineFunction>(*F, *TM, *ST, 1, *MMI);
|
||||
MF->initTargetMachineFunctionInfo(*ST);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user