Add aliasing meta data to loads and stores

This commit is contained in:
Magnus Norddahl 2016-10-08 09:29:26 +02:00
commit fc07a25306
22 changed files with 260 additions and 189 deletions

View file

@ -7,6 +7,10 @@ SSAScope::SSAScope(llvm::LLVMContext *context, llvm::Module *module, llvm::IRBui
: _context(context), _module(module), _builder(builder)
{
instance = this;
_constant_scope_domain = llvm::MDNode::get(SSAScope::context(), { llvm::MDString::get(SSAScope::context(), "ConstantScopeDomain") });
_constant_scope = llvm::MDNode::getDistinct(SSAScope::context(), { _constant_scope_domain });
_constant_scope_list = llvm::MDNode::get(SSAScope::context(), { _constant_scope });
}
SSAScope::~SSAScope()
@ -50,6 +54,11 @@ llvm::Value *SSAScope::alloca(llvm::Type *type, SSAInt size)
return alloca_builder.CreateAlloca(type, size.v, hint());
}
llvm::MDNode *SSAScope::constant_scope_list()
{
return instance->_constant_scope_list;
}
const std::string &SSAScope::hint()
{
return instance->_hint;