[all-commits] [llvm/llvm-project] 949ec8: [InstCombine] Relax the same-underlying-object con...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sun Dec 31 08:35:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 949ec83eaf6fa6dbffb94c2ea9c0a4d5efdbd239
      https://github.com/llvm/llvm-project/commit/949ec83eaf6fa6dbffb94c2ea9c0a4d5efdbd239
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-01-01 (Mon, 01 Jan 2024)

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

  Log Message:
  -----------
  [InstCombine] Relax the same-underlying-object constraint for the GEP canonicalization (#76583)

https://github.com/llvm/llvm-project/commit/7d7001b2cbd05bb1955c18e7f8668644bd1258dc
canonicalizes `(gep i8, X, (ptrtoint Y) - (ptrtoint X))` into `bitcast
Y` iff `X` and `Y` have the same underlying object.

I find that the result of this pattern is usually used as an operand of
an icmp in some real-world applications. I think we can do the
canonicalization if the result is only used by icmps/ptrtoints.

Alive2: https://alive2.llvm.org/ce/z/j4-HJZ




More information about the All-commits mailing list