- Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 40483 |
| Resolution | FIXED |
| Resolved on | Jul 25, 2019 07:25 |
| Version | trunk |
| OS | Windows NT |
| Blocks | #41819 |
| CC | @topperc,@zmodem,@RKSimon,@rotateright |
| Fixed by commit(s) | r353044,r354771 |
Extended Description
We sometimes fail to recognise that ISD::SUB(x,y) and X86ISD::SUB(x,y) can be represented by the X86ISD::SUB(x,y).
#include <x86intrin.h>
using u64 = unsigned long long;
u64 test_sub1(u64 *p, u64 x) {
u64 r = *p - x;
_subborrow_u64(0, *p, x, p);
return *p - r; // zero
}
u64 test_sub2(u64 *p, u64 x) {
u64 r = *p - x;
_subborrow_u64(0, *p, x, p);
return r - *p; // zero
}
_Z9test_sub1Pyy:
movq (%rdi), %rcx
movq %rcx, %rax
subq %rsi, %rax
movq %rax, (%rdi)
subq %rcx, %rsi
addq %rsi, %rax
retq
_Z9test_sub2Pyy:
subq %rsi, (%rdi)
xorl %eax, %eax
retq