go-llvm / llgo

LLVM-based compiler for Go
Other
1.25k stars 81 forks source link

Apply globaldce at -O0 to remove references (via descriptor) to dead fun... #213

Closed pcc closed 9 years ago

pcc commented 9 years ago

...ctions

This fixes the libgo build at -O0. This also seems generally useful for compatibility with other compilers.

axw commented 9 years ago

Is there a reason not to enable it all the time? GCC says DCE is enabled at levels 0+; not sure about Clang/LLVM.

pcc commented 9 years ago

We already get DCE from the pass manager builder at -O1 and higher. The issue here is that the builder does not add the pass at -O0 so we need to add it ourselves.

axw commented 9 years ago

Okay, thanks. LGTM.