[all-commits] [llvm/llvm-project] 53dc52: [LoopInfo] Fix function getInductionVariable

ClarDB via All-commits all-commits at lists.llvm.org
Thu Nov 11 00:25:33 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53dc5258282a8322451cba14b5ad2f670028d196
      https://github.com/llvm/llvm-project/commit/53dc5258282a8322451cba14b5ad2f670028d196
  Author: duanbo.db <duanbo.db at alibaba-inc.com>
  Date:   2021-11-11 (Thu, 11 Nov 2021)

  Changed paths:
    M llvm/lib/Analysis/LoopInfo.cpp
    M llvm/unittests/Analysis/LoopInfoTest.cpp

  Log Message:
  -----------
  [LoopInfo] Fix function getInductionVariable

The way function gets the induction variable is by judging whether
StepInst or IndVar in the phi statement is one of the operands of CMP.
But if the LatchCmpOp0/LatchCmpOp1 is a constant,  the subsequent
comparison may result in null == null, which is meaningless. This patch
fixes the typo.

Reviewed By: Whitney

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




More information about the All-commits mailing list