24 #define DEBUG_TYPE "ppc-lower-massv-entries" 31 const unsigned MASSVSuffixLength = 5;
34 #define TLI_DEFINE_MASSV_VECFUNCS_NAMES 35 #include "llvm/Analysis/VecFuncs.def" 38 class PPCLowerMASSVEntries :
public ModulePass {
44 bool runOnModule(
Module &M)
override;
46 StringRef getPassName()
const override {
return "PPC Lower MASS Entries"; }
55 static std::string createMASSVFuncName(
Function &Func,
85 "Power8 and Power9 subtargets.");
91 PPCLowerMASSVEntries::createMASSVFuncName(
Function &Func,
93 StringRef Suffix = getCPUSuffix(Subtarget);
95 std::string MASSVEntryName = GenericName + Suffix.
str();
96 return MASSVEntryName;
108 std::string MASSVEntryName = createMASSVFuncName(Func, Subtarget);
118 bool PPCLowerMASSVEntries::runOnModule(
Module &M) {
119 bool Changed =
false;
121 auto *TPC = getAnalysisIfAvailable<TargetPassConfig>();
132 if (!isMASSVFunc(Func.
getName()))
142 for (
auto *
User : MASSVUsers) {
148 Changed |= lowerMASSVCall(CI, Func, M, Subtarget);
163 return new PPCLowerMASSVEntries();
const_iterator end(StringRef path)
Get end iterator over path.
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
void push_back(const T &Elt)
This class represents a function call, abstracting a target machine's calling convention.
char & PPCLowerMASSVEntriesID
AnalysisUsage & addRequired()
ModulePass * createPPCLowerMASSVEntriesPass()
void setCalledFunction(Function *Fn)
Sets the function called, including updating the function type.
AttributeList getAttributes() const
Return the attribute list for this Function.
Represent the analysis usage information of a pass.
INITIALIZE_PASS(PPCLowerMASSVEntries, DEBUG_TYPE, "Lower MASSV entries", false, false) ModulePass *llvm
Common code between 32-bit and 64-bit PowerPC targets.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
FunctionCallee getOrInsertFunction(StringRef Name, FunctionType *T, AttributeList AttributeList)
Look up the specified function in the module symbol table.
FunctionType * getFunctionType() const
Returns the FunctionType for me.
iterator_range< user_iterator > users()
StringRef getName() const
Return a constant reference to the value's name.
const Function * getParent() const
Return the enclosing method, or null if none.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool isDeclaration() const
Return true if the primary definition of this global value is outside of the current translation unit...
LLVM_NODISCARD StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
StringRef - Represent a constant reference to a string, i.e.
const BasicBlock * getParent() const