LLVM Discussion Forums

Run constprop on a region

Is it possible to run constprop only on a region of a function instead of the entire function? For my use case i want to replace some uses with concrete values and then run constprop to see for instance if a branch is always taken or find concrete values for GEP indices, given those (assumed) values. I think just running constprop is probably working fine - its doing the job alright in the simple examples i’ve tried - but i think something like a region constprop would make more sense and give more control.