[llvm] [TLI] Pass replace-with-veclib works with Scalable Vectors. (PR #73642)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 08:30:55 PST 2023


================
@@ -40,7 +40,7 @@ define <4 x float> @llvm_cos_f32(<4 x float> %in) {
 define <vscale x 2 x double> @llvm_cos_vscale_f64(<vscale x 2 x double> %in) #0 {
 ; CHECK-LABEL: define <vscale x 2 x double> @llvm_cos_vscale_f64
 ; CHECK-SAME: (<vscale x 2 x double> [[IN:%.*]]) #[[ATTR1:[0-9]+]] {
-; CHECK-NEXT:    [[TMP1:%.*]] = call fast <vscale x 2 x double> @llvm.cos.nxv2f64(<vscale x 2 x double> [[IN]])
+; CHECK-NEXT:    [[TMP1:%.*]] = call fast <vscale x 2 x double> @armpl_svcos_f64_x(<vscale x 2 x double> [[IN]])
----------------
mgabka wrote:

This isn't correct replacement, the armpl_svcos_f64_x is a masked function, so you are missing an argument here,
and in order to get the position of the mask in the vector routine you will need to use the VFABI rules for the specific ISA, so the ReplaceWithVeclib pass will need to start using the VFABI helper functions

https://github.com/llvm/llvm-project/pull/73642


More information about the llvm-commits mailing list