LLVM  10.0.0svn
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 
32  MachineIRBuilder &MIRBuilder,
33  GISelChangeObserver &Observer) const override;
34 
35 private:
36  void setFCmpLibcallsGNU();
37  void setFCmpLibcallsAEABI();
38 
39  struct FCmpLibcallInfo {
40  // Which libcall this is.
41  RTLIB::Libcall LibcallID;
42 
43  // The predicate to be used when comparing the value returned by the
44  // function with a relevant constant (currently hard-coded to zero). This is
45  // necessary because often the libcall will return e.g. a value greater than
46  // 0 to represent 'true' and anything negative to represent 'false', or
47  // maybe 0 to represent 'true' and non-zero for 'false'. If no comparison is
48  // needed, this should be CmpInst::BAD_ICMP_PREDICATE.
50  };
52 
53  // Map from each FCmp predicate to the corresponding libcall infos. A FCmp
54  // instruction may be lowered to one or two libcalls, which is why we need a
55  // list. If two libcalls are needed, their results will be OR'ed.
57 
58  FCmpLibcallsMapTy FCmp32Libcalls;
59  FCmpLibcallsMapTy FCmp64Libcalls;
60 
61  // Get the libcall(s) corresponding to \p Predicate for operands of \p Size
62  // bits.
63  FCmpLibcallsList getFCmpLibcalls(CmpInst::Predicate, unsigned Size) const;
64 };
65 } // End llvm namespace.
66 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
This class provides the information for the target register banks.
Abstract class that contains various methods for clients to notify about changes. ...
unsigned const MachineRegisterInfo * MRI
Helper class to build MachineInstr.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:732
ARMLegalizerInfo(const ARMSubtarget &ST)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:837
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
Definition: MachineInstr.h:64
bool legalizeCustom(MachineInstr &MI, MachineRegisterInfo &MRI, MachineIRBuilder &MIRBuilder, GISelChangeObserver &Observer) const override
uint32_t Size
Definition: Profile.cpp:46
IRTranslator LLVM IR MI