summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-03 17:39:50 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-03 17:39:50 +0000
commitb5a97004fb74a26ab28c06b13153518fb58f0726 (patch)
tree53ee90663aaeb8aeea0ca3ca6675fb2e41ee49c9 /llvm/lib/Target/R600
parent2183b70523b86c0e568ef6efb3c7a2cecdf104bf (diff)
downloadbcm5719-llvm-b5a97004fb74a26ab28c06b13153518fb58f0726.tar.gz
bcm5719-llvm-b5a97004fb74a26ab28c06b13153518fb58f0726.zip
R600/SI: Handle nodes with glue results correctly SITargetLowering::foldOperands()
llvm-svn: 183133
Diffstat (limited to 'llvm/lib/Target/R600')
-rw-r--r--llvm/lib/Target/R600/SIISelLowering.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/SIISelLowering.cpp b/llvm/lib/Target/R600/SIISelLowering.cpp
index 826ed9acd3b..d2cf0dcf20e 100644
--- a/llvm/lib/Target/R600/SIISelLowering.cpp
+++ b/llvm/lib/Target/R600/SIISelLowering.cpp
@@ -700,6 +700,22 @@ SDNode *SITargetLowering::foldOperands(MachineSDNode *Node,
for (unsigned i = NumOps - NumDefs, e = Node->getNumOperands(); i < e; ++i)
Ops.push_back(Node->getOperand(i));
+ // Nodes that have a glue result are not CSE'd by getMachineNode(), so in
+ // this case a brand new node is always be created, even if the operands
+ // are the same as before. So, manually check if anything has been changed.
+ if (Desc->Opcode == Opcode) {
+ bool Changed = false;
+ for (unsigned i = 0, e = Node->getNumOperands(); i < e; ++i) {
+ if (Ops[i].getNode() != Node->getOperand(i).getNode()) {
+ Changed = true;
+ break;
+ }
+ }
+ if (!Changed) {
+ return Node;
+ }
+ }
+
// Create a complete new instruction
return DAG.getMachineNode(Desc->Opcode, SDLoc(Node), Node->getVTList(), Ops);
}
OpenPOWER on IntegriCloud