<div dir="ltr"><div>Hi everyone,</div><div><br></div><div>Is there a target equivalent to `getHostCPUFeatures`?<br></div><div><a href="https://llvm.org/doxygen/namespacellvm_1_1sys.html#a768d54e5ada846d513f72d9e43e89ef6">https://llvm.org/doxygen/namespacellvm_1_1sys.html#a768d54e5ada846d513f72d9e43e89ef6</a></div><div><br></div><div>Additionally, is it possible to query target vector widths, and the number of vector registers (e.g. 16 for x86 with AVX, 32 with AVX512, but only 8 if in 32-bit mode)?</div><div><br></div><div>I have been using `getHostCPUFeatures` for features, and then on x86 I've added some simple logic to pick vector width and number of registers. For other architecutres, I'm using some generic values. LLVM has all this information, so it'd be great if I could use it for other architectures like ARM and POWER (and for x86 too), but I'm not sure how to access it myself.<br></div><div><br></div><div>Background:</div><div>I'm the author of a somewhat experimental Julia library called "LoopVectorization.jl" that autovectorizes loops.</div><div>The optimization decisions it makes are target specific, and the final generated code itself is as well, and not always in a manner that backends can handle if incorrect, e.g. it might use something like `@llvm.x86.avx512.mask.pternlog.q.512`.</div><div>I've been making the assumption that the host is the target (and using `getHostCPUFeatures`). This isn't always the case, which has resulted in crashes before for some users.<br></div><div><br></div><div>Thanks everyone,</div><div>Chris<br></div></div>