|
LLVM 24.0.0git
|
#include "RISCV.h"#include "RISCVSubtarget.h"#include "RISCVTargetMachine.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/TargetLowering.h"#include "llvm/CodeGen/TargetPassConfig.h"#include "llvm/IR/Analysis.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constant.h"#include "llvm/IR/Constants.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/IR/PassManager.h"#include "llvm/IR/Type.h"#include "llvm/Pass.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Debug.h"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. | |
| #define DEBUG_TYPE "riscv-promote-constant" |
Definition at line 38 of file RISCVPromoteConstant.cpp.
| #define RISCV_PROMOTE_CONSTANT_NAME "RISC-V Promote Constants" |
Definition at line 39 of file RISCVPromoteConstant.cpp.
Referenced by INITIALIZE_PASS().
| INITIALIZE_PASS | ( | RISCVPromoteConstantLegacy | , |
| DEBUG_TYPE | , | ||
| RISCV_PROMOTE_CONSTANT_NAME | , | ||
| false | , | ||
| false | ) |
Definition at line 64 of file RISCVPromoteConstant.cpp.
References llvm::createRISCVPromoteConstantLegacyPass(), DEBUG_TYPE, and RISCV_PROMOTE_CONSTANT_NAME.
|
static |
Definition at line 71 of file RISCVPromoteConstant.cpp.
References llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::at(), C(), llvm::cast(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::dbgs(), llvm::dyn_cast(), F, llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::Function::getAttributes(), llvm::Type::getDoubleTy(), llvm::BasicBlock::getFirstInsertionPt(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::BasicBlock::getTerminator(), I, II, instructions, llvm::GlobalValue::InternalLinkage, llvm::isa(), llvm::TargetLoweringBase::isFPImmLegal(), llvm::TargetLoweringBase::isTypeLegal(), LLVM_DEBUG, llvm::MapVector< KeyT, ValueT, MapType, VectorType, N >::size(), and Uses.
Referenced by promoteConstantsInModule().
|
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 | ( | NumPromoted | , |
| "Number of constant literals promoted to globals" | ) |
| STATISTIC | ( | NumPromotedUses | , |
| "Number of uses of promoted literal constants" | ) |