[PATCH] D70488: [InstCombine] Infer fast math flags on fadd/fsub/fmul/fcmp

Benjamin Kramer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 05:48:11 PST 2019


bkramer created this revision.
bkramer added a reviewer: spatel.
Herald added subscribers: cfe-commits, hiraditya.
Herald added projects: clang, LLVM.

Applies nnan, ninf and nsz. This allows more instructions to be folded
away even with no fast math flags, e.g. (int)x * (b ? 1.0 : 0.0) -> b ? x : 0.0

As a side effect this will propagate fast math flags out of inlined fast
math code into surrounding functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70488

Files:
  clang/test/CodeGen/builtins-systemz-zvector.c
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/add-sitofp.ll
  llvm/test/Transforms/InstCombine/cast-int-fcmp-eq-0.ll
  llvm/test/Transforms/InstCombine/fadd-fsub-factor.ll
  llvm/test/Transforms/InstCombine/fast-math.ll
  llvm/test/Transforms/InstCombine/fcmp.ll
  llvm/test/Transforms/InstCombine/known-never-nan.ll
  llvm/test/Transforms/InstCombine/minmax-fp.ll
  llvm/test/Transforms/InstCombine/pow_fp_int.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70488.230243.patch
Type: text/x-patch
Size: 15178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191120/f24872ea/attachment-0001.bin>


More information about the llvm-commits mailing list