Question about size optimization and PRE

Hi All,

I have a question about the opportunity of size optimization in clang. As you know, the PRE(partial redundancy elimination) copies partially available instructions to paths in which the instruction is not available. I think it makes code size bigger. I can see the PRE implementation in llvm's GVN pass. However, I can not see the options like '-enable-pre=false' or '-enable-load-pre=fasle' on clang with size optimization. How do you think about disabling PRE with clang's size optimization? If I missed something, please let me know.

Thanks,

JinGu Kang

Hi All,

I have a question about the opportunity of size optimization in clang.
As you know, the PRE(partial redundancy elimination) copies partially
available instructions to paths in which the instruction is not
available. I think it makes code size bigger. I can see the PRE
implementation in llvm's GVN pass. However, I can not see the options
like '-enable-pre=false' or '-enable-load-pre=fasle' on clang with
size optimization. How do you think about disabling PRE with clang's
size optimization? If I missed something, please let me know.

The right way to do this would be to have the pass itself check
F->optForSize() (or F->optForMinSize(), as the case may be). Clang
itself should essentially never set pass command-line options for anything.

-Hal

Thanks for the helpful comment Hal.

Do you agree the PRE makes code size bigger?

JinGu Kang