diff options
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/GCStrategy.h | 6 | ||||
| -rw-r--r-- | include/llvm/CodeGen/GlobalISel/LegalizerInfo.h | 4 | ||||
| -rw-r--r-- | include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h | 10 | ||||
| -rw-r--r-- | include/llvm/CodeGen/MachORelocation.h | 10 | ||||
| -rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 2 | ||||
| -rw-r--r-- | include/llvm/CodeGen/MachineOutliner.h | 14 | ||||
| -rw-r--r-- | include/llvm/CodeGen/ScheduleDAG.h | 2 | ||||
| -rw-r--r-- | include/llvm/CodeGen/StackMaps.h | 2 | ||||
| -rw-r--r-- | include/llvm/CodeGen/TargetLowering.h | 13 | ||||
| -rw-r--r-- | include/llvm/CodeGen/TargetPassConfig.h | 2 | ||||
| -rw-r--r-- | include/llvm/CodeGen/TargetRegisterInfo.h | 4 | 
11 files changed, 47 insertions, 22 deletions
diff --git a/include/llvm/CodeGen/GCStrategy.h b/include/llvm/CodeGen/GCStrategy.h index 91604fd2df872..f835bacfb5481 100644 --- a/include/llvm/CodeGen/GCStrategy.h +++ b/include/llvm/CodeGen/GCStrategy.h @@ -104,12 +104,12 @@ public:    const std::string &getName() const { return Name; }    /// By default, write barriers are replaced with simple store -  /// instructions. If true, you must provide a custom pass to lower  +  /// instructions. If true, you must provide a custom pass to lower    /// calls to \@llvm.gcwrite.    bool customWriteBarrier() const { return CustomWriteBarriers; }    /// By default, read barriers are replaced with simple load -  /// instructions. If true, you must provide a custom pass to lower  +  /// instructions. If true, you must provide a custom pass to lower    /// calls to \@llvm.gcread.    bool customReadBarrier() const { return CustomReadBarriers; } @@ -146,7 +146,7 @@ public:    }    /// By default, roots are left for the code generator so it can generate a -  /// stack map. If true, you must provide a custom pass to lower  +  /// stack map. If true, you must provide a custom pass to lower    /// calls to \@llvm.gcroot.    bool customRoots() const { return CustomRoots; } diff --git a/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h index 713d72eb4c9be..a8c26082f2210 100644 --- a/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h +++ b/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h @@ -786,7 +786,7 @@ public:    /// setAction ({G_ADD, 0, LLT::scalar(32)}, Legal);    /// setLegalizeScalarToDifferentSizeStrategy(    ///   G_ADD, 0, widenToLargerTypesAndNarrowToLargest); -  /// will end up defining getAction({G_ADD, 0, T}) to return the following  +  /// will end up defining getAction({G_ADD, 0, T}) to return the following    /// actions for different scalar types T:    ///  LLT::scalar(1)..LLT::scalar(31): {WidenScalar, 0, LLT::scalar(32)}    ///  LLT::scalar(32):                 {Legal, 0, LLT::scalar(32)} @@ -814,7 +814,7 @@ public:      VectorElementSizeChangeStrategies[OpcodeIdx][TypeIdx] = S;    } -  /// A SizeChangeStrategy for the common case where legalization for a  +  /// A SizeChangeStrategy for the common case where legalization for a    /// particular operation consists of only supporting a specific set of type    /// sizes. E.g.    ///   setAction ({G_DIV, 0, LLT::scalar(32)}, Legal); diff --git a/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h index 983a4e680d5c8..ac1673de5f3f1 100644 --- a/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h +++ b/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h @@ -942,6 +942,16 @@ public:    /// \return a MachineInstrBuilder for the newly created instruction.    MachineInstrBuilder buildAtomicRMWUmin(unsigned OldValRes, unsigned Addr,                                           unsigned Val, MachineMemOperand &MMO); + +  /// Build and insert \p Res = G_BLOCK_ADDR \p BA +  /// +  /// G_BLOCK_ADDR computes the address of a basic block. +  /// +  /// \pre setBasicBlock or setMI must have been called. +  /// \pre \p Res must be a generic virtual register of a pointer type. +  /// +  /// \return The newly created instruction. +  MachineInstrBuilder buildBlockAddress(unsigned Res, const BlockAddress *BA);  };  /// A CRTP class that contains methods for building instructions that can diff --git a/include/llvm/CodeGen/MachORelocation.h b/include/llvm/CodeGen/MachORelocation.h index 8c9b7a84e5b88..cbb49695af753 100644 --- a/include/llvm/CodeGen/MachORelocation.h +++ b/include/llvm/CodeGen/MachORelocation.h @@ -27,15 +27,15 @@ namespace llvm {      uint32_t r_symbolnum; // symbol index if r_extern == 1 else section index      bool     r_pcrel;     // was relocated pc-relative already      uint8_t  r_length;    // length = 2 ^ r_length -    bool     r_extern;    //  +    bool     r_extern;    //      uint8_t  r_type;      // if not 0, machine-specific relocation type.      bool     r_scattered; // 1 = scattered, 0 = non-scattered      int32_t  r_value;     // the value the item to be relocated is referring                            // to. -  public:       +  public:      uint32_t getPackedFields() const {        if (r_scattered) -        return (1 << 31) | (r_pcrel << 30) | ((r_length & 3) << 28) |  +        return (1 << 31) | (r_pcrel << 30) | ((r_length & 3) << 28) |            ((r_type & 15) << 24) | (r_address & 0x00FFFFFF);        else          return (r_symbolnum << 8) | (r_pcrel << 7) | ((r_length & 3) << 5) | @@ -45,8 +45,8 @@ namespace llvm {      uint32_t getRawAddress() const { return r_address; }      MachORelocation(uint32_t addr, uint32_t index, bool pcrel, uint8_t len, -                    bool ext, uint8_t type, bool scattered = false,  -                    int32_t value = 0) :  +                    bool ext, uint8_t type, bool scattered = false, +                    int32_t value = 0) :        r_address(addr), r_symbolnum(index), r_pcrel(pcrel), r_length(len),        r_extern(ext), r_type(type), r_scattered(scattered), r_value(value) {}    }; diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 6be304fa368bb..554e89019b76f 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -105,7 +105,7 @@ class MachineModuleInfo : public ImmutablePass {    /// basic block's address of label.    MMIAddrLabelMap *AddrLabelSymbols; -  // TODO: Ideally, what we'd like is to have a switch that allows emitting  +  // TODO: Ideally, what we'd like is to have a switch that allows emitting    // synchronous (precise at call-sites only) CFA into .eh_frame. However,    // even under this switch, we'd like .debug_frame to be precise when using    // -g. At this moment, there's no way to specify that some CFI directives diff --git a/include/llvm/CodeGen/MachineOutliner.h b/include/llvm/CodeGen/MachineOutliner.h index 4249a99a891b7..95bfc24b57ffa 100644 --- a/include/llvm/CodeGen/MachineOutliner.h +++ b/include/llvm/CodeGen/MachineOutliner.h @@ -19,6 +19,7 @@  #include "llvm/CodeGen/LiveRegUnits.h"  #include "llvm/CodeGen/MachineFunction.h"  #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/LivePhysRegs.h"  namespace llvm {  namespace outliner { @@ -74,6 +75,13 @@ public:    /// cost model information.    LiveRegUnits LRU; +  /// Contains the accumulated register liveness information for the +  /// instructions in this \p Candidate. +  /// +  /// This is optionally used by the target to determine which registers have +  /// been used across the sequence. +  LiveRegUnits UsedInSequence; +    /// Return the number of instructions in this Candidate.    unsigned getLength() const { return Len; } @@ -137,6 +145,12 @@ public:      // outlining candidate.      std::for_each(MBB->rbegin(), (MachineBasicBlock::reverse_iterator)front(),                    [this](MachineInstr &MI) { LRU.stepBackward(MI); }); + +    // Walk over the sequence itself and figure out which registers were used +    // in the sequence. +    UsedInSequence.init(TRI); +    std::for_each(front(), std::next(back()), +                  [this](MachineInstr &MI) { UsedInSequence.accumulate(MI); });    }  }; diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index 5e7837834ec81..56adc2e2fbfa6 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -252,7 +252,7 @@ class TargetRegisterInfo;      MachineInstr *Instr = nullptr; ///< Alternatively, a MachineInstr.    public: -    SUnit *OrigNode = nullptr; ///< If not this, the node from which this node  +    SUnit *OrigNode = nullptr; ///< If not this, the node from which this node                                 /// was cloned. (SD scheduling only)      const MCSchedClassDesc *SchedClass = diff --git a/include/llvm/CodeGen/StackMaps.h b/include/llvm/CodeGen/StackMaps.h index 3c98502657377..e584a4136e4fb 100644 --- a/include/llvm/CodeGen/StackMaps.h +++ b/include/llvm/CodeGen/StackMaps.h @@ -156,7 +156,7 @@ class StatepointOpers {    // TODO:: we should change the STATEPOINT representation so that CC and    // Flags should be part of meta operands, with args and deopt operands, and    // gc operands all prefixed by their length and a type code. This would be -  // much more consistent.  +  // much more consistent.  public:    // These values are aboolute offsets into the operands of the statepoint    // instruction. diff --git a/include/llvm/CodeGen/TargetLowering.h b/include/llvm/CodeGen/TargetLowering.h index d5ff71cf9ac2f..40540bd6e1ffa 100644 --- a/include/llvm/CodeGen/TargetLowering.h +++ b/include/llvm/CodeGen/TargetLowering.h @@ -718,7 +718,7 @@ public:    /// always broken down into scalars in some contexts. This occurs even if the    /// vector type is legal.    virtual unsigned getVectorTypeBreakdownForCallingConv( -      LLVMContext &Context, EVT VT, EVT &IntermediateVT, +      LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT,        unsigned &NumIntermediates, MVT &RegisterVT) const {      return getVectorTypeBreakdown(Context, VT, IntermediateVT, NumIntermediates,                                    RegisterVT); @@ -1174,7 +1174,7 @@ public:    /// are legal for some operations and not for other operations.    /// For MIPS all vector types must be passed through the integer register set.    virtual MVT getRegisterTypeForCallingConv(LLVMContext &Context, -                                            EVT VT) const { +                                            CallingConv::ID CC, EVT VT) const {      return getRegisterType(Context, VT);    } @@ -1182,6 +1182,7 @@ public:    /// this occurs when a vector type is used, as vector are passed through the    /// integer register set.    virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context, +                                                 CallingConv::ID CC,                                                   EVT VT) const {      return getNumRegisters(Context, VT);    } @@ -3489,10 +3490,10 @@ public:    //    SDValue BuildSDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,                      bool IsAfterLegalization, -                    std::vector<SDNode *> *Created) const; +                    SmallVectorImpl<SDNode *> &Created) const;    SDValue BuildUDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,                      bool IsAfterLegalization, -                    std::vector<SDNode *> *Created) const; +                    SmallVectorImpl<SDNode *> &Created) const;    /// Targets may override this function to provide custom SDIV lowering for    /// power-of-2 denominators.  If the target returns an empty SDValue, LLVM @@ -3500,7 +3501,7 @@ public:    /// operations.    virtual SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor,                                  SelectionDAG &DAG, -                                std::vector<SDNode *> *Created) const; +                                SmallVectorImpl<SDNode *> &Created) const;    /// Indicate whether this target prefers to combine FDIVs with the same    /// divisor. If the transform should never be done, return zero. If the @@ -3690,7 +3691,7 @@ private:  /// Given an LLVM IR type and return type attributes, compute the return value  /// EVTs and flags, and optionally also the offsets, if the return value is  /// being lowered to memory. -void GetReturnInfo(Type *ReturnType, AttributeList attr, +void GetReturnInfo(CallingConv::ID CC, Type *ReturnType, AttributeList attr,                     SmallVectorImpl<ISD::OutputArg> &Outs,                     const TargetLowering &TLI, const DataLayout &DL); diff --git a/include/llvm/CodeGen/TargetPassConfig.h b/include/llvm/CodeGen/TargetPassConfig.h index 5918c524d11c2..8f5c9cb8c3fa8 100644 --- a/include/llvm/CodeGen/TargetPassConfig.h +++ b/include/llvm/CodeGen/TargetPassConfig.h @@ -16,7 +16,7 @@  #include "llvm/Pass.h"  #include "llvm/Support/CodeGen.h" -#include <cassert>  +#include <cassert>  #include <string>  namespace llvm { diff --git a/include/llvm/CodeGen/TargetRegisterInfo.h b/include/llvm/CodeGen/TargetRegisterInfo.h index 538a5845466c5..55a8ba630a595 100644 --- a/include/llvm/CodeGen/TargetRegisterInfo.h +++ b/include/llvm/CodeGen/TargetRegisterInfo.h @@ -456,7 +456,7 @@ public:    /// stack frame offset. The first register is closest to the incoming stack    /// pointer if stack grows down, and vice versa.    /// Notice: This function does not take into account disabled CSRs. -  ///         In most cases you will want to use instead the function  +  ///         In most cases you will want to use instead the function    ///         getCalleeSavedRegs that is implemented in MachineRegisterInfo.    virtual const MCPhysReg*    getCalleeSavedRegs(const MachineFunction *MF) const = 0; @@ -518,7 +518,7 @@ public:    /// guaranteed to be restored before any uses. This is useful for targets that    /// have call sequences where a GOT register may be updated by the caller    /// prior to a call and is guaranteed to be restored (also by the caller) -  /// after the call.  +  /// after the call.    virtual bool isCallerPreservedPhysReg(unsigned PhysReg,                                          const MachineFunction &MF) const {      return false;  | 
