[PATCH] D45065: [InstCombine] Fix PR17564: don't fold [zs]ext into phi.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 06:18:02 PDT 2018


spatel added a comment.

Avoiding instcombine folds is fragile. There's no guarantee that the IR isn't already in the form we're trying to avoid when we start instcombine, so we would fail to optimize in that case. Also, some of the tests show the benefit of the existing transform - we eliminate an instruction by changing the type of the phi.

I think we should solve this using something like https://reviews.llvm.org/D45108 instead, but I need to look closer at how the case in the bug report escaped the matching that we already have in foldSelectInstWithICmp() and foldSelectICmpAnd().


Repository:
  rL LLVM

https://reviews.llvm.org/D45065





More information about the llvm-commits mailing list