Does opt introduce extra dependencies?

Hi,

We use Clang to emit llvm bytecode, opt to optimise them using a number of size-reducing passes and Clang again to compile optimised bytecode to objects, for 80 out of 400 source files in our project.

We notice that for these 80 files, generated objects are much smaller than their counterparts that compiled directly using Clang with -Oz.

However, after linking these files with the remaining compiled directly with Clang, the final .so file is even slightly larger than the original. We did not change the linking command and library flags also remained unchanged.

Could you please help us look into this problem?