Page MenuHomePhabricator

[IRInterpreter] Fix misevaluation of interpretation expressions with `urem`

Authored by davide on Jul 10 2018, 2:35 PM.



Scalar::MakeUnsigned was implemented incorrectly so it didn't really change the sign of the type (leaving signed types signed).
This showed up as a misevaluation when IR-interpreting urem but it's likely to arise in other contexts.

This commit fixes the definition, and adds a test to make sure this won't regress in future (hopefully).

Fixes rdar://problem/42038760 and LLVM PR38076

Diff Detail


Event Timeline

davide created this revision.Jul 10 2018, 2:35 PM
davide accepted this revision.Jul 11 2018, 5:32 PM

Ack'ed by Jim offline.

This revision is now accepted and ready to land.Jul 11 2018, 5:32 PM
This revision was automatically updated to reflect the committed changes.