[all-commits] [llvm/llvm-project] f66975: [Float2Int] Extract calcRange() method (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Mar 31 07:13:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f66975555fec57e55f3d72d06d8bc83472cd2c1e
      https://github.com/llvm/llvm-project/commit/f66975555fec57e55f3d72d06d8bc83472cd2c1e
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-03-31 (Thu, 31 Mar 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/Float2Int.h
    M llvm/lib/Transforms/Scalar/Float2Int.cpp

  Log Message:
  -----------
  [Float2Int] Extract calcRange() method (NFC)

This avoids the awkward "Abort" flag, because we can simply
early-return instead.


  Commit: 33ac23e7cf8fa8422550f83ff1734f941f19dc6c
      https://github.com/llvm/llvm-project/commit/33ac23e7cf8fa8422550f83ff1734f941f19dc6c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-03-31 (Thu, 31 Mar 2022)

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

  Log Message:
  -----------
  [Float2Int] Avoid unnecessary lamdbas (NFC)

Instead of first creating a lambda for calculating the range,
then collecting the ranges for the operands, and then calling the
lambda on those ranges, we can first calculate the operand ranges
and then calculate the result directly in the switch.


Compare: https://github.com/llvm/llvm-project/compare/d81fa76f3a6b...33ac23e7cf8f


More information about the All-commits mailing list