https://bugs.llvm.org/show_bug.cgi?id=40149
Bug ID: 40149
Summary: Assumptions without constant operands are not
propagated
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: nikita....@gmail.com
CC: llvm-bugs@lists.llvm.org
For icmps that don't have a constant operand, assumptions are not propagated.
For example, in the following test case %c1 implies that %c2 is false.
define i1 @test(i32 %x, i32 %y) {
%c1 = icmp ult i32 %x, %y
call void @llvm.assume(i1 %c1)
%c2 = icmp ugt i32 %x, %y
ret i1 %c2
}
declare void @llvm.assume(i1)
Something like this will only get simplified if either
a) the icmps match exactly, so they are CSEd, or
b) the icmps are inverses of either other and canonicalization is possible
(after which they're CSEd).
I'm not sure which pass should be responsible for this. I think right now it
would be easy and cheap to do in SCCP because it already computes
PredicateInfo, but it's not really the right pass to do this semantically.
--
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