[all-commits] [llvm/llvm-project] 7f1bf6: [SCEVExpander] Only check overflow if it is needed.

Florian Hahn via All-commits all-commits at lists.llvm.org
Sun Jan 9 05:04:51 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f1bf68d7dd6e4d7d64e7b6b30055d62db3bbe32
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-01-09 (Sun, 09 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll
    M llvm/test/Transforms/LoopVectorize/PowerPC/optimal-epilog-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/X86/pr35432.ll
    M llvm/test/Transforms/LoopVectorize/induction.ll
    M llvm/test/Transforms/LoopVectorize/optimal-epilog-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll
    M llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll

  Log Message:
  [SCEVExpander] Only check overflow if it is needed.

9345ab3a4550 updated generateOverflowCheck to skip creating checks that
always evaluate to false. This in turn means that we only need to check
for overflows if the result of the multiplication is actually used.

Sink the Or for the overflow check into ComputeEndCheck, so it is only
created when there's an actual check.

More information about the All-commits mailing list