Go to the documentation of this file.
21 assert(TSM &&
"Can not clone null module");
24 ShouldCloneDef = [](
const GlobalValue &) {
return true; };
30 std::set<GlobalValue *> ClonedDefsInSrc;
33 if (ShouldCloneDef(*GV)) {
40 if (UpdateClonedDefSource)
41 for (
auto *GV : ClonedDefsInSrc)
42 UpdateClonedDefSource(*GV);
52 StringRef(ClonedModuleBuffer.data(), ClonedModuleBuffer.size()),
53 "cloned module buffer");
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
void writeModule(const Module &M, bool ShouldPreserveUseListOrder=false, const ModuleSummaryIndex *Index=nullptr, bool GenerateHash=false, ModuleHash *ModHash=nullptr)
Write the specified module to the buffer specified at construction time.
LLVMContext * getContext()
Returns a pointer to the LLVMContext that was used to construct this instance, or null if the instanc...
Expected< std::unique_ptr< Module > > parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context, DataLayoutCallbackTy DataLayoutCallback=[](StringRef) { return None;})
Read the specified bitcode file, returning the module.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
An LLVMContext together with an associated mutex that can be used to lock the context to prevent conc...
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
A Module instance is used to store all the information related to an LLVM module.
decltype(auto) withModuleDo(Func &&F)
Locks the associated ThreadSafeContext and calls the given function on the contained Module.
StringRef - Represent a constant reference to a string, i.e.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
void writeStrtab()
Write the bitcode file's string table.
std::function< bool(const GlobalValue &)> GVPredicate
std::unique_ptr< Module > CloneModule(const Module &M)
Return an exact copy of the specified module.
void writeSymtab()
Attempt to write a symbol table to the bitcode file.
std::function< void(GlobalValue &)> GVModifier
An LLVM Module together with a shared ThreadSafeContext.
ThreadSafeModule cloneToNewContext(const ThreadSafeModule &TSMW, GVPredicate ShouldCloneDef=GVPredicate(), GVModifier UpdateClonedDefSource=GVModifier())
Clones the given module on to a new context.