[PATCH] D125072: [MachineOutliner] Make getOutliningType partially target-independent

duk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 20:39:10 PDT 2022


duck-37 created this revision.
duck-37 added a reviewer: jpaquette.
Herald added subscribers: luke957, frasercrmck, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a reviewer: paquette.
Herald added a project: All.
duck-37 requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay.
Herald added a project: LLVM.

The motivation behind this change is to make fixing this <https://reviews.llvm.org/D124707#3483805> (and other issues like this that may crop up in the future) easier.
This is _almost_ NFC, but there are some notable changes here:

1. `isMetaInstruction()` is used directly instead of checking for specific meta-instructions like `IMPLICIT_DEF` or `KILL`. This was already the case in RISCV, but other architectures still did hardcoded checks.
  - As an exception to this, CFI instructions are explicitly delegated to the target because RISCV has different handling for those.
2. `isTargetIndex()` checks are replaced with an assert; none of the architectures supported actually use MO_TargetIndex at this point in time, but just removing this check may trip someone up down the line.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125072

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/TargetInstrInfo.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.h
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfo.h
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/lib/Target/X86/X86InstrInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125072.427524.patch
Type: text/x-patch
Size: 16600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220506/ab76dce5/attachment.bin>


More information about the llvm-commits mailing list