xref: /freebsd/contrib/llvm-project/llvm/lib/Target/DirectX/DirectXTargetTransformInfo.h (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1 //===- DirectXTargetTransformInfo.h - DirectX TTI ---------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
12 #define LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
13 
14 #include "DirectXSubtarget.h"
15 #include "DirectXTargetMachine.h"
16 #include "llvm/CodeGen/BasicTTIImpl.h"
17 #include "llvm/IR/Function.h"
18 
19 namespace llvm {
20 class DirectXTTIImpl : public BasicTTIImplBase<DirectXTTIImpl> {
21   using BaseT = BasicTTIImplBase<DirectXTTIImpl>;
22   using TTI = TargetTransformInfo;
23 
24   friend BaseT;
25 
26   const DirectXSubtarget *ST;
27   const DirectXTargetLowering *TLI;
28 
29   const DirectXSubtarget *getST() const { return ST; }
30   const DirectXTargetLowering *getTLI() const { return TLI; }
31 
32 public:
33   explicit DirectXTTIImpl(const DirectXTargetMachine *TM, const Function &F)
34       : BaseT(TM, F.getParent()->getDataLayout()), ST(TM->getSubtargetImpl(F)),
35         TLI(ST->getTargetLowering()) {}
36   unsigned getMinVectorRegisterBitWidth() const { return 32; }
37 };
38 } // namespace llvm
39 
40 #endif // LLVM_DIRECTX_DIRECTXTARGETTRANSFORMINFO_H
41