I missed some existing test diffs in D63214 (not currently shown there), and this is the root cause: we loosely matched libm function names without checking that the return/parameter types correspond to the name.
The rule is:
- No suffix --> double
- 'f' suffix --> float
- 'l' suffix --> long double
I'm not sure how to deal with long double yet, so I left that as TODOs.
The AMDGPU tests are adjusted to have the correct libm names without changing anything else. The instcombine sqrt test is the intentional diff. There are more comprehensive existing instcombine tests that will fail when transforming double functions to float functions, so I didn't bother adding tests for each name.