search for: powerfunc5

Displaying 1 result from an estimated 1 matches for "powerfunc5".

Did you mean: powerfunc
2007 Nov 21
1
[LLVMdev] program specialization vs LTO in LLVM
...int n ) { if n is 0 return 1 if n is even return square( powerFunc( x, 0.5*n ) ) if n is odd return x * powerFunc( x, n - 1 ) } If we know what the exponent (say n = 5) is at compile time, program can be optimized via specialization (partial evaluation) to get: int powerFunc5( int x ) { return x * square( square( x ) ); } My question is whether LLVM framework can perform these types of transformations at runtime so that the function can be optimized at runtime based on the program's input as opposed to at compile time via specialization. If yes, what are the...