Skip to main content
Top
Published in:
Cover of the book

2015 | OriginalPaper | Chapter

Automatic Inference of Loop Complexity Through Polynomial Interpolation

Authors : Francisco Demontiê, Junio Cezar, Mariza Bigonha, Frederico Campos, Fernando Magno Quintão Pereira

Published in: Programming Languages

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Complexity analysis is an important activity for software engineers. Such an analysis can be specially useful in the identification of performance bugs. Although the research community has made significant progress in this field, existing techniques still show limitations. Purely static methods may be imprecise due to their inability to capture the dynamic behaviour of programs. On the other hand, dynamic approaches usually need user intervention and/or are not effective to relate complexity bounds with the symbols in the program code. In this paper, we present a hybrid technique that solves these shortcomings. Our technique uses a numeric method based on polynomial interpolation to precisely determine a complexity function for loops. Statically, we determine: (i) the inputs of a loop, i.e., the variables that control its iterations; and (ii) an algebraic equation relating the loops within a function. We then instrument the program to plot a curve relating inputs and number of operations executed. By running the program over different inputs, we generate sufficient points for our interpolator. In the end, the complexity function for each loop is combined using an algebra of our own craft. We have implemented our technique in the LLVM compiler, being able to analyse 99.7 % of all loops available in the Polybench benchmark suite, and most of the loops in Rodinia. These results indicate that our technique is an effective and useful way to find the complexity of loops in high-performance applications.

Dont have a licence yet? Then find out more about our products and how to get one now:

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!

