LLVM backend for 6502
Go to file
Pete Cooper 71a4b301fd Loop idiom recognizer was replacing too many uses of popcount.
When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop.

The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed

 %tobool.5 = icmp ne i32 %num, 0
 store i1 %tobool.5, i1* %ptr
 br i1 %tobool.5, label %for.body.lr.ph, label %for.end

to

 store i1 %1, i1* %ptr
 %0 = call i32 @llvm.ctpop.i32(i32 %num)
 %1 = icmp ne i32 %0, 0
 br i1 %1, label %for.body.lr.ph, label %for.end

Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect.  The store doesn’t want the result of ctpop.

The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses.

Reviewed by Hal Finkel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242068 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 21:25:33 +00:00
autoconf [Support] Lazy load of dbghlp.dll on Windows 2015-07-02 14:34:57 +00:00
bindings Remove getRelocationAddress. 2015-07-06 14:55:37 +00:00
cmake Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working." 2015-07-13 20:30:58 +00:00
docs [mips] Explained the 'w' modifier in the Inline Assembler documentation. 2015-07-13 09:24:21 +00:00
examples Simplify the Mangler interface now that DataLayout is mandatory. 2015-06-23 13:59:29 +00:00
include Add support deterministic output in llvm-ar and make it the default. 2015-07-13 20:38:09 +00:00
lib Loop idiom recognizer was replacing too many uses of popcount. 2015-07-13 21:25:33 +00:00
projects
resources
test Loop idiom recognizer was replacing too many uses of popcount. 2015-07-13 21:25:33 +00:00
tools Add support deterministic output in llvm-ar and make it the default. 2015-07-13 20:38:09 +00:00
unittests Revert "[ExecutionEngine] Use std::function rather than a function pointer for the LazyFunctionCreator." 2015-07-11 13:42:48 +00:00
utils AVX-512: Added all AVX-512 forms of Vector Convert for Float/Double/Int/Long types. 2015-07-13 13:26:20 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore Minor updates to gitignore so that symlinks are ignored in the projects dir. 2015-07-07 20:24:58 +00:00
CMakeLists.txt Do not pass -allow-shlib-undefined to the Solaris linker. 2015-06-22 18:24:01 +00:00
CODE_OWNERS.TXT [WebAssembly] Initial WebAssembly backend 2015-06-29 23:51:55 +00:00
configure Disallow in-source builds (as we already do for the cmake build). 2015-07-01 18:09:21 +00:00
CREDITS.TXT [WebAssembly] Initial WebAssembly backend 2015-06-29 23:51:55 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in Disallow in-source builds (as we already do for the cmake build). 2015-07-01 18:09:21 +00:00
Makefile.rules
README.txt

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

This directory and its subdirectories contain source code for LLVM,
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 documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

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