[PATCH] D156657: [ValueTracking][InstCombine] Fold icmp(constants[x]) when the range of x is given

Hongyu Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 03:09:01 PDT 2023


XChy added a comment.

In D156657#4546067 <https://reviews.llvm.org/D156657#4546067>, @nikic wrote:

> This should be handled by the foldCmpLoadFromIndexedGlobal() fold, by first converting the icmp(load(gep(g, idx))) into icmp(idx) and then folding that icmp against the dominating condition.
>
> That fold currently requires a very specific GEP source element type, but should be easy to generalize.

Sure, I'll have a check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156657



More information about the llvm-commits mailing list