Reland [IR] Intrinsics default attributes and opt-out flag

Intrinsic properties can now be set to default and applied to all
intrinsics. If the attributes are not needed, the user can opt-out by
setting the DisableDefaultAttributes flag to true.

Differential Revision: https://reviews.llvm.org/D70365
diff --git a/llvm/test/TableGen/intrin-side-effects.td b/llvm/test/TableGen/intrin-side-effects.td
index 7588855..f58d374 100644
--- a/llvm/test/TableGen/intrin-side-effects.td
+++ b/llvm/test/TableGen/intrin-side-effects.td
@@ -11,7 +11,10 @@
 
 def llvm_i32_ty        : LLVMType<i32>;
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
+
 def IntrNoMem : IntrinsicProperty;
 def IntrHasSideEffects : IntrinsicProperty;
 
@@ -27,6 +30,8 @@
   list<LLVMType> ParamTypes = param_types;
   list<IntrinsicProperty> IntrProperties = intr_properties;
   let Properties = sd_properties;
+  bit DisableDefaultAttributes = 1;
+
 
   bit isTarget = 0;
 }
diff --git a/llvm/test/TableGen/intrinsic-long-name.td b/llvm/test/TableGen/intrinsic-long-name.td
index c2f696e..d661732 100644
--- a/llvm/test/TableGen/intrinsic-long-name.td
+++ b/llvm/test/TableGen/intrinsic-long-name.td
@@ -1,7 +1,10 @@
 // RUN: llvm-tblgen -gen-intrinsic-enums %s | FileCheck %s
 // XFAIL: vg_leak
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
+
 class SDNodeProperty;
 
 class ValueType<int size, int value> {
@@ -22,6 +25,7 @@
   list<LLVMType> ParamTypes = param_types;
   list<IntrinsicProperty> IntrProperties = [];
   list<SDNodeProperty> Properties = [];
+  bit DisableDefaultAttributes = 1;
 }
 
 def iAny : ValueType<0, 253>;
diff --git a/llvm/test/TableGen/intrinsic-pointer-to-any.td b/llvm/test/TableGen/intrinsic-pointer-to-any.td
index c58595a..0b0bc15 100644
--- a/llvm/test/TableGen/intrinsic-pointer-to-any.td
+++ b/llvm/test/TableGen/intrinsic-pointer-to-any.td
@@ -6,7 +6,10 @@
 // case, so TableGen would hit an assertion in EncodeFixedType that was checking
 // to ensure that the substitution being processed was correctly replaced.
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
+
 class SDNodeProperty;
 
 class ValueType<int size, int value> {
@@ -32,6 +35,7 @@
   list<IntrinsicProperty> IntrProperties = [];
   list<SDNodeProperty> Properties = [];
   bit isTarget = 0;
+  bit DisableDefaultAttributes = 1;
 }
 
 class LLVMQualPointerType<LLVMType elty>
diff --git a/llvm/test/TableGen/intrinsic-struct.td b/llvm/test/TableGen/intrinsic-struct.td
index 7a3089c..bc044a4 100644
--- a/llvm/test/TableGen/intrinsic-struct.td
+++ b/llvm/test/TableGen/intrinsic-struct.td
@@ -1,7 +1,10 @@
 // RUN: llvm-tblgen -gen-intrinsic-enums %s | FileCheck %s
 // XFAIL: vg_leak
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
+
 class SDNodeProperty;
 
 class ValueType<int size, int value> {
@@ -22,6 +25,7 @@
   list<LLVMType> ParamTypes = [];
   list<IntrinsicProperty> IntrProperties = [];
   list<SDNodeProperty> Properties = [];
+  bit DisableDefaultAttributes = 1;
 }
 
 def iAny : ValueType<0, 253>;
diff --git a/llvm/test/TableGen/intrinsic-varargs.td b/llvm/test/TableGen/intrinsic-varargs.td
index 6a22522..da860ed 100644
--- a/llvm/test/TableGen/intrinsic-varargs.td
+++ b/llvm/test/TableGen/intrinsic-varargs.td
@@ -3,7 +3,9 @@
 
 include "llvm/CodeGen/ValueTypes.td"
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
 class SDNodeProperty;
 
 class LLVMType<ValueType vt> {
@@ -18,6 +20,7 @@
   list<LLVMType> ParamTypes = param_types;
   list<IntrinsicProperty> IntrProperties = [];
   list<SDNodeProperty> Properties = [];
+  bit DisableDefaultAttributes = 1;
 }
 
 def llvm_vararg_ty : LLVMType<isVoid>;   // this means vararg here
diff --git a/llvm/test/TableGen/searchabletables-intrinsic.td b/llvm/test/TableGen/searchabletables-intrinsic.td
index e5cb9db..75722d1 100644
--- a/llvm/test/TableGen/searchabletables-intrinsic.td
+++ b/llvm/test/TableGen/searchabletables-intrinsic.td
@@ -3,7 +3,10 @@
 
 include "llvm/TableGen/SearchableTable.td"
 
-class IntrinsicProperty;
+class IntrinsicProperty<bit is_default = 0> {
+  bit IsDefault = is_default;
+}
+
 class SDNodeProperty;
 
 class ValueType<int size, int value> {
@@ -24,6 +27,7 @@
   list<LLVMType> ParamTypes = param_types;
   list<IntrinsicProperty> IntrProperties = [];
   list<SDNodeProperty> Properties = [];
+  bit DisableDefaultAttributes = 1;
 }
 
 def iAny : ValueType<0, 253>;