diff options
Diffstat (limited to 'llvm/include/llvm/CodeGen/TargetLowering.h')
-rw-r--r-- | llvm/include/llvm/CodeGen/TargetLowering.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h index b2d82e0cc6e8..bec191570594 100644 --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -63,7 +63,6 @@ namespace llvm { -class BranchProbability; class CCState; class CCValAssign; class Constant; @@ -1802,11 +1801,14 @@ public: /// Return the preferred loop alignment. virtual Align getPrefLoopAlignment(MachineLoop *ML = nullptr) const; + /// Return the maximum amount of bytes allowed to be emitted when padding for + /// alignment + virtual unsigned + getMaxPermittedBytesForAlignment(MachineBasicBlock *MBB) const; + /// Should loops be aligned even when the function is marked OptSize (but not /// MinSize). - virtual bool alignLoopsWithOptSize() const { - return false; - } + virtual bool alignLoopsWithOptSize() const { return false; } /// If the target has a standard location for the stack protector guard, /// returns the address of that location. Otherwise, returns nullptr. @@ -1836,8 +1838,8 @@ public: virtual Function *getSSPStackGuardCheck(const Module &M) const; /// \returns true if a constant G_UBFX is legal on the target. - virtual bool isConstantUnsignedBitfieldExtactLegal(unsigned Opc, LLT Ty1, - LLT Ty2) const { + virtual bool isConstantUnsignedBitfieldExtractLegal(unsigned Opc, LLT Ty1, + LLT Ty2) const { return false; } @@ -2341,6 +2343,9 @@ protected: /// means the target does not care about loop alignment. The target may also /// override getPrefLoopAlignment to provide per-loop values. void setPrefLoopAlignment(Align Alignment) { PrefLoopAlignment = Alignment; } + void setMaxBytesForAlignment(unsigned MaxBytes) { + MaxBytesForAlignment = MaxBytes; + } /// Set the minimum stack alignment of an argument. void setMinStackArgumentAlignment(Align Alignment) { @@ -2521,6 +2526,8 @@ public: case ISD::SHL: case ISD::SRL: case ISD::SRA: + case ISD::ROTL: + case ISD::ROTR: case ISD::SDIV: case ISD::UDIV: case ISD::SREM: @@ -3030,6 +3037,8 @@ private: /// The preferred loop alignment (in log2 bot in bytes). Align PrefLoopAlignment; + /// The maximum amount of bytes permitted to be emitted for alignment. + unsigned MaxBytesForAlignment; /// Size in bits of the maximum atomics size the backend supports. /// Accesses larger than this will be expanded by AtomicExpandPass. @@ -3283,6 +3292,17 @@ public: return false; } + // Lets target to control the following reassociation of operands: (op (op x, + // c1), y) -> (op (op x, y), c1) where N0 is (op x, c1) and N1 is y. By + // default consider profitable any case where N0 has single use. This + // behavior reflects the condition replaced by this target hook call in the + // DAGCombiner. Any particular target can implement its own heuristic to + // restrict common combiner. + virtual bool isReassocProfitable(SelectionDAG &DAG, SDValue N0, + SDValue N1) const { + return N0.hasOneUse(); + } + virtual bool isSDNodeAlwaysUniform(const SDNode * N) const { return false; } |