]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Eliminate redundant compare between set{z,nz} and j{z,nz}
authorUros Bizjak <ubizjak@gmail.com>
Mon, 18 Dec 2023 21:18:05 +0000 (22:18 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Mon, 18 Dec 2023 21:18:56 +0000 (22:18 +0100)
commit86b6daefc8ca00f6879779f6002ca575920d38d2
treea0605969566d35e7aeaeb687335a0b3eac2758ae
parentb77691a90fc8a7e917417ce747bf78669304f951
i386: Eliminate redundant compare between set{z,nz} and j{z,nz}

Eliminate redundant compare between set{z,nz} and j{z,nz}:
setz %al; test %al,%al; jz <...> -> setz %al; jnz <...> and
setnz %al, test %al,%al; jz <...> -> setnz %al; jz <...>.

We can use the original Zero-flag value instead of setting the
temporary register and testing it for zero.

gcc/ChangeLog:

* config/i386/i386.md (redundant compare peephole2):
New peephole2 pattern.
gcc/config/i386/i386.md