[PATCH] D42725: IRGen: Move vtable load after argument evaluation.

Peter Collingbourne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 19:07:38 PST 2018


pcc created this revision.
pcc added reviewers: vlad.tsyrklevich, rsmith.

This change reduces the live range of the loaded function pointer,
resulting in a slight code size decrease (~10KB in clang), and also
improves the security of CFI for virtual calls by making it less
likely that the function pointer will be spilled, and ensuring that
it is not spilled across a function call boundary.

Fixes PR35353.


https://reviews.llvm.org/D42725

Files:
  clang/lib/CodeGen/CGCXXABI.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGCall.h
  clang/lib/CodeGen/CGExprCXX.cpp
  clang/lib/CodeGen/ItaniumCXXABI.cpp
  clang/lib/CodeGen/MicrosoftCXXABI.cpp
  clang/test/CodeGenCXX/cfi-vcall-check-after-args.cpp
  clang/test/CodeGenCXX/cxx2a-destroying-delete.cpp
  clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
  clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
  clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-this-adjustment.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42725.132094.patch
Type: text/x-patch
Size: 23795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180131/d4adc0e9/attachment-0001.bin>


More information about the cfe-commits mailing list