LLVM 24.0.0git
RISCVPromoteConstant.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "riscv-promote-constant"
#define RISCV_PROMOTE_CONSTANT_NAME   "RISC-V Promote Constants"

Functions

 STATISTIC (NumPromoted, "Number of constant literals promoted to globals")
 STATISTIC (NumPromotedUses, "Number of uses of promoted literal constants")
 INITIALIZE_PASS (RISCVPromoteConstantLegacy, DEBUG_TYPE, RISCV_PROMOTE_CONSTANT_NAME, false, false) ModulePass *llvm
static bool promotConstantsInFunction (Function &F, const RISCVTargetLowering *TLI)
static bool promoteConstantsInModule (Module &M, const TargetMachine &TM)
 Iterate over the functions and promote the double fp constants that would otherwise go into the constant pool to a constant array.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-promote-constant"

Definition at line 38 of file RISCVPromoteConstant.cpp.

◆ RISCV_PROMOTE_CONSTANT_NAME

#define RISCV_PROMOTE_CONSTANT_NAME   "RISC-V Promote Constants"

Definition at line 39 of file RISCVPromoteConstant.cpp.

Referenced by INITIALIZE_PASS().

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( RISCVPromoteConstantLegacy ,
DEBUG_TYPE ,
RISCV_PROMOTE_CONSTANT_NAME ,
false ,
false  )

◆ promotConstantsInFunction()

◆ promoteConstantsInModule()

bool promoteConstantsInModule ( Module & M,
const TargetMachine & TM )
static

Iterate over the functions and promote the double fp constants that would otherwise go into the constant pool to a constant array.

Definition at line 201 of file RISCVPromoteConstant.cpp.

References Changed, F, llvm::TargetMachine::getSubtarget(), and promotConstantsInFunction().

Referenced by llvm::RISCVPromoteConstantPass::run().

◆ STATISTIC() [1/2]

STATISTIC ( NumPromoted ,
"Number of constant literals promoted to globals"  )

◆ STATISTIC() [2/2]

STATISTIC ( NumPromotedUses ,
"Number of uses of promoted literal constants"  )