[PATCH] D76419: [DAGCombiner] Add nsz constraint to aggressive fma folding

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 04:49:41 PDT 2020


spatel added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/fma-combine.ll:3
 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=amdgcn -mcpu=verde -verify-machineinstrs -fp-contract=fast < %s | FileCheck -enable-var-scope -check-prefix=SI-NOFMA -check-prefix=SI-SAFE -check-prefix=SI -check-prefix=FUNC %s
 ; RUN:  llc -amdgpu-scalarize-global-loads=false  -march=amdgcn -mcpu=tahiti -verify-machineinstrs -fp-contract=fast -enable-no-infs-fp-math -enable-unsafe-fp-math -mattr=+fp32-denormals < %s | FileCheck -enable-var-scope -check-prefix=SI-FMA -check-prefix=SI-UNSAFE -check-prefix=SI -check-prefix=FUNC %s
 
----------------
It would be better to fix this RUN line (or better: add IR-level FMF to the changed test).


================
Comment at: llvm/test/CodeGen/AMDGPU/mad-combine.ll:5
 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -fp-contract=fast < %s | FileCheck -enable-var-scope -check-prefix=SI -check-prefix=SI-STD -check-prefix=SI-STD-SAFE -check-prefix=FUNC %s
 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck -enable-var-scope -check-prefix=SI -check-prefix=SI-STD -check-prefix=SI-STD-UNSAFE -check-prefix=FUNC %s
 
----------------
It would be better to fix this RUN line (or better: add IR-level FMF to the changed test).


================
Comment at: llvm/test/CodeGen/PowerPC/fma-assoc.ll:133-136
+  %F = fmul nsz double %A, %B         ; <double> [#uses=1]
+  %G = fmul nsz double %C, %D         ; <double> [#uses=1]
+  %H = fadd nsz double %F, %G         ; <double> [#uses=1]
+  %I = fsub nsz double %E, %H         ; <double> [#uses=1]
----------------
Please create a test that uses IR-level FMF ("reassoc nsz" or "fast"?) entirely. If you can update this file to avoid the global "-enable-unsafe-fp-math" as a preliminary commit, that would be best.

It would also be great to use "utils/update_llc_test_checks.py" to auto-generate complete CHECK lines as a preliminary NFC commit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76419





More information about the llvm-commits mailing list