Displaying 8 results from an estimated 8 matches for "hasargument".
2016 Nov 28
2
Looking for help with an ast matcher
...ted your matcher a little bit just to understand it:
>
> ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(
> isInteger()),
> has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("
> compare"))),
> hasArgument(0,
> declRefExpr().bind("str2")),
> callee(memberExpr(has(
> declRefExpr().bind("str1"))))))))).bind("case1")
>
> And this is the AST part that we care about
> |-IfStmt 0x7fba9625f5e8 <line:8:5, line:10:5&g...
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr,
I think I found a working matcher: match
ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(isInteger()),
has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("compare"))),
hasArgument(0, declRefExpr().bind("str2")),
callee(memberExpr(has(declRefExpr().bind("str1"))))))))).bind("case1")
This one bind to both str1 and str2 in str1.compare(str2). I have included
a code segment below. I have attached a screenshot of this matcher working
from clang-quer...
2009 Jul 23
0
[LLVMdev] [PATCH] PR2218
...(!isa<AllocaInst>(pointer))
+ return false;
3. In this code, does the argument also need to be sret, or is any
argument ok?
+ if(CallInst *C = dyn_cast<CallInst>(dep.getInst())) {
+ CallSite CS = CallSite::get(C);
+
+ /* Pointer must be a parameter (case 1) */
+ if(!CS.hasArgument(pointer))
+ return false;
4. Here, please do an alias check if the store's pointer operand is
not the same as the load's (allowing the xform if they are must-
alias). This helps in some cases where there are GEP's that are the
same but not actually CSE'd:
+ /* Store...
2009 Jul 22
2
[LLVMdev] [PATCH] PR2218
Hello,
This patch fixes PR2218. However, I'm not pretty sure that this
optimization should be in MemCpyOpt. I think that GVN is good place as
well.
Regards
--
Jakub Staszak
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr2218.patch
Type: application/octet-stream
Size: 6146 bytes
Desc: not available
URL:
2009 Nov 06
0
[LLVMdev] Functions: sret and readnone
...rguments; // only accesses args, no
globals
return AliasAnalysis::getModRefBehavior(F, Info);
}
ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size)
{
std::string functionName = CS.getCalledFunction()->getNameStr();
if(_srets.find(functionName) != _srets.end())
{
if(CS.hasArgument(P))
{
if(CS.getArgument(0) == P)
return AliasAnalysis::Mod; // modify value pointed to by sret
param
else
return AliasAnalysis::NoModRef; // there aren't any other pointer
args
}
}
return AliasAnalysis::getModRefInfo(CS, P, Size);
}
bool hasNoModRefInfoForCalls()...
2009 Nov 06
2
[LLVMdev] Functions: sret and readnone
Hi Stephan,
> intrinsic float4 sample(int tex, float2 tc);
>
> float4 main(int tex, float2 tc)
> {
> float4 x = sample(tex, tc);
> return 0.0;
> }
without additional information it would be wrong to remove the call to
sample because it might write to a global variable.
> As you can see, the call to the sample function is still present,
> although the actual value
2016 Nov 27
2
Looking for help with an ast matcher
Adding cfe-dev, because it is related to clang, not LLVM.
2016-11-27 22:34 GMT+01:00 Piotr Padlewski <piotr.padlewski at gmail.com>:
> Hi Mads,
> Can you provide the code that you run clang-query on, or at least AST for
> the fragment you want to match?
>
> Piotr
>
> 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org
> >:
>
2009 Jul 25
2
[LLVMdev] [PATCH] PR2218
...alse;
>
>
> 3. In this code, does the argument also need to be sret, or is any
> argument ok?
>
> + if(CallInst *C = dyn_cast<CallInst>(dep.getInst())) {
> + CallSite CS = CallSite::get(C);
> +
> + /* Pointer must be a parameter (case 1) */
> + if(!CS.hasArgument(pointer))
> + return false;
>
> 4. Here, please do an alias check if the store's pointer operand is
> not the same as the load's (allowing the xform if they are must-
> alias). This helps in some cases where there are GEP's that are the
> same but not actual...