On Sun, Dec 10, 2023 at 10:30 AM Xi Ruoyao <xry...@xry111.site> wrote: > > On Sun, 2023-12-10 at 01:21 -0800, Andrew Pinski wrote: > > diff --git a/gcc/expr.cc b/gcc/expr.cc > > index 6da51f2aca2..4686cacd22f 100644 > > --- a/gcc/expr.cc > > +++ b/gcc/expr.cc > > @@ -10209,8 +10209,9 @@ expand_expr_real_2 (sepops ops, rtx target, > > machine_mode tmode, > > /* Expand X*Y as X&-Y when Y must be zero or one. */ > > if (SCALAR_INT_MODE_P (mode)) > > { > > - bool bit0_p = tree_nonzero_bits (treeop0) == 1; > > - bool bit1_p = tree_nonzero_bits (treeop1) == 1; > > + bool gimple_zero_one_valued_p (tree, tree (*)(tree)); > > Should we declare this in the file scope instead?
An improvement might be to have genmatch create a special header file with all the match declarations. Though initially I hoped we could eventually have "inlined" match predicates to be picked up by genmatch from .cc files, like hidden within comments: // @match // (match (...) // ...) // @endmatch (doesn't solve the declaration part though). Richard. > > + bool bit0_p = gimple_zero_one_valued_p (treeop0, nullptr); > > + bool bit1_p = gimple_zero_one_valued_p (treeop1, nullptr); > > -- > Xi Ruoyao <xry...@xry111.site> > School of Aerospace Science and Technology, Xidian University