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

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

Details

Summary

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

Repository
rL LLVM
davide created this revision.Tue, Jul 10, 2:35 PM
davide accepted this revision.Wed, Jul 11, 5:32 PM

Ack'ed by Jim offline.

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