[all-commits] [llvm/llvm-project] ddb68f: [flang] Initial support for FastMathAttr setup in ...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Mon Nov 7 09:04:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ddb68f36ae3a7ecb833e3ddf2ab8afe6ed509651
      https://github.com/llvm/llvm-project/commit/ddb68f36ae3a7ecb833e3ddf2ab8afe6ed509651
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp

  Log Message:
  -----------
  [flang] Initial support for FastMathAttr setup in FirOpBuilder.

Provide FirOpBuilder::setFastMathFlags() to configure FastMathFlags
for the builder. Set FastMathAttr for operations based on FirOpBuilder
configuration via mlir::OpBuilder::Listener.

This is a little bit hacky solution, because we lose the ability
to hook other listeners to FirOpBuilder. There are also potential
issues with OpBuilder::clone() - the hook will be invoked for cloned
operations and will effectively overwrite FastMathAttr with the ones
configured in FirOpBuilder, which should not be happening.
We should teach mlir::OpBuilder about FastMathAttr setup in future.

Reviewed By: jeanPerier, kiranchandramohan

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




More information about the All-commits mailing list