[PATCH] Branch folding causes different code generation at "-O2 -g" and "-O2"

Romanova, Katya Katya_Romanova at playstation.sony.com
Thu Mar 13 23:51:02 PDT 2014


Hi Chandler,

I think I have shortened the metadata as much as I could.  Out of 91 entries that I had in the original patch, I now have only 7.

!38 = metadata !{i32 786688, null, metadata !"var2", null, i32 20, null, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [var2] [line 20]
!48 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
!49 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
!50 = metadata !{metadata !"clang version 3.5 (202418)"}
!60 = metadata !{i32 786689, null, metadata !"this", null, i32 16777216, null, i32 1088, null} ; [ DW_TAG_arg_variable ] [this] [line 0]
!62 = metadata !{i8* getelementptr inbounds ([1 x i8]* @.str, i64 0, i64 0)}
!63 = metadata !{i32 786689, null, metadata !"value", null, i32 33554439, null, i32 0, null} ; [ DW_TAG_arg_variable ] [value] [line 7]

If I understood you correctly, I should replace some of these entries with “metadata !{null}”. Is this what you meant?

The compiler is asserting if I substitute
!63 = metadata !{i32 786689, null, metadata !"value", null, i32 33554439, null, i32 0, null} ; [ DW_TAG_arg_variable ] [value] [line 7]
with
!63 = metadata !{null} ;

The test started to pass (i.e. the same code generated at –O2 –g vs -O2), after I substituted
!60 = metadata !{i32 786689, null, metadata !"this", null, i32 16777216, null, i32 1088, null} ; [ DW_TAG_arg_variable ] [this] [line 0]
with
!60 = metadata !{null} ;

Replacing any of the 7 metadata entries with metadata !{null} ; either caused the test to produce the same code at –O2 –g/-O2 or caused the assertion failure. Please let me know if you meant to reduce the test in some other way.

Thanks!
Katya.



From: chandlerc at google.com [mailto:chandlerc at google.com] On Behalf Of Chandler Carruth
Sent: Thursday, March 13, 2014 5:02 PM
To: reviews+D2970+public+de5bc9734a467b4e at llvm-reviews.chandlerc.com
Cc: Chandler Carruth; Romanova, Katya; Commit Messages and Patches for LLVM
Subject: Re: [PATCH] Branch folding causes different code generation at "-O2 -g" and "-O2"


On Thu, Mar 13, 2014 at 4:16 PM, Katya Romanova <Katya_Romanova at playstation.sony.com<mailto:Katya_Romanova at playstation.sony.com>> wrote:
  Hi Chandler,
  This bugfix is still sitting in my queue. Is it OK to commit?  If you are busy, maybe Eric could review?

  I will make a small change to the testcase before I commit. I will add -mtriple-x86_64-linux to the RUN line.

  Thank you!

Please minimize the test case according to this comment I made previously:

I don't think we need a full debug-info test case here.
Just put some stub debug_value calls into the test in the appropriate places with null metadata. It should still work just as well and won't require the full Clang-generated DWARF-structured debug info metadata.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140314/a480f19e/attachment.html>


More information about the llvm-commits mailing list