LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 845 - Eliminate cyclic dependencies between libraries
Summary: Eliminate cyclic dependencies between libraries
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Core LLVM classes (show other bugs)
Version: 1.0
Hardware: All All
: P normal
Assignee: Chris Lattner
URL:
Keywords: build-problem
Depends on:
Blocks:
 
Reported: 2006-07-26 13:32 PDT by Chris Lattner
Modified: 2018-11-07 00:17 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2006-07-26 13:32:08 PDT
We want to eliminate cycles in the dependency graph of the LLVM libraries.  llvm-config reports this, 
and Reid has compiled this information.  To get this info, use:

list of which libs/objs depend on which other ones:
GenLibDeps.pl -flat /path/to/Debug/lib > LibDeps.flat

full dependency listing including symbols:
GenLibDeps.pl -why /path/to/Debug/lib | c++filt > LibDeps.whyå

Here are some simple dependencies that can be snipped, this may be out-of-date:

The main cycle is this:
  libLLVMAnalysis.a -> libLLVMCodeGen.a -> libLLVMScalarOpts.a ->
  libLLVMSelectionDAG.a -> libLLVMTarget.a -> libLLVMTransformUtils.a ->
  libLLVMipa.a -> libLLVMAnalysis.a

libLLVMAnalysis.a shouldn't depend on libLLVMCodeGen.a
libLLVMSelectionDAG.a shouldn't depend on libLLVMTransformUtils.a (it uses it for critical edge 
breaking) 
libLLVMTransformUtils.a shouldn't use LLVMipa (it uses/updates call-graph stuff)
libLLVMTarget.a uses libLLVMCodeGen.a for MVT::getVectorType  (codegen should use target, not the 
other way around)

LLVMIA64 uses intrinsic lowering?  It shouldn't.

Maybe snippable:
libLLVMCodeGen uses Analysis only for loopinfo?

TransformUtils shouldn't depend on ScalarOpts.  It currently does to get LowerSelectID, LowerSwitchID, 
PromoteMemoryToRegisterID.  We need to make a pass be able to "update" another pass without having 
a strong dependency on that pass existing.

Thanks to Reid for collecting much of this data.

-Chris
Comment 1 Chris Lattner 2006-08-03 15:59:22 PDT
This is now fixed.  'make' in llvm-config now prints:

llvm[0]: Regenerating LibDeps.txt
llvm[0]: Finding cyclic dependencies between LLVM libraries.
llvm[0]: Building llvm-config script.

-Chris
Comment 2 Reid Spencer 2006-08-03 16:48:16 PDT
Verified on Linux. The makefile check has been re-enabled. It is now verbotten
to create cycles in library dependencies.