This is an archive of the discontinued LLVM Phabricator instance.

[MC] Move bundling and MCSubtargetInfo to MCEncodedFragment [NFC]
ClosedPublic

Authored by peter.smith on Apr 23 2018, 7:07 AM.

Details

Summary

Instruction bundling is only supported on descendants of the MCEncodedFragment type. By moving the bundling functionality and MCSubtargetInfo to this class it makes it easier to set and extract the MCSubtargetInfo when nops need to be written.

This is part 1 of 4 of a patch series to pass MCSubtargetInfo to writeNops so that the ARM and X86 AsmBackends can remove the per-module STI that is used to decide which nop encodings can be used.
1 [MC] Move bundling and MCSubtargetInfo to MCEncodedFragment [NFC]
2 [MC] Add MCSubtargetInfo to MCPaddingFragment [NFC]
3 [MC] Add MCSubtargetInfo to MCAlignFragment [NFC]
4 [MC] Use local MCSubtargetInfo in writeNops

This patch depends on D44928.

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Apr 23 2018, 7:07 AM

Rebased [NFC]

asb accepted this revision.EditedJun 14 2018, 6:47 AM

This looks good to me (in that the motivation makes sense and the change seems to implement the desired change). Only caveat is that I'm not familiar with the code paths for bundled instructions.

The rebased patch still applies and compiles. It looks like clang-format might format some of the changed lines slightly differently, so it might be worth running the git-clang-format helper.

This revision is now accepted and ready to land.Jun 14 2018, 6:47 AM

Thanks, I'll wait till tomorrow before committing to see if anyone in the US timezone has any objections.

This revision was automatically updated to reflect the committed changes.