This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines] Use `Value::stripPointerCasts` to collect lifetime marker of `alloca` in CoroFrame
ClosedPublic

Authored by ChuanqiXu on Aug 5 2020, 12:16 AM.

Details

Summary

In CoroFrame, we collect lifetime marker of an alloca by collect the user of BitCast who is the user of the alloca. However, either the alloca itself could be used with the lifetime marker or the BitCast of the alloca could be transformed to other instructions. (e.g., it may be transformed to all zero reps in InstCombine pass). This patch tries to fix these two little bugs.

TestPlan: cppcoro, check-llvm

Diff Detail

Event Timeline

ChuanqiXu created this revision.Aug 5 2020, 12:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 5 2020, 12:16 AM
ChuanqiXu requested review of this revision.Aug 5 2020, 12:16 AM
ChuanqiXu abandoned this revision.Aug 5 2020, 12:22 AM
ChuanqiXu updated this revision to Diff 283143.Aug 5 2020, 12:34 AM

Due to my mistake, the diff updated before is a draft. It is terribly sorry if it confuses any one...

LGTM,Thank you, Please merge the testcases into one file.

ChuanqiXu updated this revision to Diff 283472.Aug 5 2020, 7:09 PM

Create BitCastInst directly instead of using IRBuilder

LGTM,Thank you, Please merge the testcases into one file.

It seems a little hard to merge the test cases into one file due to the order of function emitted by NewPassManager and LegacyPassManager is reverse. Although CHECK-DAG could match the string that don’t occur in a strictly sequential order, the string need to be checked in there test cases is dependent. Maybe there are some methods to merge the test cases, but I can't find these methods directly.

ChuanqiXu edited the summary of this revision. (Show Details)Aug 5 2020, 7:24 PM
junparser accepted this revision.Aug 5 2020, 7:59 PM
This revision is now accepted and ready to land.Aug 5 2020, 7:59 PM
ChuanqiXu closed this revision.Aug 5 2020, 11:56 PM