[PATCH] D142215: [MC] Define and use MCInstrDesc implicit_uses and implicit_defs. NFC.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 07:15:28 PST 2023


foad created this revision.
Herald added subscribers: kosarev, StephenFan, kerbowa, pengfei, kbarton, hiraditya, jvesely, nemanjai, arsenm, MatzeB.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The new methods return a range for easier iteration. Use them everywhere
instead of getImplicitUses, getNumImplicitUses, getImplicitDefs and
getNumImplicitDefs. A future patch will remove the old methods.

In some use cases the new methods are less efficient because they always
have to scan the whole uses/defs array to count its length, but that
will be fixed in a future patch by storing the number of implicit
uses/defs explicitly in MCInstrDesc. At that point there will be no need
to 0-terminate the arrays.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142215

Files:
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/include/llvm/MC/MCInstrDesc.h
  llvm/lib/CodeGen/MIRParser/MIParser.cpp
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/lib/CodeGen/RDFGraph.cpp
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
  llvm/lib/MC/MCInstrDesc.cpp
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/MC/MCParser/MasmParser.cpp
  llvm/lib/MCA/InstrBuilder.cpp
  llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
  llvm/lib/Target/ARM/ARMFastISel.cpp
  llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
  llvm/lib/Target/Hexagon/HexagonGenMux.cpp
  llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
  llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp
  llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
  llvm/lib/Target/X86/X86FastISel.cpp
  llvm/tools/llvm-exegesis/lib/MCInstrDescView.cpp
  llvm/tools/llvm-exegesis/lib/MCInstrDescView.h
  llvm/tools/llvm-reduce/deltas/ReduceRegisterDefs.cpp
  llvm/tools/llvm-reduce/deltas/ReduceRegisterUses.cpp
  llvm/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142215.490833.patch
Type: text/x-patch
Size: 41449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230120/52c8a538/attachment.bin>


More information about the llvm-commits mailing list