Handle an inline assembly feature of GCC: code prefixed with "%v", e. g. "%vpcmpestri" is transformed into "vpcmpestri" instruction if target supports AVX and into "pcmpestri" otherwise.
Given the code:
void f(void* arg) { __asm__ ("%vpcmpestri $0, (%1), %2" : "=c"(arg) : "r"(arg), "x"(arg)); }
"gcc -c test.c -o test.o" produces
movq -0x10(%rbp),%xmm0 pcmpestri $0x0,(%rax),%xmm0
While "gcc -c -march=corei7-avx test.c -o test.o" produces
vmovq %rdx,%xmm0 vpcmpestri $0x0,(%rax),%xmm0
I'd prefer not to keep SupportsAVX cached, or pass it though, but rather look up what we need from the function if we need it. We can also cache the set of valid subtarget features on the Stmt if necessary from the Function.