Evan Cheng 425489d397 Cmp peephole optimization isn't always safe for signed arithmetics.
int tries = INT_MAX;    
while (tries > 0) {
      tries--;
}

The check should be:
        subs    r4, #1
        cmp     r4, #0
        bgt     LBB0_1

The subs can set the overflow V bit when r4 is INT_MAX+1 (which loop
canonicalization apparently does in this case). cmp #0 would have cleared
it while not changing the N and Z bits. Since BGT is dependent on the V
bit, i.e. (N == V) && !Z, it is not safe to eliminate the cmp #0.

rdar://9172742

llvm-svn: 128179
2011-03-23 22:52:04 +00:00
..
2010-11-03 18:21:33 +00:00
2010-08-04 21:56:30 +00:00
2010-09-17 21:46:16 +00:00
2010-10-22 21:55:03 +00:00
2011-03-11 21:52:04 +00:00
2010-01-19 00:35:20 +00:00
2011-03-14 21:05:21 +00:00
2010-09-02 20:19:24 +00:00
2010-03-14 18:42:52 +00:00
2010-04-17 16:29:15 +00:00
2010-04-17 16:29:15 +00:00
2010-02-08 23:47:34 +00:00
2010-06-04 01:01:24 +00:00
2010-06-04 23:28:13 +00:00
2009-10-21 08:15:52 +00:00
2010-10-22 22:04:28 +00:00
2010-01-05 17:55:26 +00:00
2011-03-15 01:49:08 +00:00
2011-01-01 20:57:26 +00:00
2010-08-30 23:41:49 +00:00
2009-09-24 20:23:02 +00:00
2010-11-29 22:39:38 +00:00
2011-03-15 20:47:26 +00:00
2009-09-15 20:58:02 +00:00
2009-09-15 20:58:02 +00:00
2009-10-07 20:51:42 +00:00