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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to