鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

选项 -fipa-struct-sfc,-fipa-struct-sfc-bitfield,-fipa-struct-sfc-shadow

说明

  • -fipa-struct-sfc: 使能结构体静态成员压缩优化,在编译期检查结构体成员存储数据的最大值,对成员的数据类型进行压缩,减小结构体大小
  • -fipa-struct-sfc-bitfield: 结构体静态成员压缩优化子选项,开启后可进一步将优化目标成员压缩成位域
图1 结构体静态成员压缩示意图
  • -fipa-struct-sfc-shadow: 结构体静态成员压缩优化子选项,开启后使能静态成员隐藏优化,检查结构体中相同类型的成员的值是否始终相同,隐藏重复成员

使用方法

在编译选项中加入:

-O3 -flto -flto-partition=one -fipa-struct-reorg=2 -fipa-struct-sfc -fipa-struct-sfc-bitfield -fipa-struct-sfc-shadow

-fipa-struct-sfc 选项需要在开启 -O3 -flto -flto-partition=one 以及 -fipa-struct-reorg 等级大于 2(或使用 -fipa-reorder-fields) 的基础上才能使能。

-fipa-struct-sfc-bitfield, -fipa-struct-sfc-shadow 选项需要在开启 -fipa-struct-sfc 的基础上才能使能。