[LLVMdev] Confuse on getSCEVAtScope

Dan Gohman gohman at apple.com
Tue Jun 29 11:25:26 PDT 2010


On Jun 29, 2010, at 7:08 AM, ether zhhb wrote:
> 
> why  computeSCEVAtScope not try to get the operands in the current
> scope like the function do with SCEVCommutativeExpr, like:
> 
> if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) {
>    if (!L || !AddRec->getLoop()->contains(L)) {
>      ...
>      // Then, evaluate the AddRec.
>      AddRec = AddRec->evaluateAtIteration(BackedgeTakenCount, *this);
>    }
> 
>    try to evalue every operand of AddRec;
> 
>    return AddRec;
>  }

That looks reasonable to me. Do you have a testcase which exhibits this?

Dan




More information about the llvm-dev mailing list