[all-commits] [llvm/llvm-project] 405977: [StatepointLowering] Only export STATEPOINT result...

dantrushin via All-commits all-commits at lists.llvm.org
Wed Apr 27 05:55:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4059770af593c5ec8f751b1ceb6c288e1cfc866e
      https://github.com/llvm/llvm-project/commit/4059770af593c5ec8f751b1ceb6c288e1cfc866e
  Author: Denis Antrushin <dantrushin at gmail.com>
  Date:   2022-04-27 (Wed, 27 Apr 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
    M llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
    M llvm/test/CodeGen/X86/statepoint-vreg-details.ll
    M llvm/test/CodeGen/X86/statepoint-vreg-unlimited-tied-opnds.ll
    M llvm/test/CodeGen/X86/statepoint-vreg.ll

  Log Message:
  -----------
  [StatepointLowering] Only export STATEPOINT results if used in nonlocal blocks.

Cuurently we always export STATEPOINT results (GC pointers lowered via VRegs)
to virtual registers. When processing gc.relocate instructions we have to
generate CopyFromRegs node and then export it to VReg again if gc.relocate
is used in other basic blocks. This results in generation of extra COPY MIR
instruction if statepoint and its gc.relocate are in the same BB, but gc.relocate
result is used in other blocks.

This patch changes this behavior to export statepoint results only if used
in other basic blocks. For local uses StatepointLoweringState.(get|set)Location()
API is used to communicate appropriate statepoint result from `LowerStatepoint()`
to `visitGCRelocate()`

This is NFC and is purely compile time optimization. On big methids it can improve
codegen compile time up to 10%.

Reviewed By: reames

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




More information about the All-commits mailing list