[PATCH] D71495: [SelectionDAG] Copy FP flags when visiting a binary instruction.

Valentin Churavy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 15:18:30 PST 2019


vchuravy created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

We noticed in Julia that the sequence below no longer turned into
a sequence of FMA instructions in LLVM 7+, but it did in LLVM 6.

  %29 = fmul contract <4 x double> %wide.load, %wide.load16
  %30 = fmul contract <4 x double> %wide.load13, %wide.load17
  %31 = fmul contract <4 x double> %wide.load14, %wide.load18
  %32 = fmul contract <4 x double> %wide.load15, %wide.load19
  %33 = fadd fast <4 x double> %vec.phi, %29
  %34 = fadd fast <4 x double> %vec.phi10, %30
  %35 = fadd fast <4 x double> %vec.phi11, %31
  %36 = fadd fast <4 x double> %vec.phi12, %32

Unlike Clang, Julia doesn't set the `unsafe-fp-math=true` function
attribute, but rather emits more local instruction flags.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71495

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/test/CodeGen/X86/fused-fma.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71495.233887.patch
Type: text/x-patch
Size: 7392 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191213/3bc30fec/attachment.bin>


More information about the llvm-commits mailing list