search for: aliasresult

Displaying 20 results from an estimated 59 matches for "aliasresult".

2015 Jun 16
4
[LLVMdev] AliasAnalysis refactoring for the new pass manager
...ode. Its nuts.[1] So the options I see are: 1) Commit the significant body of code necessary to emulate proper enum classes in C++, and document it as a boilerplate pattern. I might be able to shrink it with some clever macro tricks, but it looks pretty doubtful honestly. 2) Use "enum class AliasResult { NoAlias, ... }" and update everywhere to say explicitly "... != AliasResult::NoAlias". 3) Use "enum AliasResult { NoAlias = 0, ... }" and everything Just Works but we pollute the llvm namespace with "NoAlias" and friends. 4) Use "enum AliasResult { AR_NoA...
2017 Oct 09
3
Expose aliasing information in getModRefInfo (or viceversa?)
Hi, This came up in https://reviews.llvm.org/D38569, and I'd like some input on what's the best way to get alias and mod-ref info without having two alias calls. A couple of ideas: (a) Extend the getModRefInfo interface (+getModRefBehavior, +gerArgModRefInfo) to return a pair {ModRefInfo, AliasResult}. The AliasResult can be optional based on an argument e.g.: struct MRI_AR { ModRefInfo MRI, AliasResult AR }; MRI_AR getModRefInfoAlias (LoadInst *LI, MemoryLocation Loc, bool SetAliasResultField); Add wrapper APIs to preserve current calls. e.g.: ModRefInfo getModRefInfo (...
2017 Oct 09
2
Expose aliasing information in getModRefInfo (or viceversa?)
...and I'd like some input >> on what's the best way to get alias and mod-ref info without having two >> alias calls. >> >> A couple of ideas: >> (a) Extend the getModRefInfo interface (+getModRefBehavior, >> +gerArgModRefInfo) to return a pair {ModRefInfo, AliasResult}. >> >> The AliasResult can be optional based on an argument >> e.g.: >> struct MRI_AR { ModRefInfo MRI, AliasResult AR }; >> MRI_AR getModRefInfoAlias (LoadInst *LI, MemoryLocation Loc, bool >> SetAliasResultField); >> >> Add wrapper API...
2017 Oct 09
1
Expose aliasing information in getModRefInfo (or viceversa?)
...569, and I'd like some > input on what's the best way to get alias and mod-ref info without > having two alias calls. > > A couple of ideas: > (a) Extend the getModRefInfo interface (+getModRefBehavior, > +gerArgModRefInfo) to return a pair {ModRefInfo, AliasResult}. > > The AliasResult can be optional based on an argument > e.g.: > struct MRI_AR { ModRefInfo MRI, AliasResult AR }; > MRI_AR getModRefInfoAlias (LoadInst *LI, MemoryLocation Loc, > bool SetAliasResultField); > > Add wrapper APIs to pre...
2017 Oct 10
2
Expose aliasing information in getModRefInfo (or viceversa?)
...what's the best way to get alias and mod-ref info without having >>>> two alias calls. >>>> >>>> A couple of ideas: >>>> (a) Extend the getModRefInfo interface (+getModRefBehavior, >>>> +gerArgModRefInfo) to return a pair {ModRefInfo, AliasResult}. >>>> >>>> The AliasResult can be optional based on an argument >>>> e.g.: >>>> struct MRI_AR { ModRefInfo MRI, AliasResult AR }; >>>> MRI_AR getModRefInfoAlias (LoadInst *LI, MemoryLocation Loc, bool >>>> SetAlia...
2015 Jun 16
2
[LLVMdev] AliasAnalysis refactoring for the new pass manager
...9;s that. Might be better to have "NoAlias" be the only one that treats "alias" as a noun though. PartiallyAlias? PartlyAlias? (But since it's inconsistent anyway, then PartialAlias isn't all bad.) > That leaves the question of the enumeration name. I think "AliasResult" is my new found favorite. Danny gave me a reason: these are really results of a particular query, not just abstract kinds of aliasing... And its shorter than AliasRelationship. =] > > Thoughts? I don't really see how it's better than AliasKind, but I don't see anything wro...
2012 Apr 06
5
[LLVMdev] Incorrect result in LLVM Alias Analysis
...a=(int *)malloc(sizeof(int)); b=(int *)malloc(sizeof(int)); *a=10; *b=8; return 0; } I use the below code for this (getAnalysisUsage method has been defined) AliasAnalysis::Location loc1=AliasAnalysis::Location(k1); //a AliasAnalysis::Location loc2=AliasAnalysis::Location(k2); //b AliasAnalysis::AliasResult ar=AA.alias(loc1,loc2); But I get ar=1 i.e May Alias result. Where am I going wrong? I have included -basicaa option in the opt command for running this. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/2012040...
2009 Nov 05
0
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
...gt; / Hans > Index: lib/Analysis/BasicAliasAnalysis.cpp > =================================================================== > --- lib/Analysis/BasicAliasAnalysis.cpp (revision 86023) > +++ lib/Analysis/BasicAliasAnalysis.cpp (working copy) > @@ -633,6 +633,15 @@ > AliasAnalysis::AliasResult > BasicAliasAnalysis::aliasCheck(const Value *V1, unsigned V1Size, > const Value *V2, unsigned V2Size) { > + // Null pointers do not alias with anything > + if (const Constant *C = dyn_cast<Constant>(V1)) > + if (C->isNullValue()) > +...
2012 Apr 06
0
[LLVMdev] Incorrect result in LLVM Alias Analysis
...izeof(int)); > *a=10; > *b=8; > return 0; > } > > I use the below code for this (getAnalysisUsage method has been defined) > > AliasAnalysis::Location loc1=AliasAnalysis::Location(k1); //a > AliasAnalysis::Location loc2=AliasAnalysis::Location(k2); //b > AliasAnalysis::AliasResult ar=AA.alias(loc1,loc2); > > But I get ar=1 i.e May Alias result. Where am I going wrong? did you run a basic set of optimizers first? Alias analysis assumes that at least mem2reg has been run. Otherwise it returns conservatively correct but useless answers for everything. I have include...
2015 Feb 16
2
[LLVMdev] alias result
Hi all, I am implementing a pass which needs aliasanalysis in llvm. My pass firstly records all store or load instructions as follows: loc[cnt++] = AA.getLocation(si/li); Then, get each pairwise alias result. AliasAnalysis::AliasResult ar = AA.alias(loc[i], loc[j]); switch(ar){ case 0,1,2,3;} And the command is: opt -load mypass.so -mypass -basicaa test.bc The store/load in test.bc: (1): store i64* %thd, i64** %t, align 8 //int64 *t = &thd; (2): %1 = load i64** %t, align 8 //load t (3): store i64* %1, i64**...
2014 Apr 24
4
[LLVMdev] writing an alias analysis pass?
...{} virtual void initializePass() { DEBUG(dbgs() << "Initializing everything-must-alias\n"); InitializeAliasAnalysis(this); } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AliasAnalysis::getAnalysisUsage(AU); AU.setPreservesAll(); } virtual AliasResult alias(const Location &LocA, const Location &LocB) { DEBUG(dbgs() << "Everything must alias!\n"); return AliasAnalysis::MustAlias; } }; } namespace llvm { void initializeEverythingMustAliasPass(PassRegistry &Registry); } char EverythingMustAlias::ID = 0; stati...
2020 Mar 18
2
valid BasicAA behavior?
Am Di., 17. März 2020 um 16:56 Uhr schrieb Chawla, Pankaj via llvm-dev <llvm-dev at lists.llvm.org>: > All I am expecting from DA is a direction vector containing (*). There seems to be a bug in DI, see Felipe's answer. > I think the main problem is that currently there is no exact way DA can query AliasAnalysis in a ‘conservatively correct’ manner. > > Using UnknownSize
2015 Feb 16
2
[LLVMdev] alias result
...gt; Hi all, >> >> I am implementing a pass which needs aliasanalysis in llvm. >> >> My pass firstly records all store or load instructions as follows: >> loc[cnt++] = AA.getLocation(si/li); >> >> Then, get each pairwise alias result. >> AliasAnalysis::AliasResult ar = AA.alias(loc[i], loc[j]); >> switch(ar){ case 0,1,2,3;} >> >> And the command is: opt -load mypass.so -mypass -basicaa test.bc >> >> The store/load in test.bc: >> >> (1): store i64* %thd, i64** %t, align 8 //int64 *t = &thd; >> (2): %1 = l...
2009 Nov 04
5
[LLVMdev] BasicAliasAnalysis: Null pointers do not alias with anything
This is the first patch I've sent to this project. Please be gentle :) LLVM fails to remove the dead load in the following code when running $./llvm-as -o - test.ll | ./opt -O3 -o - | ./llvm-dis -o - %t = type { i32 } declare void @foo(i8*) define void @f(%t* noalias nocapture %stuff ) { %p = getelementptr inbounds %t* %stuff, i32 0, i32 0 %before = load i32* %p call void
2018 Jun 18
2
Question about Alias Analysis with restrict keyword
...ther 1299     // pointer, we know they cannot alias. 1300 1301     // If both accesses are unknown size, we can't do anything useful here. 1302     if (V1Size == MemoryLocation::UnknownSize && 1303         V2Size == MemoryLocation::UnknownSize) 1304       return MayAlias; 1305 1306     AliasResult R = aliasCheck(UnderlyingV1, MemoryLocation::UnknownSize, 1307                                AAMDNodes(), V2, MemoryLocation::UnknownSize, 1308                                V2AAInfo, nullptr, UnderlyingV2); On line 1306, we can see the V1Size and V2Size are set up with "MemoryLocation::...
2017 Jul 14
2
PartialAlias: different start addresses
...t. >> I'm asking this because: >> 1) This condition seems very strict and I don't think it's met in a few >> places I found by manual inspection > If I read the definition correctly, at least our Andersens' AA > implementation violates it. > see: > > AliasResult CFLAndersAAResult::alias(const MemoryLocation &LocA, > const MemoryLocation &LocB) { > if (LocA.Ptr == LocB.Ptr) > return LocA.Size == LocB.Size ? MustAlias : PartialAlias; > > > (i.e. the two objects are overlapping here *and*...
2017 Jul 14
2
PartialAlias: different start addresses
Hi, I going through the alias analysis documentation (http://llvm.org/docs/AliasAnalysis.html) and noticed the following in the definition of PartialAlias: " The PartialAlias response is used when the two memory objects are known to be overlapping in some way, but *do not start at the same address*. " Is it really required that the objects do no start at the same address? if
2015 Jun 14
2
[LLVMdev] Expressing ambiguous points-to info in AliasAnalysis::alias(...) results?
...in that case, which is unsatisfying. One solution would be for me to adapt the algorithm to remove this ambiguity. But if possible I'd like to keep the algorithm as close to the published version as possible, so I'd rather find another solution. Another approach is to add a value to the AliasResult enumeration, indicating "MustAlias or NoAlias, I'm not sure which". But I'm not sure if any downstream analyses could make use of a result like that. A third, even uglier solution would be to modify the AliasAnalysis::alias(...) methods to let the caller indicate whether or not...
2015 Feb 16
2
[LLVMdev] alias result
...a pass which needs aliasanalysis in llvm. >>>> >>>> My pass firstly records all store or load instructions as follows: >>>> loc[cnt++] = AA.getLocation(si/li); >>>> >>>> Then, get each pairwise alias result. >>>> AliasAnalysis::AliasResult ar = AA.alias(loc[i], loc[j]); >>>> switch(ar){ case 0,1,2,3;} >>>> >>>> And the command is: opt -load mypass.so -mypass -basicaa test.bc >>>> >>>> The store/load in test.bc: >>>> >>>> (1): store i64* %thd, i64** %t...
2012 Mar 07
3
[LLVMdev] Alias analysis result
...Operand(); for(Function::arg_iterator k=F.arg_begin(); k!=F.arg_end();++k) { Value *v=dyn_cast<Value>(k); AliasAnalysis::Location loc=AliasAnalysis::Location(v); AliasAnalysis::AliasResult ar=AA.alias(LocA,loc); switch(ar) { case 0:errs()<< "NoAlias\n"; break; ///< No dependencies. case 1:errs()<<"MayAlias\n&qu...