You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NFC] Move FirOpBuilder, ExtendedValue and tools into lib/Optimizer/Builder
Many FIR related tools and helpers are not accessible in
lib/Optimizer/Transform because they are part of lib/Lower library
even though they only operate on FIR and MLIR data structures.
Most of these tools are using the FirOpBuilder. Move this class into
Optimizer/Builder/FirOpBuilder.h. Change FirOpBuilder namespace to
fir.
Similarly, the fir::ExtendedValue is a key data structure in all
helpers. Move it under Optimizer/Builder/BoxValue.h. Its namespace was
already fir. Split its implementation from Lower/SymbolMap.cpp into
a new Optimzer/Builder/BoxValue.cpp file.
The FirOpBuilder implementation depends on ComplexExpr.h,
CharacterExpr.h, DoLoopHelper.h, and Allocatable.h.
- Split Allocatable.h into Lower/Allocatable.h (that contains the API to
lower allocation/association on front end data structure) and
Optimizer/Builder/MutableBox.h (that contains the tools to work with
MutableBoxValue)
- Move CharacterExpr.h to Optimizer/Builder/Character.h. Implement a
small genMin locally in Character.cpp to break the dependency with
lib/Lower/intrinsicCall.cpp.
- Move ComplexExpr.h to Optimizer/Builder/Complex.h. ComplexExpr.cpp
depended on lib/Lower/ConvertType.cpp to convert a kind to a real
type. Add a getRealType(kind) helper to FirOpBuilder using the kindMap
instead.
- Move DoLoopHelper.h to Optimizer/Builder/DoLoopHelper.h.
Apart from the ExtendedValue and FirOpBuilder classes that are directly under
fir namespace, all moved functions are placed under the fir::factory
namespace since they generate big chunks of FIR to implement Fortran
pattern.
The lib/Optimizer/Builder files are added to a new libFIROpBuilder
library.
With all this, FirOpBuilder and related tools is available in
lib/Optimizer and no new dependency is brought into lib/Optimizer.
0 commit comments