[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: __builtin_assume warnings
From: |
Mattias Engdegård |
Subject: |
Re: __builtin_assume warnings |
Date: |
Wed, 19 Aug 2020 10:01:04 +0200 |
19 aug. 2020 kl. 00.53 skrev Paul Eggert <eggert@cs.ucla.edu>:
> No, it's the other way around at least for me: having 'assume' use Clang's
> __builtin_assume makes 'assume' slower. Without __builtin_assume, 'assume'
> falls back on __builtin_unreachable, and Clang generates better code for
> __builtin_unreachable than it does __builtin_assume.
Right you are; as far as I can tell, __builtin_assume is strictly less useful.
There does not seem to be any point in using it at this time. The only
advantage over if(!x)__builtin_unreachable() appears to be that the argument
isn't actually evaluated, but I'm not sure when that property would be useful.
Thank you for clearing that up.