Let's say I write a function that looks like:
int ComputeStuff(int value) {
if(value < 27) {
long and complex computation specialized for values under 27
return result
} else {
long and complex computation specialized for values 27 or more
return result
}
}
Then I call it from somewhere else like so: int x = ComputeStuff(12);
Let's say the compiler decides this is a good candidate for inlining. Since the programmer wrote code with the intention of it running, are you saying that the compiler should not take advantage of the fact that it knows the exact value being passed into the function in this case and can delete half the code knowing it will never run?