https://llvm.org/bugs/show_bug.cgi?id=27296
Bug ID: 27296
Summary: LVI should understand conditional branches where the
condition is a conjunction or disjunction
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
LVI is perfectly capable of learning from sequenced simple branches:
%cmp = icmp sgt i32 %x, 20
br i1 %cmp, label %cont, label %if.end3
%cmp1 = icmp sgt i32 %y, 200
br i1 %cmp1, label %if.then2, label %if.end3
%add = add nsw i32 %y, %x
However, after SimplifyCFG we're instead looking at code like this:
%cmp = icmp sgt i32 %x, 20
%cmp1 = icmp sgt i32 %y, 200
%or.cond = and i1 %cmp, %cmp1
br i1 %or.cond, label %if.then2, label %if.end3
And now LVI learns nothing. A mix would be to cause LVI to look for cases where
an i1 that goes to a branch is the result of an and, and recursively accumulate
dataflow facts.
Though it's probably less important, LVI can also learn facts when flags are
or'ed, for example:
%cmp = icmp eq i32 %x, 10
%cmp1 = icmp eq i32 %x, 12
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %if.then2, label %if.end3
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs