[PATCH] D82005: [InstCombine] Replace selects with Phis

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 01:03:31 PDT 2020


nikic added a comment.

@mkazantsev I don't think this is about backend-specific optimizations (which indeed InstCombine should not be concerned about), phis and selects generally have different weak points in mid-level optimization. While you are right that the use of phis enables better jump threading, phis will usually not work with redundancy elimination and code motion optimizations. E.g. I don't think CSE or GVN do anything with phis right now.

That said, I can definitely see the argument that //if// you already have a branch, it is beneficial to represent a select as a phi, and leave the decision on whether to turn the whole branch into a sequence of selects to EarlyCSE.


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

https://reviews.llvm.org/D82005





More information about the llvm-commits mailing list