Skip to main content

2015 | OriginalPaper | Buchkapitel

Detection of Redundant Expressions: A Complete and Polynomial-Time Algorithm in SSA

verfasst von : Rekha R. Pai

Erschienen in: Programming Languages and Systems

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Detection of redundant expressions in a program based on values is a well researched problem done with a view to eliminate the redundancies so as to improve the run-time efficiency of the program. The problem entails the detection of equivalent expressions in a program. Here we present an iterative data-flow analysis algorithm to detect equivalent expressions in SSA for the purpose of detection of redundancies. The central challenge in this static analysis is to define a “join” operation to detect all equivalences at a join point such that any later occurrences of redundant expressions are detected in polynomial time. We achieve this by introducing the notion of value \(\phi \) -function. We claim the algorithm is complete and takes only polynomial time. We implemented the algorithm in LLVM and demonstrated its performance.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Anhänge
Nur mit Berechtigung zugänglich
Fußnoten
1
A copy statement is an assignment statement of the form \(x = y\), where y is a variable.
 
2
In the literature, a \(\phi \)-function restricts its operands to different subscripted versions of the same non-SSA variable, say \(\phi (x_{1}, x_{2})\).
 
3
Point p in a CFG dominates point \(p^{\prime }\) if all paths from entry point to \(p^{\prime }\) go through p.
 
4
Merge of expressions can be viewed as an extended notion of merge of variables. “Merge of expressions” \(e_{i1}+e_{i2}\) and \(e_{j1}+e_{j2}\) is the expression \(e_{i}+e_{j}\) such that \(e_{i}\) is the merge of \(e_{i1}\) and \(e_{j1}\). Similarly, \(e_{j}\) is the merge of \(e_{i2}\) and \(e_{j2}\).
 
5
Since \(x_{3}\) is a merge of variables \(x_{1}\) and \(x_{2}\), expression \(x_{3}+1\) is a merge of \(x_{1}+1\) and \(x_{2}+1\).
 
6
Transfer function for a block is the composition of transfer function of each statement in the block [1].
 
Literatur
1.
Zurück zum Zitat Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison Wesley, Boston (2006) Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison Wesley, Boston (2006)
2.
Zurück zum Zitat Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1988, pp. 1–11. ACM, New York (1988) Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1988, pp. 1–11. ACM, New York (1988)
3.
Zurück zum Zitat Briggs, P., Cooper, K., Simpson, L.: Value numbering. Software: Practice and Experience 27(6), 701–724 (1997) Briggs, P., Cooper, K., Simpson, L.: Value numbering. Software: Practice and Experience 27(6), 701–724 (1997)
4.
Zurück zum Zitat Gulwani, S., Necula, G.C.: A polynomial-time algorithm for global value numbering. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 212–227. Springer, Heidelberg (2004) CrossRef Gulwani, S., Necula, G.C.: A polynomial-time algorithm for global value numbering. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 212–227. Springer, Heidelberg (2004) CrossRef
5.
Zurück zum Zitat Kildall, G.A.: A unified approach to global program optimization. In: Proceedings of the 1st Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1973, pp. 194–206. ACM, New York (1973) Kildall, G.A.: A unified approach to global program optimization. In: Proceedings of the 1st Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL 1973, pp. 194–206. ACM, New York (1973)
6.
Zurück zum Zitat Nie, J.-T., Cheng, X.: An efficient SSA-based algorithm for complete global value numbering. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 319–334. Springer, Heidelberg (2007) CrossRef Nie, J.-T., Cheng, X.: An efficient SSA-based algorithm for complete global value numbering. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 319–334. Springer, Heidelberg (2007) CrossRef
7.
Zurück zum Zitat Odaira, R., Hiraki, K.: Partial value number redundancy elimination. In: Eigenmann, R., Li, Z., Midkiff, S.P. (eds.) LCPC 2004. LNCS, vol. 3602, pp. 409–423. Springer, Heidelberg (2005) CrossRef Odaira, R., Hiraki, K.: Partial value number redundancy elimination. In: Eigenmann, R., Li, Z., Midkiff, S.P. (eds.) LCPC 2004. LNCS, vol. 3602, pp. 409–423. Springer, Heidelberg (2005) CrossRef
8.
Zurück zum Zitat Rüthing, O., Knoop, J., Steffen, B.: Detecting equalities of variables: combining efficiency with precision. In: Cortesi, A., Filé, G. (eds.) SAS 1999. LNCS, vol. 1694, pp. 232–247. Springer, Heidelberg (1999) CrossRef Rüthing, O., Knoop, J., Steffen, B.: Detecting equalities of variables: combining efficiency with precision. In: Cortesi, A., Filé, G. (eds.) SAS 1999. LNCS, vol. 1694, pp. 232–247. Springer, Heidelberg (1999) CrossRef
9.
Zurück zum Zitat Saleena, N., Paleri, V.: Global value numbering for redundancy detection: a simple and efficient algorithm. In: Proceedings of the 29th Annual ACM Symposium on Applied Computing, SAC 2014, pp. 1609–1611. ACM, New York (2014) Saleena, N., Paleri, V.: Global value numbering for redundancy detection: a simple and efficient algorithm. In: Proceedings of the 29th Annual ACM Symposium on Applied Computing, SAC 2014, pp. 1609–1611. ACM, New York (2014)
10.
Zurück zum Zitat Simpson, L.T.: Value-driven redundancy elimination. Ph.D. thesis, Rice University, Houston, TX, USA (1996) Simpson, L.T.: Value-driven redundancy elimination. Ph.D. thesis, Rice University, Houston, TX, USA (1996)
11.
Zurück zum Zitat VanDrunen, T., Hosking, A.L.: Value-based partial redundancy elimination. In: Duesterwald, E. (ed.) CC 2004. LNCS, vol. 2985, pp. 167–184. Springer, Heidelberg (2004) CrossRef VanDrunen, T., Hosking, A.L.: Value-based partial redundancy elimination. In: Duesterwald, E. (ed.) CC 2004. LNCS, vol. 2985, pp. 167–184. Springer, Heidelberg (2004) CrossRef
Metadaten
Titel
Detection of Redundant Expressions: A Complete and Polynomial-Time Algorithm in SSA
verfasst von
Rekha R. Pai
Copyright-Jahr
2015
DOI
https://doi.org/10.1007/978-3-319-26529-2_4