For below case
for(int i = 0; i < LENGTH; i++) {
c[i] = a[i] + 2;
}
AArch64 backend generates SVE add instructions with a immediate move
mov z16.s, #2
add z17.s, z17.s, z16.s
Considering sve has supported basic binary operations with immediate,
we should optimize this pattern, and the new generated vector
instructions should be like
add z16.s, z16.s, #2
for(int i = 0; i < LENGTH; i++) {
c[i] = a[i] + 2;
}
AArch64 backend generates SVE add instructions with a immediate move
mov z16.s, #2
add z17.s, z17.s, z16.s
Considering sve has supported basic binary operations with immediate,
we should optimize this pattern, and the new generated vector
instructions should be like
add z16.s, z16.s, #2