1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
Go to file
Philip Reames 10eda0ad7d Refine the notion of MayThrow in LICM to include a header specific version
In LICM, we have a check for an instruction which is guaranteed to execute and thus can't introduce any new faults if moved to the preheader. To handle a function which might unconditionally throw when first called, we check for any potentially throwing call in the loop and give up.

This is unfortunate when the potentially throwing condition is down a rare path. It prevents essentially all LICM of potentially faulting instructions where the faulting condition is checked outside the loop. It also greatly diminishes the utility of loop unswitching since control dependent instructions - which are now likely in the loops header block - will not be lifted by subsequent LICM runs.

define void @nothrow_header(i64 %x, i64 %y, i1 %cond) {
; CHECK-LABEL: nothrow_header
; CHECK-LABEL: entry
; CHECK: %div = udiv i64 %x, %y
; CHECK-LABEL: loop
; CHECK: call void @use(i64 %div)
entry:
  br label %loop
loop: ; preds = %entry, %for.inc
  %div = udiv i64 %x, %y
  br i1 %cond, label %loop-if, label %exit
loop-if:
  call void @use(i64 %div)
  br label %loop
exit:
  ret void
}

The current patch really only helps with non-memory instructions (i.e. divs, etc..) since the maythrow call down the rare path will be considered to alias an otherwise hoistable load.  The one exception is that it does kick in for loads which are known to be invariant without regard to other possible stores, i.e. those marked with either !invarant.load metadata of tbaa 'is constant memory' metadata.

Differential Revision: http://reviews.llvm.org/D6725

llvm-svn: 224965
2014-12-29 23:00:57 +00:00
autoconf [multilib] Add support to the autoconf build to substitute 2014-12-29 11:58:17 +00:00
bindings [OCaml] Expose Llvm_executionengine.get_{global_value,function}_address. 2014-12-24 01:52:51 +00:00
cmake [go] Teach the go cmake build functions to funnel the include directories down into the cgo-setup variables of llvm-go. 2014-12-29 22:50:30 +00:00
docs Fixed 2 minor typos in the documentation. 2014-12-29 09:47:51 +00:00
examples Once more on the cmake build. nativecodegen->native on the dependencies. 2014-12-08 18:24:06 +00:00
include Add segmented stack support for DragonFlyBSD. 2014-12-29 15:47:28 +00:00
lib Refine the notion of MayThrow in LICM to include a header specific version 2014-12-29 23:00:57 +00:00
projects [cmake] Use the external project machinery for libcxxabi so that it can 2014-07-25 10:27:40 +00:00
test Refine the notion of MayThrow in LICM to include a header specific version 2014-12-29 23:00:57 +00:00
tools [cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX. 2014-12-29 11:16:25 +00:00
unittests [cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it to 2014-12-29 11:16:19 +00:00
utils Masked Load/Store - Changed the order of parameters in intrinsics. 2014-12-25 07:49:20 +00:00
.arcconfig Updated phabricator server. 2014-04-07 03:57:04 +00:00
.clang-format Test commit. 2014-03-02 13:08:46 +00:00
.clang-tidy Enable display of compiler diagnostics in clang-tidy by default. 2014-10-29 17:29:38 +00:00
.gitignore Initial version of Go bindings. 2014-10-16 22:48:02 +00:00
CMakeLists.txt [py3] Teach the CMake build to reject Python versions older than 2.7. 2014-12-29 19:36:05 +00:00
CODE_OWNERS.TXT Add myself as SystemZ code owner 2014-12-18 19:27:50 +00:00
configure [multilib] Add support to the autoconf build to substitute 2014-12-29 11:58:17 +00:00
CREDITS.TXT Rise from the dead and update personal info 2014-08-25 17:51:04 +00:00
LICENSE.TXT Remove projects/sample. 2014-03-12 22:40:22 +00:00
llvm.spec.in
LLVMBuild.txt
Makefile [configure/make] Propagate names of build host tools when making BuildTools 2014-03-25 21:45:41 +00:00
Makefile.common
Makefile.config.in Add a check for misbehaving -Wcomment from gcc-4.7 and add 2014-11-05 00:35:15 +00:00
Makefile.rules Add a check for misbehaving -Wcomment from gcc-4.7 and add 2014-11-05 00:35:15 +00:00
README.txt [TEST-COMMIT] As per Developer Policy, Added a blank line. 2014-12-06 00:38:39 +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.