diff options
| author | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-04-27 21:03:27 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel_l_sanders@apple.com> | 2018-04-27 21:03:27 +0000 |
| commit | 4f246999d983878243295814b92b978781f366ee (patch) | |
| tree | dbe2e839c0408bf68023d2e6bd9a78ca6739ab9c /llvm | |
| parent | 5a6482450a3f734d6ad3d22ebf4ab9407dcd2a18 (diff) | |
| download | bcm5719-llvm-4f246999d983878243295814b92b978781f366ee.tar.gz bcm5719-llvm-4f246999d983878243295814b92b978781f366ee.zip | |
Attempt to fix remaining build failures after r331071 by changing the tuple to a struct
Some of the bots were failing in a different way to the others. These were
unable to compare tuples. Fix this by changing to a struct, thereby avoiding
the quirks of tuples.
llvm-svn: 331081
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h | 16 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp | 9 |
2 files changed, 18 insertions, 7 deletions
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h index c054875b791..c856bd60931 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h @@ -161,6 +161,17 @@ using LegalizeMutation = std::function<std::pair<unsigned, LLT>(const LegalityQuery &)>; namespace LegalityPredicates { +struct TypePairAndMemSize { + LLT Type0; + LLT Type1; + uint64_t MemSize; + + bool operator==(const TypePairAndMemSize &Other) const { + return Type0 == Other.Type0 && Type1 == Other.Type1 && + MemSize == Other.MemSize; + } +}; + /// True iff P0 and P1 are true. LegalityPredicate all(LegalityPredicate P0, LegalityPredicate P1); /// True iff the given type index is one of the specified types. @@ -175,7 +186,7 @@ typePairInSet(unsigned TypeIdx0, unsigned TypeIdx1, /// specified type pairs. LegalityPredicate typePairAndMemSizeInSet( unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx, - std::initializer_list<std::tuple<LLT, LLT, unsigned>> TypesAndMemSizeInit); + std::initializer_list<TypePairAndMemSize> TypesAndMemSizeInit); /// True iff the specified type index is a scalar. LegalityPredicate isScalar(unsigned TypeIdx); /// True iff the specified type index is a scalar that's narrower than the given @@ -346,7 +357,8 @@ public: /// The instruction is legal when type indexes 0 and 1 along with the memory /// size is any type and size tuple in the given list. LegalizeRuleSet &legalForTypesWithMemSize( - std::initializer_list<std::tuple<LLT, LLT, unsigned>> TypesAndMemSize) { + std::initializer_list<LegalityPredicates::TypePairAndMemSize> + TypesAndMemSize) { return legalIf(LegalityPredicates::typePairAndMemSizeInSet( 0, 1, /*MMOIdx*/ 0, TypesAndMemSize)); } diff --git a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp index b43d88fc237..56b57b53d64 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp @@ -43,12 +43,11 @@ LegalityPredicate LegalityPredicates::typePairInSet( LegalityPredicate LegalityPredicates::typePairAndMemSizeInSet( unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx, - std::initializer_list<std::tuple<LLT, LLT, unsigned>> TypesAndMemSizeInit) { - SmallVector<std::tuple<LLT, LLT, unsigned>, 4> TypesAndMemSize = TypesAndMemSizeInit; + std::initializer_list<TypePairAndMemSize> TypesAndMemSizeInit) { + SmallVector<TypePairAndMemSize, 4> TypesAndMemSize = TypesAndMemSizeInit; return [=](const LegalityQuery &Query) { - std::tuple<LLT, LLT, unsigned> Match = - std::make_tuple(Query.Types[TypeIdx0], Query.Types[TypeIdx1], - Query.MMODescrs[MMOIdx].Size); + TypePairAndMemSize Match = {Query.Types[TypeIdx0], Query.Types[TypeIdx1], + Query.MMODescrs[MMOIdx].Size}; return std::find(TypesAndMemSize.begin(), TypesAndMemSize.end(), Match) != TypesAndMemSize.end(); }; |

