[all-commits] [llvm/llvm-project] 6c767c: [InstCombine] Canonicalize GEP of GEP by swapping ...

William Junda Huang via All-commits all-commits at lists.llvm.org
Thu Oct 20 10:41:44 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c767cef5a1d21154730f18ec01d76b7f36a3610
      https://github.com/llvm/llvm-project/commit/6c767cef5a1d21154730f18ec01d76b7f36a3610
  Author: William Huang <williamjhuang at google.com>
  Date:   2022-10-20 (Thu, 20 Oct 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/gep-canonicalize-constant-indices.ll
    M llvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll
    M llvm/test/Transforms/InstCombine/shift.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/vector-reverse-mask4.ll
    M llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
    M llvm/test/Transforms/PhaseOrdering/single-iteration-loop-sroa.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back

Canonicalize GEP of GEP by swapping GEP with some suffix constant indices to the back (and GEP with all constant indices to the back of that), this allows more constant index GEP merging to happen. Exceptions are: If swapping violates use-def relations, or anti-optimizes LICM

For constant indexed GEP of GEP, if they cannot be merged directly, they will be casted to i8* and merged.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D125845




More information about the All-commits mailing list