Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / LoongArch / LoongArchTargetMachine.h
blobfa9bc7608e7d2c5b4d48bcbd5f52a5ead9c13cd3
1 //=- LoongArchTargetMachine.h - Define TargetMachine for LoongArch -*- 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 // This file declares the LoongArch specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H
14 #define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H
16 #include "LoongArchSubtarget.h"
17 #include "llvm/Target/TargetMachine.h"
18 #include <optional>
20 namespace llvm {
22 class LoongArchTargetMachine : public LLVMTargetMachine {
23 std::unique_ptr<TargetLoweringObjectFile> TLOF;
24 mutable StringMap<std::unique_ptr<LoongArchSubtarget>> SubtargetMap;
26 public:
27 LoongArchTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28 StringRef FS, const TargetOptions &Options,
29 std::optional<Reloc::Model> RM,
30 std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
31 bool JIT);
32 ~LoongArchTargetMachine() override;
34 TargetTransformInfo getTargetTransformInfo(const Function &F) const override;
35 const LoongArchSubtarget *getSubtargetImpl(const Function &F) const override;
36 const LoongArchSubtarget *getSubtargetImpl() const = delete;
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
41 TargetLoweringObjectFile *getObjFileLowering() const override {
42 return TLOF.get();
45 MachineFunctionInfo *
46 createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,
47 const TargetSubtargetInfo *STI) const override;
49 // Addrspacecasts are always noops.
50 bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {
51 return true;
55 } // end namespace llvm
57 #endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H