[LLVMbugs] [Bug 8991] New: Early-CSE is not idempotent

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jan 16 21:12:08 PST 2011


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

           Summary: Early-CSE is not idempotent
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Running the Early-CSE several times in succession results in more
simplifications than running it once, for example:

$ opt -disable-output -stats gcc.bc -early-cse
===-------------------------------------------------------------------------===
                          ... Statistics Collected ...
===-------------------------------------------------------------------------===

    24 early-cse    - Number of call instructions CSE'd
190990 early-cse    - Number of instructions CSE'd
 68115 early-cse    - Number of instructions simplified or DCE'd
 44538 early-cse    - Number of load instructions CSE'd
   140 early-cse    - Number of trivial dead stores removed
     2 instsimplify - Number of expansions
    31 instsimplify - Number of reassociations

$ opt -disable-output -stats gcc.bc -early-cse -early-cse -early-cse -early-cse
-early-cse -early-cse -early-cse -early-cse -early-cse -early-cse -early-cse
-early-cse -early-cse -early-cse -early-cse -early-cse -early-cse
===-------------------------------------------------------------------------===
                          ... Statistics Collected ...
===-------------------------------------------------------------------------===

    24 early-cse    - Number of call instructions CSE'd
190993 early-cse    - Number of instructions CSE'd
 70166 early-cse    - Number of instructions simplified or DCE'd
 44587 early-cse    - Number of load instructions CSE'd
   176 early-cse    - Number of trivial dead stores removed
    18 instsimplify - Number of expansions
   271 instsimplify - Number of reassociations

That's about a 3% increase in "Number of instructions simplified or DCE'd"
and a 25% increase in "Number of trivial dead stores removed".

My guess is that when an instruction is CSE'd/simplified, its uses are not
being revisited/recursively CSE'd/simplified.  I think this can only occur
in loops when uses occur before the instruction.

-- 
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