[PATCH] D36711: [X86] Combining CMOVs with [ANY, SIGN, ZERO]_EXTEND for cases where CMOV has constant arguments

Alexander Ivchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 12:44:09 PDT 2017


aivchenk marked an inline comment as done.
aivchenk added a comment.

Thank you for your comments, I updated the patch to address them:

1. Done
2. MCU target does not have CMOV instruction so it is always converted into test+branch. I firstly cared about it - that's the reason why it is here
3. Just a miss. It is fixed
4. Ditto

About converting into math ops.. I think that in most cases my patch would be obsolete then. The only reason I see why it would be not obsolete is: assume that CMOV with constants is part of a CMOV-group (as defined in X86CmovConversion.cpp: consecutive/having the same CC) and the decision taken by x86-cmov-converter is to transform this CMOV-group into branch. Since branch is generated anyways now, basically this "constant" CMOV is transformed into two addition MOVs, which should be more effective than converting it to three ops math logic


https://reviews.llvm.org/D36711





More information about the llvm-commits mailing list