diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-09 23:53:43 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-09 23:53:43 +0000 |
commit | 32ab3a817d4d8ae20e868e8966ceef1511a88d03 (patch) | |
tree | 9ca9b77b41506c562b0e2c4d4cbcbc790f1f4960 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp | |
parent | ab3f96cb21ed0bb5697bb5f92f3630d89e1e97de (diff) | |
download | llvm-32ab3a817d4d8ae20e868e8966ceef1511a88d03.zip llvm-32ab3a817d4d8ae20e868e8966ceef1511a88d03.tar.gz llvm-32ab3a817d4d8ae20e868e8966ceef1511a88d03.tar.bz2 |
Re-apply r286384, "X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable immediate.", with a fix for 32-bit x86.
Teach X86InstrInfo::analyzeCompare() not to crash on CMP and SUB instructions
that take a global address operand.
llvm-svn: 286420
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index c8ced6b..3cc7b1b 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -805,14 +805,9 @@ static unsigned getPatternSize(const TreePatternNode *P, if (P->isLeaf() && isa<IntInit>(P->getLeafValue())) Size += 2; - // FIXME: This is a hack to statically increase the priority of patterns - // which maps a sub-dag to a complex pattern. e.g. favors LEA over ADD. - // Later we can allow complexity / cost for each pattern to be (optionally) - // specified. To get best possible pattern match we'll need to dynamically - // calculate the complexity of all patterns a dag can potentially map to. const ComplexPattern *AM = P->getComplexPatternInfo(CGP); if (AM) { - Size += AM->getNumOperands() * 3; + Size += AM->getComplexity(); // We don't want to count any children twice, so return early. return Size; |