diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2020-07-15 21:27:00 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2020-07-15 21:29:59 +0200 |
commit | 6c2848ad02feef5ac094d1158be3861819b3bb49 (patch) | |
tree | 7cd73e410c711ba4f8700bc1227f595b00c83394 /libsanitizer/sanitizer_common | |
parent | 51542d9254426c54363a42451885a77b44ebbeaf (diff) | |
download | gcc-6c2848ad02feef5ac094d1158be3861819b3bb49.zip gcc-6c2848ad02feef5ac094d1158be3861819b3bb49.tar.gz gcc-6c2848ad02feef5ac094d1158be3861819b3bb49.tar.bz2 |
i386: Introduce peephole2 to use flags from CMPXCHG more [PR96189]
CMPXCHG instruction sets ZF flag if the values in the destination operand
and EAX register are equal; otherwise the ZF flag is cleared and value
from destination operand is loaded to EAX. Following assembly:
movl %esi, %eax
lock cmpxchgl %edx, (%rdi)
cmpl %esi, %eax
sete %al
can be optimized by removing the unneeded comparison, since set ZF flag
signals that no update to EAX happened.
2020-15-07 Uroš Bizjak <ubizjak@gmail.com>
gcc/ChangeLog:
PR target/95355
* config/i386/sync.md
(peephole2 to remove unneded compare after CMPXCHG): New pattern.
gcc/testsuite/ChangeLog:
PR target/95355
* gcc.target/i386/pr96189.c: New test.
Diffstat (limited to 'libsanitizer/sanitizer_common')
0 files changed, 0 insertions, 0 deletions