Skip to content

Commit 6ae08f7

Browse files
author
Jenkins
committed
Merge branch amd-master into amd-common
2 parents 00c8fc1 + 480f461 commit 6ae08f7

File tree

232 files changed

+10549
-5971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+10549
-5971
lines changed

docs/SourceLevelDebugging.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,4 +1661,4 @@ are correctly pointing to the ``[[C]]`` and ``[[D]]`` variables.
16611661
for a ``DILocation`` to have a specific line number, and someone later adds
16621662
an instruction before the one we check the test will fail. In the cases this
16631663
can't be avoided (say, if a test wouldn't be precise enough), moving the
1664-
test to it's own file is preferred.
1664+
test to its own file is preferred.

examples/Kaleidoscope/Chapter9/toy.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,9 +1245,8 @@ Function *FunctionAST::codegen() {
12451245
unsigned ScopeLine = LineNo;
12461246
DISubprogram *SP = DBuilder->createFunction(
12471247
FContext, P.getName(), StringRef(), Unit, LineNo,
1248-
CreateFunctionType(TheFunction->arg_size(), Unit),
1249-
false /* internal linkage */, true /* definition */, ScopeLine,
1250-
DINode::FlagPrototyped, false);
1248+
CreateFunctionType(TheFunction->arg_size(), Unit), ScopeLine,
1249+
DINode::FlagPrototyped, DISubprogram::SPFlagDefinition);
12511250
TheFunction->setSubprogram(SP);
12521251

12531252
// Push the current scope.

include/llvm/ADT/STLExtras.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,40 @@ auto apply_tuple(F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(
14051405
Indices{});
14061406
}
14071407

1408+
/// Return true if the sequence [Begin, End) has exactly N items. Runs in O(N)
1409+
/// time. Not meant for use with random-access iterators.
1410+
template <typename IterTy>
1411+
bool hasNItems(
1412+
IterTy &&Begin, IterTy &&End, unsigned N,
1413+
typename std::enable_if<
1414+
!std::is_same<
1415+
typename std::iterator_traits<typename std::remove_reference<
1416+
decltype(Begin)>::type>::iterator_category,
1417+
std::random_access_iterator_tag>::value,
1418+
void>::type * = nullptr) {
1419+
for (; N; --N, ++Begin)
1420+
if (Begin == End)
1421+
return false; // Too few.
1422+
return Begin == End;
1423+
}
1424+
1425+
/// Return true if the sequence [Begin, End) has N or more items. Runs in O(N)
1426+
/// time. Not meant for use with random-access iterators.
1427+
template <typename IterTy>
1428+
bool hasNItemsOrMore(
1429+
IterTy &&Begin, IterTy &&End, unsigned N,
1430+
typename std::enable_if<
1431+
!std::is_same<
1432+
typename std::iterator_traits<typename std::remove_reference<
1433+
decltype(Begin)>::type>::iterator_category,
1434+
std::random_access_iterator_tag>::value,
1435+
void>::type * = nullptr) {
1436+
for (; N; --N, ++Begin)
1437+
if (Begin == End)
1438+
return false; // Too few.
1439+
return true;
1440+
}
1441+
14081442
} // end namespace llvm
14091443

14101444
#endif // LLVM_ADT_STLEXTRAS_H

