This is an archive of the discontinued LLVM Phabricator instance.

clang/HIP: Fix broken implementations of __make_mantissa* functions
ClosedPublic

Authored by arsenm on Nov 20 2022, 8:43 PM.

Details

Summary

The optimizer was folding the entire function to return 0. This
meant to be checking the character content of the pointer is the
string terminator, not null.

Not sure if the null checks are necessary. I'm not sure what
the spec is for these, or why these would even be exposed.

Diff Detail

Event Timeline

arsenm created this revision.Nov 20 2022, 8:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 20 2022, 8:43 PM
arsenm requested review of this revision.Nov 20 2022, 8:43 PM
JonChesterfield accepted this revision.Nov 28 2022, 3:47 PM

Patch is obviously fine. Given these are internal functions, perhaps we should annotate them with the non-null attribute and delete the early exit.

This revision is now accepted and ready to land.Nov 28 2022, 3:47 PM
arsenm updated this revision to Diff 482839.Dec 14 2022, 6:29 AM

Don't handle null and add nonnull attributes

arsenm requested review of this revision.Dec 19 2022, 9:17 AM

ping

yaxunl accepted this revision.Dec 21 2022, 1:20 PM

LGTM. Thanks.

It seems gcc assumes the argument to nan is nonnull (https://godbolt.org/z/xzb8T6Gon), so we can assume that too.

This revision is now accepted and ready to land.Dec 21 2022, 1:20 PM