[all-commits] [llvm/llvm-project] 54a9f0: [SCEV] Fix BinomialCoefficient Iteration to fit in...

annamthomas via All-commits all-commits at lists.llvm.org
Wed Apr 10 06:02:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54a9f0007cb4f19d2e9df30405c5027229f5def0
      https://github.com/llvm/llvm-project/commit/54a9f0007cb4f19d2e9df30405c5027229f5def0
  Author: annamthomas <anna at azul.com>
  Date:   2024-04-10 (Wed, 10 Apr 2024)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    A llvm/test/Analysis/ScalarEvolution/pr87798.ll

  Log Message:
  -----------
  [SCEV] Fix BinomialCoefficient Iteration to fit in W bits (#88010)

BinomialCoefficient computes the value of W-bit IV at iteration It of a loop. When W is 1, we can call multiplicative inverse on 0 which triggers an assert since 1b76120.
    
Since the arithmetic is supposed to wrap if It or K does not fit in W bits, do the truncation into W bits after we do the shift.
    
 Fixes #87798



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list