[all-commits] [llvm/llvm-project] 24619f: [RISCV][GISEL] Do not initialize GlobalISel object...

Michael Maitland via All-commits all-commits at lists.llvm.org
Wed Jul 10 12:13:19 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24619f6aaf1df4ef07c9b495681fb73f58a767c4
      https://github.com/llvm/llvm-project/commit/24619f6aaf1df4ef07c9b495681fb73f58a767c4
  Author: Michael Maitland <michaeltmaitland at gmail.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVSubtarget.cpp
    M llvm/lib/Target/RISCV/RISCVSubtarget.h

  Log Message:
  -----------
  [RISCV][GISEL] Do not initialize GlobalISel objects unless needed (#98233)

Prior to this commit, we created the GlobalISel objects in the
RISCVSubtarget constructor, even if we are not running GlobalISel. This
patch moves creation of the GlobalISel objects into their getters, which
ensures that we only create these objects if they are actually needed.
This helps since some of the constructors of the GlobalISel objects have
a significant amount of code.

We make the `unique_ptr`s `mutable` since GlobalISel passes only have
access to `const TargetSubtargetInfo` through `MF.getSubtarget()`.

This patch is tested by the fact that all existing RISC-V GlobalISel
tests remain passing.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list