1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

Fix a case where the DAG Combiner would accidentally CSE flag-producing nodes,

creating graphs that cannot be scheduled.

llvm-svn: 24866
This commit is contained in:
Chris Lattner 2005-12-19 22:21:21 +00:00
parent 53c898b638
commit 91987b5c3c

View File

@ -389,9 +389,14 @@ SDNode *SelectionDAG::AddNonLeafNodeToCSEMaps(SDNode *N) {
assert(N->getNumOperands() && "This is a leaf node!");
if (N->getOpcode() == ISD::CALLSEQ_START ||
N->getOpcode() == ISD::CALLSEQ_END ||
N->getOpcode() == ISD::HANDLENODE)
N->getOpcode() == ISD::HANDLENODE || N->getValueType(0) == MVT::Flag)
return 0; // Never add these nodes.
// Check that remaining values produced are not flags.
for (unsigned i = 1, e = N->getNumValues(); i != e; ++i)
if (N->getValueType(i) == MVT::Flag)
return 0; // Never CSE anything that produces a flag.
if (N->getNumValues() == 1) {
if (N->getNumOperands() == 1) {
SDNode *&U = UnaryOps[std::make_pair(N->getOpcode(),