mirror of
https://github.com/intel/intel-graphics-compiler.git
synced 2025-10-30 08:18:26 +08:00
[Autobackout][FuncReg]Revert of change: 543493b9d1
Inherit VC TTI from BasicTTIImplBase Needed to make GenXSubtarget available there.
This commit is contained in:
@ -37,7 +37,6 @@ SPDX-License-Identifier: MIT
|
||||
#include "GenX.h"
|
||||
#include "GenXDebugInfo.h"
|
||||
#include "GenXModule.h"
|
||||
#include "GenXSubtarget.h"
|
||||
|
||||
#include "vc/GenXCodeGen/GenXOCLRuntimeInfo.h"
|
||||
#include "vc/GenXOpts/GenXOpts.h"
|
||||
@ -157,7 +156,8 @@ void initializeGenXPasses(PassRegistry ®istry) {
|
||||
}
|
||||
|
||||
TargetTransformInfo GenXTargetMachine::getTargetTransformInfo(const Function &F) {
|
||||
return TargetTransformInfo(GenXTTIImpl(this, F));
|
||||
GenXTTIImpl GTTI(F.getParent()->getDataLayout());
|
||||
return TargetTransformInfo(GTTI);
|
||||
}
|
||||
|
||||
} // namespace llvm
|
||||
|
||||
@ -78,25 +78,17 @@ public:
|
||||
CodeGenOpt::Level OL, bool JIT);
|
||||
};
|
||||
|
||||
class GenXTTIImpl : public BasicTTIImplBase<GenXTTIImpl> {
|
||||
|
||||
using BaseT = BasicTTIImplBase<GenXTTIImpl>;
|
||||
using TTI = TargetTransformInfo;
|
||||
|
||||
// This implementation allows us to define our own costs for
|
||||
// the GenX backend. Did not use BasicTTIImplBase because the overloaded
|
||||
// constructors have TragetMachine as an argument, so I inherited from
|
||||
// its parent which has only DL as its arguments
|
||||
class GenXTTIImpl : public TargetTransformInfoImplCRTPBase<GenXTTIImpl>
|
||||
{
|
||||
typedef TargetTransformInfoImplCRTPBase<GenXTTIImpl> BaseT;
|
||||
typedef TargetTransformInfo TTI;
|
||||
friend BaseT;
|
||||
|
||||
const GenXSubtarget &ST;
|
||||
|
||||
const GenXSubtarget *getST() const { return &ST; }
|
||||
|
||||
const TargetLowering *getTLI() const {
|
||||
// No target lowering in VC.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
public:
|
||||
explicit GenXTTIImpl(const GenXTargetMachine *TM, const Function &F)
|
||||
: BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getGenXSubtarget()) {}
|
||||
GenXTTIImpl(const DataLayout& DL) : BaseT(DL) {}
|
||||
|
||||
bool shouldBuildLookupTables() { return false; }
|
||||
unsigned getFlatAddressSpace() { return vc::AddrSpace::Generic; }
|
||||
|
||||
Reference in New Issue
Block a user