[PATCH] D40150: [LibCallSimplifier] fix pow(x, 0.5) -> sqrt() transforms

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 15:30:08 PST 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

This would be a lot simpler if we could disregard errno when we have relaxed FP math, but I'm assuming it's possible to do something like '-ffast-math -fmath-errno' and still expect errno to be set for domain errors?

As the first test shows, we could transform an llvm intrinsic into a libcall which could then set errno, so that's just wrong...unless I'm not seeing some loophole. The second test diff is a phantom change (same output as before), but I've updated the CHECK lines to highlight that we get that case right on purpose now.


https://reviews.llvm.org/D40150

Files:
  include/llvm/Transforms/Utils/SimplifyLibCalls.h
  lib/Transforms/Utils/SimplifyLibCalls.cpp
  test/Transforms/InstCombine/pow-sqrt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40150.123248.patch
Type: text/x-patch
Size: 6112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171116/7cfa4e31/attachment.bin>


More information about the llvm-commits mailing list