Skip to content
Commit 72acd042 authored by Junfeng Dong's avatar Junfeng Dong Committed by Hongtao Yu
Browse files

Pass split-machine-functions to code generator when flto is used

-fsplit-machine-functions is an optimization in codegen phase. when -flto is use, clang generate IR bitcode in .o files, and linker will call into these codegen optimization passes. Current clang driver doesn't pass this option to linker when both -fsplit-machine-functions and -flto are used, so the optimization is silently ignored.  My fix generates linker option -plugin-opt=-split-machine-functions for this case. It allows the linker to pass "split-machine-functions" to code generator to turn on that optimization.  It works for both gold and lld.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D121969
parent 3ea6727e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment