[all-commits] [llvm/llvm-project] f16d2b: Devirtualize a call on alloca without waiting for ...

hjyamauchi via All-commits all-commits at lists.llvm.org
Fri Feb 28 10:02:38 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f16d2bec40691f4050174c99600847d024486bc5
      https://github.com/llvm/llvm-project/commit/f16d2bec40691f4050174c99600847d024486bc5
  Author: Hiroshi Yamauchi <yamauchi at google.com>
  Date:   2020-02-28 (Fri, 28 Feb 2020)

  Changed paths:
    M clang/test/CodeGenCXX/member-function-pointer-calls.cpp
    M llvm/lib/Transforms/IPO/Inliner.cpp
    A llvm/test/Transforms/Inline/devirtualize-4.ll

  Log Message:
  -----------
  Devirtualize a call on alloca without waiting for post inline cleanup and next DevirtSCCRepeatedPass iteration.

This aims to fix a missed inlining case.

If there's a virtual call in the callee on an alloca (stack allocated object) in
the caller, and the callee is inlined into the caller, the post-inline cleanup
would devirtualize the virtual call, but if the next iteration of
DevirtSCCRepeatedPass doesn't happen (under the new pass manager), which is
based on a heuristic to determine whether to reiterate, we may miss inlining the
devirtualized call.

This enables inlining in clang/test/CodeGenCXX/member-function-pointer-calls.cpp.

This is a second commit after a revert
https://reviews.llvm.org/rG4569b3a86f8a4b1b8ad28fe2321f936f9d7ffd43 and a fix
https://reviews.llvm.org/rG41e06ae7ba91.

Differential Revision: https://reviews.llvm.org/D69591




More information about the All-commits mailing list