[PATCH] D63294: [Analysis] enhance FP library function prototype checking to match types with name suffix

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 12:13:50 PDT 2019


spatel created this revision.
spatel added reviewers: efriedma, cameron.mcinally, hfinkel.
Herald added subscribers: hiraditya, tpr, nhaehnle, jvesely, mcrosier.
Herald added a project: LLVM.

I missed some existing test diffs in D63214 <https://reviews.llvm.org/D63214> (not currently shown there), and this is the root cause: we loosely matched libm function names without checking that the return/parameter types correspond to the name.

The rule is:

1. No suffix --> double
2. 'f' suffix --> float
3. 'l' suffix --> long double

I'm not sure how to deal with long double yet, so I left that as TODOs.

The AMDGPU tests are adjusted to have the correct libm names without changing anything else. The instcombine sqrt test is the intentional diff. There are more comprehensive existing instcombine tests that will fail when transforming double functions to float functions, so I didn't bother adding tests for each name.


https://reviews.llvm.org/D63294

Files:
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/test/CodeGen/AMDGPU/complex-folding.ll
  llvm/test/CodeGen/AMDGPU/fabs.ll
  llvm/test/CodeGen/AMDGPU/floor.ll
  llvm/test/CodeGen/AMDGPU/fneg-fabs.ll
  llvm/test/CodeGen/AMDGPU/r600-infinite-loop-bug-while-reorganizing-vector.ll
  llvm/test/CodeGen/AMDGPU/schedule-if-2.ll
  llvm/test/Transforms/InstCombine/sqrt-nofast.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63294.204601.patch
Type: text/x-patch
Size: 14545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190613/91a7ce68/attachment.bin>


More information about the llvm-commits mailing list