[PATCH] D92337: [x86] adjust cost model values for minnum/maxnum with fast-math-flags

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 11:19:59 PST 2020


spatel created this revision.
spatel added reviewers: RKSimon, pengfei, craig.topper.
Herald added subscribers: hiraditya, mcrosier.
Herald added a project: LLVM.
spatel requested review of this revision.

Without FMF, we lower these intrinsics into something like this:

  vmaxsd	%xmm0, %xmm1, %xmm2
  vcmpunordsd	%xmm0, %xmm0, %xmm0
  vblendvpd	%xmm0, %xmm1, %xmm2, %xmm0

But if we can ignore NANs, the single min/max instruction is enough because there is no need to fix up the x86 logic that corresponds to something like `X>Y ? X : Y`.
We probably want to make other adjustments for FP intrinsics with FMF to account for specialized codegen (for example, FSQRT).


https://reviews.llvm.org/D92337

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/fmaxnum.ll
  llvm/test/Analysis/CostModel/X86/fminnum.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92337.308426.patch
Type: text/x-patch
Size: 33592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201130/f16b19b7/attachment.bin>


More information about the llvm-commits mailing list