[llvm-commits] [llvm] r131516 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineCalls.cpp lib/Transforms/InstCombine/InstructionCombining.cpp test/Transforms/InstCombine/call.ll

Devang Patel dpatel at apple.com
Wed May 18 14:04:38 PDT 2011


On May 18, 2011, at 12:44 AM, Frits van Bommel wrote:

> On Wed, May 18, 2011 at 3:28 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> Start trying to make InstCombine preserve more debug info.  The idea here is
>> to set the debug location on the IRBuilder, which will be then right
>> location in most cases.  This should magically give many transformations
>> debug locations, and fixing places which are missing a debug location will
>> usually just means changing the code creating it to use the IRBuilder.
> 
>>     // Now that we have an instruction, try combining it to simplify it.
>>     Builder->SetInsertPoint(I->getParent(), I);
>> +    Builder->SetCurrentDebugLocation(I->getDebugLoc());
> 
> This would look even nicer if the IRBuilder::SetInsertPoint()
> overloads that take an Instruction* did this automatically :).

Good idea! r131575.

-
Devang
> That would also make the migration of other passes to IRBuilder look cleaner.
> 
> IRBuilder users that want a different DebugLoc can always set it manually...




More information about the llvm-commits mailing list