[PowerPC] Generate Power9 extswsli extend sign and shift immediate instruction
[llvm-core.git] / lib / Target / PowerPC / PPCTargetMachine.h
blob75b98a815ab42cbc5d1e64bca4b95b40859ebed4
1 //===-- PPCTargetMachine.h - Define TargetMachine for PowerPC ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the PowerPC specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_POWERPC_PPCTARGETMACHINE_H
17 #include "PPCInstrInfo.h"
18 #include "PPCSubtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
22 namespace llvm {
24 /// Common code between 32-bit and 64-bit PowerPC targets.
25 ///
26 class PPCTargetMachine final : public LLVMTargetMachine {
27 public:
28 enum PPCABI { PPC_ABI_UNKNOWN, PPC_ABI_ELFv1, PPC_ABI_ELFv2 };
29 private:
30 std::unique_ptr<TargetLoweringObjectFile> TLOF;
31 PPCABI TargetABI;
33 mutable StringMap<std::unique_ptr<PPCSubtarget>> SubtargetMap;
35 public:
36 PPCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
37 StringRef FS, const TargetOptions &Options,
38 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
39 CodeGenOpt::Level OL, bool JIT);
41 ~PPCTargetMachine() override;
43 const PPCSubtarget *getSubtargetImpl(const Function &F) const override;
44 // DO NOT IMPLEMENT: There is no such thing as a valid default subtarget,
45 // subtargets are per-function entities based on the target-specific
46 // attributes of each function.
47 const PPCSubtarget *getSubtargetImpl() const = delete;
49 // Pass Pipeline Configuration
50 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
52 TargetTransformInfo getTargetTransformInfo(const Function &F) override;
54 TargetLoweringObjectFile *getObjFileLowering() const override {
55 return TLOF.get();
57 bool isELFv2ABI() const { return TargetABI == PPC_ABI_ELFv2; }
58 bool isPPC64() const {
59 const Triple &TT = getTargetTriple();
60 return (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
63 bool isMachineVerifierClean() const override {
64 return false;
67 } // end namespace llvm
69 #endif