[all-commits] [llvm/llvm-project] 64987c: [ValueTracking] isNonZero sub of ptr2int's with re...

bipmis via All-commits all-commits at lists.llvm.org
Wed Dec 20 06:12:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64987c648f87613102eee70ccf9ff50e4f59f55e
      https://github.com/llvm/llvm-project/commit/64987c648f87613102eee70ccf9ff50e4f59f55e
  Author: bipmis <102525366+bipmis at users.noreply.github.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Analysis/ValueTracking/known-non-zero.ll
    M llvm/test/Analysis/ValueTracking/phi-known-bits.ll
    M llvm/test/Transforms/InstCombine/sub-gep.ll

  Log Message:
  -----------
  [ValueTracking] isNonZero sub of ptr2int's with recursive GEP (#68680)

When the sub arguments are ptr2int it is not possible to determine
computeKnownBits() of its arguments.
For scalar case generally sub of 2 ptr2int are converted to sub of
indexes.
However a loop with recursive GEP/PHI where the arguments to sub is of
type ptr2int, if it is possible to determine that a sub of this GEP and
another pointer with the same base is KnownNonZero we can return this.
This helps subsequent passes to optimize the loop further.




More information about the All-commits mailing list