Thank you for the comments. > I don't think we can use an unbounded recursive walk, since that > would become quadratic if we ever used it when optimising one > AND in a chain of ANDs. (And using this function for ANDs > seems plausible.) Maybe we should be handling the information > in a similar way to Ranger.
I'm trying to get rid of the recursion by reusing the code in get_nonzero_bits(). > Rather than handle the built-in case entirely in target code, how about > having a target hook into nonzero_element_bits (or whatever replaces it) > for machine-dependent builtins? >From the perspective of necessity, do you think it's worth checking the >"svand" call inside, or worth handling the whole built-in case? Operations >with ACLE SVE types can also be folded as long as we use C/C++ general >operators which has been supported in GCC 15. Thanks, Pengfei