1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/lib/Transforms/InstCombine
Arnaud A. de Grandmaison 3d6b7ea719 [InstCombine] Remove trivially empty lifetime start/end ranges.
Summary:
Some passes may open up opportunities for optimizations, leaving empty
lifetime start/end ranges. For example, with the following code:

    void foo(char *, char *);
    void bar(int Size, bool flag) {
      for (int i = 0; i < Size; ++i) {
        char text[1];
        char buff[1];
        if (flag)
          foo(text, buff); // BBFoo
      }
    }

the loop unswitch pass will create 2 versions of the loop, one with
flag==true, and the other one with flag==false, but always leaving
the BBFoo basic block, with lifetime ranges covering the scope of the for
loop. Simplify CFG will then remove BBFoo in the case where flag==false,
but will leave the lifetime markers.

This patch teaches InstCombine to remove trivially empty lifetime marker
ranges, that is ranges ending right after they were started (ignoring
debug info or other lifetime markers in the range).

This fixes PR24598: excessive compile time after r234581.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 249018
2015-10-01 14:54:31 +00:00
..
CMakeLists.txt
InstCombineAddSub.cpp don't repeat function names in comments; NFC 2015-09-09 15:24:36 +00:00
InstCombineAndOrXor.cpp [InstCombine] match De Morgan's Law hidden by zext ops (PR22723) 2015-09-25 23:21:38 +00:00
InstCombineCalls.cpp [InstCombine] Remove trivially empty lifetime start/end ranges. 2015-10-01 14:54:31 +00:00
InstCombineCasts.cpp There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that 2015-09-10 11:31:20 +00:00
InstCombineCompares.cpp [InstCombine] FoldICmpCstShrCst failed for ashr when comparing against -1 2015-09-19 00:48:31 +00:00
InstCombineInternal.h [InstCombine] fold zexts and constants into a phi (PR24766) 2015-09-27 20:34:31 +00:00
InstCombineLoadStoreAlloca.cpp Clean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s parameter MaxInstsToScan. (Complete version of r247497. See D12886) 2015-09-18 19:14:35 +00:00
InstCombineMulDivRem.cpp don't repeat function names in comments; NFC 2015-09-09 15:24:36 +00:00
InstCombinePHI.cpp [InstCombine] fold zexts and constants into a phi (PR24766) 2015-09-27 20:34:31 +00:00
InstCombineSelect.cpp don't repeat function names in comments; NFC 2015-09-09 15:24:36 +00:00
InstCombineShifts.cpp Convert PHI getIncomingValue() to foreach over incoming_values(). NFC. 2015-05-12 20:05:31 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine] Improve Vector Demanded Bits Through Bitcasts 2015-09-29 08:19:11 +00:00
InstCombineVectorOps.cpp don't repeat function names in comments; NFC 2015-09-09 15:24:36 +00:00
InstructionCombining.cpp add ShouldChangeType() variant that takes bitwidths 2015-09-21 16:09:37 +00:00
LLVMBuild.txt
Makefile