https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106200
Bug ID: 106200
Summary: Shrink-wrapping opportunity releated to function call
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: zhongyunde at huawei dot com
Target Milestone: ---
case:https://godbolt.org/z/sc5rTzaeb
```
double advance(double dt, double dx, double dy, double dz)
{
double dSquared = dx * dx + dy * dy + dz * dz;
double mag = dt / (dSquared * std::sqrt(dSquared));
return mag;
}
```
we can the llvm Shrink-wrapping, so the spill only in the branch where *call
sqrt*, so there is no spill if goto the branch where use the *insn fsqrt*.