[PATCH] D155688: [PATCH] [llvm] [InstCombine] Canonicalise ADD+GEP

2023-10-10 Thread Fei Peng via Phabricator via cfe-commits
fiigii added a comment. That would be fine. Thanks for explaining. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155688/new/ https://reviews.llvm.org/D155688 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D155688: [PATCH] [llvm] [InstCombine] Canonicalise ADD+GEP

2023-10-09 Thread Fei Peng via Phabricator via cfe-commits
fiigii added a comment. > The reverse transform is only done if A + B simplifies. Looks like`simplifyAddInst` may give add expressions, so I guess this patch may make IC run into infinite loops. Additionally, this change could make longer GEP chains that could hurt other optimizations by excee

[PATCH] D155688: [PATCH] [llvm] [InstCombine] Canonicalise ADD+GEP

2023-10-06 Thread Fei Peng via Phabricator via cfe-commits
fiigii added a comment. How does this patch work with `visitGEPOfGEP` that does a reverse transformation? // Replace: gep (gep %P, long B), long A, ... // With:T = long A+B; gep %P, T, ... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1556