llvm-6502/test
Philip Reames 1714ad67bd 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224965 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-29 23:00:57 +00:00
..
Analysis IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Assembler DebugInfo: Update testcase to actually check something 2014-12-16 07:08:19 +00:00
Bindings [OCaml] PR21901: Update tests. 2014-12-24 01:58:45 +00:00
Bitcode IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
BugPoint IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
CodeGen [Hexagon] Adding post-increment register form stores and register-immediate form stores with tests. 2014-12-29 20:44:51 +00:00
DebugInfo Band-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled on Windows 2014-12-26 17:00:51 +00:00
ExecutionEngine
Feature IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
FileCheck
Instrumentation [asan] change the coverage collection scheme so that we can easily emit coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset 2014-12-23 22:32:17 +00:00
Integer
JitListener IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Linker Reapply "Linker: Drop superseded subprograms" 2014-12-18 01:05:33 +00:00
LTO llvm-lto: Add testing coverage for local contexts 2014-12-17 02:00:38 +00:00
MC Convert test to llvm-readobj. NFC. 2014-12-29 22:14:35 +00:00
Object [Object] Don't crash on empty export lists. 2014-12-19 02:31:01 +00:00
Other
SymbolRewriter
TableGen
tools Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers. 2014-12-23 22:56:39 +00:00
Transforms Refine the notion of MayThrow in LICM to include a header specific version 2014-12-29 23:00:57 +00:00
Unit
Verifier IR: Stop printing 'metadata' in Metadata::print() 2014-12-16 07:40:31 +00:00
YAMLParser
.clang-format
CMakeLists.txt Revert r224149, llvm-dsymutil was already here. 2014-12-12 21:25:07 +00:00
lit.cfg Teach lit.cfg to recognize -windows-gnu in addition to -mingw32. 2014-12-17 09:55:15 +00:00
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh