This is an archive of the discontinued LLVM Phabricator instance.

alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe
ClosedPublic

Authored by danielmarjamaki on Oct 14 2016, 1:56 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

danielmarjamaki retitled this revision from to alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe.
danielmarjamaki updated this object.
danielmarjamaki added a reviewer: NoQ.
danielmarjamaki set the repository for this revision to rL LLVM.
zaks.anna edited edge metadata.Oct 18 2016, 4:47 PM

Looks like you've also added handling of Xor, Or , Div, and Rem. Should there be tests for those?

I added more testcases. There are several undetected "TODO: loss of precision" right now in the tests that I would like to fix. If this patch to fix FP is accepted I will commit it and continue working on the TODO tests. If it's not accepted I will continue investigating the TODO tests anyway..

Updated the patch so all the loss of precision are detected also

NoQ accepted this revision.Apr 4 2017, 6:10 AM

There are several undetected "TODO: loss of precision" right now in the tests that I would like to fix.

I think it's a good idea to have // no-warning comments as well when testing for lack of false positives.

I've a feeling that the original false positive that you've been fixing initially has disappeared from the final tests (we've got stuff with unsigned long += int, but large types behave quite differently when it comes to integral promotion). If i'm wrong, please commit :)

This revision is now accepted and ready to land.Apr 4 2017, 6:10 AM
This revision was automatically updated to reflect the committed changes.