summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-28 20:58:39 +0000
committerChris Lattner <sabre@nondot.org>2005-09-28 20:58:39 +0000
commit7fe6734dff95512aab78b2069fd11f139dc2741d (patch)
tree33ba1a228b42b66ec040e2cdb45249e31e6ffb50 /llvm/lib
parent492e70f4ec97f5069997674a9a84050adbd98c8c (diff)
downloadbcm5719-llvm-7fe6734dff95512aab78b2069fd11f139dc2741d.tar.gz
bcm5719-llvm-7fe6734dff95512aab78b2069fd11f139dc2741d.zip
Mark associative nodes as associative
llvm-svn: 23503
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PowerPCInstrInfo.td18
1 files changed, 12 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PowerPCInstrInfo.td b/llvm/lib/Target/PowerPC/PowerPCInstrInfo.td
index 94f504a23ab..9467f17cd5d 100644
--- a/llvm/lib/Target/PowerPC/PowerPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PowerPCInstrInfo.td
@@ -87,7 +87,8 @@ def SDTExtInreg : SDTypeProfile<1, 2, [ // sext_inreg
// Note: These are hard coded into tblgen.
//
class SDNodeProperty;
-def SDNPCommutative : SDNodeProperty;
+def SDNPCommutative : SDNodeProperty; // X op Y == Y op X
+def SDNPAssociative : SDNodeProperty; // (X op Y) op Z == X op (Y op Z)
//===----------------------------------------------------------------------===//
// Selection DAG Node definitions.
@@ -105,12 +106,17 @@ def node;
def imm : SDNode<"ISD::Constant" , SDTImm , [], "ConstantSDNode">;
def vt : SDNode<"ISD::VALUETYPE" , SDTVT , [], "VTSDNode">;
-def and : SDNode<"ISD::AND" , SDTIntBinOp, [SDNPCommutative]>;
-def or : SDNode<"ISD::OR" , SDTIntBinOp, [SDNPCommutative]>;
-def xor : SDNode<"ISD::XOR" , SDTIntBinOp, [SDNPCommutative]>;
-def add : SDNode<"ISD::ADD" , SDTBinOp , [SDNPCommutative]>;
+def and : SDNode<"ISD::AND" , SDTIntBinOp,
+ [SDNPCommutative, SDNPAssociative]>;
+def or : SDNode<"ISD::OR" , SDTIntBinOp,
+ [SDNPCommutative, SDNPAssociative]>;
+def xor : SDNode<"ISD::XOR" , SDTIntBinOp,
+ [SDNPCommutative, SDNPAssociative]>;
+def add : SDNode<"ISD::ADD" , SDTBinOp ,
+ [SDNPCommutative, SDNPAssociative]>;
def sub : SDNode<"ISD::SUB" , SDTBinOp>;
-def mul : SDNode<"ISD::MUL" , SDTBinOp , [SDNPCommutative]>;
+def mul : SDNode<"ISD::MUL" , SDTBinOp ,
+ [SDNPCommutative, SDNPAssociative]>;
def sdiv : SDNode<"ISD::SDIV" , SDTBinOp>;
def udiv : SDNode<"ISD::UDIV" , SDTIntBinOp>;
def mulhs : SDNode<"ISD::MULHS" , SDTIntBinOp, [SDNPCommutative]>;
OpenPOWER on IntegriCloud