include/llvm/Analysis/LoopAccessAnalysis.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,10 @@ class LoopAccessInfo {
564564
/// Print the information about the memory accesses in the loop.
565565
void print(raw_ostream &OS, unsigned Depth = 0) const;
566566

567-
/// If the loop has multiple stores to an invariant address, then
568-
/// return true, else return false.
569-
bool hasMultipleStoresToLoopInvariantAddress() const {
570-
return HasMultipleStoresToLoopInvariantAddress;
567+
/// If the loop has memory dependence involving an invariant address, i.e. two
568+
/// stores or a store and a load, then return true, else return false.
569+
bool hasDependenceInvolvingLoopInvariantAddress() const {
570+
return HasDependenceInvolvingLoopInvariantAddress;
571571
}
572572

573573
/// Used to add runtime SCEV checks. Simplifies SCEV expressions and converts
@@ -620,8 +620,8 @@ class LoopAccessInfo {
620620
/// Cache the result of analyzeLoop.
621621
bool CanVecMem;
622622

623-
/// Indicator that there are multiple stores to a uniform address.
624-
bool HasMultipleStoresToLoopInvariantAddress;
623+
/// Indicator that there are non vectorizable stores to a uniform address.
624+
bool HasDependenceInvolvingLoopInvariantAddress;
625625

626626
/// The diagnostics report generated for the analysis. E.g. why we
627627
/// couldn't analyze the loop.

include/llvm/Analysis/ProfileSummaryInfo.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ class ProfileSummaryInfo {
9898
bool isFunctionEntryCold(const Function *F);
9999
/// Returns true if \p F contains only cold code.
100100
bool isFunctionColdInCallGraph(const Function *F, BlockFrequencyInfo &BFI);
101-
/// Returns true if \p F is a hot function.
101+
/// Returns true if count \p C is considered hot.
102102
bool isHotCount(uint64_t C);
103103
/// Returns true if count \p C is considered cold.
104104
bool isColdCount(uint64_t C);
105-
/// Returns true if BasicBlock \p B is considered hot.
106-
bool isHotBB(const BasicBlock *B, BlockFrequencyInfo *BFI);
107-
/// Returns true if BasicBlock \p B is considered cold.
108-
bool isColdBB(const BasicBlock *B, BlockFrequencyInfo *BFI);
105+
/// Returns true if BasicBlock \p BB is considered hot.
106+
bool isHotBlock(const BasicBlock *BB, BlockFrequencyInfo *BFI);
107+
/// Returns true if BasicBlock \p BB is considered cold.
108+
bool isColdBlock(const BasicBlock *BB, BlockFrequencyInfo *BFI);
109109
/// Returns true if CallSite \p CS is considered hot.
110110
bool isHotCallSite(const CallSite &CS, BlockFrequencyInfo *BFI);
111111
/// Returns true if Callsite \p CS is considered cold.
@@ -134,9 +134,8 @@ class ProfileSummaryInfoWrapperPass : public ImmutablePass {
134134
static char ID;
135135
ProfileSummaryInfoWrapperPass();
136136

137-
ProfileSummaryInfo *getPSI() {
138-
return &*PSI;
139-
}
137+
ProfileSummaryInfo &getPSI() { return *PSI; }
138+
const ProfileSummaryInfo &getPSI() const { return *PSI; }
140139

141140
bool doInitialization(Module &M) override;
142141
bool doFinalization(Module &M) override;

include/llvm/CodeGen/Passes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ namespace llvm {
379379
///
380380
FunctionPass *createInterleavedAccessPass();
381381

382+
/// InterleavedLoadCombines Pass - This pass identifies interleaved loads and
383+
/// combines them into wide loads detectable by InterleavedAccessPass
384+
///
385+
FunctionPass *createInterleavedLoadCombinePass();
386+
382387
/// LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all
383388
/// TLS variables for the emulated TLS model.
384389
///

include/llvm/CodeGen/SelectionDAG.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -929,41 +929,42 @@ class SelectionDAG {
929929
Type *SizeTy, unsigned ElemSz, bool isTailCall,
930930
MachinePointerInfo DstPtrInfo);
931931

932-
/// Helper function to make it easier to build SetCC's if you just
933-
/// have an ISD::CondCode instead of an SDValue.
934-
///
932+
/// Helper function to make it easier to build SetCC's if you just have an
933+
/// ISD::CondCode instead of an SDValue.
935934
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS,
936935
ISD::CondCode Cond) {
937936
assert(LHS.getValueType().isVector() == RHS.getValueType().isVector() &&
938-
"Cannot compare scalars to vectors");
937+
"Cannot compare scalars to vectors");
939938
assert(LHS.getValueType().isVector() == VT.isVector() &&
940-
"Cannot compare scalars to vectors");
939+
"Cannot compare scalars to vectors");
941940
assert(Cond != ISD::SETCC_INVALID &&
942-
"Cannot create a setCC of an invalid node.");
941+
"Cannot create a setCC of an invalid node.");
943942
return getNode(ISD::SETCC, DL, VT, LHS, RHS, getCondCode(Cond));
944943
}
945944

946-
/// Helper function to make it easier to build Select's if you just
947-
/// have operands and don't want to check for vector.
945+
/// Helper function to make it easier to build Select's if you just have
946+
/// operands and don't want to check for vector.
948947
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS,
949948
SDValue RHS) {
950949
assert(LHS.getValueType() == RHS.getValueType() &&
951950
"Cannot use select on differing types");
952951
assert(VT.isVector() == LHS.getValueType().isVector() &&
953952
"Cannot mix vectors and scalars");
954-
return getNode(Cond.getValueType().isVector() ? ISD::VSELECT : ISD::SELECT, DL, VT,
955-
Cond, LHS, RHS);
953+
auto Opcode = Cond.getValueType().isVector() ? ISD::VSELECT : ISD::SELECT;
954+
return getNode(Opcode, DL, VT, Cond, LHS, RHS);
956955
}
957956

958-
/// Helper function to make it easier to build SelectCC's if you
959-
/// just have an ISD::CondCode instead of an SDValue.
960-
///
957+
/// Helper function to make it easier to build SelectCC's if you just have an
958+
/// ISD::CondCode instead of an SDValue.
961959
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True,
962960
SDValue False, ISD::CondCode Cond) {
963-
return getNode(ISD::SELECT_CC, DL, True.getValueType(),
964-
LHS, RHS, True, False, getCondCode(Cond));
961+
return getNode(ISD::SELECT_CC, DL, True.getValueType(), LHS, RHS, True,
962+
False, getCondCode(Cond));
965963
}
966964

965+
/// Try to simplify a select/vselect into 1 of its operands or a constant.
966+
SDValue simplifySelect(SDValue Cond, SDValue TVal, SDValue FVal);
967+
967968
/// VAArg produces a result and token chain, and takes a pointer
968969
/// and a source value as input.
969970
SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,

