[PATCH] D138867: [RFC] Add new intrinsics and attribute to control accuracy of FP calls

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 14:36:54 PST 2022


andrew.w.kaylor created this revision.
Herald added subscribers: kosarev, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, mgrang, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, jvesely, nemanjai.
Herald added a project: All.
andrew.w.kaylor requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, jdoerfert, MaskRay.
Herald added a project: LLVM.

This patch adds a new set of fpbuiltin intrinsics to represent operations that are equivalent to common math library functions and basic operations, and adds a new call site attribute ("fp-max-error") to specify the required accuracy of these calls.

The purpose of these new IR constructs is to support alternate math library implementations and provide a general mechanism for selecting among multiple implementations based on specific requirements.

This is a follow-up to discussions here: https://discourse.llvm.org/t/rfc-floating-point-accuracy-control/66018


https://reviews.llvm.org/D138867

Files:
  llvm/include/llvm/Analysis/AltMathLibFuncs.def
  llvm/include/llvm/Analysis/TargetLibraryInfo.h
  llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
  llvm/include/llvm/CodeGen/FPBuiltinFnSelection.h
  llvm/include/llvm/CodeGen/MachinePassRegistry.def
  llvm/include/llvm/CodeGen/Passes.h
  llvm/include/llvm/IR/FPBuiltinOps.def
  llvm/include/llvm/IR/IntrinsicInst.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/include/llvm/InitializePasses.h
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/CodeGen.cpp
  llvm/lib/CodeGen/FPBuiltinFnSelection.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/lib/IR/IntrinsicInst.cpp
  llvm/test/CodeGen/AArch64/O0-pipeline.ll
  llvm/test/CodeGen/AArch64/O3-pipeline.ll
  llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
  llvm/test/CodeGen/ARM/O3-pipeline.ll
  llvm/test/CodeGen/Generic/fp-builtin-intrinsics.ll
  llvm/test/CodeGen/PowerPC/O3-pipeline.ll
  llvm/test/CodeGen/RISCV/O0-pipeline.ll
  llvm/test/CodeGen/RISCV/O3-pipeline.ll
  llvm/test/CodeGen/X86/O0-pipeline.ll
  llvm/test/CodeGen/X86/opt-pipeline.ll
  llvm/tools/opt/opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138867.478379.patch
Type: text/x-patch
Size: 53694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221128/62736096/attachment-0001.bin>


More information about the llvm-commits mailing list