@@ -11,11 +11,6 @@ def TruePredicate : Predicate<"">;
11
11
// FIXME: Tablegen should specially supports this
12
12
def FalsePredicate : Predicate<"false">;
13
13
14
- // Add a predicate to the list if does not already exist to deduplicate it.
15
- class PredConcat<Predicate pred, list<Predicate> lst> {
16
- list<Predicate> ret = !listconcat(lst, !listremove([pred], lst));
17
- }
18
-
19
14
// Prevent using other kinds of predicates where True16 predicates are
20
15
// expected by giving them their own class.
21
16
class True16PredicateClass<string cond> : Predicate<cond>;
@@ -28,9 +23,8 @@ class PredicateControl {
28
23
True16PredicateClass True16Predicate = NoTrue16Predicate;
29
24
list<Predicate> OtherPredicates = [];
30
25
list<Predicate> Predicates =
31
- PredConcat<SubtargetPredicate,
32
- PredConcat<AssemblerPredicate,
33
- PredConcat<WaveSizePredicate,
34
- PredConcat<True16Predicate,
35
- OtherPredicates>.ret>.ret>.ret>.ret;
26
+ !foldl(OtherPredicates, [SubtargetPredicate, AssemblerPredicate,
27
+ WaveSizePredicate, True16Predicate],
28
+ preds, p,
29
+ preds # !listremove([p], [TruePredicate, NoTrue16Predicate] # preds));
36
30
}
0 commit comments