SelectionDAG: Make Properties a field of SDPatternOperator

Currently you can't specify node properties like commutativity on
a PatFrag. If you want to create a PatFrag on a commutative node
with a hasOneUse predicate, this enables you to specify that the
PatFrag is also commutable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault 2016-02-10 18:40:04 +00:00
parent 472b217160
commit b9f1dbe18d
7 changed files with 16 additions and 14 deletions

View File

@ -240,7 +240,7 @@ class Intrinsic<list<LLVMType> ret_types,
string TargetPrefix = ""; // Set to a prefix for target-specific intrinsics.
list<LLVMType> RetTypes = ret_types;
list<LLVMType> ParamTypes = param_types;
list<IntrinsicProperty> Properties = properties;
list<IntrinsicProperty> IntrProperties = properties;
bit isTarget = 0;
}
@ -359,7 +359,7 @@ def int_memset : Intrinsic<[],
llvm_i32_ty, llvm_i1_ty],
[IntrReadWriteArgMem, NoCapture<0>]>;
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
def int_fma : Intrinsic<[llvm_anyfloat_ty],
[LLVMMatchType<0>, LLVMMatchType<0>,
LLVMMatchType<0>]>;
@ -421,7 +421,7 @@ def int_expect : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
//
// None of these intrinsics accesses memory at all.
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
def int_bswap: Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>;
def int_ctpop: Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>]>;
def int_ctlz : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>, llvm_i1_ty]>;
@ -435,7 +435,7 @@ let Properties = [IntrNoMem] in {
// None of these intrinsics accesses memory at all...but that doesn't mean the
// optimizers can change them aggressively. Special handling needed in a few
// places.
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
def int_dbg_declare : Intrinsic<[],
[llvm_metadata_ty,
llvm_metadata_ty,
@ -472,7 +472,7 @@ def int_eh_unwind_init: Intrinsic<[]>,
def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty]>;
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
def int_eh_sjlj_callsite : Intrinsic<[], [llvm_i32_ty]>;
}
@ -597,7 +597,7 @@ def int_debugtrap : Intrinsic<[]>,
def int_donothing : Intrinsic<[], [], [IntrNoMem]>;
// Intrisics to support half precision floating point format
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
def int_convert_to_fp16 : Intrinsic<[llvm_i16_ty], [llvm_anyfloat_ty]>;
def int_convert_from_fp16 : Intrinsic<[llvm_anyfloat_ty], [llvm_i16_ty]>;
}

View File

@ -159,7 +159,7 @@ let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
// Arithmetic ops
let Properties = [IntrNoMem] in {
let IntrProperties = [IntrNoMem] in {
// Vector Add Across Lanes
def int_aarch64_neon_saddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
def int_aarch64_neon_uaddv : AdvSIMD_1VectorArg_Int_Across_Intrinsic;
@ -212,7 +212,7 @@ let Properties = [IntrNoMem] in {
// Vector Extending Multiply
def int_aarch64_neon_fmulx : AdvSIMD_2FloatArg_Intrinsic {
let Properties = [IntrNoMem, Commutative];
let IntrProperties = [IntrNoMem, Commutative];
}
// Vector Saturating Doubling Long Multiply

View File

@ -207,7 +207,7 @@ class Neon_Tbl6Arg_Intrinsic
// Arithmetic ops
let Properties = [IntrNoMem, Commutative] in {
let IntrProperties = [IntrNoMem, Commutative] in {
// Vector Add.
def int_arm_neon_vhadds : Neon_2Arg_Intrinsic;

View File

@ -300,7 +300,9 @@ def SDNPWantParent : SDNodeProperty; // ComplexPattern gets the parent
//===----------------------------------------------------------------------===//
// Selection DAG Pattern Operations
class SDPatternOperator;
class SDPatternOperator {
list<SDNodeProperty> Properties = [];
}
//===----------------------------------------------------------------------===//
// Selection DAG Node definitions.
@ -310,7 +312,7 @@ class SDNode<string opcode, SDTypeProfile typeprof,
: SDPatternOperator {
string Opcode = opcode;
string SDClass = sdclass;
list<SDNodeProperty> Properties = props;
let Properties = props;
SDTypeProfile TypeProfile = typeprof;
}

View File

@ -19,7 +19,7 @@ class Intrinsic<string name, list<LLVMType> param_types = []> {
string TargetPrefix = "";
list<LLVMType> RetTypes = [];
list<LLVMType> ParamTypes = param_types;
list<IntrinsicProperty> Properties = [];
list<IntrinsicProperty> IntrProperties = [];
}
def iAny : ValueType<0, 254>;

View File

@ -19,7 +19,7 @@ class Intrinsic<string name, list<LLVMType> param_types = []> {
string TargetPrefix = "";
list<LLVMType> RetTypes = [];
list<LLVMType> ParamTypes = param_types;
list<IntrinsicProperty> Properties = [];
list<IntrinsicProperty> IntrProperties = [];
}
// isVoid needs to match the definition in ValueTypes.td

View File

@ -565,7 +565,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
}
// Parse the intrinsic properties.
ListInit *PropList = R->getValueAsListInit("Properties");
ListInit *PropList = R->getValueAsListInit("IntrProperties");
for (unsigned i = 0, e = PropList->size(); i != e; ++i) {
Record *Property = PropList->getElementAsRecord(i);
assert(Property->isSubClassOf("IntrinsicProperty") &&