mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
LLVM backend for 6502
ffddf6ba1c
branch folding can now compile stuff like this: void foo(int W, int X, int Y, int Z) { if (W & 1) { for (; X;--X) bar(); } else if (W & 2) { for (; Y;--Y) bar(); } else if (W & 4) { for (; Z;--Z) bar(); } else if (W & 8) { for (; W;--W) bar(); } if (W) { bar(); } } contrived testcase where loops exits all end up merging together. To have the loop merges be: ... cmplw cr0, r30, r27 bne cr0, LBB1_14 ;bb38 LBB1_16: ;cond_next48.loopexit mr r27, r29 LBB1_20: ;cond_next48 cmplwi cr0, r27, 0 beq cr0, LBB1_22 ;UnifiedReturnBlock ... instead of: ... cmplw cr0, r30, r27 bne cr0, LBB1_14 ;bb38 LBB1_16: ;cond_next48.loopexit mr r27, r29 b LBB1_20 ;cond_next48 LBB1_17: ;cond_next48.loopexit1 b LBB1_20 ;cond_next48 LBB1_18: ;cond_next48.loopexit2 b LBB1_20 ;cond_next48 LBB1_19: ;cond_next48.loopexit3 LBB1_20: ;cond_next48 cmplwi cr0, r27, 0 beq cr0, LBB1_22 ;UnifiedReturnBlock ... This is CodeGen/PowerPC/branch-opt.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31006 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
autoconf | ||
docs | ||
examples | ||
include/llvm | ||
lib | ||
projects | ||
runtime | ||
test | ||
tools | ||
utils | ||
win32 | ||
Xcode | ||
.cvsignore | ||
configure | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
llvm.spec.in | ||
Makefile | ||
Makefile.common | ||
Makefile.config.in | ||
Makefile.rules | ||
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.