1 //===-- AMDGPUPredicateControl.td --------------------------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 def TruePredicate : Predicate<"">;
11 // FIXME: Tablegen should specially supports this
12 def FalsePredicate : Predicate<"false">;
14 // Prevent using other kinds of predicates where True16 predicates are
15 // expected by giving them their own class.
16 class True16PredicateClass<string cond> : Predicate<cond>;
17 def NoTrue16Predicate : True16PredicateClass<"">;
19 class PredicateControl {
20 Predicate SubtargetPredicate = TruePredicate;
21 Predicate AssemblerPredicate = TruePredicate;
22 Predicate WaveSizePredicate = TruePredicate;
23 True16PredicateClass True16Predicate = NoTrue16Predicate;
24 list<Predicate> OtherPredicates = [];
25 list<Predicate> Predicates =
26 !foldl(OtherPredicates, [SubtargetPredicate, AssemblerPredicate,
27 WaveSizePredicate, True16Predicate],
29 preds # !listremove([p], [TruePredicate, NoTrue16Predicate] # preds));