[LLVMbugs] [Bug 665] NEW: mem2reg adds unnecessary phi nodes

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Nov 16 21:29:08 PST 2005


           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 at nondot.org
        ReportedBy: alenhar2 at 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.

More information about the llvm-bugs mailing list