This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Fix X86MCPlusBuilder::replaceRegWithImm
ClosedPublic

Authored by Amir on Feb 21 2022, 10:16 AM.

Details

Summary

Reassigning the operand didn't update the operand type which resulted in an
assertion (Assertion isReg() && "This is not a register operand!"' failed.`)
Reset the instruction instead.

Test Plan:

ninja check-bolt
...
PASS: BOLT-Unit :: Core/./CoreTests/X86/MCPlusBuilderTester.ReplaceRegWithImm/0 (90 of 136)

Diff Detail

Event Timeline

Amir created this revision.Feb 21 2022, 10:16 AM
Amir requested review of this revision.Feb 21 2022, 10:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2022, 10:16 AM
Amir added a comment.Feb 21 2022, 10:19 AM
This comment was removed by Amir.
Amir updated this revision to Diff 411001.Feb 23 2022, 8:54 PM

Fix tail-duplication-prop-bug.s

rafauler accepted this revision.Feb 28 2022, 5:43 PM

Thanks

This revision is now accepted and ready to land.Feb 28 2022, 5:43 PM
This revision was automatically updated to reflect the committed changes.