[LLVMbugs] [Bug 22705] New: [InstCombine] @llvm.assume(i1 false) -> unreachable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 25 17:56:36 PST 2015


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

            Bug ID: 22705
           Summary: [InstCombine] @llvm.assume(i1 false) -> unreachable
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: listmail at philipreames.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

If we encounter an @llvm.assume whose condition has been proven false, we can
assume that path is not reachable.  An example where this would be useful would
be the following:

void foo(bool unrelated, int* p) {
  if(unrelated) {
    assume(p != null);
    expensive();
  }
}
void bar() { foo(true, nullptr); }


I'm not quite sure how to implement this in InstCombine given that pass is
supposed to preserve the CFG, but it otherwise seems like the right spot to do
it.  It could also be done in SimplifyCFG, but it'd be nice to have it effect
the iteration inside InstCombine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150226/05465c4d/attachment.html>


More information about the llvm-bugs mailing list