This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Relocate instructions that maybe spilled after coro.begin
ClosedPublic

Authored by GorNishanov on May 24 2017, 5:21 PM.

Details

Summary

Frontend generates store instructions after allocas, for example:

define i8* @f(i64 %this) "coroutine.presplit"="1" personality i32 0 {
entry:
  %this.addr = alloca i64
  store i64 %this, i64* %this.addr
  ..
  %hdl = call i8* @llvm.coro.begin(token %id, i8* %alloc)

Such instructions may require spilling into coro.frame, but, coro-frame address is only available after coro.begin and thus needs to be moved after coro.begin.
The only instructions that should not be moved are the arguments of coro.begin and all of their operands.

Diff Detail

Repository
rL LLVM

Event Timeline

GorNishanov created this revision.May 24 2017, 5:21 PM
GorNishanov accepted this revision.May 24 2017, 5:21 PM
This revision is now accepted and ready to land.May 24 2017, 5:21 PM
This revision was automatically updated to reflect the committed changes.