Displaying 1 result from an estimated 1 matches for "llvm_lifetime_end".
2016 Feb 29
2
Jit: use @llvm.lifetime.end to optimize away stores to globals used as temporaries
...tion 'f'.
After the function has finished to value can be discarded.
How can I tell the optimizer to optimize away to stores to the 'tmp' variable?
Can I use the @llvm.lifetime.end intrinsic to do this?
Eg If I change the function 'f' as follows:
extern "C" void llvm_lifetime_end(unsigned long long, void*);
void cleanup(State* s)
{
// llvm_lifetime_end will be replaced with @llvm.lifetime.end
llvm_lifetime_end(sizeof(s->tmp), (void*)&s->tmp);
}
void f(State* s)
{
f0(s);
f1(s);
cleanup(s);
}
And then use a pass to replace the function llvm_lifetime_end...