[JIT] X86/X64 - Eliminate redundant 'cmp' instructions (#82750)
* Fixed improper peephole zero-extension removal when cdq/cdqe/cwde instructions are involved * Update regression test * Formatting * Handle cdq differently * Handle cdq differently * Handle cdq differently * Initial commit to eliminate redundant 'cmp' instructions * Take into account cmpxchg * Take into account cmpxchg * Feedback * Temporarily disable cmp opt if we encounter a mov * Allow checking for mov * Allow regardless of targetReg * Allow regardless of targetReg * Checking if an instruction resets a flag. * Remove useless comment * Minor fix * Abort are checking cmp * Some refactoring. Taking into account any instruction that modifies flags. * Minor cleanup * Remove function from header * Quick fix * Sync * Formatting * Only look for 'cmp reg, reg' * Added comment * Update src/coreclr/jit/emitxarch.cpp Co-authored-by: NBruce Forstall <brucefo@microsoft.com> * Update src/coreclr/jit/emitxarch.cpp Co-authored-by: NBruce Forstall <brucefo@microsoft.com> --------- Co-authored-by: NBruce Forstall <brucefo@microsoft.com>
Showing
想要评论请 注册 或 登录