The add/sub with constant folding does not provide substantial gains when there is an intermediate use of the initial result, resulting in the same number of instructions.
Also, this behaviour can interfere with other optimizations which sometimes can result in an extra instruction.
%a = load i32 ... %b = load i32 ... %1 = sub %a, 10 %2 = store %1 %3 = sub 0, %1 %4 = add %b, %3
-> The statement (%3 = sub 0, %1) will get folded as follows:
%1 = sub %a, 10 %2 = store %1 %3 = sub 0, %1 => %3 = sub 10, %a %4 = add %b, %3
-> Preventing the combination of (%3 = sub 0, %1) and (%4 = add %b, %3) into (%3 = sub %b, %1)