include/llvm/IR/BasicBlock.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
237237
static_cast<const BasicBlock *>(this)->getUniquePredecessor());
238238
}
239239

240+
/// Return true if this block has exactly N predecessors.
241+
bool hasNPredecessors(unsigned N) const;
242+
243+
/// Return true if this block has N predecessors or more.
244+
bool hasNPredecessorsOrMore(unsigned N) const;
245+
240246
/// Return the successor of this block if it has a single successor.
241247
/// Otherwise return a null pointer.
242248
///

include/llvm/IR/CFG.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ inline const_pred_iterator pred_end(const BasicBlock *BB) {
117117
inline bool pred_empty(const BasicBlock *BB) {
118118
return pred_begin(BB) == pred_end(BB);
119119
}
120+
/// Get the number of predecessors of \p BB. This is a linear time operation.
121+
/// Use \ref BasicBlock::hasNPredecessors() or hasNPredecessorsOrMore if able.
120122
inline unsigned pred_size(const BasicBlock *BB) {
121123
return std::distance(pred_begin(BB), pred_end(BB));
122124
}

include/llvm/IR/DIBuilder.h

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -653,29 +653,28 @@ namespace llvm {
653653
/// \param File File where this variable is defined.
654654
/// \param LineNo Line number.
655655
/// \param Ty Function type.
656-
/// \param isLocalToUnit True if this function is not externally visible.
657-
/// \param isDefinition True if this is a function definition.
658656
/// \param ScopeLine Set to the beginning of the scope this starts
659657
/// \param Flags e.g. is this function prototyped or not.
660658
/// These flags are used to emit dwarf attributes.
661-
/// \param isOptimized True if optimization is ON.
659+
/// \param SPFlags Additional flags specific to subprograms.
662660
/// \param TParams Function template parameters.
663661
/// \param ThrownTypes Exception types this function may throw.
664-
DISubprogram *createFunction(
665-
DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
666-
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
667-
bool isDefinition, unsigned ScopeLine,
668-
DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
669-
DITemplateParameterArray TParams = nullptr,
670-
DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
662+
DISubprogram *
663+
createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName,
664+
DIFile *File, unsigned LineNo, DISubroutineType *Ty,
665+
unsigned ScopeLine, DINode::DIFlags Flags = DINode::FlagZero,
666+
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
667+
DITemplateParameterArray TParams = nullptr,
668+
DISubprogram *Decl = nullptr,
669+
DITypeArray ThrownTypes = nullptr);
671670

672671
/// Identical to createFunction,
673672
/// except that the resulting DbgNode is meant to be RAUWed.
674673
DISubprogram *createTempFunctionFwdDecl(
675674
DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
676-
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
677-
bool isDefinition, unsigned ScopeLine,
678-
DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
675+
unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine,
676+
DINode::DIFlags Flags = DINode::FlagZero,
677+
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
679678
DITemplateParameterArray TParams = nullptr,
680679
DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
681680

@@ -687,10 +686,6 @@ namespace llvm {
687686
/// \param File File where this variable is defined.
688687
/// \param LineNo Line number.
689688
/// \param Ty Function type.
690-
/// \param isLocalToUnit True if this function is not externally visible..
691-
/// \param isDefinition True if this is a function definition.
692-
/// \param Virtuality Attributes describing virtualness. e.g. pure
693-
/// virtual function.
694689
/// \param VTableIndex Index no of this method in virtual table, or -1u if
695690
/// unrepresentable.
696691
/// \param ThisAdjustment
@@ -699,17 +694,18 @@ namespace llvm {
699694
/// \param VTableHolder Type that holds vtable.
700695
/// \param Flags e.g. is this function prototyped or not.
701696
/// This flags are used to emit dwarf attributes.
702-
/// \param isOptimized True if optimization is ON.
697+
/// \param SPFlags Additional flags specific to subprograms.
703698
/// \param TParams Function template parameters.
704699
/// \param ThrownTypes Exception types this function may throw.
705-
DISubprogram *createMethod(
706-
DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
707-
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
708-
bool isDefinition, unsigned Virtuality = 0, unsigned VTableIndex = 0,
709-
int ThisAdjustment = 0, DIType *VTableHolder = nullptr,
710-
DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
711-
DITemplateParameterArray TParams = nullptr,
712-
DITypeArray ThrownTypes = nullptr);
700+
DISubprogram *
701+
createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName,
702+
DIFile *File, unsigned LineNo, DISubroutineType *Ty,
703+
unsigned VTableIndex = 0, int ThisAdjustment = 0,
704+
DIType *VTableHolder = nullptr,
705+
DINode::DIFlags Flags = DINode::FlagZero,
706+
DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
707+
DITemplateParameterArray TParams = nullptr,
708+
DITypeArray ThrownTypes = nullptr);
713709

714710
/// This creates new descriptor for a namespace with the specified
715711
/// parent scope.

0 commit comments

Comments
 (0)