[PATCH] D28675: [DAGCombine] require UnsafeFPMath for re-association of addition

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 07:10:41 PST 2017

spatel added a comment.

In https://reviews.llvm.org/D28675#650304, @nhaehnle wrote:

> Add FIXMEs. @hfinkel, do I understand your comment correctly that this patch is
>  good to go?

The patch will cause a crash on a modified form of the PPC tests because we can't ask for flags of an FMA (sigh):

  define double @test_FMADD_ASSOC1(double %A, double %B, double %C, double %D, double %E) {
    %F = fmul fast double %A, %B
    %G = fmul fast double %C, %D
    %H = fadd fast double %F, %G
    %I = fadd fast double %H, %E
    ret double %I

  $ ./llc -march=ppc32 -fp-contract=fast  fma_crash.ll -o -
  	.section	__TEXT,__text,regular,pure_instructions
  	.macosx_version_min 10, 12
  	.machine ppc
  	.section	__TEXT,__textcoal_nt,coalesced,pure_instructions
  	.section	__TEXT,__symbol_stub1,symbol_stubs,pure_instructions,16
  	.section	__TEXT,__text,regular,pure_instructions
  Stack dump:
  0.	Program arguments: ./llc -march=ppc32 -fp-contract=fast fma_crash.ll -o - 
  1.	Running pass 'Function Pass Manager' on module 'fma_crash.ll'.
  2.	Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@test_FMADD_ASSOC1'


More information about the llvm-commits mailing list