Mark suspend as RuntimeInfo.
Change-Id: Ib474032c0d7817cd5aff2e84b00ef2f82573cbac
diff --git a/src/compiler_llvm/ir_builder.h b/src/compiler_llvm/ir_builder.h
index 93a7f19..a700c69 100644
--- a/src/compiler_llvm/ir_builder.h
+++ b/src/compiler_llvm/ir_builder.h
@@ -105,6 +105,10 @@
StoreToObjectOffset(object_addr, offset, new_value, tbaa_.GetSpecialType(special_ty));
}
+ void SetTBAACall(llvm::CallInst* call_inst, TBAASpecialType special_ty) {
+ call_inst->setMetadata(llvm::LLVMContext::MD_tbaa, tbaa_.GetSpecialType(special_ty));
+ }
+
//--------------------------------------------------------------------------
// Pointer Arithmetic Helper Function
diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc
index f4343fc..f7b9f07 100644
--- a/src/compiler_llvm/runtime_support_builder.cc
+++ b/src/compiler_llvm/runtime_support_builder.cc
@@ -156,7 +156,7 @@
Value* suspend_count = irb_.LoadFromObjectOffset(thread,
Thread::SuspendCountOffset().Int32Value(),
irb_.getJIntTy(),
- kTBAAJRuntime);
+ kTBAARuntimeInfo);
Value* is_suspend = irb_.CreateICmpNE(suspend_count, irb_.getJInt(0));
BasicBlock* basic_block_suspend = BasicBlock::Create(context_, "suspend", func);
@@ -164,7 +164,8 @@
irb_.CreateCondBr(is_suspend, basic_block_suspend, basic_block_else);
irb_.SetInsertPoint(basic_block_suspend);
- irb_.CreateCall(slow_func, thread);
+ CallInst* call_inst = irb_.CreateCall(slow_func, thread);
+ irb_.SetTBAACall(call_inst, kTBAARuntimeInfo);
irb_.CreateBr(basic_block_else);
irb_.SetInsertPoint(basic_block_else);