diff options
author | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2020-09-22 14:04:13 -0400 |
---|---|---|
committer | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2020-09-22 14:23:32 -0400 |
commit | 6801950192ff4f6d60c822fc721354f34e609e7a (patch) | |
tree | 2c1020197ba23ce261c69acc9daac600e12ff203 /llvm/lib/Transforms/Utils/LoopVersioning.cpp | |
parent | b0f58aa116a1ac2c2fa6b1667017bb29b3418411 (diff) | |
download | llvm-6801950192ff4f6d60c822fc721354f34e609e7a.zip llvm-6801950192ff4f6d60c822fc721354f34e609e7a.tar.gz llvm-6801950192ff4f6d60c822fc721354f34e609e7a.tar.bz2 |
[InstCombine] For pow(x, +/-0.5), stop falling into pow(x, 1.5), etc. case
The current code for handling pow(x, y) where y is an integer plus 0.5
is not explicitly guarded against attempting to transform the case where
abs(y) is exactly 0.5.
The latter case is meant to be handled by `replacePowWithSqrt`. Indeed,
if the pow(x, integer+0.5) case proceeds past a certain point, it will
hit an assertion by attempting to form pow(x, 0) using `getPow`.
This patch adds an explicit check to prevent attempting the
pow(x, integer+0.5) transformation on pow(x, +/-0.5) as suggested during
the review of D87877. This has the effect of retaining the shrinking of
`pow` to `powf` when the `sqrt` libcall cannot be formed.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D88066
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
0 files changed, 0 insertions, 0 deletions