https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88834
--- Comment #3 from kugan at gcc dot gnu.org --- I added iv-use for MASKED_LOAD_LANE and the result is cmp w3, 0 ble .L1 sub w5, w3, #1 mov x4, 0 lsr w5, w5, 1 add w5, w5, 1 whilelo p0.s, xzr, x5 .p2align 3,,7 .L3: lsl x3, x4, 3 incw x4 add x7, x1, x3 add x6, x2, x3 ld2w {z4.s - z5.s}, p0/z, [x7] ld2w {z2.s - z3.s}, p0/z, [x6] add x3, x0, x3 add z0.s, z4.s, z2.s sub z1.s, z5.s, z3.s st2w {z0.s - z1.s}, p0, [x3] whilelo p0.s, x4, x5 bne .L3 .L1: ret No base plus scaled index addressing mode. This is because in ivopt When called from ivopt: Breakpoint 4, aarch64_classify_address (info=0x7fffffffcba0, x=0x7ffff6c44f30, mode=E_DImode, strict_p=false, type=ADDR_QUERY_M) at /home/kugan/work/abe/snapshots/gcc.git~origin~aarch64~sve-acle-branch/gcc/config/aarch64/aarch64.c:5689 5689 { (gdb) p debug_rtx (x) (plus:DI (mult:DI (reg:DI 91) (const_int 8 [0x8])) (reg:DI 90)) it accepts it. When in cfgexpand: Breakpoint 5, aarch64_classify_address (info=0x7fffffffcca0, x=0x7ffff6c5b840, mode=E_VNx8SImode, strict_p=false, type=ADDR_QUERY_M) at /home/kugan/work/abe/snapshots/gcc.git~origin~aarch64~sve-acle-branch/gcc/config/aarch64/aarch64.c:5689 5689 { (gdb) p debug_rtx (x) (plus:DI (mult:DI (reg:DI 92 [ ivtmp_28 ]) (const_int 8 [0x8])) (reg/v/f:DI 110 [ y ])) This is not accepted because of aarch64_classify_index (info, op1, mode, strict_p) failing (as it should). Note the difference in mode for aarch64_classify_address. Not sure if this is because of the way my patch changes ivopt.