diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-02-02 06:36:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-02-02 06:36:13 +0000 |
| commit | 49ce35542f9c2944f0eae43dbaa500863c16bd58 (patch) | |
| tree | 78653ed36147e9f81db4e7638b30bd91ca9b437d /llvm/lib/CodeGen/MachineDebugInfo.cpp | |
| parent | 166ea0eda7da57316a540ffcae13caba6e1923b5 (diff) | |
| download | bcm5719-llvm-49ce35542f9c2944f0eae43dbaa500863c16bd58.tar.gz bcm5719-llvm-49ce35542f9c2944f0eae43dbaa500863c16bd58.zip | |
add two dag combines:
(C1-X) == C2 --> X == C1-C2
(X+C1) == C2 --> X == C2-C1
This allows us to compile this:
bool %X(int %X) {
%Y = add int %X, 14
%Z = setne int %Y, 12345
ret bool %Z
}
into this:
_X:
cmpl $12331, 4(%esp)
setne %al
movzbl %al, %eax
andl $1, %eax
ret
not this:
_X:
movl $14, %eax
addl 4(%esp), %eax
cmpl $12345, %eax
setne %al
movzbl %al, %eax
andl $1, %eax
ret
Testcase here: Regression/CodeGen/X86/compare-add.ll
nukage of the and coming up next.
llvm-svn: 25898
Diffstat (limited to 'llvm/lib/CodeGen/MachineDebugInfo.cpp')
0 files changed, 0 insertions, 0 deletions

