llvm-project
ced508fb - [AArch64][GlobalISel] Split wide G_SMULH/G_UMULH instead of lowering them (#235327)

Commit
24 days ago
[AArch64][GlobalISel] Split wide G_SMULH/G_UMULH instead of lowering them (#235327) Vector `G_SMULH`/`G_UMULH` wider than 128 bits were lowered to widening multiplies and shifts. This splits them into legal 128-bit pieces first, as `G_MUL` already does, so they select to `smull`/`umull` pairs and `uzp2`. For example, `udiv <8 x i32>` by a constant: ``` define <8 x i32> @test(<8 x i32> %x) { %r = udiv <8 x i32> %x, <i32 7, i32 6, i32 7, i32 6, i32 7, i32 6, i32 7, i32 6> ret <8 x i32> %r } ``` goes from 27 instructions to 22, now identical to SelectionDAG: the half-register extractions (`mov d2, v0.d[1]`, ...) are gone and the multiply-highs use `umull2`.
Author
Parents
Loading