1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/lib
Wei Mi c58f7f97a3 [LSR] Allow formula containing Reg for SCEVAddRecExpr related with outerloop.
In RateRegister of existing LSR, if a formula contains a Reg which is a SCEVAddRecExpr,
and this SCEVAddRecExpr's loop is an outerloop, the formula will be marked as Loser
and dropped.

Suppose we have an IR that %for.body is outerloop and %for.body2 is innerloop. LSR only
handle inner loop now so only %for.body2 will be handled.

Using the logic above, formula like
reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) will be dropped
no matter what because reg({1,+, %size}<%for.body>) is a SCEVAddRecExpr type reg related
with outerloop. Only formula like
reg(%array) + 1*reg({{1,+, %size}<%for.body>,+,1}<nuw><nsw><%for.body2>) will be kept
because the SCEVAddRecExpr related with outerloop is folded into the initial value of the
SCEVAddRecExpr related with current loop.

But in some cases, we do need to share the basic induction variable
reg{0 ,+, 1}<%for.body2> among LSR Uses to reduce the final total number of induction
variables used by LSR, so we don't want to drop the formula like
reg(%array) + reg({1,+, %size}<%for.body>) + 1*reg({0,+,1}<%for.body2>) unconditionally.

From the existing comment, it tries to avoid considering multiple level loops at the same time.
However, existing LSR only handles innermost loop, so for any SCEVAddRecExpr with a loop other
than current loop, it is an invariant and will be simple to handle, and the formula doesn't have
to be dropped.

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

llvm-svn: 286999
2016-11-15 18:35:53 +00:00
..
Analysis [tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), LLVM part 2016-11-14 21:41:13 +00:00
AsmParser IR: Introduce inrange attribute on getelementptr indices. 2016-11-10 22:34:55 +00:00
Bitcode Restore "[ThinLTO] Prevent exporting of locals used/defined in module level asm" 2016-11-14 17:12:32 +00:00
CodeGen Integer legalization: fix MUL expansion 2016-11-15 18:29:24 +00:00
DebugInfo Improve DWARF parsing speed by improving DWARFAbbreviationDeclaration 2016-11-15 01:23:06 +00:00
Demangle Demangle: only demangle mangled symbols 2016-11-14 04:54:47 +00:00
ExecutionEngine [ORC] Re-apply 286620 with fixes for the ErrorSuccess class. 2016-11-11 21:42:09 +00:00
Fuzzer [libFuzzer] replace 'auto' with 'auto *' to better follow the LLVM style 2016-11-14 19:21:38 +00:00
IR [X86] Add LLVM version number for each intrinsic handled by auto upgrade for age tracking. 2016-11-15 05:04:51 +00:00
IRReader Bitcode: Change module reader functions to return an llvm::Expected. 2016-11-13 07:00:17 +00:00
LibDriver
LineEditor
Linker Linker: Remove unnecessary call to copyMetadata in IRLinker::linkGlobalVariable. 2016-11-14 23:18:38 +00:00
LTO [ThinLTO] Only promote exported locals as marked in index 2016-11-14 19:21:41 +00:00
MC Fix 24560: assembler does not share constant pool for same constants 2016-11-04 19:17:32 +00:00
Object Fix -Wswitch. 2016-11-15 00:58:50 +00:00
ObjectYAML Fix Clang-tidy readability-redundant-string-cstr warnings 2016-11-02 16:43:50 +00:00
Option
Passes Conditionally eliminate library calls where the result value is not used 2016-10-18 21:36:27 +00:00
ProfileData Make the Error class constructor protected 2016-11-11 04:28:40 +00:00
Support Simplify identify_magic. 2016-11-15 01:57:05 +00:00
TableGen TableGen: Add operator !or 2016-11-15 06:49:28 +00:00
Target vector load store with length (left justified) llvm portion 2016-11-15 17:54:19 +00:00
Transforms [LSR] Allow formula containing Reg for SCEVAddRecExpr related with outerloop. 2016-11-15 18:35:53 +00:00
CMakeLists.txt
LLVMBuild.txt