llvm/lib
Evan Cheng 2c33915628 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128179 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 22:52:04 +00:00
..
Analysis Revert r128140 for now. 2011-03-23 15:51:12 +00:00
Archive Revert PathV2 changes, as sys::fs::unique_file is not finished yet. 2011-03-01 19:50:55 +00:00
AsmParser Use X86_thiscall calling convention for Win64 as well. 2011-03-03 07:49:07 +00:00
Bitcode Move library stuff out of the toplevel CMakeLists.txt file. 2011-02-18 22:06:14 +00:00
CodeGen PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND. 2011-03-23 22:18:48 +00:00
CompilerDriver Build CompilerDriver library. 2011-03-12 22:01:42 +00:00
ExecutionEngine Split out relocation resolution into target-specific bits. 2011-03-23 22:06:06 +00:00
Linker Correctly merge available_externally and regular definitions when they have 2011-02-01 05:33:52 +00:00
MC Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like BLX, rather than a 2-byte instruction like B. 2011-03-23 21:19:56 +00:00
Object Object: Fix type punned pointer issues by making DataRefImpl a union and using intptr_t. 2011-01-21 02:27:02 +00:00
Support We don't need a null terminator for the output file. 2011-03-22 19:20:47 +00:00
Target Cmp peephole optimization isn't always safe for signed arithmetics. 2011-03-23 22:52:04 +00:00
Transforms Fix PR9464 by correcting some math that just happened to be right in most cases 2011-03-23 05:25:55 +00:00
VMCore Do not accidently initialize NumDbgValueLost and NumDbgLineLost counts. 2011-03-16 00:27:57 +00:00
CMakeLists.txt Build CompilerDriver library. 2011-03-12 22:01:42 +00:00
Makefile Add LLVMObject Library. 2010-11-15 03:21:41 +00:00