Path: blob/main/contrib/llvm-project/llvm/lib/Target/LoongArch/LoongArchTargetMachine.h
35269 views
//=- LoongArchTargetMachine.h - Define TargetMachine for LoongArch -*- C++ -*-//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file declares the LoongArch specific subclass of TargetMachine.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H13#define LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H1415#include "LoongArchSubtarget.h"16#include "llvm/Target/TargetMachine.h"17#include <optional>1819namespace llvm {2021class LoongArchTargetMachine : public LLVMTargetMachine {22std::unique_ptr<TargetLoweringObjectFile> TLOF;23mutable StringMap<std::unique_ptr<LoongArchSubtarget>> SubtargetMap;2425public:26LoongArchTargetMachine(const Target &T, const Triple &TT, StringRef CPU,27StringRef FS, const TargetOptions &Options,28std::optional<Reloc::Model> RM,29std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,30bool JIT);31~LoongArchTargetMachine() override;3233TargetTransformInfo getTargetTransformInfo(const Function &F) const override;34const LoongArchSubtarget *getSubtargetImpl(const Function &F) const override;35const LoongArchSubtarget *getSubtargetImpl() const = delete;3637// Pass Pipeline Configuration38TargetPassConfig *createPassConfig(PassManagerBase &PM) override;3940TargetLoweringObjectFile *getObjFileLowering() const override {41return TLOF.get();42}4344MachineFunctionInfo *45createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,46const TargetSubtargetInfo *STI) const override;4748// Addrspacecasts are always noops.49bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override {50return true;51}52};5354} // end namespace llvm5556#endif // LLVM_LIB_TARGET_LOONGARCH_LOONGARCHTARGETMACHINE_H575859