[PATCH] D80542: [DAGCombiner] Require ninf for division estimation

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 22:52:49 PDT 2020


steven.zhang added a comment.

I think, this is the right fix. Notice that, even with this fix, we still have issue when the input is denormal floating point. We might have to add some test before doing the software expansion as what we did for sqrt. But this check may hurt the performance.

> cat a.C

  #include <stdio.h>
  double __attribute__((noinline)) foo(double a, double b) {
  	return a/b;
  }
  
  int main() {
  	printf("%g\n", foo(1.0, 2.2250738585072009e-309));
  	return 0;
  }

> clang a.C -Ofast;./a.out

nan


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80542





More information about the llvm-commits mailing list