search for: getlibfunc

Displaying 15 results from an estimated 15 matches for "getlibfunc".

2019 Apr 24
2
Accelerating TLI getLibFunc lookups
...of TLI) * We'd change IntID field in GlobalValue to be union of IntrinsicID and LibFunc. * We'd change Function::getIntrisicID to check the HasLLVMReservedName flag (already existing), and return Intrinsic::not_inrinsic value if not set. * We'd add a corresponding getLibFuncID, and isLibFunc function to Function. * We'd modify recalculateIntrinsicID to compute the libfunc enum as well. The tradeoff is that function construction and renaming would become slightly slower, but determining whether a function was a library function would become fast.  We could al...
2016 Jun 07
3
llvm intrinsics/libc/libm question
I'm trying to figure out exactly how the intrinsics/libc/libm work in llvm. For example, this code return user defined function: float acos(float x, float y) { return x+y; } float a; void foo(float b, float c) { a = acos(b, c); } But this code returns llvm.intrinsic: float acos(float, float); float a; void foo(float b, float c) { a = acos(b, c); } float acos(float x, float y) {
2016 Jun 07
3
llvm intrinsics/libc/libm question
...' to say 'XXX_acos' in your libm > > it'll still be optimized? > > Correct, it won't be. > > It's possible to make that happen with a few patches, but there has > been no need for that yet: > > - replace the various calls to TLI::has() or > TLI::getLibFunc(StringRef, Func&) with TLI::getLibFunc(Function&, > Func&). Any of the former are probably hiding bugs related to > incorrect prototypes > > - teach TLI::getLibFunc to check function availability using the > custom name instead of always checking the standard name. Agai...
2015 Jan 20
3
[LLVMdev] strlen in fast-isel
It seems that fast-isel for intel does not handle strlen. It's a general problem in fast-isel . ~/llvmw/build/Deb~/llvmw/build/Debug+Asserts/bin/clang -O0 -mllvm -fast-isel-verbose -mllvm -fast-isel strlen1.c strlen1.c:12:3: warning: implicitly declaring library function 'printf' with type 'int (const char *, ...)' printf("%i\n", len); ^
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...endenceResults *MD, > const DataLayout &DL, const TargetLibraryInfo *TLI, > InstOverlapIntervalsTy &IOL, > DenseMap<Instruction *, size_t> *InstrOrdering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->getCalledFunction(); > if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || > Func != LibFunc_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = > dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; > if (!isStri...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...&BBI, AliasAnalysis *AA, MemoryDependenceResults *MD, const DataLayout &DL, const TargetLibraryInfo *TLI, InstOverlapIntervalsTy &IOL, DenseMap<Instruction *, size_t> *InstrOrdering) { // Must be a strlen. LibFunc Func; Function *Callee = CI->getCalledFunction(); if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || Func != LibFunc_strlen) return false; Value *Dst = CI->getOperand(0); Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); if (!UnderlyingPointer) return false; if (!isStringFromCalloc(Dst, TLI)) return false; if (m...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...endenceResults *MD, > const DataLayout &DL, const TargetLibraryInfo *TLI, > InstOverlapIntervalsTy &IOL, > DenseMap<Instruction *, size_t> *InstrOrdering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->getCalledFunction(); > if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || > Func != LibFunc_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = > dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; > if (!isStri...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...&IOL, >>>> DenseMap<Instruction *, size_t> *InstrOrdering) { >>>> >>>> // Must be a strlen. >>>> LibFunc Func; >>>> Function *Callee = CI->getCalledFunction(); >>>> if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || >>>> Func != LibFunc_strlen) >>>> return false; >>>> >>>> Value *Dst = CI->getOperand(0); >>>> Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, D...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...ibraryInfo *TLI, > InstOverlapIntervalsTy &IOL, > DenseMap<Instruction *, size_t> *InstrOrdering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->getCalledFunction(); > if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || > Func != LibFunc_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer) > return false; &...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...DataLayout &DL, const TargetLibraryInfo *TLI, InstOverlapIntervalsTy &IOL, DenseMap<Instruction *, size_t> *InstrOrdering) { // Must be a strlen. LibFunc Func; Function *Callee = CI->getCalledFunction(); if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || Func != LibFunc_strlen) return false; Value *Dst = CI->getOperand(0); Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); if (!UnderlyingPointer) return false; if (isStringFromCalloc(Dst, TLI))...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...InstOverlapIntervalsTy &IOL, >> DenseMap<Instruction *, size_t> *InstrOrdering) { >> >> // Must be a strlen. >> LibFunc Func; >> Function *Callee = CI->getCalledFunction(); >> if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || >> Func != LibFunc_strlen) >> return false; >> >> Value *Dst = CI->getOperand(0); >> Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); >> if (!UnderlyingPointer)...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...InstOverlapIntervalsTy &IOL, > DenseMap<Instruction *, size_t> *InstrOrdering) { > > // Must be a strlen. > LibFunc Func; > Function *Callee = CI->getCalledFunction(); > if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || > Func != LibFunc_strlen) > return false; > > Value *Dst = CI->getOperand(0); > Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); > if (!UnderlyingPointer)...
2018 May 21
2
DSE: Remove useless stores between malloc & memset
memoryIsNotModifiedBetween is precisely the sort of expensive walk we shouldn't be doing... I'm surprised it hasn't caused any serious issues yet.  Ideally, what we should be doing is using MemorySSA to find a dependency from the memset: if the closest dependency is the malloc, there aren't any stores between the memset and the malloc.  (But we aren't using MemorySSA in
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...InstOverlapIntervalsTy &IOL, >>> DenseMap<Instruction *, size_t> *InstrOrdering) { >>> >>> // Must be a strlen. >>> LibFunc Func; >>> Function *Callee = CI->getCalledFunction(); >>> if (!TLI->getLibFunc(*Callee, Func) || !TLI->has(Func) || >>> Func != LibFunc_strlen) >>> return false; >>> >>> Value *Dst = CI->getOperand(0); >>> Instruction *UnderlyingPointer = dyn_cast<Instruction>(GetUnderlyingObject(Dst, DL)); >>>...
2015 Dec 03
3
Function attributes for LibFunc and its impact on GlobalsAA
----- Original Message ----- > From: "James Molloy via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Vaivaswatha Nagaraj" <vn at compilertree.com> > Cc: "LLVM Dev" <llvm-dev at lists.llvm.org> > Sent: Thursday, December 3, 2015 4:41:46 AM > Subject: Re: [llvm-dev] Function attributes for LibFunc and its impact on GlobalsAA > >