[InstCombine] Signed saturation patterns
[llvm-complete.git] / lib / Target / Hexagon / HexagonTargetObjectFile.h
blobb362825789503cffdf0fac7bbefab3a5f22408f2
1 //===-- HexagonTargetObjectFile.h -----------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
12 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
13 #include "llvm/MC/MCSectionELF.h"
15 namespace llvm {
17 class HexagonTargetObjectFile : public TargetLoweringObjectFileELF {
18 public:
19 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
21 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
22 const TargetMachine &TM) const override;
24 MCSection *getExplicitSectionGlobal(const GlobalObject *GO,
25 SectionKind Kind,
26 const TargetMachine &TM) const override;
28 bool isGlobalInSmallSection(const GlobalObject *GO,
29 const TargetMachine &TM) const;
31 bool isSmallDataEnabled(const TargetMachine &TM) const;
33 unsigned getSmallDataSize() const;
35 bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
36 const Function &F) const override;
38 const Function *getLutUsedFunction(const GlobalObject *GO) const;
40 private:
41 MCSectionELF *SmallDataSection;
42 MCSectionELF *SmallBSSSection;
44 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
45 const TargetMachine &TM) const;
47 MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
48 SectionKind Kind,
49 const TargetMachine &TM) const;
51 MCSection *selectSectionForLookupTable(const GlobalObject *GO,
52 const TargetMachine &TM,
53 const Function *Fn) const;
56 } // namespace llvm
58 #endif