Memory::mkCallState: avoid creating lambda for non local mem in the common case
MODIFY
ir/memory.cpp
ir/memory.cpp
@@ -1291,12 +1291,14 @@ Memory::mkCallState(const vector<PtrInput> *ptr_inputs, bool nofree) const {
st.non_local_block_val
= initial_non_local_block_val.subst(blk_val, st.block_val_var);
+ if (!modifies.isTrue()) {
auto idx = p.shortPtr();
st.non_local_block_val
= expr::mkLambda({ idx },
expr::mkIf(modifies, st.non_local_block_val.load(idx),
non_local_block_val.load(idx)));
}
+ }
if (num_nonlocals_src && !nofree) {
expr one = expr::mkUInt(1, num_nonlocals);

Memory::mkCallState: avoid creating lambda for non local mem in the common case