[llvm-dev] Well-formed @llvm.lifetime.start and @llvm.lifetime.end intrinsics

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 30 15:45:12 PDT 2017


2017-03-31 0:19 GMT+02:00 Daniel Berlin <dberlin at dberlin.org>:
>> I modified Polly's code generator to produce
>>
>>     if (c) {
>>       llvm.lifetime.start(&var)
>>     } else {
>>       llvm.lifetime.start(&var)
>>     }
>>     [...]
>>     llvm.lifetime.end(&var)
>>
>> and it does not miscompile anymore. However, Polly is currently is not
>> able to compute the lifetime in the general case.
>
>
> Of course, nothing is.
> But they are also metadata, so you could just drop them if you wanted.

This is actually exactly what Polly did, but only in the optimized
side of the loop versioning. The original code version is not touched,
which keeps the llvm.lifetime.start in it.

So of the bug is on Polly's side, I would "fix" it by deleting all
lifetime markers also in the original code.

Michael


More information about the llvm-dev mailing list