[llvm] [X86] fold mov dec/inc to lea +- 1 (PR #185194)

Takashi Idobe via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 18:26:05 PDT 2026


Takashiidobe wrote:

I tried changing isProfitableToConv3Addr to handle the mov + lea case but this breaks a lot of tests. It's a 6 line implementation diff that handles all the optimizations into lea (tests are in mov-lea-folds.ll) and also breaks 250k loc of snapshot tests, where basically every other change is registers changing or movs + leas swapping around. 

I personally think this change is much better since it handles every case immediately but given how many lines of code change because of it I assume it's pretty dangerous to merge. Not sure what to do in that case.

https://github.com/llvm/llvm-project/pull/185194


More information about the llvm-commits mailing list