[PATCH] D149915: [CodeGen][KCFI] Move cfi-type lowering to TargetLowering

Sami Tolvanen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 15:50:52 PDT 2023


samitolvanen created this revision.
samitolvanen added reviewers: nickdesaulniers, MaskRay, pcc, joaomoreira, kees, reames, craig.topper, jrtc27.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
samitolvanen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

KCFI machine function passes transform indirect calls with a
cfi-type attribute into architecture-specific type checks bundled
together with the calls. Instead of having a separate pass for each
architecture, add a generic machine function pass for KCFI and
move the architecture-specific code that emits the actual check to
TargetLowering. This avoids unnecessary duplication and makes it
easier to add KCFI support to other architectures.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149915

Files:
  llvm/include/llvm/CodeGen/Passes.h
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/KCFI.cpp
  llvm/lib/Target/AArch64/AArch64.h
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64KCFI.cpp
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/lib/Target/AArch64/CMakeLists.txt
  llvm/lib/Target/X86/CMakeLists.txt
  llvm/lib/Target/X86/X86.h
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/lib/Target/X86/X86KCFI.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/AArch64/kcfi-bti.ll
  llvm/test/CodeGen/AArch64/kcfi.ll
  llvm/test/CodeGen/X86/kcfi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149915.519684.patch
Type: text/x-patch
Size: 27016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230504/b06c74e4/attachment.bin>


More information about the llvm-commits mailing list