Literature
1.
go back to reference Alves, P.R.O., Rodrigues, R.E., de Souza, R.M., Pereira, F.M.Q.: A case for a fast trip count predictor. Inf. Process. Lett. 115(2), 146–150 (2015)MathSciNetCrossRef Alves, P.R.O., Rodrigues, R.E., de Souza, R.M., Pereira, F.M.Q.: A case for a fast trip count predictor. Inf. Process. Lett. 115(2), 146–150 (2015)MathSciNetCrossRef
2.
go back to reference Appel, A.W., Palsberg, J.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)CrossRef Appel, A.W., Palsberg, J.: Modern Compiler Implementation in Java, 2nd edn. Cambridge University Press, Cambridge (2002)CrossRef
3.
go back to reference Che, S., Boyer, M., Meng, J., Tarjan, D., Sheaffer, J.W., Lee, S.-H., Skadron, K.: Rodinia: a benchmark suite for heterogeneous computing. In: IISWC, pp. 44–54. IEEE (2009) Che, S., Boyer, M., Meng, J., Tarjan, D., Sheaffer, J.W., Lee, S.-H., Skadron, K.: Rodinia: a benchmark suite for heterogeneous computing. In: IISWC, pp. 44–54. IEEE (2009)
4.
go back to reference Coppa, E., Demetrescu, C., Finocchi, I.: Input-sensitive profiling. In: PLDI. ACM (2012) Coppa, E., Demetrescu, C., Finocchi, I.: Input-sensitive profiling. In: PLDI. ACM (2012)
5.
go back to reference Danielsson, N.A.: Lightweight semiformal time complexity analysis for purely functional data structures. In: POPL, pp. 133–144. ACM (2008) Danielsson, N.A.: Lightweight semiformal time complexity analysis for purely functional data structures. In: POPL, pp. 133–144. ACM (2008)
6.
go back to reference Debray, S.K., Lin, N.-W.: Cost analysis of logic programs. ACM Trans. Program. Lang. Syst. 15(5), 826–875 (1993)CrossRef Debray, S.K., Lin, N.-W.: Cost analysis of logic programs. ACM Trans. Program. Lang. Syst. 15(5), 826–875 (1993)CrossRef
8.
go back to reference Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. TOPLAS 9(3), 319–349 (1987)CrossRefMATH Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. TOPLAS 9(3), 319–349 (1987)CrossRefMATH
9.
go back to reference Goldsmith, S.F., Aiken, A.S., Wilkerson, D.S.: Measuring empirical computational complexity. In: FSE, pp. 395–404. ACM (2007) Goldsmith, S.F., Aiken, A.S., Wilkerson, D.S.: Measuring empirical computational complexity. In: FSE, pp. 395–404. ACM (2007)
10.
go back to reference Graham, S.L., Kessler, P.B., McKusick, M.K.: gprof: a call graph execution profiler (with retrospective). In: Best of PLDI, pp. 49–57 (1982) Graham, S.L., Kessler, P.B., McKusick, M.K.: gprof: a call graph execution profiler (with retrospective). In: Best of PLDI, pp. 49–57 (1982)
11.
go back to reference Gulavani, B.S., Gulwani, S.: A numerical abstract domain based on expression abstraction and max operator with application in timing analysis. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 370–384. Springer, Heidelberg (2008) CrossRef Gulavani, B.S., Gulwani, S.: A numerical abstract domain based on expression abstraction and max operator with application in timing analysis. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 370–384. Springer, Heidelberg (2008) CrossRef
12.
go back to reference Gulwani, S., Jain, S., Koskinen, E.: Control-flow refinement and progress invariants for bound analysis. In: PLDI, pp. 375–385. ACM (2009) Gulwani, S., Jain, S., Koskinen, E.: Control-flow refinement and progress invariants for bound analysis. In: PLDI, pp. 375–385. ACM (2009)
13.
go back to reference Gulwani, S., Mehra, K.K., Chilimbi, T.: SPEED: precise and efficient static estimation of program computational complexity. In: POPL, pp. 127–139. ACM (2009) Gulwani, S., Mehra, K.K., Chilimbi, T.: SPEED: precise and efficient static estimation of program computational complexity. In: POPL, pp. 127–139. ACM (2009)
14.
go back to reference Lattner, C., Adve, V.S.: LLVM: a compilation framework for lifelong program analysis & transformation. In: CGO, pp. 75–88. IEEE (2004) Lattner, C., Adve, V.S.: LLVM: a compilation framework for lifelong program analysis & transformation. In: CGO, pp. 75–88. IEEE (2004)
15.
go back to reference Le Métayer, D.: Ace: an automatic complexity evaluator. ACM Trans. Program. Lang. Syst. 10(2), 248–266 (1988)CrossRef Le Métayer, D.: Ace: an automatic complexity evaluator. ACM Trans. Program. Lang. Syst. 10(2), 248–266 (1988)CrossRef
16.
go back to reference Monniaux, D., Gonnord, L.: Using bounded model checking to focus fixpoint iterations. In: Yahav, E. (ed.) Static Analysis. LNCS, vol. 6887, pp. 369–385. Springer, Heidelberg (2011) CrossRef Monniaux, D., Gonnord, L.: Using bounded model checking to focus fixpoint iterations. In: Yahav, E. (ed.) Static Analysis. LNCS, vol. 6887, pp. 369–385. Springer, Heidelberg (2011) CrossRef
17.
go back to reference Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. In: PLDI, pp. 89–100. ACM (2007) Nethercote, N., Seward, J.: Valgrind: a framework for heavyweight dynamic binary instrumentation. In: PLDI, pp. 89–100. ACM (2007)
18.
go back to reference Piccoli, G., Santos, H., Rodrigues, R., Pousa, C., Borin, E., Pereira, F.M.Q.: Compiler support for selective page migration in NUMA architectures. In: PACT, pp. 369–380. ACM (2014) Piccoli, G., Santos, H., Rodrigues, R., Pousa, C., Borin, E., Pereira, F.M.Q.: Compiler support for selective page migration in NUMA architectures. In: PACT, pp. 369–380. ACM (2014)
21.
go back to reference Wolfe, M.: High Performance Compilers for Parallel Computing, 1st edn. Adison-Wesley, Redwood City (1996)MATH Wolfe, M.: High Performance Compilers for Parallel Computing, 1st edn. Adison-Wesley, Redwood City (1996)MATH
22.
go back to reference Zaparanuks, D., Hauswirth, M.: Algorithmic profiling. In: PLDI, pp. 67–76. ACM (2012) Zaparanuks, D., Hauswirth, M.: Algorithmic profiling. In: PLDI, pp. 67–76. ACM (2012)
Metadata
Title
Automatic Inference of Loop Complexity Through Polynomial Interpolation
Authors
Francisco Demontiê
Junio Cezar
Mariza Bigonha
Frederico Campos
Fernando Magno Quintão Pereira
Copyright Year
2015
DOI
https://doi.org/10.1007/978-3-319-24012-1_1

Premium Partner