This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Let lifetime intrinsic use alloca address space
ClosedPublic

Authored by yaxunl on Apr 5 2017, 10:46 AM.

Details

Summary

Currently the pointer argument of lifetime intrinsics is still in address space 0. When the alloca address is not 0, there is invalid bitcast instruction.

This patch changes pointer argument of lifetime intrinsics to point to alloca address space.

Diff Detail

Event Timeline

yaxunl created this revision.Apr 5 2017, 10:46 AM
arsenm edited edge metadata.Apr 5 2017, 10:54 AM

I already have D31043 which can be committed independently of the alloca change

I already have D31043 which can be committed independently of the alloca change

I did not know you already have a patch. Can you add reviewers to it?

The only difference is that I added AllocaInt8PtrTy to CodeGenModule and a lit test for non-zero alloca addr space.

I can rebase my patch on top of yours. Or I can drop this patch and add the lit test to your patch.

I had the part for non-0 alloca too, but not sure if I posted it. It's in my GitHub branch

I had the part for non-0 alloca too, but not sure if I posted it. It's in my GitHub branch

For that one we'd better stick to https://reviews.llvm.org/D31404 since the review is almost done. I will acknowledge your contribution and others in the commit message.

yaxunl updated this revision to Diff 94980.Apr 12 2017, 9:02 AM
yaxunl retitled this revision from CodeGen: Emit lifetime intrinsics with pointer argument in alloca address space to CodeGen: Let lifetime intrinsic use alloca address space.
yaxunl edited the summary of this revision. (Show Details)

Rebased.

arsenm accepted this revision.Apr 13 2017, 11:31 AM

LGTM

test/CodeGenOpenCL/lifetime.cl
14 ↗(On Diff #94980)

Check line for the end as well?

This revision is now accepted and ready to land.Apr 13 2017, 11:31 AM
rjmccall accepted this revision.Apr 17 2017, 8:32 AM

LGTM.

This revision was automatically updated to reflect the committed changes.