[all-commits] [llvm/llvm-project] 322ac2: [X86][MC][NFC] Reduce the parameters of functions ...
KanRobert via All-commits
all-commits at lists.llvm.org
Wed Apr 15 18:54:37 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 322ac2e9173a6fc778f10cf528c676c9159d893f
https://github.com/llvm/llvm-project/commit/322ac2e9173a6fc778f10cf528c676c9159d893f
Author: Shengchen Kan <shengchen.kan at intel.com>
Date: 2020-04-16 (Thu, 16 Apr 2020)
Changed paths:
M llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
Log Message:
-----------
[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part I)
Summary:
The function in X86MCCodeEmitter has too many parameters to make it look
messy, and some parameters are unnecessary. This is the first patch to
reduce their parameters.
The follwing operations are cheap
```
unsigned Opcode = MI.getOpcode();
const MCInstrDesc &Desc = MCII.get(Opcode);
uint64_t TSFlags = Desc.TSFlags;
```
So if we pass a `MCInst`, we don't need to pass `MCInstrDesc`;
if we pass a `MCInstrDesc`, we don't need to pass `TSFlags`.
Reviewers: craig.topper, MaskRay, pengfei
Reviewed By: craig.topper
Subscribers: annita.zhang, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78180
More information about the All-commits
mailing list