isAllOnes() should return true for zero bit values because
there are no zeros in it.
Thanks to Jay Foad for pointing this out.
Differential D111241
[APInt] Fix isAllOnes and extractBits for zero width values. lattner on Oct 6 2021, 9:53 AM. Authored by
Details isAllOnes() should return true for zero bit values because Thanks to Jay Foad for pointing this out.
Diff Detail
Event TimelineComment Actions This makes me happy!
Comment Actions Did this get an audit for existing users? It can be argued in both ways. E.g. "".isdigit() in Python is False, because there is no digit contained and that's pretty much the same use case. Comment Actions AFAIK there are no in-tree users to audit: zero-width APInts were only introduced very recently, and I don't think they're used in-tree except for unit tests. Comment Actions Right, they are only being used in the CIRCT incubator project afaik, and it is fine. |