[all-commits] [llvm/llvm-project] 2128fc: [InstCombine] Canonicalize `gep T* X, V / sizeof(T...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Thu Dec 28 19:30:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2128fca6c1e3a0ba4d105f62ad0f6a841e992cfb
      https://github.com/llvm/llvm-project/commit/2128fca6c1e3a0ba4d105f62ad0f6a841e992cfb
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-12-29 (Fri, 29 Dec 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/getelementptr.ll

  Log Message:
  -----------
  [InstCombine] Canonicalize `gep T* X, V / sizeof(T)` to `gep i8* X, V` (#76458)

This patch canonicalize `gep T* X, V / sizeof(T)` to `gep i8* X, V`.
Alive2: https://alive2.llvm.org/ce/z/7XGjiB

As this pattern has been handled by the backends, the motivation of this
patch is to reduce the ref count of sdiv, which will enable more
optimizations.




More information about the All-commits mailing list