[all-commits] [llvm/llvm-project] 3fd64c: [ValueTracking] Handle two PHIs in isKnownNonEqual()

JinGu Kang via All-commits all-commits at lists.llvm.org
Thu Mar 25 15:57:21 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fd64cc7a361ae02f4c0f84f5f6a85a6f05c100c
      https://github.com/llvm/llvm-project/commit/3fd64cc7a361ae02f4c0f84f5f6a85a6f05c100c
  Author: Jingu Kang <jingu.kang at arm.com>
  Date:   2021-03-25 (Thu, 25 Mar 2021)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Analysis/ValueTracking/known-non-equal.ll

  Log Message:
  -----------
  [ValueTracking] Handle two PHIs in isKnownNonEqual()

loop:
  %cmp.0 = phi i32 [ 3, %entry ], [ %inc, %loop ]
  %pos.0 = phi i32 [ 1, %entry ], [ %cmp.0, %loop ]
  ...
  %inc = add i32 %cmp.0, 1
  br label %loop

On above example, %pos.0 uses previous iteration's %cmp.0 with backedge
according to PHI's instruction's defintion. If the %inc is not same among
iterations, we can say the two PHIs are not same.

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




More information about the All-commits mailing list