LLVM  14.0.0git
ARMLegalizerInfo.h
Go to the documentation of this file.
1 //===- ARMLegalizerInfo ------------------------------------------*- 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 /// \file
9 /// This file declares the targeting of the Machinelegalizer class for ARM.
10 /// \todo This should be generated by TableGen.
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_ARM_ARMMACHINELEGALIZER_H
14 #define LLVM_LIB_TARGET_ARM_ARMMACHINELEGALIZER_H
15 
16 #include "llvm/ADT/IndexedMap.h"
20 #include "llvm/IR/Instructions.h"
21 
22 namespace llvm {
23 
24 class ARMSubtarget;
25 
26 /// This class provides the information for the target register banks.
28 public:
30 
31  bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI) const override;
32 
33 private:
34  void setFCmpLibcallsGNU();
35  void setFCmpLibcallsAEABI();
36 
37  struct FCmpLibcallInfo {
38  // Which libcall this is.
39  RTLIB::Libcall LibcallID;
40 
41  // The predicate to be used when comparing the value returned by the
42  // function with a relevant constant (currently hard-coded to zero). This is
43  // necessary because often the libcall will return e.g. a value greater than
44  // 0 to represent 'true' and anything negative to represent 'false', or
45  // maybe 0 to represent 'true' and non-zero for 'false'. If no comparison is
46  // needed, this should be CmpInst::BAD_ICMP_PREDICATE.
48  };
50 
51  // Map from each FCmp predicate to the corresponding libcall infos. A FCmp
52  // instruction may be lowered to one or two libcalls, which is why we need a
53  // list. If two libcalls are needed, their results will be OR'ed.
55 
56  FCmpLibcallsMapTy FCmp32Libcalls;
57  FCmpLibcallsMapTy FCmp64Libcalls;
58 
59  // Get the libcall(s) corresponding to \p Predicate for operands of \p Size
60  // bits.
61  FCmpLibcallsList getFCmpLibcalls(CmpInst::Predicate, unsigned Size) const;
62 };
63 } // End llvm namespace.
64 #endif
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::ARMLegalizerInfo::legalizeCustom
bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI) const override
Called for instructions with the Custom LegalizationAction.
Definition: ARMLegalizerInfo.cpp:364
IndexedMap.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:721
llvm::ARMSubtarget
Definition: ARMSubtarget.h:46
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::RTLIB::Libcall
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit.
Definition: RuntimeLibcalls.h:30
llvm::ARMLegalizerInfo::ARMLegalizerInfo
ARMLegalizerInfo(const ARMSubtarget &ST)
Definition: ARMLegalizerInfo.cpp:67
llvm::LegalizerHelper
Definition: LegalizerHelper.h:39
LegalizerInfo.h
llvm::ARMLegalizerInfo
This class provides the information for the target register banks.
Definition: ARMLegalizerInfo.h:27
llvm::IndexedMap< FCmpLibcallsList >
llvm::PPC::Predicate
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
RuntimeLibcalls.h
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
Instructions.h
llvm::LegalizerInfo
Definition: LegalizerInfo.h:1108
GISelChangeObserver.h