llvm-project/llvm/lib
Ehsan Amiri dbcfea9811 Extend trip count instead of truncating IV in LFTR, when legal
When legal, extending trip count in the loop control logic generates better code compared to truncating IV. This is because

(1) extending trip count is a loop invariant operation (see genLoopLimit where we prove trip count is loop invariant).
(2) Scalar Evolution seems to have problems understanding trunc when computing loop trip count. So removing them allows better analysis performed in Scalar Evolution. (In particular this fixes PR 28363 which is the motivation for this change).

I am not going to perform any performance test. Any degradation caused by this should be an indication of a bug elsewhere.

To prove legality, we rely on SCEV to prove zext(trunc(IV)) == IV (or similarly for sext). If this holds, we can prove equivalence of trunc(IV)==ExitCnt (1) and IV == zext(ExitCnt). Simply take zext of boths sides of (1) and apply the proven equivalence.

This commit contains changes in a newly added testcase which was not included in the previous commit (which was reverted later on).

https://reviews.llvm.org/D23075

llvm-svn: 278421
2016-08-11 21:31:40 +00:00
..
Analysis Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
AsmParser Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
Bitcode [ThinLTO] Address review comments from PGO indirect call promotion (NFC) 2016-07-18 18:31:50 +00:00
CodeGen Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
DebugInfo CodeView: extract the OMF Directory Header 2016-08-09 00:25:12 +00:00
ExecutionEngine [MCJIT] Improve documentation and error handling for MCJIT::runFunction. 2016-08-11 15:56:23 +00:00
Fuzzer [libFuzzer] make libFuzzer work with a bit older clang versions 2016-08-06 21:28:56 +00:00
IR Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
IRReader
LTO Fix type truncation warnings 2016-08-11 20:38:39 +00:00
LibDriver Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI. 2016-06-29 22:27:42 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker IR: New representation for CFI and virtual call optimization pass metadata. 2016-06-24 21:21:32 +00:00
MC Re-commit r277988: [mips][ias] Fix all the hacks related to MIPS-specific unary operators (%hi/%lo/%gp_rel/etc.). 2016-08-08 11:50:25 +00:00
Object Restore "Resolution-based LTO API." 2016-08-11 14:58:12 +00:00
ObjectYAML [MachOYAML] Don't output empty ExportTrie 2016-08-11 00:20:03 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
Passes Consistently use CGSCCAnalysisManager 2016-08-09 00:28:56 +00:00
ProfileData Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
Support Fix UB in APInt::ashr 2016-08-10 19:50:14 +00:00
TableGen [TableGen] Autobrief-ize Record. NFC. 2016-07-14 14:53:14 +00:00
Target Use range algorithms instead of unpacking begin/end 2016-08-11 21:15:00 +00:00
Transforms Extend trip count instead of truncating IV in LFTR, when legal 2016-08-11 21:31:40 +00:00
CMakeLists.txt
LLVMBuild.txt