flang/Optimizer/Support/Utils.h has header file dependency on the FIRDialect. It also specifies that dependency in the cmake file with
DEPENDS FIROpsIncGen HLFIROpsIncGen
However FIRDialect links with FIRSupport which causes a circular dependency exposed by https://reviews.llvm.org/D145530 and summarily fixed by
https://reviews.llvm.org/D145602
This patch breaks up the utility libraries into 2 parts:
- libDialectSupport is a utility library the FIR dialect depends on and has no dependency on the dialect itself
- libSupport remains a utility library that depends and operates on the FIR dialect but that the dialect does not depend on.
There are some clean-ups of the DEPENDS attribute when it is redundant with link_libs