https://bugs.llvm.org/show_bug.cgi?id=38002
Bug ID: 38002
Summary: Missed opportunity for SETE for 2-cases switch
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Hello,
Code:
bool sw1(int x) {
switch(x) {
case 3:
case 5:
return true;
default:
return false;
}
}
Clang trunk -03/Os:
sw1(int): # @sw1(int)
mov al, 1
cmp edi, 3
je .LBB0_3
cmp edi, 5
jne .LBB0_2 <----------- avoid jump, use "sete al"?
.LBB0_3:
ret
.LBB0_2:
xor eax, eax
ret
--
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