[PATCH] D147041: [CodeGen] Remove redundent instructions generated by combineAddrModes.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 21:12:00 PDT 2023


skatkov added a comment.

ok, the algorithm working with combined address is a bit complex, so it seems that more or less safe way (at least as I see) to remove dead instruction in case of bail out would be:

1. Add a destructor to AddressingModeCombiner
2. Remember CommonValue  as you did it
3. Erase CommonValue as you did it in eraseCommonValue()

otherwise your fix is very narrow.

While you can restrict other optimization as @Peter wrote, but removing dead introduced instruction makes sense anyway.

Thank you for doing it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147041/new/

https://reviews.llvm.org/D147041



More information about the llvm-commits mailing list