[PATCH] D37686: [DAG] Consolidating Instruction->SDNode Flags propagation in one class for better code management.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 08:38:12 PDT 2017


spatel added a comment.

Here's a potential test case that would show a difference from having FMF on a sqrt intrinsic:

  define float @fast_recip_sqrt(float %x) {
    %y = call fast float @llvm.sqrt.f32(float %x)
    %z = fdiv fast float 1.0,  %y
    ret float %z
  }
  declare float @llvm.sqrt.f32(float) nounwind readonly

...but as I said earlier, we need to fix the DAGCombiner code where this fold is implemented to recognize the flags on the individual nodes. Currently, it just checks the global state:

  if (Options.UnsafeFPMath) {

On x86 currently, this will use the full-precision sqrtss+divss, but it should be using rsqrtss followed by mulss/addss to refine the estimate.


https://reviews.llvm.org/D37686





More information about the llvm-commits mailing list