Re: [x86_64 PATCH] PR tree-opt/91384: peephole2 to eliminate testl after negl.

2022-02-28 Thread Uros Bizjak via Gcc-patches
On Mon, Feb 28, 2022 at 6:36 PM Roger Sayle wrote: > > > This patch is my proposed solution to PR tree-optimization/91384 which is > a missed-optimization/code quality regression on x86_64. The problematic > idiom is "if (r = -a)" which is equivalent to both "r = -a; if (r != 0)" > and alternativ

[x86_64 PATCH] PR tree-opt/91384: peephole2 to eliminate testl after negl.

2022-02-28 Thread Roger Sayle
This patch is my proposed solution to PR tree-optimization/91384 which is a missed-optimization/code quality regression on x86_64. The problematic idiom is "if (r = -a)" which is equivalent to both "r = -a; if (r != 0)" and alternatively "r = -a; if (a != 0)". In this particular case, on x86_64,