Patch for mem2reg pass

Piotr Perek pperek1234 at gmail.com
Sat Jul 13 05:12:44 PDT 2013


On 12.07.2013 23:50, David Blaikie wrote:
>> The mem2reg pass loses the debug info for the affected variables. I have
>> created a patch to fix it. Please review.
> Thanks for working on this!
>
> The patch seems fairly simple, though I'm unfamiliar with that area of
> the code & can't sign off on it immediately.
>
> For testing - we're trying to move to a model in which we simplify C++
> (or C) source code as much as possible, compile that with Clang & use
> it as a test case (which it looks like you've done, more or less - it
> could, perhaps, be simpler source, though? (do you need a loop to
> demonstrate the problem?) - except you're missing the original C++
> source in your test case).
>
> -> Could you simplify the source and add it in comments to the test case?
I added the source code to the test file as you asked.
>
> Would it be beneficial to constrain the check any further than simply
> "there is a dbg.value for i.0"? Maybe where it exists in the code?
> What about other i.N SSA values produced by mem2reg? Or is that the
> only one?
The dbg.value call is added after each new PHI Node created by the 
mem2reg pass. It should be placed after the line defining the PHI Node. 
I think it is checked in this test. What additional tests should I add?

>
>> Best regards,
>> Piotr
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mem2reg.diff
Type: text/x-diff
Size: 6508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130713/3641bd0a/attachment.diff>


More information about the llvm-commits mailing list