define i64 @tgt2(i64 %3) {
entry:
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i64
ret i64 %5
}
compiles to:
tgt2: # @tgt2
xor eax, eax
cmp rdi, 1
sbb rax, rax
ret
For x86-64.
This has a completely unnecessary xor eax, eax at the start
I assume the function is simply -!arg there
https://godbolt.org/z/zaPY53YT1
The sbb rax, rax renders it so.