LLVM backend for 6502
Go to file
Andrew Trick fcf79528da Rotate multi-exit loops even if the latch was simplified.
Test case by Michele Scandale!

Fixes PR10293: Load not hoisted out of loop with multiple exits.

There are few regressions with this patch, now tracked by
rdar:13817079, and a roughly equal number of improvements. The
regressions are almost certainly back luck because LoopRotate has very
little idea of whether rotation is profitable. Doing better requires a
more comprehensive solution.

This checkin is a quick fix that lacks generality (PR10293 has
a counter-example). But it trivially fixes the case in PR10293 without
interfering with other cases, and it does satify the criteria that
LoopRotate is a loop canonicalization pass that should avoid
heuristics and special cases.

I can think of two approaches that would probably be better in
the long run. Ultimately they may both make sense.

(1) LoopRotate should check that the current header would make a good
loop guard, and that the loop does not already has a sufficient
guard. The artifical SimplifiedLoopLatch check would be unnecessary,
and the design would be more general and canonical. Two difficulties:

- We need a strong guarantee that we won't endlessly rotate, so the
  analysis would need to be precise in order to avoid the
  SimplifiedLoopLatch precondition.

- Analysis like this are usually based on SCEV, which we don't want to
  rely on.

(2) Rotate on-demand in late loop passes. This could even be done by
shoving the loop back on the queue after the optimization that needs
it. This could work well when we find LICM opportunities in
multi-branch loops. This requires some work, and it doesn't really
solve the problem of SCEV wanting a loop guard before the analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181230 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06 17:58:18 +00:00
autoconf [SystemZ] Add to --enable-targets=all 2013-05-06 16:23:07 +00:00
bindings Exposing MCJIT through C API 2013-04-29 17:49:40 +00:00
cmake [SystemZ] Add configure bits 2013-05-06 16:22:34 +00:00
docs [SystemZ] Add configure bits 2013-05-06 16:22:34 +00:00
examples Port ExceptionDemo to MCJIT. 2013-05-05 20:57:58 +00:00
include Provide InstCombines for the following 3 cases: 2013-05-06 16:55:50 +00:00
lib Rotate multi-exit loops even if the latch was simplified. 2013-05-06 17:58:18 +00:00
projects [SystemZ] Add to --enable-targets=all 2013-05-06 16:23:07 +00:00
runtime Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and 2013-03-07 02:03:08 +00:00
test Rotate multi-exit loops even if the latch was simplified. 2013-05-06 17:58:18 +00:00
tools Optimize llvm-link too. 2013-05-04 05:30:49 +00:00
unittests [SystemZ] Set up JIT/MCJIT test cases 2013-05-06 16:21:50 +00:00
utils Try to fix ProgramTest on FreeBSD 2013-04-30 04:30:41 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt [SystemZ] Add to --enable-targets=all 2013-05-06 16:23:07 +00:00
CODE_OWNERS.TXT Fix random typo. 2013-04-17 03:18:49 +00:00
configure [SystemZ] Add to --enable-targets=all 2013-05-06 16:23:07 +00:00
CREDITS.TXT Add myself in the CREDITS.TXT 2013-04-11 13:15:39 +00:00
LICENSE.TXT Add LICENSE.TXT covering contributions made by ARM. 2013-01-07 10:04:49 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Improved svn repo searching for 'make update' 2013-01-28 03:19:57 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools. 2013-04-23 08:28:39 +00:00
Makefile.rules Remove this hack. We can support this better with function attributes. 2013-05-03 21:53:50 +00:00
README.txt test 2013-04-17 05:34:03 +00:00

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 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.