We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keywords: duplicate duplicated redundant repeated compare comparison cmp
The compare instruction is repeated unnecessarily in the code generated from this:
const char *f(int x, int y) { return x < y ? "<" : x == y ? "=" : ">"; }
I've seen this with the ARM and x86 back ends.
Currently on r116298.
The text was updated successfully, but these errors were encountered:
Yep, this is because MachineCSE isn't doing everything it needs to
Sorry, something went wrong.
This problem shows up on all targets I look at:
PPC32: f: # @f
cmpw 0, 3, 4 blt 0, .LBB0_4
cmplw 0, 3, 4 bne 0, .LBB0_3
Thumb: f: @ BB#0: @ %entry cmp r0, r1 blt .LBB0_4 @ BB#1: @ %cond.false cmp r0, r1 bne .LBB0_3
ARM: f: @ @f @ BB#0: @ %entry cmp r0, r1 ldrlt r0, .LCPI0_2 bxlt lr ldr r3, .LCPI0_1 cmp r0, r1 mov r0, r3
x86: f: # @f
movl 8(%esp), %eax movl 4(%esp), %ecx cmpl %eax, %ecx jl .LBB0_2
cmpl %eax, %ecx movl $.L.str1, %ecx
Starting investigation, maybe I can come up with something acceptable.
r130928.
No branches or pull requests
Extended Description
Keywords: duplicate duplicated redundant repeated compare comparison cmp
The compare instruction is repeated unnecessarily in the code generated from this:
const char *f(int x, int y)
{
return x < y ? "<" : x == y ? "=" : ">";
}
I've seen this with the ARM and x86 back ends.
Currently on r116298.
The text was updated successfully, but these errors were encountered: