[LLVMdev] Can simplifycfg kill llvm.lifetime intrinsics?
kparzysz at codeaurora.org
Wed Dec 26 12:28:51 PST 2012
On 12/25/2012 1:31 PM, Alexey Samsonov wrote:
> Ok, suppose you have the following code:
> store to %a
> br %BB2
> <some code>
> br %BB1
> If you remove the first "llvm.lifetime.start", then when you enter
> %BB1 for the second time, your "store to %a" can be considered invalid,
> as you've already called llvm.lifetime.end for this variable.
The llvm.lifetime.end(%a) in your example is invalid, according to the
"This intrinsic indicates that after this point in the code, the value
of the memory pointed to by ptr is dead. This means that it is known to
never be used and has an undefined value. Any stores into the memory
object following this intrinsic may be removed as dead."
If you can re-enter the block with a still-defined value of %a, then
it's not "known to never be used".
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-dev