[all-commits] [llvm/llvm-project] 1c5716: [flang] Remove FIRBuilder dependency from optimize...
Mehdi Amini via All-commits
all-commits at lists.llvm.org
Wed Sep 23 17:23:10 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1c5716860e427859ce8c838ca3883b58eeb8b28c
https://github.com/llvm/llvm-project/commit/1c5716860e427859ce8c838ca3883b58eeb8b28c
Author: Mehdi Amini <joker.eph at gmail.com>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M flang/include/flang/Optimizer/Support/Utils.h
M flang/lib/Optimizer/Builder/IntrinsicCall.cpp
M flang/lib/Optimizer/Builder/Runtime/Numeric.cpp
M flang/lib/Optimizer/Builder/Runtime/Reduction.cpp
M flang/lib/Optimizer/Builder/Runtime/Transformational.cpp
M flang/lib/Optimizer/CodeGen/CodeGen.cpp
Log Message:
-----------
[flang] Remove FIRBuilder dependency from optimizer support utilities (#225836)
Fix a GCC 16 build failure where FIROps.cpp.o had undefined references
to
fir::FirOpBuilder::setCommonAttributes(mlir::Operation *) const from
FirOpBuilder::notifyOperationInserted,
RewriterBase::ForwardingListener's notifyOperationInserted, and
OpBuilder::createOrFold<fir::ConvertOp>.
FIROps.cpp includes Optimizer/Support/Utils.h, which previously included
FIRBuilder.h. That exposes the inline virtual override
FirOpBuilder::notifyOperationInserted and its call to the out-of-line
setCommonAttributes implementation. Speculative devirtualization can
turn an ordinary virtual listener call into a guarded direct call and
inline that override, introducing a reference to setCommonAttributes
without an explicit use of FirOpBuilder in FIROps.cpp. This is
consistent with the reported call sites and GCC 16's expanded
speculative devirtualization.
The implementation belongs to FIRBuilder, whereas FIRDialect does not
link FIRBuilder. Adding that link would create a dependency cycle, since
FIRBuilder already depends on FIRDialect. Remove the unnecessary header
dependency instead, so the optimizer cannot see this derived listener
implementation when compiling FIROps.cpp.
The intrinsic type diagnostic helpers only needed the builder to get an
MLIRContext, which is already available from the type. Drop their
builder parameters, use type.getContext(), and update all callers,
including the now-unused parameters in the intrinsic-name diagnostic
helpers. Remove FIRBuilder.h from Utils.h and avoid the string-literal
namespace import it provided transitively. Include FIRBuilder.h
explicitly in CodeGen.cpp, which directly uses factory helpers declared
there.
The standalone FIRBuilder build needed acc_gen generated explicitly for
an unrelated missing OpenACC parser header.
Assisted-by: Codex
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list