move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into