Here is yet another attempt at a patch to auto-generate SIMD clones for functions that already have the "declare target" attribute. This version v4 is derived from the previous v2 version, since v3 seemed to be a dead end. I have added conditionals to restrict the auto-generation at -O2 to the offload compiler, and extended the syntax of the -fopenmp-target-simd-clone to allow explicit control over whether it applies to host, target, or both -- this primarily to allow better test coverage. I've added infrastructure to support testing on the offload compiler, added new test cases, and reworked the existing test cases to scan for interesting things written to the dump file instead of examining the .s output. I hope it is not too late to consider this patch given that I've been trying to get this feature in for months already. Also, I kind of got caught in the Sphinx churn last week, relating to the documentation parts of this patch. :-( I understand that if this patch is accepted I am also on the hook to come up with a further patch to try to GC unused clones after vectorization; I haven't started on that piece yet. -Sandra