diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPredicateControl.td b/llvm/lib/Target/AMDGPU/AMDGPUPredicateControl.td index 6c7c91ef464df..7c990aa6b2eb6 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUPredicateControl.td +++ b/llvm/lib/Target/AMDGPU/AMDGPUPredicateControl.td @@ -11,11 +11,6 @@ def TruePredicate : Predicate<"">; // FIXME: Tablegen should specially supports this def FalsePredicate : Predicate<"false">; -// Add a predicate to the list if does not already exist to deduplicate it. -class PredConcat lst> { - list ret = !listconcat(lst, !listremove([pred], lst)); -} - // Prevent using other kinds of predicates where True16 predicates are // expected by giving them their own class. class True16PredicateClass : Predicate; @@ -28,9 +23,8 @@ class PredicateControl { True16PredicateClass True16Predicate = NoTrue16Predicate; list OtherPredicates = []; list Predicates = - PredConcat.ret>.ret>.ret>.ret; + !foldl(OtherPredicates, [SubtargetPredicate, AssemblerPredicate, + WaveSizePredicate, True16Predicate], + preds, p, + preds # !listremove([p], [TruePredicate, NoTrue16Predicate] # preds)); }