Affiliation:
1. Federal University of Minas Gerais, Brazil
Abstract
This paper describes a compiler optimization to eliminates dynamic occurrences of expressions in the format
a
←
a
⊕
b
⊗
c
. The operation ⊕ must admit an identity element
z
, such that
a
⊕
z
=
a
. Also,
z
must be the absorbing element of ⊗, such that
b
⊗
z
=
z
⊗
c
=
z
. Semirings where ⊕ is the additive operator and ⊗ is the multiplicative operator meet this contract. This pattern is common in high-performance benchmarks—its canonical representative being the multiply-add operation
a
←
a
+
b
×
c
. However, several other expressions involving arithmetic and logic operations satisfy the required algebra. We show that the runtime elimination of such assignments can be implemented in a performance-safe way via online profiling. The elimination of dynamic redundancies involving identity and absorbing elements in 35 programs of the LLVM test suite that present semiring patterns brings an average speedup of 1.19x (total optimized time over total unoptimized time) on top of clang -O3. When projected onto the entire test suite (259 programs) the optimization leads to a speedup of 1.025x. Once added onto clang, semiring optimizations approximates it to TACO, a specialized tensor compiler.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference15 articles.
1. Exploiting Data Sparsity for Large-Scale Matrix Computations
2. Characterization of Silent Stores. In PACT. IEEE, Washington;Bell Gordon B.;DC, USA,2000
3. Persistence programming models for non-volatile memory
4. Optimal and Eficient Speculation-Based Partial Redundancy Elimination;Cai Qiong;CGO. IEEE, USA,2003
5. Value Profiling;Calder Brad;MICRO. IEEE, USA,1997
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. TrivialSpy: Identifying Software Triviality via Fine-grained and Dataflow-based Value Profiling;Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis;2023-11-11
2. Cooperative Profile Guided Optimizations;Computer Graphics Forum;2021-11-28
3. Reverse engineering for reduction parallelization via semiring polynomials;Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2021-06-18