Page MenuHomePhabricator

[Clang][Coroutines] Implement P2014R0 Option 1 behind -fcoroutines-aligned-alloc
Needs ReviewPublic

Authored by ychen on May 9 2021, 8:34 PM.

Details

Summary

Default off.

The allocation/deallocation function overload resolutions are following
the Issue #4 of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2014r0.pdf.

Diff Detail

Unit TestsFailed

TimeTest
80 msx64 debian > LLVM.Transforms/Coroutines::coro-frame-overalign.ll
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Coroutines/coro-frame-overalign.ll -passes=coro-split -S | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Transforms/Coroutines/coro-frame-overalign.ll
90 msx64 windows > LLVM.Transforms/Coroutines::coro-frame-overalign.ll
Script: -- : 'RUN: at line 3'; c:\ws\w16c2-3\llvm-project\premerge-checks\build\bin\opt.exe < C:\ws\w16c2-3\llvm-project\premerge-checks\llvm\test\Transforms\Coroutines\coro-frame-overalign.ll -passes=coro-split -S | c:\ws\w16c2-3\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16c2-3\llvm-project\premerge-checks\llvm\test\Transforms\Coroutines\coro-frame-overalign.ll

Event Timeline

ychen created this revision.May 9 2021, 8:34 PM
ychen requested review of this revision.May 9 2021, 8:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2021, 8:34 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Since D97915 would fix the problem that the variables in the frame may not be aligned, I think this option fcoroutines-aligned-alloc won't affect normal programmers other than language lawyers. Do you think so?

ychen added a comment.EditedMay 10 2021, 8:28 AM

Since D97915 would fix the problem that the variables in the frame may not be aligned, I think this option fcoroutines-aligned-alloc won't affect normal programmers other than language lawyers. Do you think so?

I think that's right that if all a user want is alignment, then fcoroutines-aligned-alloc may not be necessary. However if they define customed aligned allocators/dealllocators, this is needed to make it work.

Since D97915 would fix the problem that the variables in the frame may not be aligned, I think this option fcoroutines-aligned-alloc won't affect normal programmers other than language lawyers. Do you think so?

I think that's right that if all a user want is alignment, then fcoroutines-aligned-alloc may not be necessary. However if they define customed aligned allocators/dealllocators, this is needed to make it work.

I see. The overall idea looks good. I would try to look into the details.

ychen updated this revision to Diff 344609.May 11 2021, 5:25 PM
  • rebase