This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix ICE in isDesirableToCommuteWithShift
ClosedPublic

Authored by lenary on Aug 12 2019, 5:04 AM.

Details

Summary

Ana Pazos reported a bug where we were not checking that an APInt would
fit into 64-bits before calling getSExtValue(). This caused asserts when
compiling large constants, such as i128s, as happens when compiling compiler-rt.

This patch adds a testcase and makes the callback less error-prone.

Event Timeline

lenary created this revision.Aug 12 2019, 5:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2019, 5:04 AM

Note: this should be backported to 9.0 when it lands.

lenary updated this revision to Diff 214612.Aug 12 2019, 5:48 AM
  • Update check to match assert in APInt::getSExtValue()
luismarques accepted this revision.Aug 12 2019, 6:47 AM
This revision is now accepted and ready to land.Aug 12 2019, 6:47 AM
This revision was automatically updated to reflect the committed changes.
lenary added a subscriber: hans.Aug 12 2019, 6:55 AM

@hans Please may you backport this to the 9.0 release branch?

Thanks Sam, LGTM.

hans added a comment.Aug 13 2019, 4:59 AM

@hans Please may you backport this to the 9.0 release branch?

Merged in r368674.