[all-commits] [llvm/llvm-project] 05ccde: [LoopCacheAnalysis] Fix a type mismatch problem in...

CongzheUalberta via All-commits all-commits at lists.llvm.org
Wed Jul 20 22:58:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 05ccde8023a6176927454f478730d29e53104c05
      https://github.com/llvm/llvm-project/commit/05ccde8023a6176927454f478730d29e53104c05
  Author: Congzhe Cao <congzhe.cao at huawei.com>
  Date:   2022-07-21 (Thu, 21 Jul 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopCacheAnalysis.h
    M llvm/lib/Analysis/LoopCacheAnalysis.cpp
    M llvm/test/Analysis/LoopCacheAnalysis/PowerPC/compute-cost.ll
    M llvm/test/Analysis/LoopCacheAnalysis/compute-cost.ll

  Log Message:
  -----------
  [LoopCacheAnalysis] Fix a type mismatch problem in cost calculation

There is a problem in loop cache analysis that the types of SCEV variables
`Coeff` and `ElemSize` in function `isConsecutive()` may not match. The
mismatch would cause SCEV failures when `Coeff` is multiplied with `ElemSize`.

The fix in this patch is to extend the type of both `Coeff` and `ElemSize` to
whichever is wider in those two variables. As a clean-up, duplicate calculations
of `Stride` in `computeRefCost()` is then removed.

Reviewed By: Meinersbur, #loopoptwg

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




More information about the All-commits mailing list