[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 11:05:43 PST 2024


erichkeane wrote:

> > We have 2 options:
> > 
> > * Wait for llvm to get improve their handling of assumption based optimizations.
> > * Proceed with this work hoping this encourages work on the optimizer.
> 
> The standard also mentions that `__has_cpp_attribute` should return `0` ‘if an implementation does not attempt to deduce any such information from assumptions’ [dcl.attr.assume], so another option would be to just have it set to `0` for the time being and just not emit anything until that’s not an issue anymore.

in this patch you ARE emitting the llvm assume, so I believe we ARE trying enough with this patch to mark it.  So `__has_cpp_attribute` needs to be properly populated.

I think the confusion/conflict between this and clang::assume needs to be figured out.  These two should just be, as close as possible, spellings of the same thing.  

https://github.com/llvm/llvm-project/pull/81014


More information about the cfe-commits mailing list