This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Fix crash in applyShiftOfShiftedLogic caused by CSEMIRBuilder reuse instruction
ClosedPublic

Authored by bcl5980 on Nov 16 2022, 11:51 PM.

Details

Summary

If LogicNonShiftReg is the same to Shift1Base, and shift1 const is the same to MatchInfo.Shift2 const, CSEMIRBuilder will reuse the old shift1 when build shift2.
So, if we erase MatchInfo.Shift2 at the end, actually we remove old shift1. And it will cause crash later.

Solution for this issue is just erase it earlier to avoid the crash.

Fix #58423

Diff Detail

Event Timeline

bcl5980 created this revision.Nov 16 2022, 11:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2022, 11:51 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
bcl5980 requested review of this revision.Nov 16 2022, 11:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2022, 11:51 PM

Can you link to the bug report? Issue 58432 seems to be unrelated to GlobalISel.

bcl5980 updated this revision to Diff 476329.Nov 17 2022, 9:15 PM
bcl5980 edited the summary of this revision. (Show Details)

58432 to 58423

arsenm accepted this revision.Nov 18 2022, 4:03 PM
arsenm added inline comments.
llvm/test/CodeGen/AArch64/pr58423.ll
3 ↗(On Diff #476329)

Should move test under GlobalISel tests

11 ↗(On Diff #476329)

Use named values

This revision is now accepted and ready to land.Nov 18 2022, 4:03 PM
bcl5980 updated this revision to Diff 476639.Nov 18 2022, 5:12 PM
This revision was landed with ongoing or failed builds.Nov 18 2022, 5:13 PM
This revision was automatically updated to reflect the committed changes.