[llvm] [DAG] Fold fdiv X, c2 -> fmul X, 1/c2 without AllowReciprocal if exact (PR #93882)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 14:00:24 PDT 2024


================
@@ -1367,12 +1367,11 @@ define void @bcast_unfold_fdiv_v16f32(ptr nocapture %arg) {
 ; CHECK-LABEL: bcast_unfold_fdiv_v16f32:
 ; CHECK:       # %bb.0: # %bb
 ; CHECK-NEXT:    movq $-4096, %rax # imm = 0xF000
-; CHECK-NEXT:    vbroadcastss {{.*#+}} zmm0 = [2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0,2.0E+0]
----------------
RKSimon wrote:

The 2.000000e+00 splat value needs to be changed to something that can't be easily inverted - the test needs to show the second operand can be hoisted out of the loop, which fails for a commutable op like fmul.

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


More information about the llvm-commits mailing list