[all-commits] [llvm/llvm-project] b81293: [FLANG] Change loop versioning to use shift instea...

Mats Petersson via All-commits all-commits at lists.llvm.org
Thu Jun 1 11:30:19 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b812932b3582752eb45240044be8ac1a9df4759f
  Author: Mats Petersson <mats.petersson at arm.com>
  Date:   2023-06-01 (Thu, 01 Jun 2023)

  Changed paths:
    M flang/lib/Optimizer/Transforms/LoopVersioning.cpp
    M flang/test/Transforms/loop-versioning.fir

  Log Message:
  [FLANG] Change loop versioning to use shift instead of divide

Despite me being convinced that the use of divide didn't produce any
divide instructions, it does in fact add more instructions than using
a plain shift operation.

This patch simply changes the divide to a shift right, with an
assert to check that the "divisor" is a power of two.

Reviewed By: kiranchandramohan, tblah

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

More information about the All-commits mailing list