search for: add_two_globals

Displaying 2 results from an estimated 2 matches for "add_two_globals".

2015 Nov 03
3
[RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
...u're trying to measure. Common alternate approaches are to use a volatile store (so that it can't be eliminated or sunk out of loops) or a call to an external function with a cheap calling convention. As an example: int a = 5; // initialization is not visible to compiler int b = 7; void add_two_globals() sink(a+b) } If what I'm look into is the code generation around addition, this is a very useful way of testing the entire compiler - frontend, middle end, and backend. I'll note that we use such a framework extensively. What I'm not clear on is why this needs to be an intrinsi...
2015 Nov 03
3
[RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
On Mon, Nov 2, 2015 at 7:19 PM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote: > Why does this need to be an intrinsic (as opposed to generic "unknown > function" to llvm)? > > Secondly, have you looked into a volatile store / load to an alloca? That > should work with PNaCl and WebAssembly. > > E.g. > > define i32 @blackbox(i32 %arg) { >