[PATCH] D93850: [InstCombine] Rewrite (switch (zext X)) as (switch X).

Chenguang Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 28 11:57:10 PST 2020


wecing added a comment.

@lebedev.ri , which "hook" did you mean?

I think the existing fold is too aggressive. Please take a look at the example I gave in an earlier comment -- doing a less strict fold first gives GVN a chance to optimize the IR.
When the new fold is triggered, the existing more aggressive fold would be triggered (if `NewWidth` happens to be a standard integer type, e.g. `i8`, so that `shouldChangeType()` returns true) the next time InstCombine gets executed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93850



More information about the llvm-commits mailing list