Just plumbing from the language level to the assume intrinsics with
separate_storage operand bundles.
Details
- Reviewers
hfinkel bruno - Commits
- rG07ef7b1ff21e: [Builtins] Add __builtin_assume_separate_storage
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Nice, thanks for adding the builtin layer.
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
7808 ↗ | (On Diff #481770) | Can you prefix this with a FIXME/TODO? |
7810 ↗ | (On Diff #481770) | IIUC, seems like there a two pieces here you can already cover as part of this patch:
|
Summarizing a brief offline discussion: I think it's probably fine to just get rid of the SemaChecking changes entirely; type-checking here is done by the generalized builtin-handling code. I'll do the change if there's no objection.
In addition to the release notes addition, I also added an entry in LanguageExtensions.rst.
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2395 | Not necessarily a blocker, but it seems like some of these things you mention can actually be caught by diagnostics without too much effort? Any plans to add them? |
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2395 | I hadn't planned to (at least in the short term). Practically I expect uses of this to be mostly backed out from looking at bad assembly (this is the way I've been using it so far in experimentation). You wouldn't generally expect people to want to try to express "these two struct fields don't alias" and so on because alias analysis can already handle those cases fairly well. My inclination would be to wait on the diagnostics until we see if it's a real problem, but I'm not strongly opposed if you'd really like them in v1. (Although in that case I'll probably bug you for some help with where / how to put the diagnostics). |
LGTM!
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2395 |
Sounds fair! Feel free to bug me when/if you decide to explore that route. |
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2395 | +2c: as of today tbaa *doesn't* handle well aliasing of two struct fields. There was some work to mitigate it by @kosarev (https://reviews.llvm.org/D41539) but it is still hidden behind a -new-struct-path-tbaa switch. Example: https://godbolt.org/z/xPMzfea8W |
Not necessarily a blocker, but it seems like some of these things you mention can actually be caught by diagnostics without too much effort? Any plans to add them?