search for: isdeclar

Displaying 20 results from an estimated 122 matches for "isdeclar".

Did you mean: isdeclare
2016 Apr 20
2
Lazily Loaded Modules and Linker::LinkOnlyNeeded
...Basically any function that was still to be materialized wasn't getting its body copied over during linking. The only line of code that differs when you set LinkOnlyNeeded is in LinkModules.cpp -> ModuleLinker::linkIfNeeded: if (shouldLinkOnlyNeeded() && !(DGV && DGV->isDeclaration())) return false; The isDeclaration() for functions has a call to isMaterializable(). Things I've tried: * If I don't pass LinkOnlyNeeded but still link from the lazily loaded runtime module into the user module, it works (albeit it is orders of magnitude slower like...
2015 Mar 11
2
[LLVMdev] how to know whether a function is a declaration or definition
Hello, I found a function call Function::isDeclaration() in llvm 2.5 (I know that's ancient...), which is useful to me, but I can't find it in the later version 3.3, nor the latest 3.7.....Therefore, is there an alternative way to check whether the function is just a declaration or a definition ? PS: I read the source code of llvm 2.5,...
2016 Apr 20
2
Lazily Loaded Modules and Linker::LinkOnlyNeeded
...at was still to be > materialized wasn't getting its body copied over during linking. > > The only line of code that differs when you set LinkOnlyNeeded is in > LinkModules.cpp -> ModuleLinker::linkIfNeeded: > > if (shouldLinkOnlyNeeded() && !(DGV && DGV->isDeclaration())) > return false; > > > The isDeclaration() for functions has a call to isMaterializable(). > > Things I've tried: > > - If I don't pass LinkOnlyNeeded but still link from the lazily loaded > runtime module into the user module, it works (albeit i...
2011 Oct 15
1
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
...ionPass { public: static char ID; Hello(): FunctionPass(ID) { ;; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MemoryDependenceAnalysis>(); errs() << "addRequired called\n"; } virtual bool runOnFunction(Function &F) { if(F.isDeclaration() == true) return false; MemoryDependenceAnalysis *MD = &getAnalysis<MemoryDependenceAnalysis>(F); for(Function::iterator i = F.begin(); i != F.end(); ++i) { for(BasicBlock::iterator j = i->begin(); j != i->end(); ++j) { i->dump(); } } return false;...
2011 Oct 14
0
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
...OnFunction(), you should check to see if the function F is a declaration before calling getAnalysis(F). Calling getAnalysis<FunctionPass>() on a function that is a declaration will trigger an assertion if the function is just a declaration. To see if a function is a declaration, call its isDeclaration() method (i.e. if (F->isDeclaration()) ... ) -- John T. On 10/13/11 8:09 PM, ret val wrote: > #include "llvm/Module.h" > #include "llvm/Analysis/MemoryDependenceAnalysis.h" > #include "llvm/Support/raw_ostream.h" > using namespace llvm; > &gt...
2011 Oct 14
2
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
#include "llvm/Module.h" #include "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; struct Hello: public ModulePass { public: static char ID; MemoryDependenceAnalysis *MD; Hello(): ModulePass(ID) { ;; } virtual void getAnalysisUsage(AnalysisUsage &AU) const {
2010 Nov 30
1
[LLVMdev] the definitions of internal functions and external functions
Hi, I have a llvm pass in hand written by other people. There are following statements that I couldn't understand: -------------------------------program---------------------------------------------------- ... // Calls to internal functions. if (!F->isDeclaration()) { DOUT << " internal call" << opcode << ": " << name << "\n"; return ...; } // Calls to external functions ... ------------------------------------------------------------------------------------------- My question is:...
2011 Nov 30
0
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
...runOnSCC(CallGraphSCC &SCC) { for (CallGraphSCC::iterator CGNodeItr = SCC.begin(), CFNodeItrE=SCC.end();CGNodeItr!=CGNodeItrE;++CGNodeItr) } const CallGraphNode *CGNode = *CGNodeItr; Function *F = CGNode->getFunction(); if (!F->isDeclaration()) LoopInfo &LI = getAnalysis<LoopInfo>(*F); } return false; } }; char myPass::ID = 0; static RegisterPass<myPass> X("myPass", "This is my pass", false, false); } -------------- next part -------------...
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
...t a full bug report, > with preprocessed source if appropriate. > See <URL:http://llvm.org/bugs> for instructions. In llvm-backend.cpp : 1086 if (GV->getName() != Name) { 1087 Function *F = TheModule->getFunction(Name); 1088 assert(F && F->isDeclaration() && "A function turned into a global?"); 1089 1090 // Replace any uses of "F" with uses of GV. 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >getType()); (gdb) p Name $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThr...
2011 Nov 21
5
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
I would have thought this would have been possible. On Thu, Nov 17, 2011 at 3:49 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > So is this simply not possible? > > > On Thu, Nov 17, 2011 at 10:31 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > >> Nick, >> >> Thanks for this info, though this didn't help my problem at all. >> >>
2009 Jun 21
4
[LLVMdev] proposal to simplify isel/asmprinter interaction with globals
...n order to output the right thing. For example, to determine whether to emit $non_lazy_ptr, it uses a logic tree like this: if (shouldPrintStub(TM, Subtarget)) { // Link-once, declaration, or Weakly-linked global variables need // non-lazily-resolved stubs if (GV->isDeclaration() || GV->isWeakForLinker()) { // Dynamically-resolved functions need a stub for the function. if (GV->hasHiddenVisibility()) { if (!GV->isDeclaration() && !GV->hasCommonLinkage()) ... else { printSuffixedName(Name, &qu...
2007 Sep 19
3
[LLVMdev] Valgrind Help Needed
Hi all, This program: @protocol CPTransferThreadObserving; @interface CPMode {} @end @implementation CPMode -(void) copyInBackgroundAndNotifyUsingPorts { id client; [client setProtocolForProxy: @protocol(CPTransferThreadObserving)]; } @end produces this internal compiler error: $ llvm-gcc -x objective-c -arch ppc64 -std=c99 -c testcase.mi testcase.mi:12: internal compiler
2011 Nov 10
4
[LLVMdev] Problem getting LoopInfo inside non-LoopPass
John, This did not work. It compiles (isDeclaration was the name of the function) and I passed a reference (&F) (F is a function pointer). I still get the opt load error from the original message (UNREACHABLE exectuted!). Thanks. On Thu, Nov 10, 2011 at 10:00 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > 1. Ok will do. > 2...
2011 Nov 30
2
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
...p;SCC) { >        for (CallGraphSCC::iterator CGNodeItr = SCC.begin(), > CFNodeItrE=SCC.end();CGNodeItr!=CGNodeItrE;++CGNodeItr)  } >                   const CallGraphNode *CGNode = *CGNodeItr; >                   Function *F = CGNode->getFunction(); >                   if (!F->isDeclaration()) >                                LoopInfo &LI = getAnalysis<LoopInfo>(*F); >         } >        return false; >    } >   }; >    char myPass::ID = 0; >    static RegisterPass<myPass> X("myPass", "This is my pass", false, false); >...
2007 Sep 20
2
[LLVMdev] Valgrind Help Needed
...reprocessed source if appropriate. >> See <URL:http://llvm.org/bugs> for instructions. > > In llvm-backend.cpp : > > 1086 if (GV->getName() != Name) { > 1087 Function *F = TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- > >getType()); > > > (gdb) p Name > $3 = 0x41819430...
2015 Dec 02
2
Function attributes for LibFunc and its impact on GlobalsAA
Hi, GlobalsAA, during propagation of mod-ref behavior in the call graph, looks at library functions (in GlobalsAAResult::AnalyzeCallGraph: F->isDeclaration() check), for attributes, and if the function does not have the onlyReadsMemory attribute set, forgets it. I noticed that library functions such as malloc/realloc do not have the attributes doesNotAccessMemory or onlyReadsMemory respectively set (FunctionAttrs.cpp). This leads to a loss of Gl...
2016 Feb 12
3
CloneFunction during LTO leads to seg fault?
In general I use DebugInfoFinder and clear out Metadata if GV in null or GV->isDeclaration(). If there is any interest, I can post that patch... Sergei --- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation > -----Original Message----- > From: Tobias Edler von Koch [mailto:tobias at codeaurora.org] > Sent: Friday, February...
2010 Sep 15
2
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
...oopDepth(&*BB) << "\n"; }; virtual bool runOnModule(Module &M) { Module::const_iterator f_it = M.begin(), f_ite = M.end(); for ( ; f_it != f_ite; ++f_it ) { errs() << f_it->getName() << '\n'; if (!f_it->isDeclaration()) getLoopInfo(*f_it); } return true; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LoopInfo> (); } }; } char bb_info::ID = 0; static RegisterPass<bb_info> Y("bb_in...
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
...nt, ...), false>::get(context), GlobalValue::ExternalLinkage, "kernelgen_launch_", m2); { CallInst* call = dyn_cast<CallInst>(cast<Value>(I)); if (!call) continue; Function* callee = call->getCalledFunction(); if (!callee && !callee->isDeclaration()) continue; if (callee->getName() != func2.getName()) continue; SmallVector<Value*, 16> callargs(call->op_begin(), call->op_end()); callargs.insert(callargs.begin(), ConstantInt::get(Type::getInt32Ty(context), call->getNumArgOperands())); ca...
2019 Jan 13
2
Problem using BlockFrequencyInfo's getBlockProfileCount
...arguments: opt input.bc -o output.bc -load mypass.so -block-freq -pgo-instr-use -pgo-test-profile-file=output.prof -profile-sample-accurate -mypass Is this a bug or am can someone provide an example on how to use BlockFrequencyInfo correctly? Example code: for (auto& F : M) {     if (F.isDeclaration()) {         continue;     }     auto& bfiPass = getAnalysis<BlockFrequencyInfoWrapperPass>(F);     llvm::BlockFrequencyInfo* BFI = &bfiPass.getBFI();     //Works - shows all info I want     BFI->print(llvm::dbgs());     for (const llvm::BasicBlock& B : F) {    ...