Go to file
Chandler Carruth d1dab0c3c0 [PM/LoopUnswitch] Add partial non-trivial unswitching for invariant
conditions feeding a chain of `and`s or `or`s for a branch.

Much like with full non-trivial unswitching, we rely on the pass manager
to handle iterating until all of the profitable unswitches have been
done. This is to allow other more profitable unswitches to fire on any
of the cloned, simpler versions of the loop if viable.

Threading the partial unswiching through the non-trivial unswitching
logic motivated some minor refactorings. If those are too disruptive to
make it reasonable to review this patch, I can separate them out, but
it'll be somewhat timeconsuming so I wanted to send it for initial
review as-is. Feel free to tell me whether it warrants pulling apart.

I've tried to re-use (and factor out) logic form the partial trivial
unswitching, but not as much could be shared as I had haped. Still, this
wasn't as bad as I naively expected.

Some basic testing is added, but I probably need more. Suggestions for
things you'd like to see tested more than welcome. One thing I'd like to
do is add some testing that when we schedule this with loop-instsimplify
it effectively cleans up the cruft created.

Last but not least, this uncovered a bug that has been in loop cloning
the entire time for non-trivial unswitching. Specifically, we didn't
correctly add the outer-most cloned loop to the list of cloned loops.
This meant that LCSSA wouldn't be updated for it hypothetically, and
more significantly that we would never visit it in the loop pass
manager. I noticed this while checking loop-instsimplify by hand. I'll
try to separate this bugfix out into its own patch with a more focused
test. But it is just one line, so shouldn't significantly confuse the
review here.

After this patch, the only missing "feature" in this unswitch I'm aware
of us non-trivial unswitching of switches. I'll try implementing *full*
non-trivial unswitching of switches (which is at least a sound thing to
implement), but *partial* non-trivial unswitching of switches is
something I don't see any sound and principled way to implement. I also
have no interesting test cases for the latter, so I'm not really
worried. The rest of the things that need to be ported are bug-fixes and
more narrow / targeted support for specific issues.

Differential Revision: https://reviews.llvm.org/D47522

llvm-svn: 335203
2018-06-21 06:14:03 +00:00
clang [X86] Remove masking from the 512-bit floating point max/min builtins. Use select in IR instead. 2018-06-21 05:01:01 +00:00
clang-tools-extra [clangd] Use workspace root path as hint path for resolving URIs in workspace/symbol 2018-06-19 09:33:53 +00:00
compiler-rt [TSan] fix build and couple of unit tests on FreeBSD 2018-06-20 20:17:44 +00:00
debuginfo-tests [debuginfo-tests] Always use the system python to invoke llgdb.py. 2018-06-10 19:38:26 +00:00
libclc Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
libcxx [CMake] Convert paths to the right form in standalone builds on Windows 2018-06-20 21:03:34 +00:00
libcxxabi [CMake] Convert paths to the right form in standalone builds on Windows 2018-06-20 20:59:18 +00:00
libunwind [CMake] Convert paths to the right form in standalone builds on Windows 2018-06-20 20:53:19 +00:00
lld [WebAssembly] Error on mismatched function signature in final output 2018-06-21 00:12:25 +00:00
lldb Improve SBThread's stepping API using SBError parameter. 2018-06-20 21:43:16 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [PM/LoopUnswitch] Add partial non-trivial unswitching for invariant 2018-06-21 06:14:03 +00:00
openmp minor: fixed typo in debug print 2018-06-20 15:54:11 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly Move ScopInfo to isl++ 2018-06-19 08:13:53 +00:00
README.md

README.md

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.