[PATCH] D130232: Reassoc FMF should not optimize FMA(a, 0, b) to (b)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 08:22:36 PDT 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/test/CodeGen/AArch64/neon-fma-FMF.ll:64
+; CHECK: fmadd
+; CHECK-NOT: fadd
+; CHECK-NOT: fsub
----------------
svenvh wrote:
> spatel wrote:
> > Prefer to add positive CHECK lines for correctness rather than NOT lines for the absence of one particular kind of wrong.
> > It would be great to update this whole file using the script at "utils/update_llc_test_checks.py" - that way, it's complete and easier to update.
> > It would be great to update this whole file using the script at "utils/update_llc_test_checks.py"
> 
> I've tried that, but it seems to remove some CHECK patterns presumably because the IR is not exactly the same for the two llc RUN invocations (yet we still want the test to verify that fma fusing happened).
> 
> Either way, I've updated the CHECK lines for this function with what `update_llc_test_checks.py` generates.
OK - thanks for trying. 

Probably need to add unique prefixes for each RUN line (presumably there is some potential difference between the runs that someone was trying to test for). There are many test file examples of that in this directory if you want to do that as a follow-up. 

I assume we'll add another test like the one you're adding in this patch -- except with nsz + nnan FMF to match the code when it is updated again.


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

https://reviews.llvm.org/D130232



More information about the llvm-commits mailing list