[all-commits] [llvm/llvm-project] 061ceb: [NFC][NARY-REASSOCIATE] Restructure code to aviod ...

llvmbot via All-commits all-commits at lists.llvm.org
Fri Dec 4 01:25:07 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 061cebb46f6c484322719f906a16ebc7a1bc5fff
      https://github.com/llvm/llvm-project/commit/061cebb46f6c484322719f906a16ebc7a1bc5fff
  Author: Evgeniy Brevnov <ybrevnov at azul.com>
  Date:   2020-12-04 (Fri, 04 Dec 2020)

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

  Log Message:
  -----------
  [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable

Currently we have to duplicate the same checks in isPotentiallyReassociatable and tryReassociate. With simple pattern like add/mul this may be not a big deal. But the situation gets much worse when I try to add support for min/max. Min/Max may be represented by several instructions and can take different forms. In order reduce complexity for upcoming min/max support we need to restructure the code a bit to avoid mentioned code duplication.

Reviewed By: mkazantsev

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




More information about the All-commits mailing list