https://llvm.org/bugs/show_bug.cgi?id=31801

            Bug ID: 31801
           Summary: changeToUnreachable makes questionable decisions (and
                    modifies the CFG)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: dav...@freebsd.org
                CC: chandl...@gmail.com, dber...@dberlin.org,
                    fil...@gmail.com, florian.h...@arm.com,
                    llvm-bugs@lists.llvm.org, llvm-...@redking.me.uk,
                    simon.f.whitta...@gmail.com
    Classification: Unclassified

Some recent changes in NewGVN revealed a couple of issues in
changeToUnreachable().
1) It's declared in Local.h, although it modifies the CFG (it shouldn't :().
2) It takes a `preserveLCSSA` boolean argument which prevents removal of
useless PHI nodes (the argument is passed down to
BasicBlock::removePredecessor). As discussed with Danny, this doesn't seem
enough to preserve LCSSA, but it could just be that the arugment of the
function is misnamed.

We should:
1) Modify the function so that it preserves the CFG
Danny suggested we could probably just insert before the terminator

new StoreInst(UndefValue::get(Int8Ty), Constant::getNullValue(Int8Ty\
getPointerTo()), TI)

so that SimplifyCFG knows how to remove it.

2) Understand how `preserveLCSSA` is used, and either fix to really preserve
LCSSA or change the parameter name (and document it, while we're there:)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to