| 659 | } |
| 660 | |
| 661 | llvm::AllocaInst* LlvmCodeGen::CreateEntryBlockAlloca( |
| 662 | llvm::Function* f, const NamedVariable& var) { |
| 663 | llvm::IRBuilder<> tmp(&f->getEntryBlock(), f->getEntryBlock().begin()); |
| 664 | llvm::AllocaInst* alloca = tmp.CreateAlloca(var.type, NULL, var.name.c_str()); |
| 665 | if (var.type == GetNamedType(CodegenAnyVal::LLVM_DECIMALVAL_NAME)) { |
| 666 | // Generated functions may manipulate DecimalVal arguments via SIMD instructions such |
| 667 | // as 'movaps' that require 16-byte memory alignment. LLVM uses 8-byte alignment by |
| 668 | // default, so explicitly set the alignment for DecimalVals. |
| 669 | alloca->setAlignment(16); |
| 670 | } |
| 671 | return alloca; |
| 672 | } |
| 673 | |
| 674 | llvm::AllocaInst* LlvmCodeGen::CreateEntryBlockAlloca( |
| 675 | const LlvmBuilder& builder, llvm::Type* type, const char* name) { |
no test coverage detected