Implement trivial constant folding