[LLVMbugs] [Bug 7695] "opt -inline -gvn" != "opt -inline" + "opt -gvn"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 23 08:11:52 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7695

Duncan Sands <baldrick at free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |baldrick at free.fr
         Resolution|                            |INVALID

--- Comment #2 from Duncan Sands <baldrick at free.fr> 2010-07-23 10:11:51 CDT ---
This is by design.  When you schedule a SCC pass like inline, followed by a
function pass like GVN, you get the following: (suppose F calls G, which
doesn't
call anything):
  - first inline is run on G; this does nothing since G doesn't call anything
  - then GVN is run on G, simplifying G
  - then inline is run on F, which may inline the call to G if the simplified G
is simple enough

When you do opt -inline followed by opt -gvn you get:
  - first inline is run on G; this does nothing since G doesn't call anything
  - then inline is run on F, which may inline the call to G if G is simple
enough
  - then GVN is run on G, simplifying G
  - then GVN is run on F, simplifying F

The point is that in the first case GVN may simplify G enough that the inliner
decides it is worth inlining into F, which it wouldn't do in the second case
because the original function G was too big.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list