1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Handle block splitting in tuple match

This commit is contained in:
Brian Fiete 2021-11-15 16:44:28 -08:00
parent f58362343b
commit c107a33268
4 changed files with 84 additions and 71 deletions

View file

@ -2519,6 +2519,8 @@ void BfIRCodeGen::HandleNextCmd()
case BfIRCmd_SetInsertPoint:
{
CMD_PARAM(llvm::BasicBlock*, block);
if (mLockedBlocks.Contains(block))
Fail("Attempt to modify locked block");
mIRBuilder->SetInsertPoint(block);
}
break;
@ -3861,6 +3863,8 @@ void BfIRCodeGen::HandleNextCmd()
if (!useAsm)
{
mLockedBlocks.Add(irBuilder->GetInsertBlock());
// This is generates slower code than the inline asm in debug mode, but can optimize well in release
auto int8Ty = llvm::Type::getInt8Ty(*mLLVMContext);
auto int8Ptr = irBuilder->CreateBitCast(val, int8Ty->getPointerTo());