diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-02-25 08:24:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-02-25 08:24:27 +0000 |
| commit | 387f464121a384ed61c3d165aaaf6384eb7f720a (patch) | |
| tree | 9313a02251ba3bc410f7b9975f246308798fd2fe /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
| parent | 26ef86b6fee3abc6b4dd2ce8b48db6dfae8a5c06 (diff) | |
| download | bcm5719-llvm-387f464121a384ed61c3d165aaaf6384eb7f720a.tar.gz bcm5719-llvm-387f464121a384ed61c3d165aaaf6384eb7f720a.zip | |
fold trivial token factor nodes. This allows us to compile
test/CodeGen/X86/fp-stack-ret.ll into:
movl 4(%esp), %eax
fldl (%eax)
ret
instead of:
subl $12, %esp
movl 16(%esp), %eax
movsd (%eax), %xmm0
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret
by eliminating a token factor that blocked a check.
llvm-svn: 34584
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 23a66f55629..2679a8ccd8a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1351,6 +1351,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, // Fold operations. switch (Opcode) { + case ISD::TokenFactor: + // Fold trivial token factors. + if (N1.getOpcode() == ISD::EntryToken) return N2; + if (N2.getOpcode() == ISD::EntryToken) return N1; + break; + case ISD::AND: // (X & 0) -> 0. This commonly occurs when legalizing i64 values, so it's // worth handling here. |

