[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 665] NEW: mem2reg adds unnecessary phi nodes
From:       bugzilla-daemon () cs ! uiuc ! edu
Date:       2005-11-17 5:29:08
Message-ID: 200511170529.XAA24828 () zion ! cs ! uiuc ! edu
[Download RAW message or body]

http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=665

           Summary: mem2reg adds unnecessary phi nodes
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs@nondot.org
        ReportedBy: alenhar2@uiuc.edu


in the attached example, runing:
opt -stats -reg2mem -mem2reg -constmerge -simplifycfg lists.llvm.bc -o foo.bc

causes an extra couple phi nodes related to this in the original:
no_exit.0.preheader.i:		; preds = %loopentry.0.i
	%tmp.5.i56.i = getelementptr [101 x %struct.DLL]* %tmp.2.i.i, int 0, int 0,
uint 1		; <%struct.DLL**> [#uses=2]
	br label %no_exit.0.i

no_exit.0.i:		; preds = %list_pop_head.exit.i, %no_exit.0.preheader.i
	br bool %tmp.2.i.i52.i, label %list_pop_head.exit.i, label %endif.i55.i

endif.i55.i:		; preds = %no_exit.0.i
	%tmp.6.i57.i = load %struct.DLL** %tmp.5.i56.i		; <%struct.DLL*> [#uses=2]
	store %struct.DLL* %tmp.11.i.i, %struct.DLL** %tmp.5.i56.i
	br label %list_pop_head.exit.i


list_pop_head.exit.i:		; preds = %endif.i55.i, %no_exit.0.i
	br bool %tmp.2.i66.i, label %loopexit.0.i, label %no_exit.0.i

a -> b
b -> c
b -> d
c -> d
d -> b
d -> out

clearly a dominates the uses in c.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic