This is an archive of the discontinued LLVM Phabricator instance.

[Float2Int] Add support for unary FNeg to Float2Int
ClosedPublic

Authored by cameron.mcinally on Jun 28 2019, 10:25 AM.

Details

Summary

I'm not that familiar with ConstantRange or F2I, so a thorough review will be appreciated.

Note that I chose to fake a binary FNeg for ConstantRange purposes. I think this is safe and should limit regressions. Opposing views welcome...

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2019, 10:25 AM
jmolloy accepted this revision.Jul 1 2019, 2:36 AM

LGTM with one simplification. Thanks!

llvm/lib/Transforms/Scalar/Float2Int.cpp
250 ↗(On Diff #207090)

I would just use:

return Zero.sub(Ops[0]);
This revision is now accepted and ready to land.Jul 1 2019, 2:36 AM
This revision was automatically updated to reflect the committed changes.