[PATCH] D131672: [opt] Optimise for zero initialisation of product given finite math in Clang

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 10:00:12 PDT 2022


fhahn added reviewers: spatel, lebedev.ri, RKSimon.
fhahn added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/remove-loop-phi-fastmul.ll:10
+; CHECK-NEXT: [[PHI_2:%.*]] = phi i64 [ 0, [[ENTRY_2:%.*]] ], [ [[INC_1:%.*]] [[LOOPBODY_2:%.*]] ]
+for.cond:
+  %f_prod.0 = phi double [0.000000e+00, %entry], [%mul, %for.body]
----------------
It would be good to split off the test changes to a separate patch that just adds the tests.


================
Comment at: llvm/test/Transforms/InstCombine/remove-loop-phi-fastmul.ll:20
+for.body:
+  %arrayidx = getelementptr inbounds [1000 x double], ptr %arr_d, i64 0, i64 %i.0
+  %0 = load double, ptr %arrayidx, align 8
----------------
Would be good to use 'rotated' version of the loop to keep things simpler.


================
Comment at: llvm/test/Transforms/InstCombine/remove-loop-phi-fastmul.ll:37
+for.cond:
+  %f_prod.0 = phi double [0.000000e+00, %entry], [%mul, %for.body]
+  %i.0 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
----------------
We should also have tests where all the incoming values are instructions or arguments. We also need some tests with phis with more than 2 incoming values.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131672/new/

https://reviews.llvm.org/D131672



More information about the llvm-commits mailing list