When converting ONNX to TRT, can trtexec load real data for optimization?

I am currently converting an ONNX model to a TRT model. Due to the presence of conditional structures in the network and custom plugins, the input data affects the computational load of the model. When trtexec converts the model, does it optimize based on random data? Would providing real input data lead to better optimization? The .bin file loaded with --loadInputs seems to be used only for inference testing after generating the TRT model.