[PATCH] D39830: [DAGCombine] [WIP] Transform (A + -2.0*B*C) -> (A - (B+B)*C)

Chad Rosier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 13:49:38 PST 2017


mcrosier added a comment.

In the bug report I provided a C test case:

  double test2(double a, double b, double c) {
    return a + -2.0*b*c;
  }

You can use this to create a test case using the following command:

  clang test.c -O3 -s -emit-llvm -o test.ll

The IR should look something like this:

  define double @test2(double %a, double %b, double %c) local_unnamed_addr #0 {
  entry:
    %mul = fmul double %b, -2.000000e+00
    %mul1 = fmul double %mul, %c
    %add = fadd double %mul1, %a
    ret double %add
  }

You can add your test case to the file suggested by Florian.  That should also include examples of how to add the FILECHECK directives, etc.


https://reviews.llvm.org/D39830





More information about the llvm-commits mailing list