[all-commits] [llvm/llvm-project] a5d685: LoopReroll::isLoopControlIV - use cast<> instead o...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Feb 11 02:20:00 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a5d6851489c7a4bfa3422a2fb3de40b9ea958833
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopRerollPass.cpp

  Log Message:
  LoopReroll::isLoopControlIV - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is always dereferenced by isCompareUsedByBranch, so assert the cast is correct instead of returning nullptr

More information about the All-commits mailing list