[clang][NFC] simplify the unset check in `ParseLabeledStatement` (#117430)
[llvm-project.git] / llvm / lib / Target / AMDGPU / AMDGPUPredicateControl.td
blob7c990aa6b2eb604a81df677380168638ec6a569e
1 //===-- AMDGPUPredicateControl.td --------------------------*- tablegen -*-===//
2 //
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
6 //
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],
28              preds, p,
29              preds # !listremove([p], [TruePredicate, NoTrue16Predicate] # preds));