1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

AMDGPU: Fix global isel crashes

llvm-svn: 274039
This commit is contained in:
Matt Arsenault 2016-06-28 17:42:09 +00:00
parent 95f4d8a1c7
commit 103dc36b00
2 changed files with 9 additions and 6 deletions

View File

@ -13,7 +13,6 @@
//===----------------------------------------------------------------------===//
#include "AMDGPUSubtarget.h"
#include "AMDGPUCallLowering.h"
#include "R600ISelLowering.h"
#include "R600InstrInfo.h"
#include "SIFrameLowering.h"
@ -190,7 +189,8 @@ SISubtarget::SISubtarget(const Triple &TT, StringRef GPU, StringRef FS,
AMDGPUSubtarget(TT, GPU, FS, TM),
InstrInfo(*this),
FrameLowering(TargetFrameLowering::StackGrowsUp, getStackAlignment(), 0),
TLInfo(TM, *this) {}
TLInfo(TM, *this),
GISel() {}
unsigned R600Subtarget::getStackEntrySize() const {
switch (getWavefrontSize()) {

View File

@ -14,16 +14,17 @@
//===----------------------------------------------------------------------===//
#include "AMDGPUTargetMachine.h"
#include "AMDGPUTargetObjectFile.h"
#include "AMDGPU.h"
#include "AMDGPUCallLowering.h"
#include "AMDGPUTargetObjectFile.h"
#include "AMDGPUTargetTransformInfo.h"
#include "R600ISelLowering.h"
#include "R600InstrInfo.h"
#include "R600MachineScheduler.h"
#include "SIISelLowering.h"
#include "SIInstrInfo.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/CodeGen/GlobalISel/CallLowering.h"
#include "llvm/CodeGen/GlobalISel/IRTranslator.h"
#include "llvm/CodeGen/MachineFunctionAnalysis.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
@ -198,8 +199,8 @@ const R600Subtarget *R600TargetMachine::getSubtargetImpl(
#ifdef LLVM_BUILD_GLOBAL_ISEL
namespace {
struct SIGISelActualAccessor : public GISelAccessor {
std::unique_ptr<CallLowering> CallLoweringInfo;
const CallLowering *getCallLowering() const override {
std::unique_ptr<AMDGPUCallLowering> CallLoweringInfo;
const AMDGPUCallLowering *getCallLowering() const override {
return CallLoweringInfo.get();
}
};
@ -232,6 +233,8 @@ const SISubtarget *GCNTargetMachine::getSubtargetImpl(const Function &F) const {
GISelAccessor *GISel = new GISelAccessor();
#else
SIGISelActualAccessor *GISel = new SIGISelActualAccessor();
GISel->CallLoweringInfo.reset(
new AMDGPUCallLowering(*I->getTargetLowering()));
#endif
I->setGISelAccessor(*GISel);