http://llvm.org/bugs/show_bug.cgi?id=2298
Summary: Missed optimization: should instcombine icmp ~A, ~B to
icmp B, A
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: new bugs
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [email protected]
Pretty simple bug: int a(int a, int b) {return ~a < ~b;} currently outputs the
following:
define i32 @a(i32 %a, i32 %b) nounwind {
entry:
%tmp1not = xor i32 %a, -1 ; <i32> [#uses=1]
%tmp2not = xor i32 %b, -1 ; <i32> [#uses=1]
%tmp3 = icmp slt i32 %tmp1not, %tmp2not ; <i1> [#uses=1]
%tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
ret i32 %tmp34
}
It should output the following:
define i32 @a(i32 %a, i32 %b) nounwind {
entry:
%tmp3 = icmp slt i32 %b, %a ; <i1> [#uses=1]
%tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
ret i32 %tmp34
}
Not an especially useful instcombine, but it's extremely cheap to implement.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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