[PATCH] D72047: Add an interface emitPrefix for MCCodeEmitter
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 5 23:12:16 PST 2020
skan marked 2 inline comments as done.
skan added inline comments.
================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:1367
+ // Pseudo instructions don't get encoded.
+ if ((TSFlags & X86II::FormMask) == X86II::Pseudo)
+ return;
----------------
craig.topper wrote:
> When would emitPrefix be called on a X86II::Pseudo?
I don't know, `encodeInstruction` checks `(TSFlags & X86II::FormMask) == X86II::Pseudo`, so I do the same for `emitPrefix`. My thought is `emitPrefix` can be used anywhere where `encodeInstruction` can be used.
================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:1421
errs() << "FORM: " << Form << "\n";
llvm_unreachable("Unknown FormMask value in X86MCCodeEmitter!");
+ case X86II::RawFrmDstSrc:
----------------
craig.topper wrote:
> Why is Pseudo no longer in this switch?
`encodeInstruction` always calls `emitPrefixImpl`, which already checks
Pseudo in the corresponding switch.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72047/new/
https://reviews.llvm.org/D72047
More information about the llvm-commits
mailing list