Skip to content

[SR-2089] SIL verifier failures with static inline stubs #44697

@stephentyrone

Description

@stephentyrone
Previous ID SR-2089
Radar rdar://problem/27378253
Original Reporter @stephentyrone
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee @eeckstein
Priority Medium

md5: 8ff06a40a5b30dcb934f2e9ce141354f

Issue Description:

In order to expose an efficient square root implementation in the stdlib, I tried making the libc shims static inline in (#3454
~~~
static inline float _swift_stdlib_sqrtf(float x) { return __builtin_sqrt❌; }
~~~
This "works" and we get the codegen we want, but under certain conditions we get SIL verifier failures. I'm not sure whether this is a compiler bug or a verifier bug. There are not extant `static inline` stubs from what I can tell, so it's not surprising this hasn't come up before, but we want to handle sqrt this way to avoid an extra layer of indirection; function call overhead is quite substantial for a single-instruction operation, and we can't use `@llvm.sqrt` because it has the wrong semantics.

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions