Open BoogerWooger opened 1 year ago
we also had a similar issue in that the MLIR to LLVM toolchain outputs mallocs with constexpr operands
they look like
%15 = call ptr @malloc(i64 add (i64 ptrtoint (ptr getelementptr (i32, ptr null, i32 10) to i64), i64 16))
and try to calculate the size of the allocation by gep offset to null.
ATM this has 2 blockers:
find_offset
calls fail. case llvm::Instruction::Add: {
if ((expr->getOperand(0)->getType()->isIntegerTy() && expr->getOperand(1)->getType()->isIntegerTy()) ||
(expr->getOperand(0)->getType()->isFieldTy() && expr->getOperand(1)->getType()->isFieldTy())) {
typename BlueprintFieldType::value_type lhs =
var_value(assignments[currProverIdx], frame.scalars[expr->getOperand(0)]);
typename BlueprintFieldType::value_type rhs =
var_value(assignments[currProverIdx], frame.scalars[expr->getOperand(1)]);
frame.scalars[c] = put_into_assignment(lhs + rhs, next_prover);
} else {
UNREACHABLE("Unhandled constant addition types");
}
break;
}
in case like:
example: memory.cpp.zip
error in assigner(backtrace):