llvm-project/llvm/lib/Transforms
Arnaud A. de Grandmaison 849f3bf8c9 [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
..
Hello Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
IPO Update sample profile propagation algorithm. 2015-10-01 00:26:56 +00:00
InstCombine [InstCombine] Remove trivially empty lifetime start/end ranges. 2015-10-01 14:54:31 +00:00
Instrumentation Fix debug info with SafeStack. 2015-09-30 19:55:43 +00:00
ObjCARC [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
Scalar [NaryReassociate] SeenExprs records WeakVH 2015-10-01 03:51:44 +00:00
Utils Fix debug info with SafeStack. 2015-09-30 19:55:43 +00:00
Vectorize [SLP] Don't vectorize loads of non-packed types (like i1, i2). 2015-09-30 21:05:43 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile