[PATCH] D125845: [InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 14:21:06 PDT 2022


spatel added a comment.

My comments about the tests were not addressed - there's a test of extra uses with no value, but no tests with loops?



================
Comment at: llvm/test/Transforms/InstCombine/gep-canonicalize-constant-indices.ll:33
 ;
   %1 = getelementptr inbounds [4 x i32], ptr %p, i64 %a, i64 1
   %2 = getelementptr inbounds i32, ptr %p, i64 %b
----------------
spatel wrote:
> I don't know what this test and the next one are supposed to show. %1 is dead code, so it gets eliminated before anything else might have happened.
I'm more confused now. The test had 1 GEP, but now it has 2 - how is that better?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125845



More information about the llvm-commits mailing list