[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 14:44:02 PDT 2011
Hi Devang,
I share Duncan's concern. This may impact compile time. Is the scanning the only solution?
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