[clang] e4b4543 - [Clang] [TableGen] Clean up !if(!eq(bool, 1) and related booleans
Paul C. Anagnostopoulos via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 22 06:29:46 PDT 2020
Author: Paul C. Anagnostopoulos
Date: 2020-10-22T09:29:15-04:00
New Revision: e4b4543ff0c83b6f1d80064e2dcd22b2bb0bfab6
URL: https://github.com/llvm/llvm-project/commit/e4b4543ff0c83b6f1d80064e2dcd22b2bb0bfab6
DIFF: https://github.com/llvm/llvm-project/commit/e4b4543ff0c83b6f1d80064e2dcd22b2bb0bfab6.diff
LOG: [Clang] [TableGen] Clean up !if(!eq(bool, 1) and related booleans
Differential Revision: https://reviews.llvm.org/D89893
Added:
Modified:
clang/include/clang/Basic/arm_mve.td
clang/include/clang/Basic/arm_mve_defs.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/arm_mve.td b/clang/include/clang/Basic/arm_mve.td
index 25daae2a0a25..94f76dd729b0 100644
--- a/clang/include/clang/Basic/arm_mve.td
+++ b/clang/include/clang/Basic/arm_mve.td
@@ -406,7 +406,7 @@ def vabdq: Intrinsic<Vector, (args Vector:$a, Vector:$b),
}
multiclass VectorVectorArithmetic<string operation, dag extraArgs = (?),
- int wantXVariant = 1> {
+ bit wantXVariant = 1> {
defm "" : IntrinsicMX<
Vector, (args Vector:$a, Vector:$b, Predicate:$pred),
!con((IRInt<operation, [Vector, Predicate]> $a, $b),
@@ -415,7 +415,7 @@ multiclass VectorVectorArithmetic<string operation, dag extraArgs = (?),
multiclass VectorScalarArithmetic<string operation, string basename,
dag extraArgs = (?),
- int wantXVariant = 1> {
+ bit wantXVariant = 1> {
defm "" : IntrinsicMXNameOverride<
Vector, (args Vector:$a, unpromoted<Scalar>:$b, Predicate:$pred),
!con((IRInt<operation, [Vector, Predicate]> $a, (splat $b)),
@@ -451,7 +451,7 @@ let params = T.Usual in {
}
multiclass DblVectorVectorArithmetic<string operation, dag extraArgs = (?),
- int wantXVariant = 1> {
+ bit wantXVariant = 1> {
defm "" : IntrinsicMX<
DblVector, (args Vector:$a, Vector:$b, DblPredicate:$pred),
!con((IRInt<operation, [DblVector, Vector, DblPredicate]> $a, $b),
@@ -460,7 +460,7 @@ multiclass DblVectorVectorArithmetic<string operation, dag extraArgs = (?),
multiclass DblVectorScalarArithmetic<string operation, string basename,
dag extraArgs = (?),
- int wantXVariant = 1> {
+ bit wantXVariant = 1> {
defm "" : IntrinsicMXNameOverride<
DblVector, (args Vector:$a, unpromoted<Scalar>:$b, DblPredicate:$pred),
!con((IRInt<operation, [DblVector, Vector, DblPredicate]> $a, (splat $b)),
diff --git a/clang/include/clang/Basic/arm_mve_defs.td b/clang/include/clang/Basic/arm_mve_defs.td
index 4038a18027f8..1a090c08cc85 100644
--- a/clang/include/clang/Basic/arm_mve_defs.td
+++ b/clang/include/clang/Basic/arm_mve_defs.td
@@ -519,7 +519,7 @@ class NameOverride<string basename_> {
// polymorph
diff erently (typically because the type of the inactive
// parameter can be used as a disambiguator if it's present).
multiclass IntrinsicMX<Type rettype, dag arguments, dag cg,
- int wantXVariant = 1,
+ bit wantXVariant = 1,
string nameSuffix = "",
PolymorphicNameType pnt_m = PNT_Type,
PolymorphicNameType pnt_x = PNT_Type> {
@@ -532,7 +532,7 @@ multiclass IntrinsicMX<Type rettype, dag arguments, dag cg,
let pnt = pnt_m;
}
- foreach unusedVar = !if(!eq(wantXVariant, 1), [1], []<int>) in {
+ if wantXVariant then {
// The _x variant leaves off that parameter, and simply uses an
// undef value of the same type.
@@ -546,7 +546,7 @@ multiclass IntrinsicMX<Type rettype, dag arguments, dag cg,
// Same as above, but with an additional parameter 'basename' which overrides
// the C intrinsic base name
multiclass IntrinsicMXNameOverride<Type rettype, dag arguments, dag cg,
- string basename, int wantXVariant = 1,
+ string basename, bit wantXVariant = 1,
string nameSuffix = "",
PolymorphicNameType pnt_m = PNT_Type,
PolymorphicNameType pnt_x = PNT_Type> {
@@ -556,7 +556,7 @@ multiclass IntrinsicMXNameOverride<Type rettype, dag arguments, dag cg,
let pnt = pnt_m;
}
- foreach unusedVar = !if(!eq(wantXVariant, 1), [1], []<int>) in {
+ if wantXVariant then {
def "_x" # nameSuffix:
Intrinsic<rettype, arguments, (seq (undef rettype):$inactive, cg)>,
NameOverride<basename # "_x" # nameSuffix> {
More information about the cfe-commits
mailing list