This patch fixes a problem encountered by the CellSPU backend where variants
authorScott Michel <scottm@aero.org>
Wed, 5 Mar 2008 17:49:05 +0000 (17:49 +0000)
committerScott Michel <scottm@aero.org>
Wed, 5 Mar 2008 17:49:05 +0000 (17:49 +0000)
commit327d0651f8c3b1480d8fc1f4d96e07a1452eaa8c
treec18217463b152fa5afa93ffe0df2ade7ac684580
parent4d93b2f16d66841f3338ffe2c1318fe6eeeef181
This patch fixes a problem encountered by the CellSPU backend where variants
were being pruned in patterns where a variable was used more than once, e.g.:

  (or (and R32C:$rA, R32C:$rC), (and R32C:$rB, (not R32C:$rC)))

In this example, $rC is used more than once and is actually significant to
instruction selection pattern matching when commuted variants are produced.
This patch scans the pattern's clauses and collects the variables, creating
a set of variables that are used more than once. TreePatternNode::isIsomorphicTo()
also understands that multiply-used variables are significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47950 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/CodeGenDAGPatterns.h