llvm2alive: cache agg constants
MODIFY
llvm_util/utils.cpp
llvm_util/utils.cpp
@@ -337,7 +337,7 @@ Value* get_operand(llvm::Value *v,
if (all_of(cnst->op_begin(), cnst->op_end(), [](auto &V) -> bool
{ return isa<llvm::ConstantData>(V); })) {
current_fn->addConstant(move(val));
- return ret;
+ RETURN_CACHE(ret);
} else {
current_fn->addAggregate(move(val));
return copy_inserter(ret);
@@ -353,7 +353,7 @@ Value* get_operand(llvm::Value *v,
auto val = make_unique<AggregateValue>(*ty, move(vals));
auto ret = val.get();
current_fn->addConstant(move(val));
- return ret;
+ RETURN_CACHE(ret);
}
if (auto cnst = dyn_cast<llvm::ConstantAggregateZero>(v)) {

llvm2alive: cache agg constants