Benjamin Kramer
98c95e7743
Revert r108141 again, sigh.
...
llvm-svn: 108148
2010-07-12 14:42:04 +00:00
Benjamin Kramer
c4f46375d3
Reapply 108136 with an ugly pasto fixed.
...
llvm-svn: 108141
2010-07-12 13:44:00 +00:00
Benjamin Kramer
d9bf737e62
Revert r108136 until I figure out why it broke selfhost.
...
llvm-svn: 108139
2010-07-12 12:35:49 +00:00
Benjamin Kramer
f00a49ceff
instcombine: fold (x & y) | (~x & z) and (x & y) ^ (~x & z) into ((y ^ z) & x) ^ z which is one instruction shorter. (PR6773)
...
before:
%and = and i32 %y, %x
%neg = xor i32 %x, -1
%and4 = and i32 %z, %neg
%xor = xor i32 %and4, %and
after:
%xor1 = xor i32 %z, %y
%and2 = and i32 %xor1, %x
%xor = xor i32 %and2, %z
llvm-svn: 108136
2010-07-12 11:54:45 +00:00
Bill Wendling
d1f658563d
This test case:
...
long test(long x) { return (x & 123124) | 3; }
Currently compiles to:
_test:
orl $3, %edi
movq %rdi, %rax
andq $123127, %rax
ret
This is because instruction and DAG combiners canonicalize
(or (and x, C), D) -> (and (or, D), (C | D))
However, this is only profitable if (C & D) != 0. It gets in the way of the
3-addressification because the input bits are known to be zero.
llvm-svn: 97616
2010-03-03 00:35:56 +00:00
Chris Lattner
e0124f19f9
optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
...
Evans!
llvm-svn: 93884
2010-01-19 18:16:19 +00:00
Chris Lattner
b033a0ac47
teach instcombine to simplify xor's harder, catching the
...
new testcase.
llvm-svn: 83799
2009-10-11 22:22:13 +00:00
Chris Lattner
c8e0cdb676
convert xor2 to filecheck, merge in a random regtest
...
llvm-svn: 83796
2009-10-11 21:42:08 +00:00
Dan Gohman
205b641954
Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
...
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.
llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Dan Gohman
c95df8b6d8
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
8d84372836
Change these tests to feed the assembly files to opt directly, instead
...
of using llvm-as, now that opt supports this.
llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Reid Spencer
c49d7dd886
For PR1319:
...
Upgrade tests to work with new llvm.exp version of llvm_runtest.
llvm-svn: 36013
2007-04-14 20:13:02 +00:00
Chris Lattner
2083adbfb8
new testcase for PR1253
...
llvm-svn: 35611
2007-04-03 01:45:32 +00:00