Granlund and Montgomery proposed an optimization method for unsigned integer division by constants [3]. Their method (called the GM method in this paper) was further improved in part by works such as [1] and [7], and is now adopted by major compilers including GCC, Clang, Microsoft Compiler, and Apple Clang. However, for example, for x/7, the generated code is designed for 32-bit CPUs and therefore does not fully exploit 64-bit capabilities. This paper proposes an optimization method for 32-bit unsigned division by constants targeting 64-bit CPUs. We implemented patches for LLVM/GCC and achieved speedups of 1.67x on Intel Xeon w9-3495X (Sapphire Rapids) and 1.98x on Apple M4 (Apple M-series SoC) in the microbenchmark described later. The LLVM patch has already been merged into llvm:main [6], demonstrating the practical applicability of the proposed method.


翻译:Granlund和Montgomery提出了一种针对无符号整数常量除法的优化方法[3]。该方法(本文称之为GM方法)经由[1]和[7]等工作的部分改进,现已被GCC、Clang、Microsoft Compiler及Apple Clang等主流编译器所采用。然而,以x/7为例,生成的代码仍针对32位CPU设计,未能充分利用64位能力。本文提出一种面向64位CPU的32位无符号常量除法优化方法。我们为LLVM/GCC实现了补丁,并在后续微基准测试中,于Intel Xeon w9-3495X(Sapphire Rapids)上实现了1.67倍加速,在Apple M4(Apple M系列SoC)上实现了1.98倍加速。该LLVM补丁已合并至llvm:main[6],证明了所提出方法的实际应用价值。

0
下载
关闭预览

相关内容

【阿姆斯特丹博士论文】带约束学习的优化算法
专知会员服务
21+阅读 · 2025年4月4日
【ICML 2024】零阶优化器微调大模型,大幅降低内存
专知会员服务
32+阅读 · 2024年7月8日
《通信和导航中的优化算法设计》美国空军研究实验室
专知会员服务
41+阅读 · 2022年8月19日
机器学习组合优化
专知会员服务
112+阅读 · 2021年2月16日
英伟达Faster Transformer:作者带你揭秘BERT优化
机器之心
14+阅读 · 2019年9月18日
从动力学角度看优化算法:GAN的第三个阶段
PaperWeekly
11+阅读 · 2019年5月13日
机器学习中的最优化算法总结
人工智能前沿讲习班
22+阅读 · 2019年3月22日
干货|掌握机器学习数学基础之优化[1](重点知识)
机器学习研究会
10+阅读 · 2017年11月19日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
军事域更好使用人工智能的实用指南
专知会员服务
6+阅读 · 10月22日
《衡量语言模型中的作战规划能力》
专知会员服务
11+阅读 · 10月20日
Maven智能系统:帕兰提尔军事人工智能平台详解
专知会员服务
14+阅读 · 10月20日
《测试自动化框架在敏捷软件开发中的角色》
专知会员服务
8+阅读 · 10月20日
俄罗斯如何拦截乌克兰无人机与巡航导弹
专知会员服务
12+阅读 · 10月15日
《武器-目标分配问题:精确与近似求解算法》
专知会员服务
16+阅读 · 10月15日
现代电磁战:集成式系统簇时代如何实现频谱优势
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员