search for: onlyreadsmemory

Displaying 20 results from an estimated 29 matches for "onlyreadsmemory".

2013 May 17
3
[LLVMdev] Inlining sqrt library function in X86
...ing to determine what it would take to get the X86 code generator to replace the call to sqrt with a sqrtsd instruction inline. It turns out that it could do exactly that, were it not for the fact that in the function visitUnaryFloatCall() at line 5514 in SelectionDAGBuilder.cpp, the result of !I.onlyReadsMemory() Is true, so the code is unable to replace the function call with an ISD::FSQRT SDNode. If I remove the above test, then the compiler will emit a sqrtsd instruction. I am hoping that someone might be able to comment on what onlyReadsMemory is supposed to do be doing in general and why it is retu...
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 GlobalsAA information in the caller (and its caller and so on). Aren't these attrib...
2013 May 17
0
[LLVMdev] Inlining sqrt library function in X86
...it would take to get the X86 code generator to replace the call to sqrt with a sqrtsd instruction inline. > > It turns out that it could do exactly that, were it not for the fact that in the function visitUnaryFloatCall() at line 5514 in SelectionDAGBuilder.cpp, the result of > > !I.onlyReadsMemory() > > Is true, so the code is unable to replace the function call with an ISD::FSQRT SDNode. If I remove the above test, then the compiler will emit a sqrtsd instruction. > > I am hoping that someone might be able to comment on what onlyReadsMemory is supposed to do be doing in gene...
2015 Dec 03
2
Function attributes for LibFunc and its impact on GlobalsAA
...vm.org> wrote: > >> 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 GlobalsAA information in the >> caller (and it...
2016 Aug 24
2
LLVM 3.9 RC2's SCCP pass removing calls to external functions?!
I am probably stating the obvious, but if the function is side-effect free (onlyReadsMemory) it is valid to remove it. But I am guessing that does not belong to this pass. On Wed, Aug 24, 2016 at 8:38 AM, Sanjoy Das via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Btw, looks like the bug is in runSCCP in > > for (BasicBlock::iterator BI = BB.begin(), E = BB.end();...
2014 Sep 08
2
[LLVMdev] Alias Analysis - ModRefBehaviour
Hello, Is there a analysis pass which calculates the ModRefBehaviours OnlyReadsPointerArguments and OnlyAccessesPointerArguments? I tried to find one but so far I only saw that different AA's return OnlyReadsMemory and DoesNotAccessMemory if the readonly and readnone attributes are set. Best regards and thanks in advance, Johannes -- Johannes Doerfert Researcher / PhD Student Compiler Design Lab (Prof. Hack) Saarland University, Computer Science Building E1.3, Room 4.26 Tel. +49 (0)681 302-57521 : doe...
2015 Dec 03
3
Function attributes for LibFunc and its impact on GlobalsAA
...t; wrote: > > > > > > > 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 GlobalsAA > information in the caller (and its calle...
2013 May 18
2
[LLVMdev] Inlining sqrt library function in X86
...get the X86 code generator to replace the call to sqrt with a sqrtsd instruction inline. >> >> It turns out that it could do exactly that, were it not for the fact that in the function visitUnaryFloatCall() at line 5514 in SelectionDAGBuilder.cpp, the result of >> >> !I.onlyReadsMemory() >> >> Is true, so the code is unable to replace the function call with an ISD::FSQRT SDNode. If I remove the above test, then the compiler will emit a sqrtsd instruction. >> >> I am hoping that someone might be able to comment on what onlyReadsMemory is supposed to do...
2012 Nov 06
4
[LLVMdev] FW: Bug in SelectionDAG visitTargetIntrinsic
From: Villmow, Micah Sent: Tuesday, November 06, 2012 1:37 PM To: 'llvm-dev at cs.uiuc.edu' Cc: Guo, Xiaoyi Subject: Bug in SelectionDAG visitTargetIntrinsic We ran into a problem where specifying IntrNoMem was causing our instruction selection to fail with target specific intrinsics. After looking into the code and ISel debug it looks like tablegen and SelectionDAG are using different
2012 Nov 06
0
[LLVMdev] Bug in SelectionDAG visitTargetIntrinsic
void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I, - unsigned Intrinsic) { - bool HasChain = !I.doesNotAccessMemory(); - bool OnlyLoad = HasChain && I.onlyReadsMemory(); + unsigned Intrinsic) { + // Info is set by getTgtMemInstrinsic + TargetLowering::IntrinsicInfo Info; + bool IsTgtIntrinsic = TLI.getTgtMemIntrinsic(Info, I, Intrinsic); + bool HasChain = Info.readMem || Info.writeMem; + bool OnlyLoad = HasChain &...
2015 Dec 11
2
RFC: New function attribute HasInaccessibleState
...aph) if (F->isDeclaration()) { // Try to get mod/ref behaviour from function attributes. - if (F->doesNotAccessMemory()) { + if (F->doesNotAccessMemory() || F->onlyAccessesArgMemory()) { // Can't do better than that! } else if (F->onlyReadsMemory()) { FunctionEffect |= Ref; if (!F->isIntrinsic()) // This function might call back into the module and read a global - // consider every global as possibly being read by this function. FR.MayReadAnyGlobal = true; } else {...
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...ph) if (F->isDeclaration()) { // Try to get mod/ref behaviour from function attributes. - if (F->doesNotAccessMemory()) { + if (F->doesNotAccessMemory() || F->onlyAccessesArgMemory()) { // Can't do better than that! } else if (F->onlyReadsMemory()) { FunctionEffect |= Ref; if (!F->isIntrinsic()) // This function might call back into the module and read a global - // consider every global as possibly being read by this function. FR.MayReadAnyGlobal = true; } else {...
2015 Dec 04
4
RFC: New function attribute HasInaccessibleState
...eclaration()) { > // Try to get mod/ref behaviour from function attributes. > - if (F->doesNotAccessMemory()) { > + if (F->doesNotAccessMemory() || F->onlyAccessesArgMemory()) { > // Can't do better than that! > } else if (F->onlyReadsMemory()) { > FunctionEffect |= Ref; > if (!F->isIntrinsic()) > // This function might call back into the module and read a global - > // consider every global as possibly being read by this function. > FR.MayReadAnyGlobal = tr...
2015 Dec 11
2
RFC: New function attribute HasInaccessibleState
...// Try to get mod/ref behaviour from function attributes. > > - if (F->doesNotAccessMemory()) { > > + if (F->doesNotAccessMemory() || > > F->onlyAccessesArgMemory()) { > > // Can't do better than that! > > } else if (F->onlyReadsMemory()) { > > FunctionEffect |= Ref; > > if (!F->isIntrinsic()) > > // This function might call back into the module and > > read a global - > > // consider every global as possibly being read by this > >...
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...Try to get mod/ref behaviour from function attributes. >>> - if (F->doesNotAccessMemory()) { >>> + if (F->doesNotAccessMemory() || F->onlyAccessesArgMemory()) { >>> // Can't do better than that! >>> } else if (F->onlyReadsMemory()) { >>> FunctionEffect |= Ref; >>> if (!F->isIntrinsic()) >>> // This function might call back into the module and read a global - >>> // consider every global as possibly being read by this function. >>&g...
2017 Oct 10
2
Expose aliasing information in getModRefInfo (or viceversa?)
...etermine it's a must-alias of a set of things, we could do the same If we determine it's a must-alias of the live on entry def, etc If I understand correctly, the necessary info for fp in this example is: isMustAlias (CallSite argument a, Value a) && getModRefBehavior(CallSite)== onlyReadsMemory. So adding a MRI_MustMod is insufficient? Are we instead looking to set a MRI_Must bit, disjunct of MRI_Mod, and test for MRI_Ref&MRI_Must or MRI_Mod&MRI_Must? In getModRefInfo(CS, Loc), the MRI_Must bit would then be set if doesAccessArgPointees and ArgAlias == MustAlias for all Args, whi...
2009 Nov 06
1
[LLVMdev] Functions: sret and readnone
Hi Stephan, >> In order to perform this transform the optimizers would have to work out >> that sample does not modify any global state. This cannot be done without >> knowing the definition of sample, but you only provide a declaration. > > Which is why I am trying to supply this additional information in a > custom alias analysis pass, but it doesn't seem to
2015 Dec 04
2
RFC: New function attribute HasInaccessibleState
...> // Try to get mod/ref behaviour from function attributes. >> - if (F->doesNotAccessMemory()) { >> + if (F->doesNotAccessMemory() || F->onlyAccessesArgMemory()) { >> // Can't do better than that! >> } else if (F->onlyReadsMemory()) { >> FunctionEffect |= Ref; >> if (!F->isIntrinsic()) >> // This function might call back into the module and read a global - >> // consider every global as possibly being read by this function. >> FR.M...
2015 Dec 11
3
RFC: New function attribute HasInaccessibleState
...ehaviour from function attributes. > > > - if (F->doesNotAccessMemory()) { > > > + if (F->doesNotAccessMemory() || > > > F->onlyAccessesArgMemory()) { > > > // Can't do better than that! > > > } else if (F->onlyReadsMemory()) { > > > FunctionEffect |= Ref; > > > if (!F->isIntrinsic()) > > > // This function might call back into the module and > > > read a global - > > > // consider every global as possibly being re...
2016 Aug 24
2
LLVM 3.9 RC2's SCCP pass removing calls to external functions?!
Hi Félix, Sanjoy Das wrote: > Félix Cloutier via llvm-dev wrote: > > Assuming that this is a bug, what are the next steps? > > Looks like you already have a very small test case -- have you tried > sticking it in a debugger to see why SCCP thinks removing the call is > okay? > > Alternatively, file a bug at llvm.org/bugs and someone will get to it. The third