LLVM backend for 6502
Go to file
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
autoconf
bindings
cmake Supports building with a list of targets that does not contain 2011-03-23 17:42:13 +00:00
docs Update Passes.html, part 3: alphabetize descriptions. 2011-03-19 05:02:14 +00:00
examples
include Add a lto_codegen_compile_to_file to avoid producing a file, reading it to 2011-03-22 20:57:13 +00:00
lib Cmp peephole optimization isn't always safe for signed arithmetics. 2011-03-23 22:52:04 +00:00
projects
runtime
test Cmp peephole optimization isn't always safe for signed arithmetics. 2011-03-23 22:52:04 +00:00
tools Add a lto_codegen_compile_to_file to avoid producing a file, reading it to 2011-03-22 20:57:13 +00:00
unittests
utils Update the Clang attribute emitter to handle attributes of 'version' 2011-03-23 01:05:46 +00:00
website
.gitignore
build-for-llvm-top.sh
CMakeLists.txt Supports building with a list of targets that does not contain 2011-03-23 17:42:13 +00:00
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
Makefile
Makefile.common
Makefile.config.in
Makefile.rules
ModuleInfo.txt
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.