On Tue, Jan 28, 2025 at 09:50:41AM +0100, Richard Biener wrote: > On Mon, Jan 27, 2025 at 9:59 PM David Malcolm <dmalc...@redhat.com> wrote: > > > > On Sat, 2025-01-25 at 23:31 -0800, Andi Kleen wrote: > > > From: Andi Kleen <a...@gcc.gnu.org> > > > > > > This is the hot function in input.cc > > > > > > The vectorizer can vectorize it now, but in a generic cpu O2 x86 > > > build it isn't. > > > Add a automatic target clone to handle it for x86 and build > > > that function with O3. > > > > > > The ifdef here is ugly, perhaps gcc should have a more convenient > > > "clone for vectorization if possible" attribute to handle this > > > portably. > > > > This patch is very cool (no pun intended); how much does it help? > > > > The patch is OK by me, but given that we're in stage 4, does a release > > manager approve? [CCed] > > I'd like to see good evidence that it helps and doesn't cause issues - IIRC > target_clones requires IFUNCs so this needs to be likely guarded not only > on the host architecture but also the host OS.
True. I don't have data actually. With the look behind cache the -Wmisleading-indentation test case runs fast with not much searching, and I currently don't have another test case that is slow. I could create the situation artificially with some params, but that seems wrong. I'll drop it for now. I prefer using the vectorizer if possible. -Andi