1 //===- DirectXTargetTransformInfo.h - DirectX TTI ---------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
12 #define LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
14 #include "DirectXSubtarget.h"
15 #include "DirectXTargetMachine.h"
16 #include "llvm/CodeGen/BasicTTIImpl.h"
17 #include "llvm/IR/Function.h"
20 class DirectXTTIImpl
: public BasicTTIImplBase
<DirectXTTIImpl
> {
21 using BaseT
= BasicTTIImplBase
<DirectXTTIImpl
>;
22 using TTI
= TargetTransformInfo
;
26 const DirectXSubtarget
*ST
;
27 const DirectXTargetLowering
*TLI
;
29 const DirectXSubtarget
*getST() const { return ST
; }
30 const DirectXTargetLowering
*getTLI() const { return TLI
; }
33 explicit DirectXTTIImpl(const DirectXTargetMachine
*TM
, const Function
&F
)
34 : BaseT(TM
, F
.getDataLayout()), ST(TM
->getSubtargetImpl(F
)),
35 TLI(ST
->getTargetLowering()) {}
36 unsigned getMinVectorRegisterBitWidth() const { return 32; }
40 #endif // LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H