[PATCH] D21121: IR: Introduce llvm.type.checked.load intrinsic.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 00:03:08 PDT 2016


pcc created this revision.
pcc added reviewers: eugenis, mehdi_amini, kcc.
pcc added a subscriber: llvm-commits.
pcc added a dependency: D21053: IR: New representation for CFI and virtual call optimization pass metadata..

This intrinsic safely loads a function pointer from a virtual table pointer
using type metadata. This intrinsic is used to implement control flow integrity
in conjunction with virtual call optimization. The virtual call optimization
pass will optimize away llvm.type.checked.load intrinsics associated with
devirtualized calls, thereby removing the type check in cases where it is
not needed to enforce the control flow integrity constraint.

This patch also introduces the capability to copy type metadata between
global variables, and teaches the virtual call optimization pass to do so.

Depends on D21053

http://reviews.llvm.org/D21121

Files:
  docs/LangRef.rst
  include/llvm/Analysis/TypeMetadataUtils.h
  include/llvm/IR/Intrinsics.td
  lib/Analysis/TypeMetadataUtils.cpp
  lib/IR/Metadata.cpp
  lib/Transforms/IPO/WholeProgramDevirt.cpp
  test/Transforms/WholeProgramDevirt/constant-arg.ll
  test/Transforms/WholeProgramDevirt/devirt-single-impl-check.ll
  test/Transforms/WholeProgramDevirt/expand-check.ll
  test/Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll
  test/Transforms/WholeProgramDevirt/virtual-const-prop-check.ll
  test/Transforms/WholeProgramDevirt/virtual-const-prop-end.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21121.60005.patch
Type: text/x-patch
Size: 37810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160608/22e58111/attachment.bin>


More information about the llvm-commits mailing list