[llvm-commits] [llvm] r130551 - in /llvm/trunk: include/llvm/Transforms/Utils/BasicBlockUtils.h lib/Transforms/Utils/BasicBlockUtils.cpp lib/Transforms/Utils/SSAUpdater.cpp

Evan Cheng evan.cheng at apple.com
Mon May 2 19:57:10 PDT 2011


On May 2, 2011, at 2:54 PM, Devang Patel wrote:

> 
> On May 2, 2011, at 2:44 PM, Evan Cheng wrote:
> 
>> Hi Devang,
>> 
>> I share Duncan's concern. This may impact compile time. Is the scanning the only solution?
> 
> I understand the concern. I have not come up with a better alternative. But for now, I'll update it to use first instruction's location.

Thanks.

Evan
> 
> -
> Devang
> 
>> 
>> Evan
>> 
>> On Apr 30, 2011, at 5:23 AM, Duncan Sands wrote:
>> 
>>> Hi Devang,
>>> 
>>>> +/// GetFirstDebugLocInBasicBlock - Return first valid DebugLoc entry in a
>>>> +/// given basic block.
>>>> +DebugLoc llvm::GetFirstDebugLocInBasicBlock(const BasicBlock *BB) {
>>>> +  for (BasicBlock::const_iterator BI = BB->begin(), BE = BB->end();
>>>> +       BI != BE; ++BI) {
>>>> +    DebugLoc DL = BI->getDebugLoc();
>>>> +    if (!DL.isUnknown())
>>>> +      return DL;
>>>> +  }
>>>> +  return DebugLoc();
>>>> +}
>>> 
>>> this potentially scans through the entire basic block which might be expensive
>>> if it is big.  Also, it's not clear to me that this makes any sense.  Suppose
>>> the first instructions in the basic block have no line number info.  Why should
>>> the phi node get the same line number as some random instruction deep down in
>>> the basic block?  How about just giving the phi node the same line info as the
>>> first instruction in the basic block?  If it doesn't have any then too bad.
>>> 
>>> Ciao, Duncan.
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
> 




More information about the llvm-commits mailing list