On Fri, Oct 21, 2016 at 05:28:42PM +0200, Uros Bizjak wrote: > On Fri, Oct 21, 2016 at 5:23 PM, Jakub Jelinek <ja...@redhat.com> wrote: > > Hi! > > > > This patch adds folding for the new ia32 md builtins. > > If they can be folded into constant, it is done in ix86_fold_builtin, > > if they can fold to corresponding generic __builtin_c[lt]z* (which have > > e.g. the advantage that VRP knows about what values it can have etc.), > > it is done in gimple_fold_builtin target hook. > > Are you sure that there is no way zero will be passed to generic > __builtin_c[lt]z?
The patch only folds the ia32 specific builtins into __builtin_c[lt]z, if the argument is known not to be 0 (from VRP). That is the expr_not_equal_to call, which uses get_range_info under the hood. Jakub