Chris Lattner
b3ddfc42af
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25898 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-02 06:36:13 +00:00
..
2006-02-02 06:36:13 +00:00
2006-02-01 22:41:11 +00:00
2005-04-21 22:36:52 +00:00
2006-01-27 20:31:25 +00:00
2005-12-28 06:29:02 +00:00
2006-01-16 21:12:35 +00:00
2005-10-21 06:41:30 +00:00
2006-01-22 23:41:00 +00:00
2006-01-04 05:40:30 +00:00
2005-04-21 22:36:52 +00:00
2005-12-28 02:44:35 +00:00
2006-01-27 17:31:30 +00:00
2006-01-31 22:23:14 +00:00
2005-04-21 22:36:52 +00:00
2004-10-27 23:18:45 +00:00
2005-10-24 04:14:30 +00:00
2006-01-04 07:12:21 +00:00
2004-02-23 06:10:13 +00:00
2005-11-06 17:43:20 +00:00
2006-01-22 23:41:00 +00:00
2006-01-22 23:41:00 +00:00
2006-01-22 23:41:00 +00:00
2006-01-22 23:41:00 +00:00
2005-04-21 22:36:52 +00:00
2006-01-22 23:41:00 +00:00
2005-04-21 22:36:52 +00:00