[PATCH] D141419: [DAGCombine] Suppress some foldings of rounding to fp16

Warren Ristow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 11:48:00 PST 2023


wristow created this revision.
wristow added reviewers: RKSimon, spatel, nlopes, efriedma.
Herald added subscribers: StephenFan, ecnelises, pengfei, hiraditya.
Herald added a project: All.
wristow requested review of this revision.
Herald added a project: LLVM.

Folding of 'x86_fp80 -> float -> half' into a direct rounding of
'x86_fp80 -> half' is legal when "unsafe-fp-math" is true, but it has
been suppressed for efficiency reasons because it generally results in
a run-time call rather than native instructions.  The same applies for
vector versions, but those foldings have not been suppressed.  The same
efficiency aspect applies to folding of 'double -> float -> half', but
those foldings have not been suppressed (scalar or vector).

This patch suppresses the foldings for the 'double' source (scalar and
vector), and for the vector version of 'x86_fp80' (to match the scalar
approach).


https://reviews.llvm.org/D141419

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/X86/fastmath-float-half-conversion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141419.487914.patch
Type: text/x-patch
Size: 11053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230110/392d43f9/attachment.bin>


More information about the llvm-commits mailing list